Ⅰ. 插件描述
:book: Folding for .in filesⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'chreekat/vimin'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'chreekat/vimin'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'chreekat/vimin'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/chreekat/vimin
Ⅳ. 文档说明
Some vim support for IN files
What's an IN file?
Eh, it's just a file with an outline. Name it foo.in. It's "in" as in inbox
— a place to keep todo lists or anything else. My IN.in once had almost 7000
items! Crap! (It's down to 3000 now, but hey, at least I know this plugin
is performant.)
Outlines look like:
- This item is at the top
- Here's another item
- Items nest and stuff
- They can nest a lot.
- Items can be really really long, so that they wrap over multiple
lines. I've set vim options that make this happen automatically, for
the most part.
- baz
What's this plugin do?
Well, it used to do lots of questionably useful things! Now I've rebooted it,
and it:
- Sets some good options
- Makes
<cr>act sort of clever. Maybe too clever? Hopefully intuitive.
Recommendations
- Keep items formatted with judicious use of
gq. - Be careful moving items around. There's no notion of an "item" text
object, so you have to do everything linewise at best. - Use the shift operators!
>>and<<in Normal mode, and<c-t>and<c-d>in Insert mode. It's fun. - Try using
insort(from chreekat/usort)
for sorting top-level items. vim-unimpaired's "paste and indent" mappings are nice. I re-implemented them
like so:function! VimrcIndentPaste(reg, dent, dir) set nofoldenable exec 'normal "' . a:reg . ']' . a:dir . a:dent . "']" set foldenable endfu for dent in ['>','<'] for dire in ['p','P'] exec 'nnoremap ' . dent . dire . " :call VimrcIndentPaste(v:register, '".dent."', '".dire."')<cr>zv" endfor endfor unlet dire dent- Works well with Goyo and NrrwRgn.
I'd like to make formatting and moving easier in the future.
License
GPLv3+, as in LICENSE.