diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2019-06-16 16:55:15 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2019-06-16 16:55:15 +1200 |
commit | 810cfea9c8a86174c425220ae2c55e8919c9959e (patch) | |
tree | 2261421ebe2b2f52c1cc28d5991f39341e330176 /vim/autoload | |
parent | Add <Leader>,o mapping to :browse :oldfiles (diff) | |
download | dotfiles-810cfea9c8a86174c425220ae2c55e8919c9959e.tar.gz dotfiles-810cfea9c8a86174c425220ae2c55e8919c9959e.zip |
Adapt :browse :oldfiles mapping into plugin
Just to avoid a hit-enter prompt by limiting it to just short of the
vertical size of the screen, with a temporary array slice of v:oldfiles.
Diffstat (limited to 'vim/autoload')
-rw-r--r-- | vim/autoload/select_old_files.vim | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/vim/autoload/select_old_files.vim b/vim/autoload/select_old_files.vim new file mode 100644 index 00000000..518b98d4 --- /dev/null +++ b/vim/autoload/select_old_files.vim @@ -0,0 +1,7 @@ +function! select_old_files#() abort + let oldfiles = v:oldfiles + let limit = get(g:, 'select_old_files_limit', &lines - 1) + let v:oldfiles = v:oldfiles[:limit-2] + browse oldfiles + let v:oldfiles = oldfiles +endfunction |