From 63faf38dd786601adcaadd3945a5babc17f67613 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Wed, 31 Jul 2019 08:25:21 -0700 Subject: improve vim --- vimrc | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) (limited to 'vimrc') diff --git a/vimrc b/vimrc index 5da401c..f585f90 100644 --- a/vimrc +++ b/vimrc @@ -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 @@ -48,22 +48,34 @@ nmap ;o :buffer =expand("%:h") . "/" " list buffers nmap ,l :ls -" delete buffer -nmap ,u :bdelete +" kill buffer +nmap ,k :bdelete -" ,d insert current date +" insert current date nmap ,d :r !date +\%Y.\%m.\%d nmap ,D :r !date +\%Y.\%m.\%d..\%H.\%M.\%S " grep (ripgrep) -nmap ,g :Rg +nmap ,g :Rg + +" clear out trailing whitespace and lines ending in whitespace +nmap ,w :%s/[\t ]\+$//e " Use to clear the highlighting of :set hlsearch. if maparg('', 'n') ==# '' nnoremap :nohlsearch=has('diff')?'diffupdate':'' 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 c :set cursorline! cursorcolumn! -- cgit v1.2.3