Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

View a list of recent documents in Vim

People also ask

How do I view multiple files in vim?

If you have already opened a file in vim editor, you can add more files to the vim session by entering :e followed by filename or path of the file to be opened. In this case also, vim will take you to the same interface that you get while opening multiple files from command line.

Where are my vim files saved?

As said by others: by default it saves in the directory where you started it. But if you aren't aware in which directory you started, then a way to find out is to use the :pwd com in vim. This will output the current directory. That's where vim will store the file.


Don't use a plugin, unless you want a nice menu. From Vim Documentation: Starting (or :help old):

:ol[dfiles]

Then to open one of the listed files, use: '0, '1, '2, ... '9


List the files that have marks stored in the viminfo file.

:bro[wse] ol[dfiles][!]

List file names as with :oldfiles, and then prompt for a number. When the number is valid that file from the list is edited. Use ! to abandon a modified buffer.


The Most Recently Used (MRU) plugin provides an easy access to a list of recently opened/edited files in Vim. This plugin automatically stores the file names as you open/edit them in Vim.

http://www.vim.org/scripts/script.php?script_id=521


Besides :oldfiles, fzf.vim has :History.


Start Vim and hit Ctrl-o-o to open previously edited file. Keep hitting o (while still pressing the Ctrl key) to cycle back through earlier files. See https://dev.to/jovica/3-little-known-but-useful-vim-tips-1pbg


vim plugin: minibufexpl may help you. the opened file list is displayed on the top or bottom of the screen:

enter image description here

in vim normal mode, type :b${bufid} to jump to the ${bufid}_th buffer, for example: type :b13 to jump to the 13th buffer, ie. ngx_mail_ssl_module.c.

besidies, you can map some convenient bindings in your vimrc, such as:

" ------------------------------- minibufexpl mappings -----------------------------------
"let g:miniBufExplSplitBelow=1
nnoremap <silent> <leader>bn :bn<cr>
nnoremap <silent> <leader>bp :bp<cr>
nnoremap <silent> <leader>bf :bf<cr>
nnoremap <silent> <leader>bl :bl<cr>
nnoremap <silent> <leader>bt :TMiniBufExplorer<cr>

Get the plugin from here: https://github.com/fholgado/minibufexpl.vim


In addition to oldfiles there's a nice thing called tinyMRU.

Vim-tinyMRU's only purpose is to provide an intuitive alternative to the built-in :oldfile command. Nothing more, nothing less.

It's very simple:

https://github.com/romainl/vim-tinyMRU/blob/master/plugin/tinymru.vim