diff options
Diffstat (limited to 'nvim')
| -rw-r--r-- | nvim/.config/nvim/lua/plugins/lsp.lua | 35 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/plugins/neo-tree.lua | 34 |
2 files changed, 13 insertions, 56 deletions
diff --git a/nvim/.config/nvim/lua/plugins/lsp.lua b/nvim/.config/nvim/lua/plugins/lsp.lua index 7cdccac..470efeb 100644 --- a/nvim/.config/nvim/lua/plugins/lsp.lua +++ b/nvim/.config/nvim/lua/plugins/lsp.lua @@ -60,7 +60,7 @@ return { -- an lsp (for example, opening `main.rs` is associated with `rust_analyzer`) this -- function will be executed to configure the current buffer vim.api.nvim_create_autocmd('LspAttach', { - group = vim.api.nvim_create_augroup('kickstart-lsp-attach', { clear = true }), + group = vim.api.nvim_create_augroup('lsp-attach', { clear = true }), callback = function(event) -- NOTE: Remember that Lua is a real programming language, and as such it is possible -- to define small helper and utility functions so you don't have to repeat yourself. @@ -132,7 +132,7 @@ return { client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_documentHighlight, event.buf) then - local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false }) + local highlight_augroup = vim.api.nvim_create_augroup('lsp-highlight', { clear = false }) vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, { buffer = event.buf, group = highlight_augroup, @@ -146,7 +146,7 @@ return { }) vim.api.nvim_create_autocmd('LspDetach', { - group = vim.api.nvim_create_augroup('kickstart-lsp-detach', { clear = true }), + group = vim.api.nvim_create_augroup('lsp-detach', { clear = true }), callback = function(event2) vim.lsp.buf.clear_references() vim.api.nvim_clear_autocmds { group = 'kickstart-lsp-highlight', buffer = event2.buf } @@ -211,30 +211,20 @@ return { -- - settings (table): Override the default settings passed when initializing the server. -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ local servers = { - -- clangd = {}, - -- gopls = {}, - -- pyright = {}, - -- rust_analyzer = {}, - -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs - -- - -- Some languages (like typescript) have entire language plugins that can be useful: - -- https://github.com/pmizio/typescript-tools.nvim - -- - -- But for many setups, the LSP (`ts_ls`) will work just fine - -- ts_ls = {}, - -- - + -- See `:help lspconfig-all` for a list of all the pre-configured LSPs + clangd = {}, + gopls = {}, + pyright = {}, + rust_analyzer = {}, + -- NOTE: https://github.com/pmizio/typescript-tools.nvim may be a better + -- LSP to use here at some point. + ts_ls = {}, lua_ls = { - -- cmd = { ... }, - -- filetypes = { ... }, - -- capabilities = {}, settings = { Lua = { completion = { callSnippet = 'Replace', }, - -- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings - -- diagnostics = { disable = { 'missing-fields' } }, }, }, }, @@ -260,8 +250,9 @@ return { require('mason-tool-installer').setup { ensure_installed = ensure_installed } require('mason-lspconfig').setup { - ensure_installed = {}, -- explicitly set to an empty table (Kickstart populates installs via mason-tool-installer) + ensure_installed = {}, -- explicitly set to an empty table (Populated via mason-tool-installer) automatic_installation = false, + automatic_enable = true, handlers = { function(server_name) local server = servers[server_name] or {} diff --git a/nvim/.config/nvim/lua/plugins/neo-tree.lua b/nvim/.config/nvim/lua/plugins/neo-tree.lua index aa0276a..a87c878 100644 --- a/nvim/.config/nvim/lua/plugins/neo-tree.lua +++ b/nvim/.config/nvim/lua/plugins/neo-tree.lua @@ -9,46 +9,12 @@ return { 'nvim-tree/nvim-web-devicons', 'MunifTanjim/nui.nvim', }, - init = function() - vim.api.nvim_create_autocmd('BufNewFile', { - group = vim.api.nvim_create_augroup('RemoteFile', { clear = true }), - callback = function() - local f = vim.fn.expand '%:p' - for _, v in ipairs { 'sftp', 'scp', 'ssh', 'dav', 'fetch', 'ftp', 'http', 'rcp', 'rsync' } do - local p = v .. '://' - if string.sub(f, 1, #p) == p then - vim.cmd [[ - unlet g:loaded_netrw - unlet g:loaded_netrwPlugin - runtime! plugin/netrwPlugin.vim - silent Explore % - ]] - vim.api.nvim_clear_autocmds { group = 'RemoteFile' } - break - end - end - end, - }) - vim.api.nvim_create_autocmd('BufEnter', { - group = vim.api.nvim_create_augroup('NeoTreeInit', { clear = true }), - callback = function() - local f = vim.fn.expand '%:p' - if vim.fn.isdirectory(f) ~= 0 then - vim.cmd('Neotree current dir=' .. f) - vim.api.nvim_clear_autocmds { group = 'NeoTreeInit' } - end - end, - }) - end, cmd = 'Neotree', keys = { { '\\', ':Neotree reveal<CR>', desc = 'NeoTree reveal', silent = true }, }, opts = { filesystem = { - filesystem = { - hijack_netrw_behavior = 'open_current', - }, window = { mappings = { ['\\'] = 'close_window', |