From e5c7c9909d6c27c040b344a4f0280263bc750d63 Mon Sep 17 00:00:00 2001 From: DarkWiiPlayer Date: Wed, 7 Mar 2018 12:52:24 +0100 Subject: [PATCH] visual-execute works differently now - Ctrl+Enter -> execute g:exe_prg - Enter -> execute b:exe_prg - b:exe_prg is initialized to g:exe_prg by default --- vimrc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/vimrc b/vimrc index b20b578..80f29e6 100644 --- a/vimrc +++ b/vimrc @@ -404,9 +404,7 @@ nnoremap Y y$ " --- VISUAL EXECUTE --- vnoremap :exec "'<,'>!".g:exe_prg -vnoremap ""y - \ :call setreg("\"", substitute(getreg("\""), "\n", "", ""), "v") - \ :"`< +vnoremap :exec "'<,'>!".b:exe_prg " --- OTHER --- " Don't exit visual mode when "shifting" @@ -671,9 +669,10 @@ function! s:init_generic_file() call s:autoClose_AddPair("(", ")") call s:autoClose_AddPair("{", "}") call s:autoClose_AddPair('"', '"') + let b:exe_prg = g:exe_prg endfunc -" Vimscript Stuff +" --- VIMSCRIPT STUFF --- au BufNewFile,BufRead *.vim,*vimrc :call init_vim_file() function! s:init_vim_file() @@ -685,6 +684,10 @@ function! s:init_vim_file() command! -buffer Functions lex MatchingLines("^\\s*fun\\(ction\\)\\?\\>!.*$") command! -buffer Commands lex MatchingLines("^\\s*com\\(mand\\)\\?\\>!.*$") command! -buffer Autocommands lex MatchingLines("^\\s*au\\(tocmd\\)\\?\\>!\\@!.*$") + + vnoremap ""y + \ :call setreg("\"", substitute(getreg("\""), "\n", "", ""), "v") + \ :"`< endfunction " --- C / C++ Stuff ---