README.md (1051B)
1 # vim-visualrun: select some lines and run them as a Vim command 2 ## Why? 3 I like how in Emacs you can run Lisp from anywhere. 4 So this lets you run Vim commands from anywhere. 5 6 ## What? 7 This plugin lets you visually select a range of lines and then run them as Vim commands. 8 9 ![Demo of visualrun](demo.gif) 10 11 The plugin exposes one visual mode mapping: 12 13 * `<Plug>VisualRunCommands`: run the visually selected lines as Vim commands 14 15 There are no default mappings (by design, so as not to force mappings on users), so you need to map this `<Plug>` yourself. 16 For example, by putting this line in your .vimrc: `vmap <silent> <leader><cr> <Plug>VisualRunCommands`. 17 18 You can define two global variables to disable loading parts of the plugin: 19 20 * `g:loaded_visualrun`: disable the entire plugin 21 * `g:loaded_visualrun_autoload`: disable autoloaded code 22 23 **Disclaimer:** this code is not extensively tested. 24 It works for me, running Vim 8.2 in the terminal on macOS, but it's not guaranteed to work for others. 25 It might not work in Neovim, as I don't use Neovim.