You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
740 B
29 lines
740 B
2 years ago
|
" General-Purpose keybinds
|
||
|
|
||
|
" Space is the leader key when outside of insert mode.
|
||
|
let mapleader=" "
|
||
|
|
||
|
map <silent> <Leader>t :NERDTreeToggle<CR>
|
||
|
nnoremap <silent> <Leader>r :call NumberToggle()<CR>
|
||
|
|
||
|
" Pressing enter in command mode clears the current search highlighting until
|
||
|
" the next search.
|
||
|
nnoremap <silent> <CR> :noh<CR><CR>
|
||
|
|
||
|
" This one maps F5 to delete all trailing whitespace
|
||
|
nnoremap <silent> <F5> :let _s=@/<Bar>:%s/\s\+$//e<Bar>:let @/=_s<Bar>:nohl<CR>
|
||
|
|
||
|
" Togglable relative line numbering
|
||
|
function! NumberToggle()
|
||
|
if(&relativenumber == 1)
|
||
|
set norelativenumber
|
||
|
set number
|
||
|
else
|
||
|
set relativenumber
|
||
|
endif
|
||
|
endfunc
|
||
|
|
||
|
" <SPC>r will toggle relative line numbers.
|
||
|
nnoremap <silent> <Leader>r :call NumberToggle()<CR>
|
||
|
|