Ⅰ. 插件描述
Expand `dbg` to the correct debugger statement for the current file.Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'losingkeys/vim-stopsign'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'losingkeys/vim-stopsign'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'losingkeys/vim-stopsign'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/losingkeys/vim-stopsign
Ⅳ. 文档说明
- Stop Sign
Expanddbgto a line of debugging code that stops your program.
** Why?
A lot of people develop muscle memory with vim, so having a standard
abbreviation that's not specific to any filetype allows you to use that
abbreviation all the time without thinking about it.
** Changing what dbg is replaced with
You can add support for a new filetype (or override the default for
a supported filetype) with the following code:
#+BEGIN_SRC vim
let g:stopsign_replacements = {
\ 'javascript': 'debugger;'
\ }#+END_SRC
A few notes about this:
1. You don't need to specify filetypes you're not changing (this
is merged with the defaults, it doesn't overwrite them)
2. If you think this abbreviation might be useful to others, check
if it's already supported, and make a pull request! (see
CONTRIBUTING for more info).** Don't like dbg?
If you want to abbreviate something other than dbg, simply set:
#+BEGIN_SRC vim
let g:stopsign_trigger = 'stop'
#+END_SRC
** Thanks
Working on the execellent [https://github.com/amdt/vim-niji] and working with [https://github.com/tpope/vim-endwise] has
helped me learn more vim script. Thanks to both of those authors.
** License
Copyright © Joshua Hoff. Same license as vim itself. See:
http://vimdoc.sourceforge.net/htmldoc/uganda.html#license Or :help license
from within vim.