Ⅰ. 插件描述
Make text objects with various elixir block structures.Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'andyl/vim-textobj-elixir'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'andyl/vim-textobj-elixir'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'andyl/vim-textobj-elixir'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/andyl/vim-textobj-elixir
Ⅳ. 文档说明
# Vim text objects for elixir block structures
This Vim plugin makes text objects with various elixir block structures.
Many end-terminated blocks are parsed using regex, indentation and syntax
- This is more correct than parsing text with regex only.
Simple one operator-pending mapping e
Elixir text objects include: 'setup_all', 'setup', 'describe', 'test',
'unless', 'quote', 'case', 'cond', 'when', 'with', 'for', 'if',
'defprotocol', 'defmodule', 'defmacro', 'defmacrop', 'defimpl', 'defp',
'def'.
Example:
#\% is the place of your cursor.
def hoge(yo) do
if yo do
IO.puts "yo!"
#\%
end
IO.puts "everyone!"
endTyping dae removes whole if block
def hoge(yo) do
#\%
IO.puts "everyone!"
endor die removes innner if block.
def hoge(yo) do
if yo do
#\%
end
endWhen a cursor places at line 6,
def hoge(yo) do
if yo do
IO.puts "yo!"
end
IO.puts "everyone!" #\%
endtype die removes inner def block.
def hoge(yo) do
endThis plugin requires vim-textobj-user