Giter Site home page Giter Site logo

vertfind's Introduction

vertfind is Vim plugin for vertical search.

For example the cursor moves from A to B by typing "<Leader>f" under following mapping.
A means position in the brackets to the right of 'A' character.
The same is true in B's case.

  noremap <expr> <Leader>f vertfind#Find('z')

  zzz A[x] zzz
  zzzxxxxxxzzz
  zzz B[z] zzz

==============================================================================
Functions:

vertfind#Find({pattern} [, {flags}])
		Search for vertical pattern {pattern}.

		{pattern} is a String or a List.  See Vertical pattern.

		{flags} is a String, which can contain these character flags:
		'b'	search backward instead of forward

vertfind#SmartFind([{flags}])
		Search for vertical pattern which suit the situation.

		{flags} is used like with vertfind#Find().

==============================================================================
Vertical pattern:

Vertical pattern is a String or a List.
The forms are following.

  {pattern}
  [{pattern}, ...]
  [[{flags}, {pattern}], ...]

{pattern} is a String, which is a regexp pattern.
When vertical pattern is a List this is a multiple lines pattern.
Vertical pattern {pattern} is equivalent to [{pattern}].
Vertical pattern [{pattern}, ...] is equivalent to [['', {pattern}], ...].

{flags} is a String, which can contain these character flags:
'<'	declare next element anchoring point
'!'	invert the sense of matching
'q'	interpret {pattern} as a fixed string

==============================================================================
Example setting:

  noremap <expr> f<C-@> vertfind#Find(['\S', ['!', '\S']])
  noremap <expr> F<C-@> vertfind#Find(['\S', ['!', '\S']], 'b')
  noremap <expr> f<C-V> vertfind#Find('\S')
  noremap <expr> F<C-V> vertfind#Find('\S', 'b')
  noremap <expr> f<C-L> vertfind#Find([['q', nr2char(getchar())]])
  noremap <expr> F<C-L> vertfind#Find([['q', nr2char(getchar())]], 'b')
  noremap <expr> f<C-B> vertfind#Find('[^' . escape(getline(".")[col(".") - 1], '\') . ']')
  noremap <expr> F<C-B> vertfind#Find('[^' . escape(getline(".")[col(".") - 1], '\') . ']', 'b')
  noremap f<C-A> f
  noremap F<C-A> F
  noremap <expr> <M-j> vertfind#SmartFind()
  noremap <expr> <M-k> vertfind#SmartFind('b')

vertfind's People

Contributors

xoi avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.