From 004bb3ca44e0351979dcc73f65d717d486adef13 Mon Sep 17 00:00:00 2001 From: TiynGER Date: Wed, 4 Nov 2020 01:05:46 +0100 Subject: [PATCH] nvim: cleanup after exiting nvim for c added --- .config/nvim/init.vim | 14 +++++++++++--- .local/bin/tools/nvim/cclear | 6 ++++++ 2 files changed, 17 insertions(+), 3 deletions(-) create mode 100755 .local/bin/tools/nvim/cclear diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index dfb6a16..23c1483 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -79,9 +79,6 @@ autocmd BufWritePre * :call TrimWhitespace() " disables automatic commenting on newline: autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o -" clean LaTex build files -autocmd VimLeave *.tex !texclear % - " mapping Dictionaries nmap :setlocal spell! spelllang=de_de nmap :set spelllang=en_us @@ -122,6 +119,10 @@ au FileType tex,latex setlocal formatprg=latexindent\ - au FileType c,java,python,tex,latex noremap gggqG +" cleanup certain files after leaving the editor +autocmd VimLeave *.tex !texclear % +autocmd VimLeave *.c !cclear + """ Begin Plugin section if ! filereadable(expand('~/.config/nvim/autoload/plug.vim')) @@ -150,6 +151,7 @@ Plug 'tomasiser/vim-code-dark' " adding colorscheme Plug 'tpope/vim-fugitive' " git wrapper Plug 'tpope/vim-surround' " help for quotes/parantheses Plug 'uiiaoo/java-syntax.vim' , {'for': 'java'} " better syntax highlight for java than default +Plug 'whonore/coqtail' , {'for': 'v'} " coq interactive proof call plug#end() " alvan/vim-closetag @@ -272,4 +274,10 @@ nnoremap gs :G " tomasiser/vim-code-dark colorscheme codedark +" whonore/coqtail +function g:CoqtailHighlight() + hi def CoqtailChecked ctermfg=2 + hi def CoqtailSent ctermfg=2 +endfunction + """ end plugin section diff --git a/.local/bin/tools/nvim/cclear b/.local/bin/tools/nvim/cclear new file mode 100755 index 0000000..49b515d --- /dev/null +++ b/.local/bin/tools/nvim/cclear @@ -0,0 +1,6 @@ +#!/bin/sh + +if [ -d .ccls-cache ] +then + rm -r '.ccls-cache' +fi