summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--vim/vimrc8
1 files changed, 8 insertions, 0 deletions
diff --git a/vim/vimrc b/vim/vimrc
index 1a501c9..47403df 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -129,6 +129,14 @@ if has('folding')
set viewoptions=folds,options,cursor,unix,slash
endif
+" from https://www.reddit.com/r/vim/comments/f5gi2g/vim_notetaking_automatic_link_creation_between/
+" copies a link from file from previous buffer for pasting into
+" next buffer with "ap
+function! s:copy_filename_as_mdlink()
+ let fname=expand("%")
+ let @a="[" . fname . "](./" . fname. ")"
+endfunction
+autocmd BufLeave * call s:copy_filename_as_mdlink()
" vim-plug
call plug#begin('~/.vim/plugged')