• You are not logged in.

    VIM Sucks

    • Started by youBane
    • 11 Replies:
    • Reputation: 0
    • Registered: 26-Oct-2013
    • Posts: 71

    Part of what got me to start learning Colemak is that the issue of VIM was addressed. That is, there's a remapping for VIM for Colemak. VIM was my favorite editor and I didn't want to give it up. Well, after trying to make it work with Colemak, I realize that it's fundamentally flawed.

    There are two paradigms going on with VIM. The first is using letters for mnemonics, such as N for Next. The second is using the layout as a GUI. It's the second paradigm that's the problem--for example, using HJKL for movement. This essentially ties the editor to the keyboard layout: QWERTY. The Colemak remapping goes a long way toward making VIM workable with Colemak, but it just extends the problem: it ties VIM to Colemak. Take Insert and Append on the left home row for example (in Colemak). They're placed there for GUI reasons (that is the physical space they occupy; I realize I'm abusing the term GUI here). The mnemonics are arbitrary and made up after the fact. But we have GUIs these days and have had them for many years. I imagine most of you, even if you run Terminal or CMD, run it in a GUI. Moving these commands to the GUI separates it from the keyboard layout allowing you to use any layout you please.

    I tried going back to QWERTY for a while to have full use of VIM. It sucked. I blame VIM, so VIM sucks (by association). I'm looking for a new editor. I'll check out Sublime Text.

    Offline
    • 0
    • Reputation: 11
    • Registered: 06-Jun-2013
    • Posts: 551

    I use emacs with no colemak specific mods and its fine

    For sure it took me a little while to swap from qwerty but its no harder to use now

    You could argue thats because it was so un-ergonomic to start off with

    but either way - swapping layouts hasn't been a detriment to its use as an editor

    Offline
    • 0
    • Reputation: 0
    • Registered: 04-Apr-2013
    • Posts: 538

    There are simpler remappings in that thread, such as only remapping within hjkl and leaving everything else with the same mnemonics.  In that case, for all keys besides hjkl, you should be able to use vim with any layout by just sounding out the mnemonic.  I use vim this way with messagease on android (which is not remotely similar to qwerty or colemak).

    The colemak hjkl positions themselves are not great, but you're not supposed to use them that much in the first place.  By that rationale, some people (mostly those for whom portability is important) don't even remap within hjkl.

    I do agree that vim has quirks and flaws, and that hjkl should be considered among them.  I disagree that GUI-intensive editors like Sublime are a valid solution, though.  GUIs are great for listing rare commands that you can't really remember, but are terrible for oft-repeated or composing commands.

    You can give a shot at emacs.  evil-mode is usually considered the best vim emulator out there, while you'd also get access to the rest of the emacs o̶p̶e̶r̶a̶t̶i̶n̶g̶ ̶s̶y̶s̶t̶e̶m̶ ecosystem.  Some relevant threads:

    http://www.reddit.com/r/vim/comments/1o … _evilmode/
    http://bling.github.io/blog/2013/10/27/ … val-guide/
    http://www.reddit.com/r/emacs/comments/ … g_awesome/

    Incidentally: emacs' C-r and C-s (reverse and forward search) are amazing on colemak.  On QWERTY, those positions make no sense at all.

    Offline
    • 0
    • Reputation: 0
    • Registered: 06-Aug-2008
    • Posts: 15

    If you're referring to Shai's vim setup, you might be interested in checking mine out. It's more standard-Vim-like and far less invasive with fewer changes to the defaults.

    I have been using this very happily for 5+ years, and have fixed up as many of Vim's default mappings as I've encountered to match. I prefer the Vim experience I have now to the Qwerty one I had before.

    I copied an overview below, but check out the vimrc itself and details here: https://github.com/bunnyfly/dotfiles

    Of course, Vim+Colemak aren't for everyone; if you find something that works better for you, good on you!

    " The idea is to use HNEI as arrows – keeping the traditional Vim homerow style – and changing as
    " little else as possible. This means JKL are free to use and NEI need new keys.
    " - k/K is the new n/N.
    " - s/S is the new i/I ["inSert"].
    " - j/J is the new e/E ["Jump" to EOW].
    " - l/L skip to the beginning and end of lines. Much more intuitive than ^/$.
    " - Ctrl-l joins lines, making l/L the veritable "Line" key.
    " - r replaces i as the "inneR" modifier [e.g. "diw" becomes "drw"].
    Offline
    • 0
    • Reputation: 0
    • Registered: 04-Apr-2013
    • Posts: 538

    Interesting choice, bunnyfly.

    If we work under the axiom that the jk (colemak ne) keys are the only important arrows, one can even avoid messing with the insert, h, and l keys:

    • swap n with k

    • swap e with j

    I think I'll give this one a shot.

    Offline
    • 0
    • Reputation: 0
    • Registered: 26-Oct-2013
    • Posts: 71

    @bunnyfly, i am ready to check out your setup. at the time you recommended it to me, i had switched to sublime text and all was well. but sublime text has this annoying horizontal scrolling of the viewport when using auto indent. vim doesn't have that problem, so i'm using your setup now. ty

    Offline
    • 0
    • Reputation: 0
    • Registered: 26-Oct-2013
    • Posts: 71

    no, it's just too arcane. vim, i mean. your setup file is nice. i got vim setup, i installed the solarized color theme. i set the horizontal scroll bar to always show. picked Consolas as my font. i was ready to code! then i wanted to search across multiple files. i'm using Gvim which is supposed to be a graphical vim, but it isn't. that command line stuff is ugly. >.<

    Offline
    • 0
    • Reputation: 0
    • Registered: 04-Apr-2013
    • Posts: 538

    At the risk of repetition, emacs perhaps? ;)

    evil has probably the highest fidelity of any vim emulator, while ag.el works similarly to ag.vim but has a more GUI-ish look.

    Offline
    • 0
    • Reputation: 0
    • Registered: 26-Oct-2013
    • Posts: 71

    Yeah, I remember you mentioned that and I just might try it. There's even a way to get the code minimap in emacs, just like in Sublime Text. But is emacs any better with GUI? Take tabs for example. I don't want to remember a command for changing tab size. In Sublime Text, I can see it on the status bar. I click it. A menu opens, then I select the tab size. The point being, I want the memory in the GUI instead of my head.

    For example, do I have to type some arcane command in emacs to search across multiple files?

    Offline
    • 0
    • Reputation: 0
    • Registered: 04-Apr-2013
    • Posts: 538

    I don't use tabs (at the moment, I use a searchable buffer list that, when I press b, pops up as something like ido-vertical-mode) so can't help you there.

    youBane said:

    For example, do I have to type some arcane command in emacs to search across multiple files?

    No; you can bind ag to the ex-command :search by

    (evil-ex-define-cmd "search" 'ag) 

    The resulting buffer can then be scrolled, and matches clicked to jump to them.


    Some other ex-bindings I'd recommend are:

    ;;comment
    (evil-ex-define-cmd "com[ment]" 'evilnc-comment-operator) ;;from https://github.com/redguardtoo/evil-nerd-commenter

    So, for example, you can comment/uncomment the current line or selection with :com.  The usual ex-stuff works with the operator, so you can comment/uncomment all lines containing "eggs" by :g/eggs/com, or all lines except those containing "eggs" by :v/eggs/com.

    ;;C-h k
    (evil-ex-define-cmd "key" 'describe-key)
    
    ;;C-h f
    (evil-ex-define-cmd "fun[ction]" 'describe-function)
    
    ;;C-h v
    (evil-ex-define-cmd "var[iable]" 'describe-variable)
    
    ;;C-h m
    (evil-ex-define-cmd "bindings" 'describe-mode)

    These last are shortcuts to some of emacs' self-documenting features.  If you're not sure what a normal mode key combo does, type :key<Return> then the key combo.  If there's an emacs function [resp. variable] you want information about, :fun<Return> [resp. :var<Return>] and then search for it.  My own config makes gives these searches the appearance of the "ido-vertical-mode" from earlier. 

    :bindings, among other things, lists all the keybindings.


    Going the extremely GUI route, tweaking the menus and popup menus to add these and others is also possible, though again, not something I've ever tried.  These starting points look promising:

    https://www.emacswiki.org/emacs/EasyMenu
    https://www.emacswiki.org/emacs/MenuBar

    I might try my hand at an EasyMenu later.

    Offline
    • 0
    • Reputation: 1
    • Registered: 19-May-2012
    • Posts: 26

    personally, i leave all the mappings alone in vim even though I use colemak. Vim is my primary editor - I use it everyday.

    What I've found is that yes, hjkl was a hard switch to make, but I no longer notice it. It's become second nature.

    Other key combinations are much improved over qwerty... for example, o (insert new line above, below), i (insert), ct (change to), cit (change inside tag - one of my plugins adds this), r (replace), ctrl-r (redo), etc...

    Offline
    • 0
    • Reputation: 0
    • Registered: 28-Nov-2022
    • Posts: 1

    I use a very minimal mapping to integrate with vim:

    " m,./ to navigate
    noremap m h
    noremap , j
    noremap . k
    noremap / l
    
    noremap h /
    noremap j m
    noremap k .
    noremap l ,

    For nmemonics, I use
    h - hunt
    j - jump
    k - kommand
    l - look reverse (also, it's the opposite of ; ... so use the index finger instead of the pinky)

    I have a programmable keyboard with layers as well, so I created a layer that contains these mappings at the press of a button for the situations where I'm remoted in or can't access my rc files.

    Last edited by hungLink (28-Nov-2022 18:55:55)
    Offline
    • 0