aboutsummaryrefslogtreecommitdiff
path: root/vim/autoload/select_old_files.vim
blob: aceff1105392cf32f7ea99a6c420132171d14ac5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
function! select_old_files#(...) abort
  if a:0
    if a:1 =~# '^\d\+$'
      let limit = a:1
    else
      echoerr 'Invalid count'
    endif
  elseif exists('g:select_old_files_limit')
    let limit = g:select_old_files_limit
  else
    let limit = &lines - 2
  endif
  let oldfiles = v:oldfiles
  let v:oldfiles = v:oldfiles[:limit - 1]
  browse oldfiles
  let v:oldfiles = oldfiles
endfunction