diff options
-rw-r--r-- | vimrc | 26 |
1 files changed, 19 insertions, 7 deletions
@@ -30,8 +30,8 @@ if has('syntax') && !exists('g:syntax_on') syntax enable endif -""" Simple Mappings -let maplocalleader = "," +""" Make , the leader key +let mapleader = "," " easy escape imap fd <Esc> @@ -48,22 +48,34 @@ nmap ;o :buffer <C-R>=expand("%:h") . "/" <CR> " list buffers nmap ,l :ls<cr> -" delete buffer -nmap ,u :bdelete<cr> +" kill buffer +nmap ,k :bdelete<cr> -" ,d insert current date +" insert current date nmap <silent> ,d :r !date +\%Y.\%m.\%d<cr> nmap <silent> ,D :r !date +\%Y.\%m.\%d..\%H.\%M.\%S<cr> " grep (ripgrep) -nmap ,g :Rg +nmap ,g :Rg + +" clear out trailing whitespace and lines ending in whitespace +nmap <silent> ,w :%s/[\t ]\+$//e<cr> " Use <C-L> to clear the highlighting of :set hlsearch. if maparg('<C-L>', 'n') ==# '' nnoremap <silent> <C-L> :nohlsearch<C-R>=has('diff')?'<Bar>diffupdate':''<CR><CR><C-L> endif -""" Easily find cursor with crosshair (\c) +" trailing spaces are always bad +syntax match Warning display "\s\+$" +" mixed tabs and spaces +syntax match Warning display " \+\t" +syntax match Warning display "\t\+ " + +" mark columns 80 and 81 in red for long lines... +match ErrorMsg /\%80v.\%81v./ + +""" Easily find cursor with crosshair (,c) :hi CursorLine cterm=NONE term=reverse ctermbg=7 guibg=Grey90 :hi CursorColumn cterm=NONE term=reverse ctermbg=7 guibg=Grey90 :nnoremap <Leader>c :set cursorline! cursorcolumn!<CR> |