From 6093c9230bddceb7d3698edc5c476651129113f3 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Fri, 19 Nov 2021 18:29:35 +0300 Subject: no time sorry! --- .config/nvim/after/ftplugin/sh.vim | 11 +++++++++++ .config/nvim/after/ftplugin/tex.vim | 3 +++ .config/nvim/after/plugin/autocmds.vim | 6 ++++++ .config/nvim/my_snippets/all.snippets | 12 +++++++++++- 4 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 .config/nvim/after/ftplugin/sh.vim (limited to '.config') 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 @@ +setg formatprg=cmdfmt\ 80 + +function! UpdateFormatprg() + let &g:formatprg = substitute( &g:formatprg , '\d\+$', &textwidth , "" ) +endfunction + +augroup UpdateFormatprgGroup + autocmd! + autocmd VimEnter,BufEnter * call UpdateFormatprg() + autocmd OptionSet textwidth call UpdateFormatprg() +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([{ \ 'buns': ['\enquote{', '}'], \ 'input': ['"'], \ }]) + + +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= augroup bukugroup au! BufRead,BufNewFile,BufEnter buku-edit-* set filetype=buku augroup END + +" Restore last position +autocmd BufReadPost * + \ if line("'\"") >= 1 && line("'\"") <= line("$") && &ft !~# 'commit' + \ | exe "normal! g`\"" + \ | 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 @@ -snippet box "Box" +# vim:ft=snippets: + +global !p +from vimsnippets import get_comment_format +endglobal + +snippet fancybox "Box" `!p snip.rv = '┌' + '─' * (len(t[1]) + 2) + '┐'` │ $1 │ `!p snip.rv = '└' + '─' * (len(t[1]) + 2) + '┘'` $0 endsnippet + +snippet todo "TODO comment" bw +`!p snip.rv=get_comment_format()[0]` TODO: $0 <`!v strftime('%d-%m-%y')`, yigit> `!p snip.rv=get_comment_format()[2]` +endsnippet -- cgit v1.2.3-70-g09d2