diff --git a/init.lua b/init.lua index 5facab98..8e274d1e 100644 --- a/init.lua +++ b/init.lua @@ -85,7 +85,7 @@ require('lazy').setup({ -- Useful status updates for LSP -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` - { 'j-hui/fidget.nvim', tag = 'legacy', opts = {} }, + { 'j-hui/fidget.nvim', tag = 'legacy', opts = {} }, -- Additional lua configuration, makes nvim stuff amazing! 'folke/neodev.nvim', @@ -109,7 +109,7 @@ require('lazy').setup({ }, -- Useful plugin to show you pending keybinds. - { 'folke/which-key.nvim', opts = {} }, + { 'folke/which-key.nvim', opts = {} }, { -- Adds git related signs to the gutter, as well as utilities for managing changes 'lewis6991/gitsigns.nvim', @@ -123,7 +123,8 @@ require('lazy').setup({ changedelete = { text = '~' }, }, on_attach = function(bufnr) - vim.keymap.set('n', 'gp', require('gitsigns').prev_hunk, { buffer = bufnr, desc = '[G]o to [P]revious Hunk' }) + vim.keymap.set('n', 'gp', require('gitsigns').prev_hunk, + { buffer = bufnr, desc = '[G]o to [P]revious Hunk' }) vim.keymap.set('n', 'gn', require('gitsigns').next_hunk, { buffer = bufnr, desc = '[G]o to [N]ext Hunk' }) vim.keymap.set('n', 'ph', require('gitsigns').preview_hunk, { buffer = bufnr, desc = '[P]review [H]unk' }) end, @@ -139,11 +140,11 @@ require('lazy').setup({ }, -- { - -- Theme inspired by Atom - -- 'navarasu/onedark.nvim', - -- priority = 1000, - -- config = function() - -- vim.cmd.colorscheme 'onedark' + -- Theme inspired by Atom + -- 'navarasu/onedark.nvim', + -- priority = 1000, + -- config = function() + -- vim.cmd.colorscheme 'onedark' -- end, -- }, @@ -217,8 +218,8 @@ require('lazy').setup({ -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. -- -- For additional information see: https://github.com/folke/lazy.nvim#-structuring-your-plugins - { import = 'custom.plugins' }, -}, {})-- [[ Setting options ]] + { import = 'custom.plugins' }, +}, {}) -- [[ Setting options ]] -- See `:help vim.o` -- NOTE: You can change these options as you wish! @@ -287,14 +288,13 @@ vim.o.colorcolumn = "80" -- Keymaps for better default experience -- See `:help vim.keymap.set()` vim.keymap.set({ 'n', 'v' }, '', '', { silent = true }) -vim.keymap.set('n', 'pv', vim.cmd.Ex, { desc = "[P]roject [V]iew"}) +vim.keymap.set('n', 'pv', vim.cmd.Ex, { desc = "[P]roject [V]iew" }) -- Remap for dealing with word wrap vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) -- Move lines --- vim.keymap.set('v', 'J', ":m '>+1gv=gv") vim.keymap.set('v', 'K', ":m '<-2gv=gv") @@ -582,5 +582,8 @@ cmp.setup { }, } +require("venv-selector").setup({ + poetry_path = "%~", +}) -- 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..22b0db01 --- /dev/null +++ b/lua/custom/plugins/venv-selector.lua @@ -0,0 +1,12 @@ +return { + "linux-cultist/venv-selector.nvim", + dependencies = { "neovim/nvim-lspconfig", "nvim-telescope/telescope.nvim" }, + config = true, + event = "VeryLazy", -- Optional: needed only if you want to type `:VenvSelect` without a keymapping + keys = {{ + "vs", ":VenvSelect", + -- key mapping for directly retrieve from cache. You may set autocmd if you prefer the no hand approach + "vc", ":VenvSelectCached" + }} +} +