diff --git a/init.lua b/init.lua index feef51d1..2d35c368 100644 --- a/init.lua +++ b/init.lua @@ -489,6 +489,9 @@ vim.defer_fn(function() } end, 0) + + + -- [[ Configure LSP ]] -- This function gets run when an LSP connects to a particular buffer. local on_attach = function(_, bufnr) @@ -511,7 +514,7 @@ local on_attach = function(_, bufnr) nmap('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition') nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences') - nmap('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation') + nmap('gi', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation') nmap('D', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition') nmap('ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols') nmap('ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols') @@ -759,6 +762,13 @@ vim.keymap.set('n', 'ds', function() widgets.centered_float(widgets.scopes) end) +-- Start Neovim in insert mode by default +vim.cmd[[autocmd VimEnter * startinsert]] +-- Map to toggle between normal and insert mode +vim.api.nvim_set_keymap('n', '', ':startinsert', { noremap = true, silent = true }) +vim.api.nvim_set_keymap('i', '', ':stopinsert', { noremap = true, silent = true }) +-- vim.api.nvim_set_keymap('v', '', ':stopinsert', { noremap = true, silent = true }) +-- vim.api.nvim_set_keymap('c', '', ':stopinsert', { noremap = true, silent = true }) -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et diff --git a/lua/custom/plugins/venv_selector.lua b/lua/custom/plugins/venv_selector.lua new file mode 100644 index 00000000..27ce421b --- /dev/null +++ b/lua/custom/plugins/venv_selector.lua @@ -0,0 +1,16 @@ +return { + 'linux-cultist/venv-selector.nvim', + dependencies = { 'neovim/nvim-lspconfig', 'nvim-telescope/telescope.nvim', 'mfussenegger/nvim-dap-python' }, + opts = { + -- Your options go here + name = {"venv", ".venv"} + -- auto_refresh = false + }, + event = 'VeryLazy', -- Optional: needed only if you want to type `:VenvSelect` without a keymapping + keys = { + -- Keymap to open VenvSelector to pick a venv. + { 'vs', 'VenvSelect' }, + -- Keymap to retrieve the venv from a cache (the one previously used for the same project directory). + { 'vc', 'VenvSelectCached' }, + }, +}