From f24ce22393920e0b5ccfc23139281e88c42224a5 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Tue, 22 Sep 2020 19:53:47 +0200 Subject: vimrc: Add i_^r^f mapping to insert the current filename Since this removes the path and extension, it makes it easier to use than `%` when I want to insert a title or symbol based on the file's name. --- vimrc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'vimrc') diff --git a/vimrc b/vimrc index 3c06d26..5908e2c 100644 --- a/vimrc +++ b/vimrc @@ -464,6 +464,9 @@ " 2020.09.10: " * Make the quickfix window 10 lines tall in vim-go. " +" 2020.09.22: +" * Add i_^r^f mapping to insert the current filename. +" " Pathogen @@ -859,6 +862,9 @@ nnoremap gp :!git log -p -- % nnoremap cf :call system('pbcopy', expand('%')) nnoremap cF :call system('pbcopy', expand('%:p')) +" Insert the current file name +inoremap =expand('%:t:r') + " Save the current session to a file nnoremap mk :mksession! vimsession -- cgit v1.2.3