\<bar\>
matches bar but neither foobar nor barbaz nor foobarbaz.
Use it like this in a substitution:
:s/\<bar\>/baz
Use it like this to list all the lines containing the whole word bar:
:g/\<bar\>
:h pattern is a good read.
\<bar\>
matches bar but neither foobar nor barbaz nor foobarbaz.
Use it like this in a substitution:
:s/\<bar\>/baz
Use it like this to list all the lines containing the whole word bar:
:g/\<bar\>
:h pattern is a good read.