diff options
author | Matthew Lemon <chaffinach+git@protonmail.ch> | 2022-06-18 12:30:38 +0100 |
---|---|---|
committer | Matthew Lemon <chaffinach+git@protonmail.ch> | 2022-06-18 12:30:38 +0100 |
commit | 2fd3d28a901e718b940286c2f4ca93423894f2ec (patch) | |
tree | 2c43695df74b4f01530c37c90dd2faedb70f9138 /vim/vimrc | |
parent | eb45473eef69d72b1c054047c51f1529f8dc550f (diff) |
added a vim function to copy link to last buffer
Diffstat (limited to '')
-rw-r--r-- | vim/vimrc | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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') |