Skip to content

Vim plugin: text object for the first part of a line before a specified separator.

Notifications You must be signed in to change notification settings

bagohart/vim-textobj-before

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Vim-Textobj-Before

This Vim plugin provides text objects to select text on a line before the specified character.

This plugin works well, but has a high startuptime. If you use Neovim, consider using a lua version of this plugin instead: textobj-before.nvim

Requirements

Developed and tested on Neovim 0.4.4, but should work on Vim 8, too. This plugin depends on vim-textobj-user.

Installation

Install with your favourite package manager or Vim's built-in package management system. For example using Vim-Plug:

Plug 'kana/vim-textobj-user'
Plug 'bagohart/vim-textobj-before'

Guide

By default, this plugin does nothing. To activate it, add the following lines to your vimrc:

let g:textobj_before_enabled = 1

This will add mappings for the following text objects: ib=, ab=, ib,, ab,, ib:, ab:, ib;, ab;, ib|, ab|, ib., ab., ib/, ab/, ib\, ab\, ib', ab', ib", ab", ib!, ab!, ib#, ab#, ib<, ab<, ib>, ab>, ib[, ab[, ib], ab], ib{, ab{, ib}, ab}, ib(, ab)

To change the default prefix (ib/ab), add:

let g:textobj_before_prefix_i = 'ix'
let g:textobj_before_prefix_a = 'ax'

Related Plugins

License

The Vim licence applies. See :help license.

About

Vim plugin: text object for the first part of a line before a specified separator.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published