How to make PuTTY display tabs within a file instead of changing them to spaces?

5

2

I have a problem with PuTTY: whenever I SSH into a UNIX computer using PuTTY on my Windows PC and I try to browse files, everything looks fine, but my tab delimited files appear to have spaces instead of tabs!

For example, when I open a tab delimited file in vim and use my arrow keys to transverse the cursor between columns, the cursor jumps across the tab gaps. However, when I use my mouse to highlight a portion of the text, my cursor "sees" spaces between each column. So, when I copy the text to my clipboard, all tabs have been replaced with stretches of spaces.

Does anyone know how to stop this behavior? I want PuTTY to properly display tabs instead of spaces, and more importantly, I want to be able to capture text from my files in UNIX to my clipboard while preserving their tabs!

jake9115

Posted 2013-10-10T03:15:53.080

Reputation: 1 029

1

I think this is a wishlist item for Putty: http://www.chiark.greenend.org.uk/~sgtatham/putty/wishlist/paste-fidelity.html

– bfhd – 2013-10-10T03:29:13.323

1Does anyone have a work-around? I really need to be able to copy text with tabs from my shell while SSHing into my server. Thanks! – jake9115 – 2013-10-10T13:01:51.420

Answers

1

The workaround I use is to do

cat -t file.txt

What that does is display tabs as ^I. I copy and paste from Putty to my Windows text editor. Then replace all the ^I with tabs.

wisbucky

Posted 2013-10-10T03:15:53.080

Reputation: 1 522

0

Use "set list" in your .vimrc. If you don't like the ^I default, use "set listchars". See the description at the vim wiki.

mpez0

Posted 2013-10-10T03:15:53.080

Reputation: 2 578