[HN Gopher] Vim Keybindings Everywhere - The Ultimate List
___________________________________________________________________
Vim Keybindings Everywhere - The Ultimate List
Author : philonoist
Score : 154 points
Date : 2023-05-04 14:55 UTC (8 hours ago)
(HTM) web link (github.com)
(TXT) w3m dump (github.com)
| tcoff91 wrote:
| If you like vimium, there's an app called Vimac that's like
| vimium but for macOS. So you can control all kinds of apps with
| they keyboard like in vimium.
|
| https://vimacapp.com/
| lachlan_gray wrote:
| I've been using kindavim, this looks more powerful though,
| gonna try it out!
|
| https://kindavim.app/
| roryrjb wrote:
| Fails to mention my favourite text editor, Sublime Text which has
| an optional Vim mode built in (Vintage). I personally am using
| NeoVintageous[0] which allows you to run various ex commands and
| shell commands, as well as incorporating features from popular
| plugins such as vim-surround.
|
| 0. https://github.com/NeoVintageous/NeoVintageous
| andrepd wrote:
| Sublime is excellent _precisely_ because it has such excellent
| non-modal hotkeys out of the box.
|
| 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.
| max182 wrote:
| For me, it's Emacs keybindings everywhere. Well really readline
| commands. I don't use super heavily (mainly just C-a, C-b, C-e,
| C-p, and C-n)
|
| 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?
| kps wrote:
| I'm not an Emacs or GNOME user, but how does it work when
| Ctrl-A means start-of-line in Emacs and select-all in GNOME?
| tra3 wrote:
| I somehow ended up with evil in emacs, but emacs bindings
| everywhere else. Makes no sense now that I think about it.
| anthk wrote:
| rlwrap command_with_no_readline_support. For instance, rlwrap
| tclsh
| ossusermivami wrote:
| I use QMK and have a "vim layer" which translates hjkl and other
| keys as left-down-up-right, i.e: something like this
| https://github.com/qmk/qmk_firmware/blob/eab2b8faa0/users/tw...
| pmarin wrote:
| The standard POSIX specification describes the vi line editing
| mode for the shell command line. They tried to add an emacs mode
| but... [1]
|
| "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...
| gumby wrote:
| I don't remember this but, knowing some of those involved, I
| completely believe it.
| xk_id wrote:
| Somewhat bizarre to make a list of apps with vim keybindings,
| when most of the functionality of those apps can be achieved
| already in vim, or the terminal. Obsidian in particular is a
| terrible experience; even with vim mode on, you still have to
| switch to the mouse for a lot of GUI operations.
| chrislan815 wrote:
| wow just found `wasavi` in the list and it's awesome.
| fortunateregard wrote:
| In that case give firenvim[1] a try. It uses your existing
| config (keymaps, plugins, autocmds, etc).
|
| [1] https://github.com/glacambre/firenvim
| deanstag wrote:
| Does anyone have a suggestion to have vim mode key bindings for
| chrome or firefox URL bar?
| adhesive_wombat wrote:
| Not sure about the URL bar specifically, but Tridactyl is good,
| despite needing to fight an uphill battle from the Webextention
| add-on extinction event.
|
| https://github.com/tridactyl/tridactyl
| hirundo wrote:
| I'm going to give another shot at adding a vim extension to the
| browser and getting it into muscle memory. I spend too much time
| there (mickey) mousing around. It looks like the main options on
| Chrome/Brave are Vimium and cVim. Anyone have any preferences?
| skowalak wrote:
| Definetly Vimium. I have tested it on both Firefox and Chrome
| (-ium) and it just works. Remember to blacklist sites that need
| you to press random keys.
| linhns wrote:
| Vimium. Just look at how many are using it
| mkhnews wrote:
| htop-vim - cool
| ggm wrote:
| No keyboard acceleration for HN however.
| turtledragonfly wrote:
| They mention 'readline' under 'shells', but it's really more
| general than that. For instance, you can configure plain
| commandline GDB to use vim key bindings that way, and any other
| program that uses readline.
|
| Similar can be done for 'editline' (a readline alternative
| sometimes seen on BSD systems).
| turtledragonfly wrote:
| One fun tidbit about using Vi keybindings in readline is: you can
| use '*' as a wildcard when searching history. You can't do it in
| the default Emacs mode. I use this all the time!
|
| 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 (:
| therealmarv wrote:
| btw. macOS supports some Emacs(ish) keybindings by default
| https://jblevins.org/log/kbd
| m463 wrote:
| so does vim by the way (like control-p, control-n)
| beembeem wrote:
| yep, would be great to have this ultimate list but for Emacs
| *ducks for cover*
| dbtc wrote:
| I use c-a and c-e all the time, but I keep putting accidental
| fs and [?]s in non-emacs forms.
| spudlyo wrote:
| This annoyed me, so I used a program called Ukelele to create
| a custom macOS keyboard layout that modified Option-F,
| Option-B, and Option-D to _not_ emit symbols and diacritical
| marks, so I 'd get the Emacs style editing functionality for
| those keys.
| 0x445442 wrote:
| No Gmail?
| AdmiralAsshat wrote:
| Gmail doesn't have a standalone Desktop app, does it? You're
| either going to interact with it in a browser tab or a mail
| client, in which case any of the email clients in the list
| would work, or the Firefox add-ons.
| dbrueck wrote:
| What's interesting is that Gmail has some limited vim key
| bindings, just not for editing text, e.g. j and k for moving
| up and down a list of emails, slash for search.
| bediger4000 wrote:
| There's a fundamental difference between vi and emacs as far as
| keybindings go.
|
| 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.
| gumby wrote:
| Emacs is modeless and none of its commands are printing
| characters so you can just have a buffer and as a command
| keystroke arrives, just handle it immediately.
|
| (Emacs does have a thing called "modes" but they are unrelated
| to the use of the term in UI discussions).
| bediger4000 wrote:
| If that were the problem, I'm sure Fischer would have written
| that, as it would have been shorter than what he did write.
| fortunateregard wrote:
| Also see vim-like-pile[1]
|
| [1] https://vim.reversed.top/
| LastTrain wrote:
| I've been using Vim for years (well, decades really...) and a
| couple of years ago I decided I was going to go all in and learn
| to do it all from the the home keys. I did the Vim snake game,
| daily practices, the whole nine yards. So now I am slightly more
| productive inside Vim and fucking type strings of j's all over
| everything else I use.
| m463 wrote:
| I went the opposite way (many) years ago with vi
|
| 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)
| hirvi74 wrote:
| I learned Emacs first, then Vi(m), then I went back to Emacs
| but with Evil-mode. It's truly the best of both worlds in my
| opinion.
|
| 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.
| BeFlatXIII wrote:
| ...if only vim mode worked nicely for us Colemak users.
| turboponyy wrote:
| This was one of the most painful things when learning
| Colemak, and ultimately probably contributed to me stopping.
| It's a shame, because it felt really comfortable otherwise.
| aranchelk wrote:
| A Kinesis Advantage keyboard with the foot pedal to activate
| keypad mode and the necessary settings gets you home row
| navigation, '0', '/', 'y' -- any single key operation that can be
| implemented as a sequence of keys. Limited, but that's truly
| every app, even for computers on which you don't have admin/sudo
| (or just don't want to bother customizing).
| tjoff wrote:
| That is really nice but not quite the same thing imho, "vim-
| keybindings" is more than just mashing hjkl. Is is putting
| keybindings up front and a way to reason about shortcuts. You
| can often imagine shortcuts you've never even used before and
| be right surprisingly often.
|
| As a result I also remember shortcuts in apps with vim-
| keybindings much better.
| kps wrote:
| Tip for vi+Kinesis users: swap | and | to match j and k. (It'll
| take a few days to get used to.)
|
| Personally, I also put Escape in the default-Delete position,
| where the Enter-Escape symmetry then matches the Space-
| Backspace symmetry.
| [deleted]
| imbnwa wrote:
| Modal bindings spare users from having to effect unergonomic key
| chords is the real win for me
| a_subsystem wrote:
| One of my all time favs/most used is installing Eclipse
| Marketplace in DBeaver so I can use vrapper in DBeaver.
| snthpy wrote:
| Thank you. I did not know this.
| dorfsmay wrote:
| It should be noted that a lot of Linux/Unix programs still
| support the variables EDITOR and VISUAL.
|
| export VISUAL=vim
|
| Will make those program use com as the default editor. I believe
| for works that way for example.
| jmmv wrote:
| You might want VISUAL=view instead of VISUAL=vim, which will
| open vim in read-only mode (which is in line with the semantics
| of VISUAL).
| kps wrote:
| Hmm, `man 7 environ` on Linux says "The user's preferred
| utility to edit text files", which matches my long-term
| understanding. The original distinction between `EDITOR` and
| `VISUAL` was that the latter need not work on a printing
| terminal. The name `VISUAL` comes from the `ex` command
| `:visual` -- i.e, vi.
| johncoltrane wrote:
| Those keybindings tend to deviate quite a lot in what they do
| from the originals, to the point of feeling almost random. Using
| the same keys as Vim for your custom keybindings doesn't make
| them "Vim Keybindings".
|
| `j` to jump to next post in Reddit is not "Vim-like" at all for
| someone familiar with Vim.
| almog wrote:
| > `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).
| avgcorrection wrote:
| I really like using NeoVim for programmatic text manipulation.[1]
| I use Spacemacs as my main non-IDE editor and I want to reuse
| that basic Vim knowledge instead of having to worry about the
| differences between sed et al.
|
| 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.
|
| [1] https://vimways.org/2018/vims-social-life/
| JNRowe wrote:
| Joey Hess' excellent moreutils1 comes with vipe which is a
| generalised solution for these types of tasks. It allows you to
| run whatever $EDITOR you've configured mid-pipe, making it
| possible to work your changes up in an interactive editor
| session. Useful for those of us not smart enough to write up
| our changes as a series of -c arguments ;)
|
| (It fixes the vim issue by virtue of using a temporary file to
| do the _magic_ )
|
| 1 https://joeyh.name/code/moreutils/
| dargscisyhp wrote:
| evil-mode is deprecated? What?
| ashton314 wrote:
| Lol--that's so wrong. Someone's already got an issue open:
| https://github.com/erikw/vim-keybindings-everywhere-the-ulti...
|
| 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.
| LanternLight83 wrote:
| > ~evil-mode~ Deprecated, check out Vimpulse or Vim Mode. Lol,
| the linked pages for Vimpulse and Vim Mode both start with the
| statement: > Superceded by Evil
|
| 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?
| matvore wrote:
| > 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.
| krig wrote:
| It's backwards. Vimpulse etc. are deprecated in favour of evil-
| mode.
| eviks wrote:
| The browser implementations are unfortunately buggy, which is not
| reflected with a single +
| kzrdude wrote:
| I don't mind switching depending on context. But I wonder how it
| works, how can the brain be wired for vim keys in some programs
| and not in others, how does it do it? I'm vaguely impressed.
| xp84 wrote:
| When I was using both PCs and (normal) Macs regularly, using a
| certain MacBook Pro I have set up to run Boot Camp was really
| annoying. I realized that the laptop itself controlled the
| mental wiring for me. On a "real" PC I would reach for Control
| for things like copy, paste, etc. But when I felt an Apple
| keyboard, my finger reaches for the...Windows Key. D'OH!
| [deleted]
___________________________________________________________________
(page generated 2023-05-04 23:00 UTC)