Skip to content

Instantly share code, notes, and snippets.

@deargle
Created July 26, 2016 19:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deargle/8217de2b0edb491acdb20392029f101c to your computer and use it in GitHub Desktop.
Save deargle/8217de2b0edb491acdb20392029f101c to your computer and use it in GitHub Desktop.
My .vimrc
set showcmd
set showmatch
set ignorecase
set incsearch
set autowrite
set tabstop=4
set expandtab
set title
set cindent
set sw=4
syntax on
set background=dark
" Search for selected text, forwards or backwards.
vnoremap <silent> * :<C-U>
\let old_reg=getreg('"')<Bar>let old_regtype=getregtype('"')<CR>
\gvy/<C-R><C-R>=substitute(
\escape(@", '/\.*$^~['), '\_s\+', '\\_s\\+', 'g')<CR><CR>
\gV:call setreg('"', old_reg, old_regtype)<CR>
vnoremap <silent> # :<C-U>
\let old_reg=getreg('"')<Bar>let old_regtype=getregtype('"')<CR>
\gvy?<C-R><C-R>=substitute(
\escape(@", '?\.*$^~['), '\_s\+', '\\_s\\+', 'g')<CR><CR>
\gV:call setreg('"', old_reg, old_regtype)<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment