diff --git a/README.md b/README.md index 6ba4ac82f4813010eb571e62bc056747576b48e0..325fa77b0995a428235a30ca3d9d487439c79835 100644 --- a/README.md +++ b/README.md @@ -293,7 +293,7 @@ Some mappings are set for the whole magit buffer, others are set for specific se ----------------------------------- -<kbd>E</kbd> +<kbd>J</kbd>, <kbd>Ctrl</kbd>+<kbd>]</kbd> If cursor is in a hunk, cursor will move in the file containing this hunk, at the line of the beginning of the hunk. @@ -304,7 +304,7 @@ If cursor is in a hunk, cursor will move in the file containing this hunk, at * if there is only magit window opened, split vertically, moves cursor to new split and open buffer at the hunk line -E means 'edit'. +J means 'jump'. :exclamation: this function is extremely powerful, just give it a try! diff --git a/autoload/magit/mapping.vim b/autoload/magit/mapping.vim index 6bffbf8399c7dd513d36aed37a4f5cc1f8d13723..58d5f81575702a661f8941207249cbb3ec55695f 100644 --- a/autoload/magit/mapping.vim +++ b/autoload/magit/mapping.vim @@ -8,7 +8,7 @@ let g:magit_commit_amend_mapping = get(g:, 'magit_commit_amend_mapping', let g:magit_commit_fixup_mapping = get(g:, 'magit_commit_fixup_mapping', 'CF' ) let g:magit_close_commit_mapping = get(g:, 'magit_close_commit_mapping', 'CU' ) let g:magit_reload_mapping = get(g:, 'magit_reload_mapping', 'R' ) -let g:magit_edit_mapping = get(g:, 'magit_edit_mapping', 'E' ) +let g:magit_edit_mapping = get(g:, 'magit_edit_mapping', 'J' ) let g:magit_jump_next_hunk = get(g:, 'magit_jump_next_hunk', '<C-N>') let g:magit_jump_prev_hunk = get(g:, 'magit_jump_prev_hunk', '<C-P>') @@ -129,6 +129,8 @@ function! magit#mapping#set_default() \ "magit#ignore_file()", '\<\%(un\)\?staged\>') call s:mg_set_mapping('n', g:magit_edit_mapping, \ "magit#jump_to()", '\<\%(un\)\?staged\>') + call s:mg_set_mapping('n', '<C-]>', + \ "magit#jump_to()", '\<\%(un\)\?staged\>') call s:mg_set_mapping('n', g:magit_reload_mapping, \ "magit#update_buffer()") diff --git a/doc/vimagit.txt b/doc/vimagit.txt index 985e2e8840eaccf9f51dc0fe7f26a80bc4d85aa1..5fddcb242e2cb133ee5b81baeabeb36c47bdaa08 100644 --- a/doc/vimagit.txt +++ b/doc/vimagit.txt @@ -326,8 +326,9 @@ section only. - *vimagit-E* *magit#jump_to()* - <E> If cursor is in a hunk, cursor will move in the file containing + *vimagit-J* *magit#jump_to()* + *vimagit-<C-]>* + <J> <C-]> If cursor is in a hunk, cursor will move in the file containing this hunk, at the line of the beginning of the hunk. - if the file is already visible in a |window|, cursor moves to this window at the hunk line @@ -335,7 +336,7 @@ section only. accessed window and open buffer at the hunk line - if there is only magit window opened, split vertically, moves cursor to new split and open buffer at the hunk line - E means 'edit'. + J means 'jump'. NOTE: this function is extremely powerful, just give it a try!