Created
October 12, 2013 23:51
-
-
Save darkturo/6956307 to your computer and use it in GitHub Desktop.
My vimrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" I like syntax highlighting ... mainly the reason why I started to use vim | |
syntax on | |
" Make tabs to be represented as 3 spaces | |
set tabstop=3 | |
" Force tabs to become spaces (3 spaces) | |
set softtabstop=3 | |
set expandtab | |
"== Set colorcolumn to be enabled when it goes over colum 80. | |
"set colorcolumn=81 | |
highlight ColorColumn ctermbg=magenta | |
call matchadd('ColorColumn', '\%81v.*', 100) | |
"== Set listchar to show off tabs and trailing spaces | |
set listchars=tab:>~,trail:. | |
"== Higlight search | |
set incsearch | |
set hlsearch | |
nnoremap <silent> n n:call HLNext(0.4)<cr> | |
nnoremap <silent> N N:call HLNext(0.4)<cr> | |
highlight WhiteOnRed ctermbg=red ctermfg=white | |
" highlight the match in red (Damian Conway) | |
function! HLNext (blinktime) | |
let [bufnum, lnum, col, off] = getpos('.') | |
let matchlen = strlen(matchstr(strpart(getline('.'),col-1),@/)) | |
let target_pat = '\c\%#'.@/ | |
let ring = matchadd('WhiteOnRed', target_pat, 101) | |
redraw | |
exec 'sleep ' . float2nr(a:blinktime * 1000) . 'm' | |
call matchdelete(ring) | |
redraw | |
endfunction | |
" remap CTRL-v to just v, when in command mode. Easier Life | |
nnoremap v <C-V> | |
nnoremap <C-V> v | |
vnoremap v <C-V> | |
vnoremap <C-V> v | |
"== spelling | |
nmap ;s :set invspell spelllang=en<CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment