4 ms·
Some small vim tweaks I've recently been using myself that I find very nice: nmap <CR> :write<CR> cabbrev w nope Re-map enter to save the file. If you try to
by gfodor 14y ago
Some small vim tweaks I've recently been using myself that I find very nice:
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/ 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.
- jlgreco 14y agoI have space mapped to execute the macro in 'q': 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 ;)
- ckw 14y agoSpace is my leader key.
- phaedrix 14y agoI use space for toggling folding: " 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
- q_revert 14y agosame here, but use 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 sessions
- deleted 14y ago[deleted]
- edanm 14y agoI use space as my easymotion leader key. So <space>-w goes forward by word, <space>down does easymotion down, etc. 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.
- Anderkent 14y agoYouCompleteMe claims to work with omnifunc-based completion engine, but I couldn't get that to work. Can't tell if it's YCM or foreplay that's dropping the ball, but they don't seem to work together (i.e. I get foreplay completions when I trigger omni completion, but not dynamically via YCM). EDIT: disregard me, it was a stupid configuration error (both plugins mapped the same key for completion, and foreplay won)