Vim Keybindings Everywhere – The Ultimate List
github.com
github.com
caps lock + j -> screwed up document too many times
(I don't recall vi having multiple undo, just one level)
Finally switched to emacs. Pleasantly surprised when emacs keystrokes worked all through macos.
I do use vi quite a bit for quick edits of config files. My fingers just figure out that i'm in vi. (and vi supports some emacs keystrokes, like c-n, c-p)
Much like you, if I need to edit a quick file, I can just fire up Vi or Vim and be on my way. What's nice about Evil, for those unaware, is that I can turn it off whenever I want and go back to Emacs' key-bindings.
However, I have Emacs bindings set-up to work while in 'insert mode' in Evil.I think the package is called 'hybrid-mode' if I am not mistaken? It's been a while since I looked at it, so I apologize.
I find that both styles have certain advantages. For example, If I want to jump to the end of a line to add a semi-colon or something, I rather just Crtl+e while I am in 'insert mode' vs Esc -> shift + a
Though if I want to jump to the corresponding open/close curl brace, I rather use Vi(m) bindings.
This is like, the whole _point_ of Vim to me - much less about muscle memory and more about mnemonic ways of interacting with text. `ciw` is "change inside word", `da{` is "delete a tag", `yat` is yank a tag, etc. t and f are "to" and "through" (I think "froo" for that one). vf; is "visually select thru the next semicolon" for example.
The whole combination of motions and text objects is the real magic of Vim for me. Also the g ex command is pretty great too.
Heck, home computers of the early 1980s had cursor keys. And nowadays we don't even have the excuse that there are some barmy terminals around that produce really odd character sequences from the cursor keys that we don't get configurations for out of the box. Even the world of terminals and terminal emulators is mostly DEC-ish now.
I realize that people do it as an exercise, or out of curiosity, sometimes. But I have no intention of ever going back to that world. (-:
I have vim navigation setup for navigating tmux, i.e. ctrl-a + h/j/k/l nav left, up, down, right. There are so many times I miss the ctrl-a, and just spam "kkk". I'm vaguely terrified I'm going to be reported to HR.
Originally I read about this feature in a POSIX spec, noticed it did not work, and filed a bug with readline about it.
They fixed the bug, but since it was only mentioned in the spec for Vi mode, they did not add the feature to Emacs mode.
I'm glad to have done my part to make Vi mode strictly superior to Emacs mode (:
Typically I will insert a step in the pipeline like for example `nvim -Es +':%s/^/go home/' +'%p'`.
NeoVim rather than Vim since Vim is painful for pipeline text manipulation.
(It fixes the vim issue by virtue of using a temporary file to do the magic)
I swear, I spent over a year training vim. I still wasn't as quick as I was after a week of sublime. It's pretty much the only proprietary software I shill for.
Two of my favorite tricks: (i) Search in file (Cmd-F), turn on regex mode if it’s not already on (Cmd-Opt-R), search for a pattern (with regex syntax highlighting!), and press Opt-Enter. This places one cursor / selection at every regexp match.(ii) Press Cmd-R to get a list of classes/functions in the file, and navigate with arrow keys (or type to search). Performs roughly the same function as I used code folding for in Vim or imenu for in Emacs. (Sublime also has code folding, but I don’t like the implementation much.)
But personally I get more return out of improving my nvim setup than trying to bend vscode to match vim.
My experience is that this definitely isn't true. Not only have I happily used all sorts of text editors in my life; I use emacs keybindings in Unix shells.
> Search in your browser with ctrl/cmd + f.
The irony is not lost that this doesn't say to search in my browser using slash. (-:
The page is also unconsciously right that it should be talking about VIM, not vi. VIM happily recognizes the [Insert] key on my keyboard. Original Joy vi would not have. Even today, nvi ends up swapping the case of a character when I press the [Insert] key in one terminal emulator.
"In early proposals, the KornShell-derived emacs mode of command line editing was included, even though the emacs editor itself was not. The community of emacs proponents was adamant that the full emacs editor not be standardized because they were concerned that an attempt to standardize this very powerful environment would encourage vendors to ship strictly conforming versions lacking the extensibility required by the community. The author of the original emacs program also expressed his desire to omit the program. Furthermore, there were a number of historical systems that did not include emacs, or included it without supporting it, but there were very few that did not include and support vi. The shell emacs command line editing mode was finally omitted because it became apparent that the KornShell version and the editor being distributed with the GNU system had diverged in some respects. The author of emacs requested that the POSIX emacs mode either be deleted or have a significant number of unspecified conditions. Although the KornShell author agreed to consider changes to bring the shell into alignment, the standard developers decided to defer specification at that time. At the time, it was assumed that convergence on an acceptable definition would occur for a subsequent draft, but that has not happened, and there appears to be no impetus to do so. In any case, implementations are free to offer additional command line editing modes based on the exact models of editors their users are most comfortable with."
[1] https://pubs.opengroup.org/onlinepubs/9699919799/utilities/s...
Every computer I use, I remap control to caps lock. On my work Mac, nothing really changes since these commands work globally.
On my home PC, I run stock Ubuntu and use gnome-tweaks to set emacs commands.
These commands are so ingrained on how I edit text, I feel extremely uncomfortable without them. The deal breaker when using a new desktop environment or Windows, is whether I can get this setup up and running.
Does anyone have any hacks for supporting Readline out of Gnome or MacOS?
Muscle memory makes you do weird things.
The emacs bindings for Mac are too limited. After using emacs everywhere on Windows (with autohotkeys), I found going back to Mac quite limiting. Ended up using some hammerspoon to address done of the faults.
Curious, where do you find them lacking? AFAIK they’re present in all cocoa apps. Are there other apps where you wish they were supported, or is it that you wish for more bindings besides the mentioned C-a, C-e, etc?
It is also worth noting that macOS also uses Cmd+Opt as its Meta key (so Cmd-Opt-F and Cmd-Opt-B are the word-wise motions).
https://web.archive.org/web/20220123004610/https://www.hcs.h...
There's someone who does the equivalent for hardware fixes. Okay it's not exactly an MIT lecture but I learned a lot from it, and in such a light-hearted way.
But you're right it's not perfectly convenient. Great for surveying information rapidly though. If you don't catch the precise information, at least you know of it, which I think is half the battle with vim keybindings.
[1] https://chrome.google.com/webstore/detail/video-speed-contro...
Similar can be done for 'editline' (a readline alternative sometimes seen on BSD systems).
If someone is able to get over the steep learning curve, having vim bindings on your fingertips is awesome.
Though frankly, any Vimmer using Emacs knows this already. Someone's either trolling, or never saw any reason to leave Vim and find out what these are options are really like, picking up the misunderstanding along the way.
I'd totally get that, these lists are awesome and maintaining them is hard work-- it's otherwise pretty great, and congratulations to everyone involved! I've always felt jealous of the folks funning neovim in their browser text-areas.
As an aside: I stick with emacs because of the modal and recursive minibuffer(s) (ie. command-line(s)). What vim setting do I change to be able to use normal mode down there?
> I stick with emacs because of the modal and recursive minibuffer(s) (ie. command-line(s)). What vim setting do I change to be able to use normal mode down there?
Not a setting. Just press Ctrl+F when your cursor is in the command line. After that, and until you finish entering the command, you will be able to use Esc to go into normal mode again.Evil has been fantastic. That said, I'm intrigued by Meow: https://github.com/meow-edit/meow
Meow inverts the order of commands: instead of vim's verb-count-object order, meow does object-count-verb, if I'm remember David Wilson's video right. This lets it pop up an avy-like overlay (I think it calls them "rulers") so you can see more clearly exactly how far of an extent an action is going to have. Kinda cool. Might try it some day.
New Tricks for an Old Terminal Driver, Eric Fischer, Usenix '99, https://www.usenix.org/legacy/event/usenix99/full_papers/Fis...
In the "User interface" section, Fischer mentions that an Emacs mode is "much easier" to write than a vi mode, but really doesn't give reasons.
(Emacs does have a thing called “modes” but they are unrelated to the use of the term in UI discussions).
The link you posted didn't work for me but this did: https://www.usenix.org/legacy/publications/library/proceedin...
When I was forced to use mainstream IDEs, I was thinking it's okay, just slap vim extension and it should be the same. However, I forgot that my snippets are not there, advanced semantic navigation and refactoring is not handled the way vim does with the config and extensions, ... The conclusion was that, it will look like Vim but it's definitely not the same.
As a result I also remember shortcuts in apps with vim-keybindings much better.
Personally, I also put Escape in the default-Delete position, where the Enter-Escape symmetry then matches the Space-Backspace symmetry.
I found it much faster than ranger (matters especially for large folders), and the UI is pretty intuitive.
`j` to jump to next post in Reddit is not "Vim-like" at all for someone familiar with Vim.
Why not? For me the verb (motion) is down and noun is the post (I just think of each post as a line).
That's where the deviation occurs and where the idea of shared keybindings universe falls appart. Yes you have `j` in vi and Vim and `j` in Reddit, but they actually do different things, which requires a tiny bit of mental gymnastics… which is exactly what having the same keybindings everywhere is supposed to prevent.
Really, it’s simple domain mismatch. In Vim, gj/gk for physical lines, j/k for logical lines, (/) for sentences, {/} for paragraphs, [[/][/][/]] for sections as they are in certain families of languages. It’s all clearly designed for plain text navigation.
Things like Reddit or an email client or whatever, {/} might be semantically a touch closer, but they’re still not exact matches, and all up j/k is extremely reasonable.
`yt` yank (duplicate) a tab
`W` detach tab to new window
export VISUAL=vim
Will make those program use com as the default editor. I believe for works that way for example.