Store pynvim setup in dedicated virtualenv, make using Makefile

This commit is contained in:
Evie Litherland-Smith 2023-03-02 16:08:39 +00:00
parent b3a5fa3202
commit 4361a7812a
5 changed files with 11 additions and 3 deletions

1
.gitignore vendored
View file

@ -11,3 +11,4 @@ config/fish/fish_variables
config/gtk-3.0/bookmarks
config/xfce4/xfconf/xfce-perchannel-xml
config/i3/config.d
config/nvim/.venv

View file

@ -32,12 +32,13 @@ unlink:
for link in $(THEMES_TARGETS); do rm "$$link"; done
rmdir $(HOME)/.ssh/sockets
install: $(LAZY_DIR) $(PYENV_DIR) $(POETRY_DIR)
install: $(LAZY_DIR) $(PYENV_DIR) $(POETRY_DIR) config/nvim/.venv
uninstall:
rm -rf $(LAZY_DIR)
rm -rf $(PYENV_DIR)
rm -rf $(POETRY_DIR)
rm -rf config/nvim/.venv
$(CONFIG_TARGETS): $(CONFIG_DIR)/%: config/%
$(SSH_TARGETS): $(SSH_DIR)/%: ssh/%
@ -55,5 +56,11 @@ $(PYENV_DIR):
$(POETRY_DIR):
python3 packages/poetry.py
config/nvim/.venv:
python3 -m venv $@
$@/bin/python3 -m pip install -U pip wheel
$@/bin/python3 -m pip install --use-pep517 pynvim
$(CONFIG_DIR) $(SSH_DIR) $(THEMES_DIR) $(HOME)/.ssh/sockets:
mkdir -p $@

View file

@ -1,5 +1,4 @@
if status is-interactive
set -gx PYENV_ROOT $HOME/.pyenv
set -g fish_user_paths $PYENV_ROOT/bin $fish_user_paths
pyenv init - | source
end

1
config/nvim/.envrc Normal file
View file

@ -0,0 +1 @@
source .venv/bin/activate

View file

@ -1,6 +1,6 @@
vim.opt.title = true
vim.opt.cmdheight = 0
vim.g.python3_host_prog = "/usr/bin/python3"
vim.g.python3_host_prog = vim.fn.stdpath "config" .. "/.venv/bin/python"
vim.g.python_indent = {
open_paren = "shiftwidth()",
nested_paren = "shiftwidth()",