From a4405ee6142fbfcd99be1e862bc7b75189029442 Mon Sep 17 00:00:00 2001 From: Julian Prein Date: Mon, 18 Mar 2024 14:36:23 +0100 Subject: [PATCH] vim:keys: Change family of gf mappings The mapping to split and open the file under cursor exists by default (not as I thought), but is not gf but rather f. Swap the mappings for tab and split 'destination'. Fixes: 8096917ad ("vim:keys: Open file in split with `g[fF]`") --- .config/vim/vimrc.d/40-keys.vim | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.config/vim/vimrc.d/40-keys.vim b/.config/vim/vimrc.d/40-keys.vim index 46ecb72..b026528 100644 --- a/.config/vim/vimrc.d/40-keys.vim +++ b/.config/vim/vimrc.d/40-keys.vim @@ -13,9 +13,13 @@ nnoremap :nohlsearch call ClearHighlights() nnoremap N vsplit nnoremap n split -" Open file under cursor in split -nnoremap gf splitgf -nnoremap gF splitgF +" My brain expects {gf,gF} to open in a split, not a tab. +" Swap the mappings for tab and split. +nnoremap gf f +nnoremap gF F +nnoremap f gf +nnoremap gf +nnoremap F gF " Substitute command if (exists('+inccommand') && &inccommand != '')