From 15599f5565e736061dafd4bc7b68eda74aac0d4d Mon Sep 17 00:00:00 2001 From: Kurtis Moxley Date: Mon, 23 May 2022 15:34:56 +0800 Subject: [PATCH] Add settings for background. --- vimrcs/extended.vim | 63 +++++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/vimrcs/extended.vim b/vimrcs/extended.vim index 486bb1b3..5f7d0afc 100644 --- a/vimrcs/extended.vim +++ b/vimrcs/extended.vim @@ -1,5 +1,5 @@ """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Important: +" Important: " This requries that you install https://github.com/amix/vimrc ! " """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" @@ -28,6 +28,7 @@ set guioptions-=l set guioptions-=L " Colorscheme +autocmd vimenter * hi Normal guibg=NONE ctermbg=NONE " transparent bg "set background=dark let ayucolor="light" colorscheme ayu @@ -41,7 +42,7 @@ autocmd! bufwritepost ~/.vim_runtime/my_configs.vim source ~/.vim_runtime/my_con """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" => Turn persistent undo on +" => Turn persistent undo on " means that you can undo even when you close a buffer/VIM """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" try @@ -61,13 +62,13 @@ cno $j e ./ cno $c e eCurrentFileDir("e") " $q is super useful when browsing on the command line -" it deletes everything until the last slash +" it deletes everything until the last slash cno $q eDeleteTillSlash() " Bash like keys for the command line -cnoremap -cnoremap -cnoremap +cnoremap +cnoremap +cnoremap cnoremap cnoremap @@ -115,14 +116,14 @@ autocmd FileType css set omnifunc=csscomplete#CompleteCSS """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Use the the_silver_searcher if possible (much faster than Ack) if executable('ag') - let g:ackprg = 'ag --vimgrep --smart-case' + let g:ackprg = 'ag --vimgrep --smart-case' endif " When you press gv you Ack after the selected text vnoremap gv :call VisualSelection('gv', '') " Open Ack and put the cursor in the right position -map g :Ack +map g :Ack " When you press r you can search and replace the selected text vnoremap r :call VisualSelection('replace', '') @@ -165,7 +166,7 @@ func! DeleteTillSlash() else let g:cmd_edited = substitute(g:cmd, "\\(.*\[/\]\\).*/", "\\1", "") endif - endif + endif return g:cmd_edited endfunc @@ -206,26 +207,26 @@ imap :call CompileRun() vmap :call CompileRun() func! CompileRun() -exec "w" -if &filetype == 'c' - exec "!gcc % -o %<" - exec "!time ./%<" -elseif &filetype == 'cpp' - exec "!g++ % -o %<" - exec "!time ./%<" -elseif &filetype == 'java' - exec "!javac %" - exec "!time java %" -elseif &filetype == 'sh' - exec "!time bash %" -elseif &filetype == 'python' - exec "!time python3 %" -elseif &filetype == 'html' - exec "!google-chrome % &" -elseif &filetype == 'go' - exec "!go build %<" - exec "!time go run %" -elseif &filetype == 'matlab' - exec "!time octave %" -endif + exec "w" + if &filetype == 'c' + exec "!gcc % -o %<" + exec "!time ./%<" + elseif &filetype == 'cpp' + exec "!g++ % -o %<" + exec "!time ./%<" + elseif &filetype == 'java' + exec "!javac %" + exec "!time java %" + elseif &filetype == 'sh' + exec "!time bash %" + elseif &filetype == 'python' + exec "!time python3 %" + elseif &filetype == 'html' + exec "!google-chrome % &" + elseif &filetype == 'go' + exec "!go build %<" + exec "!time go run %" + elseif &filetype == 'matlab' + exec "!time octave %" + endif endfunc