aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Cabergs <charles.cabergs@colruytgroup.com>2022-04-27 06:04:56 +0200
committerCharles Cabergs <charles.cabergs@colruytgroup.com>2022-04-27 06:04:56 +0200
commitca5b53db1e8ce9f7f5c33cd9ddcda63d460942e0 (patch)
treeab7b664151f3cda89cdfd45894232e3fd3d82083
parentd4d3c29d4478b1d9a1d9391bc597bd76953f954e (diff)
downloaddotfiles-ca5b53db1e8ce9f7f5c33cd9ddcda63d460942e0.tar.gz
dotfiles-ca5b53db1e8ce9f7f5c33cd9ddcda63d460942e0.tar.bz2
dotfiles-ca5b53db1e8ce9f7f5c33cd9ddcda63d460942e0.zip
Added nvim vim-slime plugin, Updated zsh chpwd hook to cache conda env list command
-rw-r--r--config/nvim/lua/plugins.lua9
-rw-r--r--config/zsh/.zshrc5
2 files changed, 10 insertions, 4 deletions
diff --git a/config/nvim/lua/plugins.lua b/config/nvim/lua/plugins.lua
index e5244a5..cd6d463 100644
--- a/config/nvim/lua/plugins.lua
+++ b/config/nvim/lua/plugins.lua
@@ -10,6 +10,13 @@ return require('packer').startup(function()
use 'lukas-reineke/indent-blankline.nvim'
use {
+ 'jpalardy/vim-slime',
+ config = function()
+ vim.g.slime_target = 'tmux'
+ end
+ }
+
+ use {
'cacharle/vim-jinja-languages',
requires = {'mitsuhiko/vim-jinja'}
}
@@ -148,7 +155,7 @@ return require('packer').startup(function()
mapping = cmp.mapping.preset.insert({
['<C-n>'] = cmp.mapping.select_next_item(),
['<C-p>'] = cmp.mapping.select_prev_item(),
- ['<CR>'] = cmp.mapping.confirm({ select = true }),
+ ['<TAB>'] = cmp.mapping.confirm({ select = true }),
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
}),
diff --git a/config/zsh/.zshrc b/config/zsh/.zshrc
index b524a17..bde98eb 100644
--- a/config/zsh/.zshrc
+++ b/config/zsh/.zshrc
@@ -65,17 +65,16 @@ chpwd() {
echo "$(pwd) contains $content entries"
[ "$(uname)" = 'Linux' ] && [ "$(stat -c "%U" .)" = "$USER" ] && touch . # to sort by last cd
-
# change conda env if name of the directory is the name of an env
[ ! -d "$PWD/.git" ] && return
name="$(basename "$PWD")"
[ "$name" = $CONDA_DEFAULT_ENV ] && return
- conda env list |
+ [ ! -e "$HOME/conda_envs" ] && conda env list > "$HOME/conda_envs"
+ < "$HOME/conda_envs" \
cut -d ' ' -f 1 |
sed -e '/^#/d' -e '/^$/d' -e '/^base$/d' |
grep -q "$name" &&
conda activate "$name"
-
}
# https://wiki.archlinux.org/title/Zsh#Shortcut_to_exit_shell_on_partial_command_line