I use \"very magic\" for regexp searches (i.e. /\\v or %s/\\v) but I wish I could set some option so I don\'t have to include \\v anymore, anywhere. Is there a way to do thi
To reply to the answer above as I can't comment yet, from How to make substitute() use another magic mode?, the vim docs and my own testing, smagic (and sm) only enters magic mode and not very magic mode.
*:snomagic* *:sno*
:[range]sno[magic] ... Same as `:substitute`, but always use 'nomagic'.
{not in Vi}
*:smagic* *:sm*
:[range]sm[agic] ... Same as `:substitute`, but always use 'magic'.
{not in Vi}
For example, one should ('s turn into )'s in a file with :%sm/(/)/g and not :%sm/\(/\)/g, which shows the following for me
E54: Unmatched \(
E54: Unmatched \(
E476: Invalid command
Instead, to enter very magic mode, one should use \v in the search expression of substitute (i.e. :%s/\v\(/\)/g)
(Please correct me if I've messed up, I am quite new to Vim)