]> apps.delaporte.us Git - dotfiles.git/blobdiff - invoke/nvim-linux/tasks.py
Update to organize tasks by subject
[dotfiles.git] / invoke / nvim-linux / tasks.py
index 68f30129553425969fe349da8223481ed9bf00f9..2bb0f0c0a7f35cfd089f1d63035d741f98578f65 100644 (file)
@@ -1,23 +1,48 @@
 from invoke import task
+
+from datetime import datetime as dt
 import os
 import platform
 
-home = os.path.expanduser('~')
 
-config_dir = f"{home}/.config/nvim"
+HOME = os.path.expanduser('~')
+
+CONFIG = f"{HOME}/.config/nvim"
+
+HOME = os.path.expanduser('~')
+TODAY = dt.now().strftime('%Y.%m.%d')
+
+def browse(c, url):
+    c.run(f"librefox {url}")
+
+
+@task
+def install(c):
+    browse(c, 'https://github.com/neovim/neovim/releases')
+    input('Downloaded?')
+    c.run(f'tar xzvf {HOME}/Downloads/nvim-linux-x86_64.tar.gz -C {HOME}/bin/')
+    c.run(f'ln -s {HOME}/bin/nvim-linux-x86_64/bin/nvim {HOME}/bin')
+    c.run(f'ls -al {HOME}/bin | grep nvim')
+
+@task
+def fixup(c):
+    '''Quick commands here fix a missed step'''
+    pass
+
 
 @task
 def link(c):
     print("Before")
     c.run(f"ls -al {config_dir}")
-    c.run(f"ln -s {home}/dotfiles/files/neovim/init.lua {config_dir}/init.lua")
+    c.run(f"ln -s {HOME}/dotfiles/files/neovim/init.lua {config_dir}/init.lua")
     print("After")
     c.run(f"ls -al {config_dir}")
 
 @task
-def plug(c):
-    c.run(f"curl -fLo {config_dir}/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim")
-    c.run(f"cd {config_dir}/autoload; tree .")
+def lazy(c):
+    c.run(f'mv {CONFIG} {CONFIG}.{TODAY}.bak')
+    c.run(f'git clone https://github.com/LazyVim/starter ~/.config/nvim')
+    c.run(f'rm -rf ~/.config/nvim/.git')
 
 @task
 def status(c):