aboutsummaryrefslogtreecommitdiff
path: root/plugin/max-splash.vim
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/max-splash.vim')
-rw-r--r--plugin/max-splash.vim23
1 files changed, 23 insertions, 0 deletions
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 @@
1"=======================================================================================================================
2" MAX_SPLASH:
3" Shows recently used files from the current directory in a location list
4"=======================================================================================================================
5
6" moved after VimEnter of statusline, so that it does not get overwritten any
7" more
8if empty(argv())
9
10 " autocmd VimEnter * call setloclist(0, filter(map(copy(v:oldfiles), {_, p->{'filename': expand(get(split(p, "'"), 0))}}), { val -> echo val}))
11
12 " from the list of recent files: make absolute paths, filter out files not
13 " contained in cwd and finally filter out directories and non-files...
14 autocmd StdinReadPre * let s:std_in=1
15 autocmd VimEnter * if !exists("s:std_in") | call setloclist(0, [], 'r',
16 \ {
17 \ 'title':'Recently used files in directory: '.getcwd(),
18 \ 'items':map(filter(filter(
19 \ map(copy(v:oldfiles),
20 \ {_, p->expand(p)}), 'v:val =~ "'.getcwd().'/"'), 'filereadable(v:val)'),
21 \ {_, p->{'filename': fnamemodify(p, ':.')}})
22 \ }) | lopen | only | setfiletype qf
23endif
..