Hacker News new | past | comments | ask | show | jobs | submit login

I am SO SATISFIED with my splits key remapping I have to share it:

    map <M-right> <C-w>l
    map <M-left> <C-w>h

    map <M-down> <C-w>j
    map <M-up> <C-w>k

    map <M-,> :split<CR><C-w>j " Horizontal split
    map <M-.> :vsplit<CR><C-w>l " Vertical split
    map <M-/> :close<CR>

    map <M-<> <C-w>K " Convert vertical to horizontal split
    map <M->> <C-w>L " Convert horizontal to vertical split



You should use `nnoremap` instead of just `map`: http://learnvimscriptthehardway.stevelosh.com/chapters/05.ht...

HTH


I moved over to evil-mode (Vim emulation) in Emacs a couple of months ago and do most things the Vim way but some things are more efficient to do in a non-Vim manner and this is one of them.

Although I use M-- and M-| for vertical and horizontal splits.


As someone who's been using vim for about 20 years, here are the problems I have with any vi/vim emulation modes in emacs:

* Configuring emacs still requires learning a lot about emacs (which takes a lot of time).

* These vi/vim emulation modes doen't touch SLIME's keybindings, afaik. So, to make them less finger-twisting will require manual rebinding (which takes yet more time).

* Most emacs tutorials assume you're using the standard key bindings. So you still have to learn them.

All of the above make the various vi/vim emulation modes fine for people who already know emacs, or who are willing to sink a ton of time in learning it and reconfiguring it. But they are far less attractive to vim users who already have a nice environment set up in vim and feel comfortable in it.

I guess they're still better than nothing. If I had to use emacs, I'd certainly use something like evil mode. But evil mode alone is not enough to make a vim veteran feel comfortable in emacs.


You are right on all points, I come however from 10 years of Vim and 15 years of Emacs so it is a natural fit.

Vim emulation modes are mostly for people who prefer a certain environment, like f.e. Emacs but want more efficient keybindings.


+1 For evil-mode. I'm still using MacVim and Emacs+Evil side by side because many things that my vim does (via plugins etc) my emacs/evil doesn't do yet and I lack the time to research it all. But having elisp for extension is such a joy to use. I've dabbled a bit with evil, too, and I really like how easy it is to extend it.


Funny, I just started using evil too. You might want to checkout prelude/projectile if you haven't yet. Also, less obviously for a vimmer, keychord.el. I'm able to use 'jk' for ESC, for instance. For others interested, the brief evil manual is worth peeking at: https://gitorious.org/evil/evil/blobs/raw/doc/doc/evil.pdf. Motions, text objects, and operators in theory are easy to add in elisp, which is cool. For this reason, evil seems unlike other vim 'emulators' that I'm aware of (could just be ignorance, obviously). I'm really digging evil though.


Yes, I feel similar. I've tried way too many vim 'emulators', and the only other one which comes close to that 'vim' feeling is XVim for XCode. However, neither that one, nor all the others feel as easily extendable (with the exception of Vico, a native Mac vim clone that uses Nu (a cocoa lisp) for extension, but Vico even though it's easily extendable lacks a ton of vim commands)


I have somewhat similar, though I map the <C-w>hjkl keys to just the arrow keys themselves with no modifiers. The only problem is when other people are poking around at one of my vim sessions it trips them up.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: