What excludes regexp pattern in vim

I want to match something, but exclude `\ t

in ruby: [^\t]which means match anything but\ t`

What is equivalence in vim?

+3
source share
1 answer

In vim syntax, you usually need to avoid these brackets. But there is a switch that you can use at the beginning of your regular expression \v, which includes "very magical" processing so you don't do this.

It’s bad for compatibility to change the default regular expression syntax, but I don’t want me to type backslash all the time. I have this in my .vimrc, which automatically inserts a very magical switch for me.

" set the "very magic" option in common searches
nnoremap / /\v
vnoremap / /\v
cnoremap s/ s/\v

See more details :help \v.

+4
source

All Articles