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 4, 2021
1 parent 34815c0 commit 5fb8b67
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>DiagnosticGotoNext
nmap [g <Plug>DiagnosticGotoPrev
nmap ]G <Plug>DiagnosticGotoLast
nmap [G <Plug>DiagnosticGotoFirst
<
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>DiagnosticGotoNext <Cmd>lua vim.diagnostic.goto_next {float=false}<CR>", NORMAL, true);
add_map((char_u *)"<Plug>DiagnosticGotoPrev <Cmd>lua vim.diagnostic.goto_prev {float=false}<CR>", NORMAL, true);
add_map((char_u *)"<Plug>DiagnosticGotoLast <Cmd>lua vim.diagnostic.goto_last {float=false}<CR>", NORMAL, true);
add_map((char_u *)"<Plug>DiagnosticGotoFirst <Cmd>lua vim.diagnostic.goto_first {float=false}<CR>", NORMAL, true);

add_map((char_u *)"]g <Plug>DiagnosticGotoNext", NORMAL, false);
add_map((char_u *)"[g <Plug>DiagnosticGotoPrev", NORMAL, false);
add_map((char_u *)"]G <Plug>DiagnosticGotoLast", NORMAL, false);
add_map((char_u *)"[G <Plug>DiagnosticGotoFirst", NORMAL, false);
}

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

0 comments on commit 5fb8b67

Please sign in to comment.