Skip to content

Instantly share code, notes, and snippets.

@clsnyder
Last active April 13, 2020 16:30
Show Gist options
  • Save clsnyder/8249775 to your computer and use it in GitHub Desktop.
Save clsnyder/8249775 to your computer and use it in GitHub Desktop.
How to run scripts in vim
VIM run scripts
[Link](http://www.ibm.com/developerworks/linux/library/l-vim-script-1/index.html)
There are numerous ways to execute Vim scripting commands. The simplest approach is to put them in a file (typically with a .vim extension) and then execute the file by :source-ing it from within a Vim session:
:source /full/path/to/the/scriptfile.vim
Alternatively, you can type scripting commands directly on the Vim command line, after the colon. For example:
:call MyBackupFunc(expand('%'), { 'all':1, 'save':'recent'})
:call ToggleSyntax()<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment