diff --git a/init.lua b/init.lua index e30e242f..4f4642ab 100644 --- a/init.lua +++ b/init.lua @@ -237,9 +237,34 @@ require('lazy').setup({ 'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically { 'nvim-tree/nvim-tree.lua', - opts = {}, + opts = { + vim.keymap.set('n', '', 'NvimTreeToggle', { desc = 'nvimtree toggle window' }), + vim.keymap.set('n', 'e', 'NvimTreeFocus', { desc = 'nvimtree focus window' }), + }, }, - 'williamboman/mason.nvim', + { + 'akinsho/toggleterm.nvim', + version = '*', + config = true, + opts = { + vim.keymap.set('n', 'h', 'ToggleTerm', { desc = 'toggleterm toggle terminal' }), + }, + }, + { + 'williamboman/mason.nvim', + opts = { + ensure_installed = { + 'rust_analyzer', + 'clangd', + 'clang_format', + 'go_pls', + }, + function() + require('mason').setup() + end, + }, + }, + -- NOTE: Plugins can also be added by using a table, -- with the first argument being the link and the following -- keys can be used to configure plugin behavior/loading/etc. @@ -425,7 +450,18 @@ require('lazy').setup({ 'neovim/nvim-lspconfig', dependencies = { -- Automatically install LSPs and related tools to stdpath for Neovim - { 'williamboman/mason.nvim', config = true }, -- NOTE: Must be loaded before dependants + { + 'williamboman/mason.nvim', + opts = { + ensure_installed = { + 'clangd', + 'rust-analyzer', + 'go_pls', + 'clang_format', + }, + }, + config = true, + }, -- NOTE: Must be loaded before dependants 'williamboman/mason-lspconfig.nvim', 'WhoIsSethDaniel/mason-tool-installer.nvim', @@ -742,7 +778,7 @@ require('lazy').setup({ -- Accept ([y]es) the completion. -- This will auto-import if your LSP supports it. -- This will expand snippets if the LSP sent a snippet. - [''] = cmp.mapping.confirm { select = true }, + [''] = cmp.mapping.confirm { select = true }, -- If you prefer more traditional completion keymaps, -- you can uncomment the following lines