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.vim43
1 files changed, 25 insertions, 18 deletions
diff --git a/plugin/max-splash.vim b/plugin/max-splash.vim
index bc578e1..3a23e60 100644
--- a/plugin/max-splash.vim
+++ b/plugin/max-splash.vim
@@ -3,24 +3,31 @@
3" Shows recently used files from the current directory in a location list 3" Shows recently used files from the current directory in a location list
4"======================================================================================================================= 4"=======================================================================================================================
5 5
6" moved after VimEnter of statusline, so that it does not get overwritten any 6" autocmd VimEnter * call setloclist(0, filter(map(copy(v:oldfiles), {_, p->{'filename': expand(get(split(p, "'"), 0))}}), { val -> echo val}))
7" more 7" from the list of recent files: make absolute paths, filter out files not
8if empty(argv()) 8" contained in cwd and finally filter out directories and non-files...
9 9autocmd StdinReadPre * let s:std_in=1
10 " autocmd VimEnter * call setloclist(0, filter(map(copy(v:oldfiles), {_, p->{'filename': expand(get(split(p, "'"), 0))}}), { val -> echo val})) 10autocmd VimEnter * if !exists("s:std_in") && empty(argv())
11 11 \ | call setloclist(0, [])
12 " from the list of recent files: make absolute paths, filter out files not 12 \ | :lopen
13 " contained in cwd and finally filter out directories and non-files... 13 \ | setlocal nospell
14 autocmd StdinReadPre * let s:std_in=1 14 \ | setlocal signcolumn=yes
15 autocmd VimEnter * if !exists("s:std_in") | call setloclist(0, [], 'r', 15 \ | setfiletype qf
16 \ { 16 \ | call setloclist(0, [], 'r', {
17 \ 'title':'Recently used files in directory: '.getcwd(), 17 \ 'title':'Recently used files in directory: '.getcwd(),
18 \ 'items':map(filter(filter( 18 \ 'items':sort(map(filter(filter(map(copy(v:oldfiles[:100]),
19 \ map(copy(v:oldfiles), 19 \ {_, p->expand(p)}),
20 \ {_, p->expand(p)}), 'v:val =~ "'.getcwd().'/"'), 'filereadable(v:val)'), 20 \ 'v:val =~ "'.getcwd().'/"'),
21 \ {_, p->{'filename': fnamemodify(p, ':.')}}) 21 \ 'filereadable(v:val)'),
22 \ }) | exec ':lopen '.getloclist(0, {'size' : 1}).size | setfiletype qf | wincmd w 22 \ {_, p->{'filename': p,
23endif 23 \ 'module': printf("%s | %-*s ",
24 \ strftime("%F %H:%M",
25 \ getftime(p)),
26 \ winwidth(0) - wincol() - 20,
27 \ fnamemodify(p, ':.')
28 \ )}}),
29 \ {a1, a2 -> a1.module < a2.module})
30 \ }) | wincmd w
24 31
25" http://vimdoc.sourceforge.net/htmldoc/quickfix.html#:caddexpr 32" http://vimdoc.sourceforge.net/htmldoc/quickfix.html#:caddexpr
26" for c in range(char2nr('a'), char2nr('z')) + range(char2nr('A'), char2nr('Z')) + range(0,9) | let p = getpos("'".nr2char(c)) | if (p[1] > 0) | exec "sign define mark_".nr2char(c)." text=".nr2char(c)." linehl=linenr" | exec "sign place ".c." name=mark_".nr2char(c)." line=".p[1] | endif | endfor 33" for c in range(char2nr('a'), char2nr('z')) + range(char2nr('A'), char2nr('Z')) + range(0,9) | let p = getpos("'".nr2char(c)) | if (p[1] > 0) | exec "sign define mark_".nr2char(c)." text=".nr2char(c)." linehl=linenr" | exec "sign place ".c." name=mark_".nr2char(c)." line=".p[1] | endif | endfor
..