Refactor directory structure
This commit is contained in:
12
modules/home/cli/neovim/plugins/bufferline.lua
Normal file
12
modules/home/cli/neovim/plugins/bufferline.lua
Normal file
@@ -0,0 +1,12 @@
|
||||
require('bufferline').setup{
|
||||
options = {
|
||||
offsets = {
|
||||
{
|
||||
filetype = "NvimTree",
|
||||
text = "File Explorer",
|
||||
highlight = "Directory",
|
||||
separator = true -- use a "true" to enable the default, or set your own character
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
46
modules/home/cli/neovim/plugins/cmp.lua
Normal file
46
modules/home/cli/neovim/plugins/cmp.lua
Normal file
@@ -0,0 +1,46 @@
|
||||
local cmp = require('cmp')
|
||||
local luasnip = require('luasnip')
|
||||
|
||||
require('luasnip.loaders.from_vscode').lazy_load()
|
||||
luasnip.config.setup {}
|
||||
|
||||
cmp.setup {
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert {
|
||||
['<C-n>'] = cmp.mapping.select_next_item(),
|
||||
['<C-p>'] = cmp.mapping.select_prev_item(),
|
||||
['<C-d>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete {},
|
||||
['<CR>'] = cmp.mapping.confirm {
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = true,
|
||||
},
|
||||
['<Tab>'] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.expand_or_locally_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { 'i', 's' }),
|
||||
['<S-Tab>'] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif luasnip.locally_jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { 'i', 's' }),
|
||||
},
|
||||
sources = {
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'luasnip' },
|
||||
},
|
||||
}
|
10
modules/home/cli/neovim/plugins/harpoon.lua
Normal file
10
modules/home/cli/neovim/plugins/harpoon.lua
Normal file
@@ -0,0 +1,10 @@
|
||||
local mark = require('harpoon.mark')
|
||||
local ui = require('harpoon.ui')
|
||||
|
||||
vim.keymap.set("n", "<leader>q", mark.add_file)
|
||||
vim.keymap.set("n", "<C-e>", ui.toggle_quick_menu)
|
||||
|
||||
vim.keymap.set("n", "<C-h>", function() ui.nav_file(1) end)
|
||||
vim.keymap.set("n", "<C-t>", function() ui.nav_file(2) end)
|
||||
vim.keymap.set("n", "<C-n>", function() ui.nav_file(3) end)
|
||||
vim.keymap.set("n", "<C-s>", function() ui.nav_file(4) end)
|
57
modules/home/cli/neovim/plugins/lsp.lua
Normal file
57
modules/home/cli/neovim/plugins/lsp.lua
Normal file
@@ -0,0 +1,57 @@
|
||||
require("mason").setup{
|
||||
PATH = "append",
|
||||
}
|
||||
require("mason-lspconfig").setup()
|
||||
require('neodev').setup()
|
||||
require('lsp-inlayhints').setup()
|
||||
|
||||
local lspconfig = require('lspconfig')
|
||||
|
||||
vim.g.rustaceanvim = {
|
||||
tools = {
|
||||
hover_actions = {
|
||||
auto_focus = true,
|
||||
},
|
||||
},
|
||||
server = {
|
||||
on_attach = function(client, bufnr)
|
||||
require("lsp-inlayhints").on_attach(client, bufnr)
|
||||
require("lsp-inlayhints").show()
|
||||
end,
|
||||
default_settings = {
|
||||
['rust-analyzer'] = {
|
||||
cargo = {
|
||||
features = "all"
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
lspconfig.tsserver.setup{}
|
||||
|
||||
lspconfig.spyglassmc_language_server.setup{
|
||||
cmd = {
|
||||
"/home/xeovalyte/.npm-global/bin/spyglassmc-language-server", "--stdio"
|
||||
}
|
||||
}
|
||||
|
||||
lspconfig.arduino_language_server.setup{
|
||||
cmd = {
|
||||
"steam-run","arduino-language-server",
|
||||
"-cli-config", "/home/xeovalyte/.arduino15/arduino-cli.yaml",
|
||||
"-cli", "/usr/bin/arduino-cli",
|
||||
"-clangd", "steam-run clangd"
|
||||
}
|
||||
}
|
||||
|
||||
lspconfig.tailwindcss.setup{
|
||||
filetypes = {
|
||||
"rust",
|
||||
"css",
|
||||
}
|
||||
}
|
||||
|
||||
lspconfig.volar.setup{}
|
||||
|
||||
lspconfig.marksman.setup{}
|
40
modules/home/cli/neovim/plugins/lualine.lua
Normal file
40
modules/home/cli/neovim/plugins/lualine.lua
Normal file
@@ -0,0 +1,40 @@
|
||||
require('lualine').setup {
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = 'auto',
|
||||
component_separators = { left = '', right = ''},
|
||||
section_separators = { left = '', right = ''},
|
||||
disabled_filetypes = {
|
||||
statusline = {},
|
||||
winbar = {},
|
||||
},
|
||||
ignore_focus = {},
|
||||
always_divide_middle = true,
|
||||
globalstatus = true,
|
||||
refresh = {
|
||||
statusline = 1000,
|
||||
tabline = 1000,
|
||||
winbar = 1000,
|
||||
}
|
||||
},
|
||||
sections = {
|
||||
lualine_a = {'mode'},
|
||||
lualine_b = {'branch', 'diff', 'diagnostics'},
|
||||
lualine_c = {'filename'},
|
||||
lualine_x = {'encoding', 'fileformat', 'filetype'},
|
||||
lualine_y = {'progress'},
|
||||
lualine_z = {'location'}
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = {'filename'},
|
||||
lualine_x = {'location'},
|
||||
lualine_y = {},
|
||||
lualine_z = {}
|
||||
},
|
||||
tabline = {},
|
||||
winbar = {},
|
||||
inactive_winbar = {},
|
||||
extensions = {}
|
||||
}
|
2
modules/home/cli/neovim/plugins/markdown-preview.lua
Normal file
2
modules/home/cli/neovim/plugins/markdown-preview.lua
Normal file
@@ -0,0 +1,2 @@
|
||||
vim.g.mkdp_auto_start = 0
|
||||
vim.g.mkdp_auto_close = 0
|
20
modules/home/cli/neovim/plugins/nvim-tree.lua
Normal file
20
modules/home/cli/neovim/plugins/nvim-tree.lua
Normal file
@@ -0,0 +1,20 @@
|
||||
local function my_on_attach(bufnr)
|
||||
local api = require "nvim-tree.api"
|
||||
|
||||
local function opts(desc)
|
||||
return { desc = "nvim-tree: " .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true }
|
||||
end
|
||||
|
||||
-- default mappings
|
||||
api.config.mappings.default_on_attach(bufnr)
|
||||
|
||||
-- custom mappings
|
||||
vim.keymap.set('n', '<C-t>', api.tree.change_root_to_parent, opts('Up'))
|
||||
vim.keymap.set('n', '?', api.tree.toggle_help, opts('Help'))
|
||||
vim.keymap.set('n', '.', api.tree.change_root_to_node, opts('CD'))
|
||||
end
|
||||
|
||||
-- pass to setup along with your other options
|
||||
require("nvim-tree").setup {
|
||||
on_attach = my_on_attach,
|
||||
}
|
7
modules/home/cli/neovim/plugins/toggleterm.lua
Normal file
7
modules/home/cli/neovim/plugins/toggleterm.lua
Normal file
@@ -0,0 +1,7 @@
|
||||
require("toggleterm").setup{
|
||||
open_mapping = [[<c-\>]],
|
||||
direction = 'float',
|
||||
float_opts = {
|
||||
border = 'curved'
|
||||
}
|
||||
}
|
9
modules/home/cli/neovim/plugins/treesitter.lua
Normal file
9
modules/home/cli/neovim/plugins/treesitter.lua
Normal file
@@ -0,0 +1,9 @@
|
||||
require("nvim-treesitter.configs").setup{
|
||||
ensure_installed = {},
|
||||
|
||||
auto_install = false,
|
||||
|
||||
highlight = { enable = true },
|
||||
|
||||
indent = { enable = true },
|
||||
}
|
Reference in New Issue
Block a user