about summary refs log tree commit diff
path: root/usbify
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2016-08-20T16·54-0400
committerWilliam Carroll <wpcarro@gmail.com>2016-08-20T16·54-0400
commit337ba2e247963c80446bfaa14399344fca83c202 (patch)
tree50f253edb0f32f00763e1207d4bdb391bbf1e46d /usbify
parentbd5c06066c388988d7b5fe34ffba3297a719f315 (diff)
Adds custom highlighting and other keymappings
Diffstat (limited to 'usbify')
-rw-r--r--usbify/vim/.vimrc37
1 files changed, 37 insertions, 0 deletions
diff --git a/usbify/vim/.vimrc b/usbify/vim/.vimrc
index ae84ddfcdb41..ce2a7c88726e 100644
--- a/usbify/vim/.vimrc
+++ b/usbify/vim/.vimrc
@@ -52,6 +52,7 @@ let g:syntastic_check_on_wq = 1
 let g:syntastic_javascript_checkers = ['gjslint']
 
 
+" Basic settings
 syntax on
 set number
 set tabstop=2
@@ -61,6 +62,32 @@ colorscheme monokai
 set t_Co=255
 
 
+" Ensure that <header> is "," character
+let mapleader = ","
+
+
+" Define highlighting groups
+highlight InterestingWord1 ctermbg=Cyan ctermfg=Black
+highlight InterestingWord2 ctermbg=Yellow ctermfg=Black
+highlight InterestingWord3 ctermbg=Magenta ctermfg=Black
+
+
+" h1 highlighting
+nnoremap <silent> <leader>h1 :execute 'match InterestingWord1 /\<<c-r><c-w>\>/'<CR>
+nnoremap <silent> <leader>xh1 :execute 'match none'<CR>
+
+" h2 highlighting
+nnoremap <silent> <leader>h2 :execute '2match InterestingWord2 /\<<c-r><c-w>\>/'<CR>
+nnoremap <silent> <leader>xh2 :execute '2match none'<CR>
+
+" h3 highlighting
+nnoremap <silent> <leader>h3 :execute '3match InterestingWord3 /\<<c-r><c-w>\>/'<CR>
+nnoremap <silent> <leader>xh3 :execute '3match none'<CR>
+
+"clear all highlighted groups
+nnoremap <silent> <leader>xhh :execute 'match none'<CR> :execute '2match none'<CR> :execute '3match none'<CR>
+
+
 " add 80 character wrap line
 highlight OverLength ctermbg=red ctermfg=white guibg=#592929
 match OverLength /\%81v.\+/
@@ -73,10 +100,20 @@ imap jj <Esc>
 map <C-n> :NERDTreeToggle<CR>
 
 
+" BOL and EOL
+nnoremap H ^
+nnoremap L $
+
+
+" set -o emacs line-editor defaults
+inoremap <C-a> <Esc>I
+inoremap <C-e> <Esc>A
+
 
 " trim trailing whitespace on save
 autocmd BufWritePre *.{js,py,tpl,html} :%s/\s\+$//e
 
+
 " set default font and size
 set guifont=Operator\ Mono:h16