فهرست منبع

feat: add venv handling

Sam Jaffe 2 ماه پیش
والد
کامیت
b18b5b780a
1فایلهای تغییر یافته به همراه21 افزوده شده و 0 حذف شده
  1. 21 0
      vimrc

+ 21 - 0
vimrc

@@ -11,6 +11,9 @@ call plug#begin('~/.vim/bundle')
 
 " **** Major Functionality Plugins
 
+Plug 'nvim-lua/plenary.nvim'
+Plug 'AckslD/swenv.nvim'
+
 " coc.nvim - code completion
 Plug 'neoclide/coc.nvim', {'branch': 'release'}
 Plug 'clangd/coc-clangd'
@@ -1011,3 +1014,21 @@ if filereadable($HOME . "/.vimrc_custom")
   source ~/.vimrc_custom
 endif
 "}}}
+
+lua << EOF
+require('swenv').setup({
+  -- Should return a list of tables with a `name` and a `path` entry each.
+  -- Gets the argument `venvs_path` set below.
+  -- By default just lists the entries in `venvs_path`.
+  get_venvs = function(venvs_path)
+    return require('swenv.api').get_venvs(venvs_path)
+  end,
+  -- Path passed to `get_venvs`.
+  venvs_path = vim.fn.expand('~/.pyenv/versions'),
+  -- Something to do after setting an environment, for example call vim.cmd.LspRestart
+  post_set_venv = function()
+    vim.cmd.CocRestart()
+  end,
+})
+EOF
+lua require('swenv.api').auto_venv()