Skip to content

Commit

Permalink
Add <Plug> mappings
Browse files Browse the repository at this point in the history
  • Loading branch information
gpanders committed Nov 8, 2021
1 parent 34815c0 commit a30a07c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
6 changes: 4 additions & 2 deletions runtime/doc/vim_diff.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,10 @@ of these in your config by simply removing the mapping, e.g. ":unmap Y".
nnoremap <C-L> <Cmd>nohlsearch<Bar>diffupdate<CR><C-L>
inoremap <C-U> <C-G>u<C-U>
inoremap <C-W> <C-G>u<C-W>
nnoremap ]g <Cmd>lua vim.diagnostic.goto_next {float=false}<CR>
nnoremap [g <Cmd>lua vim.diagnostic.goto_prev {float=false}<CR>
nmap ]g <Plug>(VimDiagnosticGotoNext)
nmap [g <Plug>(VimDiagnosticGotoPrev)
nmap ]G <Plug>(VimDiagnosticGotoLast)
nmap [G <Plug>(VimDiagnosticGotoFirst)
<
Default Autocommands ~
*default-autocmds*
Expand Down
12 changes: 10 additions & 2 deletions src/nvim/getchar.c
Original file line number Diff line number Diff line change
Expand Up @@ -845,8 +845,16 @@ void init_default_mappings(void)
add_map((char_u *)"<C-L> <Cmd>nohlsearch<Bar>diffupdate<CR><C-L>", NORMAL, true);
add_map((char_u *)"<C-U> <C-G>u<C-U>", INSERT, true);
add_map((char_u *)"<C-W> <C-G>u<C-W>", INSERT, true);
add_map((char_u *)"]g <Cmd>lua vim.diagnostic.goto_next {float=false}<CR>", NORMAL, true);
add_map((char_u *)"[g <Cmd>lua vim.diagnostic.goto_prev {float=false}<CR>", NORMAL, true);

add_map((char_u *)"<Plug>(VimDiagnosticGotoNext) <Cmd>lua vim.diagnostic.goto_next {float=false}<CR>", NORMAL, true);
add_map((char_u *)"<Plug>(VimDiagnosticGotoPrev) <Cmd>lua vim.diagnostic.goto_prev {float=false}<CR>", NORMAL, true);
add_map((char_u *)"<Plug>(VimDiagnosticGotoLast) <Cmd>lua vim.diagnostic.goto_last {float=false}<CR>", NORMAL, true);
add_map((char_u *)"<Plug>(VimDiagnosticGotoFirst) <Cmd>lua vim.diagnostic.goto_first {float=false}<CR>", NORMAL, true);

add_map((char_u *)"]g <Plug>(VimDiagnosticGotoNext)", NORMAL, false);
add_map((char_u *)"[g <Plug>(VimDiagnosticGotoPrev)", NORMAL, false);
add_map((char_u *)"]G <Plug>(VimDiagnosticGotoLast)", NORMAL, false);
add_map((char_u *)"[G <Plug>(VimDiagnosticGotoFirst)", NORMAL, false);
}

// Insert a string in position 'offset' in the typeahead buffer (for "@r"
Expand Down

0 comments on commit a30a07c

Please sign in to comment.