Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The "g" namespace is one of the few things I find annoying in Vim (which I like a lot). It is a grabbag of operations at cursor position ("gu", "gU"), mode switches ("gn"), file operations ("gf") and... weird stuff? Like, "ga" (prints the ascii value of the character under the cursor). This really does not help with memorizing the commands.

On the plus side, it enables "* + cgn + ." which is a neat way to do quick multiple substitutions, so yay I guess?



I imagine "g" as Vim's builtin leader mappings due to all other keys already being mapped to something else.


The "g" namespace is a dumping ground for "alternate" versions of things that already have normal-mode mappings.

Personally I think most of the normal mode mappings make no sense, other than the core motions and "q". A lot of precious "one-key" mappings are kind of wasted. You can of course override them, but it feels very "bolted on"

One of my high hopes for Neovim is that eventually they will start migrating the hard-coded default mappings to something more akin to a default config layer, which will be easier to override or disable. They have already started doing this for built-in commands, e.g. :cscope has been removed.


Maybe it's g for "grabbag" ...


Agreed, that's the only time I find myself missing Emacs' which-key. (Looks like there is https://github.com/liuchengxu/vim-which-key for this.)


It's on the homerow in the middle of the keyboard, equally accessible to both hands. If it were a symbol key I suspect there would be less perplexity, but because it's a letter key users are left wondering what the mnenomic is :)


I never knew about `ga`, that's pretty useful, thanks!




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

Search: