Answer the question
In order to leave comments, you need to log in
How to make "quick access" to a function in Vim?
Let's say every time I want to save a session I write:
:!rm .session.vim
:mksession .session.vim
But I'm sure that you can write a simple function that you put in .vimrc and when I enter for example :savesession then these two commands will be executed at once. How to do it?
Answer the question
In order to leave comments, you need to log in
An example of setting up hotkeys, put in .vimrc:
" F2 - сохранить файл
nmap <F2> :w<cr>
vmap <F2> <esc>:w<cr>i
imap <F2> <esc>:w<cr>i
https://github.com/xolox/vim-session
Able to save the session on exit, there is also an autosave with a given frequency.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question