by gfodor · 13y ago · 0 comments
nmap <CR> :write<CR>
cabbrev w nope
Re-map enter to save the file. If you try to do a :w it will yell at you until you take out the cabbrev so you can retrain your muscle memory. Took me about a day to retrain.
let g:EasyMotion_leader_key = ';'
nmap s ;w
nmap S ;b
Remap s and S to be easymotion forward and backward. I never use s, since it's largely a redundant command, and didn't like having to do a two key command for easymotion. (You can set the leader key to whatever here, the nmap's are the important part.)
noremap <C-H> <C-W>h
noremap <C-L> <C-W>l
noremap <C-J> <C-W>j
noremap <C-K> <C-W>k
Move between panes with motion keys with control held down.
Also the YouCompleteMe plugin got some HN airtime but it really needs to get more. It's amazing.
http://valloric.github.com/YouCompleteMe/
And as others have mentioned using vim inside of tmux is very nice. It's especially helpful to remap the entire tmux keymap to be vim-like.
Also, does anyone have any suggestions for what to re-map Space to? I am amazed Enter and Space in command mode both do relatively useless things. Remapping space to page down is OK but I use ctrl-f/b which is just as fast imho.
I used to use space as my "clear all searches and clear the echo-line" command, but decided space is too big and easymotion is too good to not pair them. I now use <leader><leader> to do the all-clear command.
" space toggles the fold state under the cursor.
nnoremap <silent><space> :exe 'normal! za'.(foldlevel('.')?'':'l')<cr>
" <leader>space expands with zO
map <leader><space> zO nnoremap <Space> za
vnoremap <Space> za
also, for folding in general I'd recommend using set foldmethod=marker
which has the benefit of making folds more 'transparent' in your code, and also persistent across vim sessionsEDIT: disregard me, it was a stupid configuration error (both plugins mapped the same key for completion, and foreplay won)
noremap <Space> @q
This lets me set a macro by first wacking qq, then q to finish, and then replay it by wacking space. I find myself using quick throw-away macros that only have a use for maybe 10 seconds far more often with this setup. (Plus wailing on the spacebar to get work done can be really satisfying ;)