New answers tagged

-1

Just looking at something like your last example, this will replace a number with double its value: s/\d\+/\=submatch(0) * 2/ This is known as a sub-replace expression and I go into some depth here, though with an emphasis on string operations: How to run a substitute command on only a certain part of the line The key is \= which says "everything ...


1

You can use submatch() function and use it to substitute with some pattern on those lines may be. I got it till here: :%s/\(\d\+\).*\ \(\d\+\).*$/\=(submatch(2)==2*submatch(1))?"YES":"NO"/g This replaces the lines where if finds the pattern that you requested for with YES. Not sure how to do it without substitution. Following for a ...


1

The following approach was not tested with Anaconda, but it fixed the issues for me when working with virtualenvwrapper The vim-virtualenv plugin changes the executable and modifies sys.path and the $PATH environment. I've compiled vim with python3.5, so when no virtualenv is activated I get: :py3 import sys; print(sys.executable) /usr/bin/python3 :py3 ...


Top 50 recent answers are included