]> us-delaporte.pagekite.me Git - dotfiles.git/blob - invoke/nvim-linux/tasks.py
Add ability to ansible symlink
[dotfiles.git] / invoke / nvim-linux / tasks.py
1 from invoke import task
2
3 from datetime import datetime as dt
4 import os
5 import platform
6
7
8 HOME = os.path.expanduser('~')
9
10 CONFIG = f"{HOME}/.config/nvim"
11
12 HOME = os.path.expanduser('~')
13 TODAY = dt.now().strftime('%Y.%m.%d')
14
15 def browse(c, url):
16 c.run(f"librefox {url}")
17
18
19 @task
20 def install(c):
21 browse(c, 'https://github.com/neovim/neovim/releases')
22 input('Downloaded?')
23 c.run(f'tar xzvf {HOME}/Downloads/nvim-linux-x86_64.tar.gz -C {HOME}/bin/')
24 c.run(f'ln -s {HOME}/bin/nvim-linux-x86_64/bin/nvim {HOME}/bin')
25 c.run(f'ls -al {HOME}/bin | grep nvim')
26
27 @task
28 def fixup(c):
29 '''Quick commands here fix a missed step'''
30 pass
31
32
33 @task
34 def link(c):
35 print("Before")
36 c.run(f"ls -al {config_dir}")
37 c.run(f"ln -s {HOME}/dotfiles/files/neovim/init.lua {config_dir}/init.lua")
38 print("After")
39 c.run(f"ls -al {config_dir}")
40
41 @task
42 def lazy(c):
43 c.run(f'mv {CONFIG} {CONFIG}.{TODAY}.bak')
44 c.run(f'git clone https://github.com/LazyVim/starter ~/.config/nvim')
45 c.run(f'rm -rf ~/.config/nvim/.git')
46
47 @task
48 def status(c):
49 result = c.run('which nvim')
50 print(f"Nvim installed? {result.ok}")
51
52 print(f"Config dir is {config_dir}")
53 c.run(f"ls {config_dir}")
54
55