vimtricks.wiki Concise Vim tricks, one at a time.

How do I get a start screen with recent files and sessions?

Answer

vim-startify plugin

Explanation

vim-startify provides a configurable start screen when you open Vim without a file. It shows recent files, bookmarks, and sessions.

How it works

  • Open Vim without arguments to see the start screen
  • Recent files are listed with numbers for quick access
  • Press the number to open that file
  • Sessions can be saved and restored

Example

  [0]  ~/.vimrc
  [1]  ~/project/main.go
  [2]  ~/project/test.go

  Sessions:
  [a]  project-session

Tips

  • Install: Plug 'mhinz/vim-startify'
  • :SClose saves and closes a session
  • :SLoad name loads a named session
  • let g:startify_bookmarks = ['~/.vimrc'] adds bookmarks
  • let g:startify_session_autoload = 1 auto-loads sessions
  • Neovim alternative: alpha-nvim or dashboard-nvim

Next

How do you yank a single word into a named register?