From a022151c5d5f928a0ddde690dcdcb12791313061 Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Sat, 3 Aug 2024 14:31:05 +0300 Subject: feat: python virtual env (venv) and nvim pyright lsp configuration --- .config/nvim/lua/custom/config/language-servers.lua | 8 +++++++- .zshrc | 6 +++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.config/nvim/lua/custom/config/language-servers.lua b/.config/nvim/lua/custom/config/language-servers.lua index 97c4bcf..763a712 100644 --- a/.config/nvim/lua/custom/config/language-servers.lua +++ b/.config/nvim/lua/custom/config/language-servers.lua @@ -18,7 +18,13 @@ return { gradle_ls = true, -- java package manager -- jdtls = true, -- java eclipse lsp kotlin_language_server = true, -- kotlin - pyright = true, -- python + pyright = { + settings = { + python = { + pythonPath = '~/python/venv/bin/python', + }, + }, + }, -- python rust_analyzer = false, -- NOTE: using rustaceanvim bashls = true, -- bash taplo = true, -- toml diff --git a/.zshrc b/.zshrc index 6d31a9d..408d8e9 100644 --- a/.zshrc +++ b/.zshrc @@ -94,6 +94,9 @@ source <(fzf --zsh) eval "$(zoxide init --cmd cd zsh)" eval "$(oh-my-posh init zsh --config $HOME/.config/ohmyposh/tokyocat_laptop.omp.yml)" +# Activate python venv +source ~/python/venv/bin/activate + # Aliases alias nvim='nvim.sh' alias cat='bat' @@ -104,7 +107,8 @@ alias c='clear' alias q='exit' alias ':q'='exit' alias vim='nvim' -alias python='python3' +alias python='~/python/venv/bin/python' +alias pip='~/python/venv/bin/pip' alias vi='nvim $(fzf --preview="bat --style=numbers --color=always --line-range :500 {}")' alias sqlite3='sqlite3 --box' -- cgit v1.3.1