aboutsummaryrefslogtreecommitdiffstats
path: root/vimrc
diff options
context:
space:
mode:
authorTeddy Wing2020-09-22 19:53:47 +0200
committerTeddy Wing2020-09-22 19:58:59 +0200
commitf24ce22393920e0b5ccfc23139281e88c42224a5 (patch)
treed2b193bb591b10b12cdeab15b9507b250f93ff01 /vimrc
parent18dacd037f756066a92972687b53d5ce94d2c96b (diff)
downloaddotvim-f24ce22393920e0b5ccfc23139281e88c42224a5.tar.bz2
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 `<C-r>%` when I want to insert a title or symbol based on the file's name.
Diffstat (limited to 'vimrc')
-rw-r--r--vimrc6
1 files changed, 6 insertions, 0 deletions
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 <leader>gp :!git log -p -- %<cr>
nnoremap <leader>cf :call system('pbcopy', expand('%'))<cr>
nnoremap <leader>cF :call system('pbcopy', expand('%:p'))<cr>
+" Insert the current file name
+inoremap <C-r><C-f> <C-r>=expand('%:t:r')<CR>
+
" Save the current session to a file
nnoremap <leader>mk :mksession! vimsession<cr>