From f19e84e1a5ffbf39bff4b4ae4c0ce42feb62eb6b Mon Sep 17 00:00:00 2001 From: Michael Campagnaro Date: Sun, 21 May 2023 18:02:21 -0400 Subject: [PATCH] Change some vim mappings --- vimrc | 62 ++++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 38 insertions(+), 24 deletions(-) diff --git a/vimrc b/vimrc index d859e16..bcfd480 100644 --- a/vimrc +++ b/vimrc @@ -1,4 +1,4 @@ -"----------------------------------------------------------------------------------------------------------------------- +"----------------------------------------------------------------------------------------------------------------------- " The config is chopped up into sections. Search for these headings to quickly jump to a particular section. " " #0 GLOBALS @@ -237,12 +237,14 @@ Plug 'ctrlpvim/ctrlp.vim' " Fuzzy file, buffer, mru, tag, etc finder Plug 'majutsushi/tagbar' " Display ctags in a window, ordered by scope. Plug 'tommcdo/vim-lion' " For text alignment, use gl= and gL= Plug 'tpope/tpope-vim-abolish' " Easily search for, substitute, and abbreviate multiple variants of a word. Add them to `vim/after/plugin/abolish.vim` -Plug 'vim-scripts/AnsiEsc.vim' " Ansi escape sequences concealed, but highlighted as specified. Plug 'sir-pinecone/errormarker.vim' " Build error highlighting (requires skywind3000/asyncrun.vim). Plug 'skywind3000/asyncrun.vim' " Async commands. Plug 'nelstrom/vim-qargs' " For the GlobalReplaceIt function (i.e. search and replace). Plug 'editorconfig/editorconfig-vim' " Adds support for .editorconfig files. +" @flagged for removal +Plug 'sir-pinecone/AnsiEsc.vim' " Ansi escape sequences concealed, but highlighted as specified. + if IsWindows() Plug 'suxpert/vimcaps' " Disable capslock (useful if the OS isn't configured to do so). endif @@ -382,7 +384,7 @@ endif set list listchars=tab:»·,trail:· " Show trailing whitespace. -set timeoutlen=300 ttimeoutlen=0 " Adding this since the esc remap on the 'i' key had a long delay when pressed. +set timeoutlen=250 ttimeoutlen=0 " Don't set it too low otherwise you won't be able to type use multi-key sequences. " @fixme might be broken if lowered to 100 from original value of 4000. Will " first try 500 and tweak from there. @@ -531,6 +533,26 @@ augroup END "||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| "||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| +" Note: if there are two+ mappings that start with the same sequence then vim +" will introduce a delay before the mapping is handled in order to wait for +" the entire sequence to be typed. e.g. s and sg will +" introduce a timeout delay, which will be noticed when you're trying to use +" s. If you type sg then it'll be handled immediately, unless +" there is a third mapping with that initial sequence, e.g. sgn. +" +" You can adjust the timeout duration by modidying the timeoutlen option. +" +" You can see when a keysequence is mapped to by entering :map +" e.g. :map ,s +" This is helpful when you are experiencing a timeout but you only have one +" mapping defined in your vimrc. It's likely that a plugin added a similar +" mapping sequence. +" +" The difference between map and noremap is that the former does recursive +" expansion and the latter doesn't. The expansion means that if the mapped key +" sequence contains any mappings then those mappings will be expanded as well. +" This can lead to issues and confusion, so it's best to use noremap unless +" you really have a reason not to. "################################################################################## " MISC @@ -601,7 +623,7 @@ noremap p "+p noremap pp :set paste! paste? " Toggle line numbers. -noremap o :set number! number? +nnoremap o :set number! number? " Show spell checking. " You can add new entries to the dict by moving the cursor over the word and pressing `zg`. @@ -885,14 +907,6 @@ noremap gb :Git blame -w command! -bar -bang -nargs=* Blame :Git blame -wCM command! -bar -bang -nargs=* Gblame :Git blame -wCM -"################################################################################## -" GIST VIM -"################################################################################## -let g:gist_detect_filetype = 1 -let g:gist_open_browser_after_post = 1 -let g:gist_show_privates = 1 -let g:gist_post_private = 1 - "################################################################################## " VIM-CLOJURE-STATIC "################################################################################## @@ -1383,33 +1397,33 @@ endfunction "///////////////////////////////////////////////// " Case insensitive: -noremap s :call Search('.', g:campo_custom_search_args, 1) +nnoremap s :call Search('.', g:campo_custom_search_args, 1) " Case sensitive: -noremap ss :call Search('.', g:campo_custom_search_args) +nnoremap ss :call Search('.', g:campo_custom_search_args) "///////////////////////////////////////////////// " SEARCH IN DIRECTORY CONTAINING THE ACTIVE FILE "///////////////////////////////////////////////// " Case insensitive: -noremap sf :call Search(expand('%:p:h'), g:campo_custom_search_args, 1) +nnoremap sf :call Search(expand('%:p:h'), g:campo_custom_search_args, 1) " Case sensitive: -noremap ssf :call Search(expand('%:p:h'), g:campo_custom_search_args) +nnoremap ssf :call Search(expand('%:p:h'), g:campo_custom_search_args) "///////////////////////////////////////////////// " SEARCH IN JAI FOLDERS "///////////////////////////////////////////////// " Case insensitive: -noremap sg :call Search(g:campo_jai_path, g:campo_custom_search_args, 1) -noremap sm :call Search(g:campo_jai_path . '/modules', g:campo_custom_search_args, 1) -noremap sh :call Search(g:campo_jai_path . '/how_to', g:campo_custom_search_args, 1) -noremap se :call Search(g:campo_jai_path . '/examples', g:campo_custom_search_args, 1) +nnoremap sg :call Search(g:campo_jai_path, g:campo_custom_search_args, 1) +nnoremap sm :call Search(g:campo_jai_path . '/modules', g:campo_custom_search_args, 1) +nnoremap sh :call Search(g:campo_jai_path . '/how_to', g:campo_custom_search_args, 1) +nnoremap se :call Search(g:campo_jai_path . '/examples', g:campo_custom_search_args, 1) " Case sensitive: -noremap ssg :call Search(g:campo_jai_path, g:campo_custom_search_args) -noremap ssm :call Search(g:campo_jai_path . '/modules', g:campo_custom_search_args) -noremap ssh :call Search(g:campo_jai_path . '/how_to', g:campo_custom_search_args) -noremap sse :call Search(g:campo_jai_path . '/examples', g:campo_custom_search_args) +nnoremap ssg :call Search(g:campo_jai_path, g:campo_custom_search_args) +nnoremap ssm :call Search(g:campo_jai_path . '/modules', g:campo_custom_search_args) +nnoremap ssh :call Search(g:campo_jai_path . '/how_to', g:campo_custom_search_args) +nnoremap sse :call Search(g:campo_jai_path . '/examples', g:campo_custom_search_args) " Navigation for the vim-ripgrep search results. " Hit o on a result line to open the file at that line.