X-Git-Url: https://us-delaporte.pagekite.me/gitweb/dotfiles.git/blobdiff_plain/cbe93fefb0223800e27ac4ef6b8c00a3cfbb0e4b..152e1ae7e4757792c731247a945466c3e17ac482:/invoke/setup-linux/tasks.py?ds=sidebyside diff --git a/invoke/setup-linux/tasks.py b/invoke/setup-linux/tasks.py index 67092e7..1e20b05 100644 --- a/invoke/setup-linux/tasks.py +++ b/invoke/setup-linux/tasks.py @@ -74,3 +74,52 @@ def link_bashrc(c): def link_all_for_invoke(c): link_to_home(c, 'files/pc/tasks.py') link_to_home(c, 'files/pc/bashrc', add_dot=True) + +@task +def vim_nerdtree(c): + add_vim_plugin(c, 'https://github.com/preservim/nerdtree.git', 'nerdtree') + +@task +def vim_markdown(c): + add_vim_plugin(c, 'https://github.com/preservim/vim-markdown.git', 'markdown') + +@task +def vim_airline(c): + add_vim_plugin(c, 'https://github.com/vim-airline/vim-airline.git', 'airline') + +@task +def vim_ollama(c): + add_vim_plugin(c, 'https://github.com/gergap/vim-ollama.git', 'vim-ollama') + +@task +def add_vim_plugin(c, git_path, folder): + c.run(f'mkdir -p {HOME}/.vim/pack/') + c.run(f'mkdir -p {HOME}/.vim/pack/vendor') + c.run(f'mkdir -p {HOME}/.vim/pack/vendor/opt') + c.run(f'git clone --depth 1 {git_path} {HOME}/.vim/pack/vendor/opt/{folder}') + c.run(f'ls -l {HOME}/.vim/pack/vendor/opt') + print(f"Use `packadd {folder}` in .vimrc to enable") + +@task +def ensure_env(c, env): + envs = f'{HOME}/envs' + path = f'{envs}/{env}' + if(not os.path.exists(envs)): + c.run(f'mkdir -p {envs}') + + if(not os.path.exists(path)): + c.run(f'python3 -m venv {path}') + reqs = f'{DOTFILES}/reqs/{env}.txt' + c.run(f'{path}/bin/pip install -r {reqs}') + + c.run(f'{path}/bin/pip freeze') + +@task +def env_ansible(c): + ensure_env(c, 'ansible') + + +@task +def env_jupyter(c): + ensure_env(c, 'jupyter') +