Ⅰ. 插件描述
Execute shell(or Windows cmd) command in Vim and echo output in VimⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin '/cmd-vim-today-cannot-touch'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle '/cmd-vim-today-cannot-touch'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug '/cmd-vim-today-cannot-touch'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/vim-scripts/cmd.vim
Ⅳ. 文档说明
Cmd.vim is a vim plugin to provide vim the ability to execute shell command
directly in vim and echo the result in vim. For example, you could use ":!ls"
to list all the files of current directory, Now cmd.vim provide a new command
":Ls" to implement the same function, but the result is in vim insteading of in
the shell. The mainpage in Chinese is avaiable at:
http://code.google.com/p/cmd-dot-vim/
There are many well known shell command to implement powerful functions, now I
port them to vim version, In the current release, there are four command
available now, More are to be added. For those not listed below, you could use
":Shell your_command" to execute your_command like "! your_command", with the
result in Vim insteading of Shell.
":Date" - print or set the system date and time
":Gcc" - gcc - GNU project C and C++ compiler
":Ls" - list directory contents
":Sdcv Words" - call sdcv to lookup Words in vim
uppercase letter, so every shell command start with an uppercase letter.
command is available. it is expected that cmd.vim works where the original
command works, whatever it's Linux, Cygwin, Windows, or Mac.
favorite map, For example, To look up the a word under the cursor, or to lookup
the words selected:
nmap <script> <silent> <unique> <Leader>l <ESC>:Sdcv '<cword>' <CR>
vmap <script> <silent> <unique> <Leader>l y<ESC>:Sdcv <c-r>" <CR>