Add 'dots/' from commit '357b97a7692c8d5ec9666d8d7d7c98d81cb51cf0'
git-subtree-dir: dots git-subtree-mainline:2ad98cde17git-subtree-split:357b97a769
This commit is contained in:
14
dots/.vim/plugin/cursor.vim
Normal file
14
dots/.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
|
||||
24
dots/.vim/plugin/fold.vim
Normal file
24
dots/.vim/plugin/fold.vim
Normal file
@@ -0,0 +1,24 @@
|
||||
" Folds {{{
|
||||
set foldmethod=marker
|
||||
|
||||
augroup filetype_vim
|
||||
autocmd!
|
||||
autocmd FileType vim setlocal foldmethod=marker
|
||||
augroup END
|
||||
|
||||
augroup filetype_python
|
||||
autocmd!
|
||||
autocmd FileType python setlocal foldmethod=indent
|
||||
augroup END
|
||||
|
||||
augroup filetype_sh
|
||||
autocmd!
|
||||
autocmd FileType sh setlocal foldmethod=marker
|
||||
augroup END
|
||||
|
||||
augroup filetype_snippets
|
||||
autocmd!
|
||||
autocmd FileType snippets setlocal foldmethod=marker
|
||||
augroup END
|
||||
|
||||
" }}}
|
||||
3
dots/.vim/plugin/netrw.vim
Normal file
3
dots/.vim/plugin/netrw.vim
Normal file
@@ -0,0 +1,3 @@
|
||||
let g:netrw_winsize = 30
|
||||
let g:netrw_liststyle=3
|
||||
let g:netrw_banner = 0
|
||||
10
dots/.vim/plugin/pandoc.vim
Normal file
10
dots/.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
dots/.vim/plugin/reload.vim
Normal file
5
dots/.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
dots/.vim/plugin/statusline.vim
Normal file
7
dots/.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%*
|
||||
6
dots/.vim/plugin/utils.vim
Normal file
6
dots/.vim/plugin/utils.vim
Normal file
@@ -0,0 +1,6 @@
|
||||
function! SynGroup()
|
||||
let l:s = synID(line('.'), col('.'), 1)
|
||||
echo synIDattr(l:s, 'name') . ' -> ' . synIDattr(synIDtrans(l:s), 'name')
|
||||
endfun
|
||||
|
||||
com! -nargs=0 Syn :call SynGroup()
|
||||
20
dots/.vim/plugin/zk.vim
Normal file
20
dots/.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