neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit 1c9f487f0edc3e6a10a53dc83a3d779980dc3a26
parent c0ae3df0528263d677fff3e1150a7b65589fb88d
Author: Gregory Anders <8965202+gpanders@users.noreply.github.com>
Date:   Fri, 15 Jul 2022 07:23:29 -0600

feat(defaults): nnoremap & :&&<CR> #19365


Diffstat:
Mruntime/doc/change.txt | 3+++
Mruntime/doc/vim_diff.txt | 1+
Msrc/nvim/mapping.c | 4++++
3 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt @@ -633,6 +633,9 @@ Directory for temporary files is created in the first possible directory of: actually work differently. You can use `:&&` to keep the flags. + *&-default* + Mapped to ":&&<CR>" by default. |default-mappings| + *g&* g& Synonym for `:%s//~/&` (repeat last substitute with last search pattern on all lines with the same flags). diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt @@ -89,6 +89,7 @@ of these in your config by simply removing the mapping, e.g. ":unmap Y". inoremap <C-W> <C-G>u<C-W> xnoremap * y/\V<C-R>"<CR> xnoremap # y?\V<C-R>"<CR> + nnoremap & :&&<CR> < Default Autocommands ~ *default-autocmds* diff --git a/src/nvim/mapping.c b/src/nvim/mapping.c @@ -2125,6 +2125,10 @@ void init_default_mappings(void) add_map("<C-W>", "<C-G>u<C-W>", MODE_INSERT, false); add_map("*", "y/\\\\V<C-R>\"<CR>", MODE_VISUAL, false); add_map("#", "y?\\\\V<C-R>\"<CR>", MODE_VISUAL, false); + + // Use : instead of <Cmd> so that ranges are supported (e.g. 3& repeats the substitution on the + // next 3 lines) + add_map("&", ":&&<CR>", MODE_NORMAL, false); } /// Add a mapping. Unlike @ref do_map this copies the string arguments, so