LogiPat : Boolean-Logic Patterns
| script karma
Downloaded by 1451
Comments, bugs, improvements
script versions (upload new version)
|LogiPat takes Boolean logic arguments and produces a regular expression which is used to search for a line satisfying the logic. The search register (@/) is initialized with the resulting regular expression, so repeating such searches is as easy as repeating any search. A series of examples follows:
will search for lines containing the string "abc"
will search for lines which don't contain the string "abc"
will search for lines which contain either the string "abc" or the string "def"
will search for lines which don't contain either of the strings "abc" or "def"
will search for lines which contain both of the strings "abc" and "def"
:let pat= LogiPat('!"abc"')
will return the regular expression which will match all lines not containing "abc". The double quotes are needed to pass normal patterns to LogiPat, and differentiate such patterns from boolean logic operators.
(alpha/beta version available at http://www.drchip.org/astronaut/vim/index.html#LOGIPAT)
|1. Place LogiPat.vim.gz into your .vim/plugin or vimfiles\plugin directory
2. gunzip LogiPat.vim
The next time you execute vim, LogiPat will extract its help page and prepare it for use (ie. it uses the HelpExtractor, see vimscript#748 for more).
Click on the package to download.
ip used for rating: 18.104.22.168