8 votes
Accepted

Why does `yW` yank until the end of the WORD, but `W` move to the next one?

It might be useful to quote :help exclusive, here: A character motion is either inclusive or exclusive. When inclusive, the start and end position of the motion are included in the operation. When ...
romainl's user avatar
  • 40k
2 votes
Accepted

Best way to keybind subsequent substitutions in visual mode

To avoid the double '<,'> problem the old way is to add <C-u> at the start of the mapping: vim.api.nvim_set_keymap( "v", "<Leader>q", ":<C-u>'<...
Vivian De Smedt's user avatar
1 vote

Keybinding to quickly update (aka prettify) React indentation

Find a command line tool that can format part or whole buffer the way it suits your needs. Integrate it with vim using :h 'formatprg' which then could be used with gq. e.g. Let's imagine there is a ...
Maxim Kim's user avatar
  • 13.1k
1 vote

keybindings that change mode: cannot use keybindings on the new mode

The key code is actually remap and not noremap. I would define it like this: local opts = { remap = false } local ll = "<leader>i" opts["desc"] = "Send visual lines&...
Vivian De Smedt's user avatar
1 vote

Best way to keybind subsequent substitutions in visual mode

The point is that Vim switches from mode to mode as it reads buttons. No matter if they come from keyboard or mapping. So you only start from Visual mode. But then you get into cmdline, then into ...
Matt's user avatar
  • 20.6k

Only top scored, non community-wiki answers of a minimum length are eligible