vim-textobj-elixir


Ⅰ. 插件描述

Make text objects with various elixir block structures.

Ⅱ. 基本信息

创建日期:  2012-11-08
使用用户:  24
Github星:  21
插件作者:  andyl

Ⅲ. 安装方法

使用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

  1. 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!"
end

Typing dae removes whole if block

def hoge(yo) do
  #\%
  IO.puts "everyone!"
end

or die removes innner if block.

def hoge(yo) do
  if yo do
  #\%
  end
end

When a cursor places at line 6,

def hoge(yo) do
  if yo do
    IO.puts "yo!"
  end
  IO.puts "everyone!" #\%
end

type die removes inner def block.

def hoge(yo) do
end

This plugin requires vim-textobj-user

添加新评论