How to replace with expanded tab in vim -


i don't have problem, i'm curious.

here part of .vimrc.

set tabstop=4 set shiftwidth=4 set expandtab 

i want replace in text notab <-here tab

so command should :

:%s/notab/^i<-here tab/ 

wich give me real tab, in order replace 4 space in need call :retab

same results in single call (directly add 4 spaces):

:%s/notab/ <-here tab/

but not convenient, first version include real tab in text, wich need te retabed , second version depends on number of space defined 1 tab.

is there generalistic way it?

i think should want:

:%s/notab/\=repeat(" ", &tabstop)/ge 

Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -