Separate config into '.vim/plugins/'
This commit is contained in:
14
.vim/plugin/cursor.vim
Normal file
14
.vim/plugin/cursor.vim
Normal file
@@ -0,0 +1,14 @@
|
||||
" Taken from /usr/share/vim/vim90/defaults.vim
|
||||
augroup vimStartup
|
||||
au!
|
||||
|
||||
" When editing a file, always jump to the last known cursor position.
|
||||
" Don't do it when the position is invalid, when inside an event handler
|
||||
" (happens when dropping a file on gvim) and for a commit message (it's
|
||||
" likely a different one than last time).
|
||||
autocmd BufReadPost *
|
||||
\ if line("'\"") >= 1 && line("'\"") <= line("$") && &ft !~# 'commit'
|
||||
\ | exe "normal! g`\""
|
||||
\ | endif
|
||||
|
||||
augroup END
|
||||
3
.vim/plugin/jsonc.vim
Normal file
3
.vim/plugin/jsonc.vim
Normal file
@@ -0,0 +1,3 @@
|
||||
" JSONC (see https://github.com/neoclide/jsonc.vim/pull/9")
|
||||
au BufNewFile,BufRead */.vscode/*.json setlocal filetype=jsonc
|
||||
|
||||
10
.vim/plugin/pandoc.vim
Normal file
10
.vim/plugin/pandoc.vim
Normal file
@@ -0,0 +1,10 @@
|
||||
fu! Compile()
|
||||
if expand('%:e') == "md"
|
||||
:silent exec "!pandoc % -s -o /tmp/op.pdf &"
|
||||
endif
|
||||
endfu
|
||||
|
||||
fu! Preview()
|
||||
:call Compile()
|
||||
:silent exec "!zathura /tmp/op.pdf &"
|
||||
endfu
|
||||
5
.vim/plugin/reload.vim
Normal file
5
.vim/plugin/reload.vim
Normal file
@@ -0,0 +1,5 @@
|
||||
augroup Vim
|
||||
au!
|
||||
" Reload vim config when ~/.vimrc is changed
|
||||
au BufWritePost $HOME/.vimrc so $MYVIMRC | redraw | echo "Reloaded vimrc"
|
||||
augroup END
|
||||
7
.vim/plugin/statusline.vim
Normal file
7
.vim/plugin/statusline.vim
Normal file
@@ -0,0 +1,7 @@
|
||||
se ls=2
|
||||
se stl=\ %0*%n
|
||||
se stl+=\ %m
|
||||
se stl+=\ %y%0*
|
||||
se stl+=\ %<%F
|
||||
se stl+=\ %0*%=%5l%*
|
||||
se stl+=%0*/%L%*
|
||||
20
.vim/plugin/zk.vim
Normal file
20
.vim/plugin/zk.vim
Normal file
@@ -0,0 +1,20 @@
|
||||
let s:zk_preview_enabled = 0
|
||||
let s:live_server_job = -1
|
||||
au BufEnter /home/h/.zk/*.md silent exe '!echo "%" > /home/h/.zk/current-zettel.txt'
|
||||
function! ToggleZKPreview()
|
||||
if s:zk_preview_enabled == 1
|
||||
let s:zk_preview_enabled = 0
|
||||
call jobstop(s:live_server_job)
|
||||
au! ZKPreview
|
||||
else
|
||||
let s:zk_preview_enabled = 1
|
||||
let s:live_server_job = jobstart('live-server --watch=/home/h/.zk/current-zettel-content.html --open=current-zettel-content.html --port=8080')
|
||||
augroup ZKPreview
|
||||
au BufEnter /home/h/.zk/*.md silent exe '!cat "%:r.html" > /home/h/.zk/current-zettel-content.html'
|
||||
au BufWritePost /home/h/.zk/*.md silent exe '!make && cat "%:r.html" > /home/h/.zk/current-zettel-content.html'
|
||||
augroup END
|
||||
endif
|
||||
endfunction
|
||||
command! ToggleZKPreview call ToggleZKPreview()
|
||||
|
||||
nn <leader>o :ToggleZKPreview<cr> :!xdg-open http://localhost:8080/%:t:r.html & <cr>
|
||||
Reference in New Issue
Block a user