From f2e01d7e513067ddb57c75f6e38cdcf434946cf8 Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Mon, 22 Oct 2018 00:02:58 +0200 Subject: Major refactoring for version 2.0 vim-plug has been removed and replaced with Vims internal bundle mechanism. But I already noticed, that there is also GLVM now and started trying that as well. --- plugin/max-splash.vim | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 plugin/max-splash.vim (limited to 'plugin/max-splash.vim') diff --git a/plugin/max-splash.vim b/plugin/max-splash.vim new file mode 100644 index 0000000..5282679 --- /dev/null +++ b/plugin/max-splash.vim @@ -0,0 +1,23 @@ +"======================================================================================================================= +" MAX_SPLASH: +" Shows recently used files from the current directory in a location list +"======================================================================================================================= + +" moved after VimEnter of statusline, so that it does not get overwritten any +" more +if empty(argv()) + + " autocmd VimEnter * call setloclist(0, filter(map(copy(v:oldfiles), {_, p->{'filename': expand(get(split(p, "'"), 0))}}), { val -> echo val})) + + " from the list of recent files: make absolute paths, filter out files not + " contained in cwd and finally filter out directories and non-files... + autocmd StdinReadPre * let s:std_in=1 + autocmd VimEnter * if !exists("s:std_in") | call setloclist(0, [], 'r', + \ { + \ 'title':'Recently used files in directory: '.getcwd(), + \ 'items':map(filter(filter( + \ map(copy(v:oldfiles), + \ {_, p->expand(p)}), 'v:val =~ "'.getcwd().'/"'), 'filereadable(v:val)'), + \ {_, p->{'filename': fnamemodify(p, ':.')}}) + \ }) | lopen | only | setfiletype qf +endif -- cgit v1.2.3