commit bad063d0b8173d1f10eb5d7f631798dad04613f8 parent 54746a62827824ec3a05b3df9e387ab45f7a0312 Author: Wim Dupont <wim@wimdupont.com> Date: Sat, 4 May 2024 20:16:01 +0200 more c mappings Diffstat:
M | vimrc | | | 19 | ++++++++++++++++++- |
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/vimrc b/vimrc @@ -60,15 +60,32 @@ function! Clear_whitespace() :%s/\ *\ /\ /g endfunction +function! Test(word) + let word_re = '\V'.escape(a:word, '/\') + let pattern = '\v<('.word_re.'\v)\((.{-})\)' + execute '%s/'.pattern.'/\1{\2}/eg' +endfunction + +runtime! ftplugin/man.vim + autocmd BufWritePost,FileWritePost config.def.h !sudo rm config.h && sudo make install nnoremap <leader>t : call Toggle_transparent()<CR> nnoremap <leader>b : call Toggle_bookmode()<CR> nnoremap <leader>f : call Format()<CR> nnoremap <leader>c : call Clear_whitespace()<CR> -vnoremap <leader>p "_dP +vnoremap <leader>y "+y +vnoremap <leader>p "+p +vnoremap <leader>P "_dP cmap W w !sudo tee > /dev/null % map <F2> :w <CR> :!gcc % -o %< && ./%< <CR> map <F3> :w <CR> :!gcc % -g -o %< && gdb ./%< <CR> +map <F4> :w <CR> :!make && ./%< <CR> +map <F5> :w <CR> :!make && gdb ./%< <CR> + +:command -bar -nargs=* Run :w | :!gcc % -o %< && ./%< <args> +:command -bar -nargs=* Rund :w | :!gcc % -o %< && gdb --args ./%< <args> +:command -bar -nargs=* Runm :w | :!make && ./%< <args> +:command -bar -nargs=* Runmd :w | :!make && gdb --args ./%< <args>