summaryrefslogtreecommitdiffstats
path: root/.config/nvim/after
diff options
context:
space:
mode:
authorYigit Sever2021-10-08 13:50:04 +0300
committerYigit Sever2021-10-08 13:50:04 +0300
commit1c0aa32806e097a2a0c30b760ae4cad481e758c6 (patch)
tree853e8f17dec94f0c42e88003b1d906abfb7f28ec /.config/nvim/after
parent484188c99b21e668f40b84b21d1b21f5b9ce8d9e (diff)
downloaddotfiles-1c0aa32806e097a2a0c30b760ae4cad481e758c6.tar.gz
dotfiles-1c0aa32806e097a2a0c30b760ae4cad481e758c6.tar.bz2
dotfiles-1c0aa32806e097a2a0c30b760ae4cad481e758c6.zip
nvim: ported wiki functions
Diffstat (limited to '.config/nvim/after')
-rw-r--r--.config/nvim/after/plugin/autocmds.vim2
-rw-r--r--.config/nvim/after/plugin/functions.vim28
-rw-r--r--.config/nvim/after/plugin/tabular_extra.vim14
3 files changed, 44 insertions, 0 deletions
diff --git a/.config/nvim/after/plugin/autocmds.vim b/.config/nvim/after/plugin/autocmds.vim
new file mode 100644
index 0000000..ae55046
--- /dev/null
+++ b/.config/nvim/after/plugin/autocmds.vim
@@ -0,0 +1,2 @@
1" I don't know how to port this yet
2autocmd BufRead,BufWrite * if ! &bin | silent! %s/\s\+$//ge | endif
diff --git a/.config/nvim/after/plugin/functions.vim b/.config/nvim/after/plugin/functions.vim
new file mode 100644
index 0000000..87a1072
--- /dev/null
+++ b/.config/nvim/after/plugin/functions.vim
@@ -0,0 +1,28 @@
1" Will learn to port promise
2function! CreateNote()
3 py3 import uuid
4 exe "e! " . fnameescape("~/nextcloud/personal_wiki/text/box/" . py3eval('str(uuid.uuid4())[:6]') . ".wiki")
5 let l:text="= up =\n\n= down =\n\n= keywords =\n\n"
6 put =l:text
7 norm gg
8endfunction
9
10function! CreatePaper(citekey)
11 exe "e! " . fnameescape("~/nextcloud/personal_wiki/text/papers/" . a:citekey . ".wiki")
12
13 let l:timestap="%date " . strftime("%F")
14 let l:text="= Came From =\n\n= Takeaways =\n\n= Might Go To =\n\n"
15
16 put! =l:timestap
17 put =l:text
18endfunction
19
20function! CreateReference(citekey)
21 exe "e! " . fnameescape("~/nextcloud/personal_wiki/text/reference/" . a:citekey . ".wiki")
22
23 let l:timestap="%date " . strftime("%F")
24 let l:text="= Literature Notes =\n\n= Citation =\n\n"
25
26 put! =l:timestap
27 put =l:text
28endfunction
diff --git a/.config/nvim/after/plugin/tabular_extra.vim b/.config/nvim/after/plugin/tabular_extra.vim
new file mode 100644
index 0000000..28713ca
--- /dev/null
+++ b/.config/nvim/after/plugin/tabular_extra.vim
@@ -0,0 +1,14 @@
1" after/plugin/my_tabular_commands.vim
2" Provides extra :Tabularize commands
3
4if !exists(':Tabularize')
5 finish " Give up here; the Tabular plugin musn't have been loaded
6endif
7
8nmap <Leader>t= :Tabularize /=<CR>
9vmap <Leader>t= :Tabularize /=<CR>
10nmap <Leader>t: :Tabularize /:\zs<CR>
11vmap <Leader>t: :Tabularize /:\zs<CR>
12
13AddTabularPattern first_comma /^[^,]*\zs,/r0c0l0
14AddTabularPattern first_colon /^[^:]*\zs:/r0c0l0