Vi/Vim restore opened files

You can map using :mksession and :source to a set of keys for easy saving and restoring. Here’s an example from my .vimrc that uses F2 and F3: map <F2> :mksession! ~/vim_session <cr> ” Quick write session with F2 map <F3> :source ~/vim_session <cr> ” And load session with F3

Getting the current row number?

What do you mean by “output”? You can do: :echo line(“.”) + 1 To display the current line number plus 1. You can bind a keystroke with map, eg: :noremap <F1> :echo line(“.”) + 1<cr> To actually insert the data into the buffer: :noremap <F1> :execute “normal! i” . ( line(“.”) + 1 )<cr>

tech