
vim - How to run a shell command through vimscript ... - Stack …
2012年5月26日 · There is <C-_> for ^_ and <CR> for ^M (in vim, not in vi). Do not suggest using raw control codes in vimrc, this scraps the output of tools that expect text (like cat vimrc | grep …
Simplest way to run a vim script - Stack Overflow
I assume to run a vim script I would want to be 'inside' the vim process (so for example, I could highlight text or do whatever might be necessary for the input to the vim script). Currently I do …
Execute a script directly within vim/mvim/gvim - Stack Overflow
2010年7月2日 · vim tutorial: Mapping keys in Vim. You can map keys so perl executes current script as suggested by jts above. map <C-p> :w<CR>:!perl %<CR> will map Ctrl+P to write file …
vim script: how to execute a command in a vim function
2011年9月29日 · Have a look at this script from vim.wikia.com which does pretty much what you are asking for. Key-line seems to be this one: let nowcolors = 'elflord morning desert evening …
What's a quick way to comment/uncomment lines in Vim?
2009年11月5日 · A few regular Vim commands do not work with my setup on Windows. Ctrl + v and Ctrl + q are some of them. I later discovered the following methods worked to uncomment …
Passing and using arguments to command in Vim script
2014年7月31日 · This is so common that Vim has a special notation for it; See :help <q-args>. Now, for :execute , you'd need another level of quoting (and based on your comments it …
vim - How to get visually selected text in VimScript - Stack Overflow
the use of getpos('v') is critical if you want the current selection (say within a map expression) as opposed to the last selection. such maps need an <esc>gv prefix otherwise. additionally, if you …
Scripting common tasks in Vim - Stack Overflow
2017年8月16日 · The vim script language is a bit too limited to try to do grand things in, for my taste. (Although vim 7 has made great strides in that respect, by borrowing a bunch of things …
How to get path to the current vimscript being executed
2011年2月12日 · In my vim plugin, I have two files: myplugin/plugin.vim myplugin/plugin_helpers.py I would like to import plugin_helpers from plugin.vim (using the vim …
vi - How do I exit Vim? - Stack Overflow
2017年5月24日 · Commands marked with '*' are Vim-only (not implemented in Vi). Safe-quit (fails if there are unsaved changes)::q[uit] Quit the current window. Quit Vim if this is the last …