tags:

views:

48

answers:

2

I have a python code something like this

file_out.write(str(i).strip()+"\t"+str(dict1[i]).strip()+"\n")

But when i try to recognize this with vim by saying on the file that was written.

:%s/\t/|/g

But it does not recognize the \t

+2  A: 

:%s/\\t/|/g

because the \ is itself a special char that needs escaping with \

mhanney
don't need to escape. if you escape it, you are actually searching for a literal \t.
ghostdog74
He IS looking for a `\t` escape sequence appearing in his source code, so looking for literal `\t` is correct.
Ben Voigt
A: 

I'd do :%s/^V^I/|/g where ^V means control-V and ^I means control-I -- that's how you get a tab into your vim command!

Alex Martelli
No need to type `<C-v>` unless `<Tab>` is mapped to something: substitute command does not have completion defined.
ZyX