1. Frank Fischer
  2. vim-mode
  3. Issues
Issue #35 open

can't use <up> <down> <left> <right> in visual-mode

coldnew NA
created an issue

In vim we can both use "hjkl" or " <up> <down> <left> <right>" to control mark-region, I think this four keymaps shuold contains in vim-mode

following are patch

Comments (4)

  1. Frank Fischer repo owner
    • changed status to open

    Well, I explicitly left those bindings out. The main reason was that using <right> with usual emacs bindings allows to select the newline-character at the end of line which is impossible with "l" but may be required when using some native emacs commands.

    Anyway, this was reason when I started vim-mode and some inherited from viper. Today it is okay for me to include those bindings.

    In fact, I knew it was only a matter of time until such a request would be made ;)

    Btw, if one includes bindings for the cursor keys, one should provide bindings for other special keys like <Home>, <End>, <PageUp>, ..., too.

    Furthermore Vim also has bindings for S-<left> C-<left> and so on. I'm not sure of one should include those bindings, because they may interfere with other packages, e.g., S-<up>, S-<down>, ... are used by windmove, C-<left>, C-<right> perhaps by some tab-packages.

    So there are several ways: 1. define ALL keybindings as Vim does 2. define only keybindings without modifier S- or C- and provide a function, say vim:enable-modifier-movement-bindings which can be called in your .emacs file to add the other bindings 3. provide several functions which may add further bindings like vim:enable-all-bindings, vim:enable-movement-bindings, vim:enable-modifier-movement-bindings, ... but no additional binding is provided as default.

    This can also be done using some customization option similar to what viper does with its modes.

    Of course there is a fourth possibility: do nothing but provide all additional bindings on the example-page on EmacsWiki. At least for me this would be okay because I never use cursor keys ;)

  2. Anonymous

    I don't want to make emacs works just as vim does.

    When I rewrite vim-elscreen.el, I found there are some problems in simulate vim.

    In vim, when we are at the first, if we wan to goto the third tab, we press 2gt, which means goto next next tab.

    However, elscreen shows tab's number in default, type 3gt goto the tab number 3 will be more great, I take this as the emacs way.

    I think the fourth way is better. However, maybe we can write a vim-tradition.el which make vim-mode works as vim does oneday.

  3. srhb

    Recent version of Vim do now show the behaviour you are saying. In Vim 7.3, for example, 1gt means "go to tab 1", 2gt means "go to tab 2" etc., as expected. Only gt means go to next tab (and gT go to previous tab)

    Note that gt and gT are not congruent, 2gt means go to tab 2 while 2gT means go two tabs bacwards. Of course you wouldn't want two aliases for the first functionality, but then it seems kind of weird to have {count}gT go backwards.

  4. Log in to comment