diff options
| -rw-r--r-- | .config/nvim/after/ftplugin/sh.vim | 11 | ||||
| -rw-r--r-- | .config/nvim/after/ftplugin/tex.vim | 3 | ||||
| -rw-r--r-- | .config/nvim/after/plugin/autocmds.vim | 6 | ||||
| -rw-r--r-- | .config/nvim/my_snippets/all.snippets | 12 |
4 files changed, 31 insertions, 1 deletions
diff --git a/.config/nvim/after/ftplugin/sh.vim b/.config/nvim/after/ftplugin/sh.vim new file mode 100644 index 0000000..d735bee --- /dev/null +++ b/.config/nvim/after/ftplugin/sh.vim | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | setg formatprg=cmdfmt\ 80 | ||
| 2 | |||
| 3 | function! UpdateFormatprg() | ||
| 4 | let &g:formatprg = substitute( &g:formatprg , '\d\+$', &textwidth , "" ) | ||
| 5 | endfunction | ||
| 6 | |||
| 7 | augroup UpdateFormatprgGroup | ||
| 8 | autocmd! | ||
| 9 | autocmd VimEnter,BufEnter * call UpdateFormatprg() | ||
| 10 | autocmd OptionSet textwidth call UpdateFormatprg() | ||
| 11 | augroup END | ||
diff --git a/.config/nvim/after/ftplugin/tex.vim b/.config/nvim/after/ftplugin/tex.vim index 27b002a..8ca7f23 100644 --- a/.config/nvim/after/ftplugin/tex.vim +++ b/.config/nvim/after/ftplugin/tex.vim | |||
| @@ -17,3 +17,6 @@ call sandwich#util#addlocal([{ | |||
| 17 | \ 'buns': ['\enquote{', '}'], | 17 | \ 'buns': ['\enquote{', '}'], |
| 18 | \ 'input': ['"'], | 18 | \ 'input': ['"'], |
| 19 | \ }]) | 19 | \ }]) |
| 20 | |||
| 21 | |||
| 22 | set signcolumn=yes | ||
diff --git a/.config/nvim/after/plugin/autocmds.vim b/.config/nvim/after/plugin/autocmds.vim index b361f7c..05b7ce9 100644 --- a/.config/nvim/after/plugin/autocmds.vim +++ b/.config/nvim/after/plugin/autocmds.vim | |||
| @@ -6,3 +6,9 @@ autocmd BufNewFile,BufRead /tmp/neomutt* set noautoindent filetype=mail wm=0 tw= | |||
| 6 | augroup bukugroup | 6 | augroup bukugroup |
| 7 | au! BufRead,BufNewFile,BufEnter buku-edit-* set filetype=buku | 7 | au! BufRead,BufNewFile,BufEnter buku-edit-* set filetype=buku |
| 8 | augroup END | 8 | augroup END |
| 9 | |||
| 10 | " Restore last position | ||
| 11 | autocmd BufReadPost * | ||
| 12 | \ if line("'\"") >= 1 && line("'\"") <= line("$") && &ft !~# 'commit' | ||
| 13 | \ | exe "normal! g`\"" | ||
| 14 | \ | endif | ||
diff --git a/.config/nvim/my_snippets/all.snippets b/.config/nvim/my_snippets/all.snippets index e6f932c..338d1d7 100644 --- a/.config/nvim/my_snippets/all.snippets +++ b/.config/nvim/my_snippets/all.snippets | |||
| @@ -1,6 +1,16 @@ | |||
| 1 | snippet box "Box" | 1 | # vim:ft=snippets: |
| 2 | |||
| 3 | global !p | ||
| 4 | from vimsnippets import get_comment_format | ||
| 5 | endglobal | ||
| 6 | |||
| 7 | snippet fancybox "Box" | ||
| 2 | `!p snip.rv = '┌' + '─' * (len(t[1]) + 2) + '┐'` | 8 | `!p snip.rv = '┌' + '─' * (len(t[1]) + 2) + '┐'` |
| 3 | │ $1 │ | 9 | │ $1 │ |
| 4 | `!p snip.rv = '└' + '─' * (len(t[1]) + 2) + '┘'` | 10 | `!p snip.rv = '└' + '─' * (len(t[1]) + 2) + '┘'` |
| 5 | $0 | 11 | $0 |
| 6 | endsnippet | 12 | endsnippet |
| 13 | |||
| 14 | snippet todo "TODO comment" bw | ||
| 15 | `!p snip.rv=get_comment_format()[0]` TODO: $0 <`!v strftime('%d-%m-%y')`, yigit> `!p snip.rv=get_comment_format()[2]` | ||
| 16 | endsnippet | ||
