summary refs log tree commit diff
path: root/.vim/after/ftplugin
diff options
context:
space:
mode:
authorRobert Günzler <r@gnzler.io>2020-12-07 19:09:32 +0100
committerRobert Günzler <r@gnzler.io>2021-01-21 19:39:11 +0100
commit9b8005439ac351ded8f6286aefa2378d25d7add5 (patch)
treee2801972bc5bfb3960bbb1233752274bd94e11db /.vim/after/ftplugin
parentc3d57d8acc9446de9fded87081939706998fb033 (diff)
vim: update after/ftplugin/*
Diffstat (limited to '.vim/after/ftplugin')
-rw-r--r--.vim/after/ftplugin/c.vim13
-rw-r--r--.vim/after/ftplugin/clap_input.vim6
-rw-r--r--.vim/after/ftplugin/gomod.vim1
-rw-r--r--.vim/after/ftplugin/mail.vim2
-rw-r--r--.vim/after/ftplugin/python.vim1
-rw-r--r--.vim/after/ftplugin/tex.vim23
-rw-r--r--.vim/after/ftplugin/yaml.vim2
7 files changed, 45 insertions, 3 deletions
diff --git a/.vim/after/ftplugin/c.vim b/.vim/after/ftplugin/c.vim
index 85ff8a2..2d275a6 100644
--- a/.vim/after/ftplugin/c.vim
+++ b/.vim/after/ftplugin/c.vim
@@ -1,12 +1,19 @@
-setlocal cindent
+" setlocal cindent
 
-setlocal foldmethod=syntax
-setlocal foldlevel=10
+" setlocal foldmethod=syntax
+" setlocal foldlevel=10
+
+if exists('g:loaded_nvim_treesitter')
+    set foldmethod=expr
+    set foldexpr=nvim_treesitter#foldexpr()
+endif
 
 if exists('g:loaded_gutentags')
     let g:gutentags_enabled = 1
 endif
 
+let g:neoformat_enabled_c = []
+
 " toggle between header and implementation in c/cpp
 function! Alternate_c()
     let file = expand('%')
diff --git a/.vim/after/ftplugin/clap_input.vim b/.vim/after/ftplugin/clap_input.vim
new file mode 100644
index 0000000..6579064
--- /dev/null
+++ b/.vim/after/ftplugin/clap_input.vim
@@ -0,0 +1,6 @@
+
+nnoremap <silent><buffer> q :<c-u>call clap#handler#exit()<CR>
+inoremap <silent><buffer> <C-n> <C-R>=clap#navigation#linewise('down')<CR>
+inoremap <silent><buffer> <C-p> <C-R>=clap#navigation#linewise('up')<CR>
+nnoremap <silent><buffer> <C-n> :<c-u> call clap#navigation#linewise('down')<CR>
+nnoremap <silent><buffer> <C-p> :<c-r> call clap#navigation#linewise('up')<CR>
diff --git a/.vim/after/ftplugin/gomod.vim b/.vim/after/ftplugin/gomod.vim
new file mode 100644
index 0000000..96369aa
--- /dev/null
+++ b/.vim/after/ftplugin/gomod.vim
@@ -0,0 +1 @@
+set commentstring=//\ %s
diff --git a/.vim/after/ftplugin/mail.vim b/.vim/after/ftplugin/mail.vim
index eadd7e3..cdfbfc6 100644
--- a/.vim/after/ftplugin/mail.vim
+++ b/.vim/after/ftplugin/mail.vim
@@ -16,3 +16,5 @@ augroup END
 
 set commentstring=>\ %s
 set showtabline=0
+
+command! DraftSave call SaveDraft()
diff --git a/.vim/after/ftplugin/python.vim b/.vim/after/ftplugin/python.vim
index 667d22e..abdaca6 100644
--- a/.vim/after/ftplugin/python.vim
+++ b/.vim/after/ftplugin/python.vim
@@ -1,3 +1,4 @@
 let g:neomake_python_enabled_makers = []
 let g:neoformat_enabled_python = ["yapf"]
+let g:neoformat_python_maker_yapf_args = ["--style=pep8"]
 
diff --git a/.vim/after/ftplugin/tex.vim b/.vim/after/ftplugin/tex.vim
index e69de29..88d4f11 100644
--- a/.vim/after/ftplugin/tex.vim
+++ b/.vim/after/ftplugin/tex.vim
@@ -0,0 +1,23 @@
+
+nnoremap <leader>c :call vimtex#compiler#compile()<cr>
+" augroup Vimtex
+"     au!
+"     au BufWritePost * silent call vimtex#compiler#compile()
+" augroup END
+
+" if exists('g:loaded_neomake')
+"     let g:neomake_tex_tectonic_maker = {
+"     \ 'exe': 'tectonic',
+"     \ 'append_file': 1,
+"     \ 'errorformat':
+"     \     '%Eerror: something bad happened inside TeX; its output follows:,'.
+"     \     '%C^[=]+$,'.
+"     \     '%C(%f,'.
+"     \     '%C.*,'.
+"     \     '%C! %m,'.
+"     \     '%Cl.%l %s,'.
+"     \     '%C^[=]+$,'.
+"     \     '%-Zcaused by: %s,'
+"     \ }
+"     let g:neomake_tex_enabled_makers = ['tectonic']
+" endif
diff --git a/.vim/after/ftplugin/yaml.vim b/.vim/after/ftplugin/yaml.vim
new file mode 100644
index 0000000..2d09076
--- /dev/null
+++ b/.vim/after/ftplugin/yaml.vim
@@ -0,0 +1,2 @@
+" fix indent
+set et sts=2