]> apps.delaporte.us Git - dotfiles.git/blobdiff - invoke/nvim/tasks.py
Add linux nvim link and plug
[dotfiles.git] / invoke / nvim / tasks.py
index e104e3698c04de95031972acf57d8ad64a9c36a9..53d378cba40978c9546c0cb41b26b6d9d6541ae9 100644 (file)
@@ -1,13 +1,34 @@
 from invoke import task
 import os
 from invoke import task
 import os
+import platform
+
+# $env:INVOKE_RUN_SHELL='C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe'
 
 home = os.path.expanduser('~')
 
 home = os.path.expanduser('~')
+
+ps = r'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe'
 config_dir = f"{home}/AppData/Local/nvim"
 
 config_dir = f"{home}/AppData/Local/nvim"
 
+if(platform.system() == 'Linux'):
+    ps = r'/usr/bin/pwsh'
+    config_dir = f"{home}/.config/nvim"
+
+@task
+def link(c):
+    c.run(f"ls -al {config_dir}")
+    c.run(f"ln -s {home}/dotfiles/files/init.lua {config_dir}/init.lua")
+
+@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 .")
+
 @task
 def status(c):
 @task
 def status(c):
-    result = c.run('powershell Get-Command nvim')
+    result = c.run('Get-Command nvim', shell=ps)
     print(f"Nvim installed? {result.ok}")
 
     print(f"Config dir is {config_dir}")
     print(f"Nvim installed? {result.ok}")
 
     print(f"Config dir is {config_dir}")
-    c.run(f"powershell ls {config_dir}")
+    c.run(f"ls {config_dir}", shell=ps)
+
+