"
" Useful mappings
 
" Map Y to act like D and C, i.e. to yank until EOL, rather than act as yy,
" which is the default
map Y y$
 
" Map <C-L> (redraw screen) to also turn off search highlighting until the
" next search
nnoremap <C-L> :nohl<CR><C-L>

" Toggle filetree
map <C-r> :NERDTreeToggle<CR>  

" Switch between header/source file
map <C-a> :A<CR>

" Save mapped to Ctrl+S
nmap <C-s> :w!<CR>

" Undo mapped to Ctrl-Z
map <C-z> :undo<CR>

" YmcCompleter mappings
nmap <F2> :YcmCompleter GetType<CR>
nmap <F3> :YcmCompleter GoToDefinition<CR>

" LLDB mappings
map <F9> <Plug>LLBreakSwitch

" Terminal emulator mappings
map <S-t> :10sp <bar> term<CR>
tnoremap <Esc> <C-\><C-n>:bd!<CR>

" Highlight currently selected word
nmap <S-h> #*

" Auto-format json file
nmap =j :%!python -m json.tool<CR>

" Auto-format xml
nmap =x :set ft=xml<CR>ggVG !xmllint --format -<CR>
