You are not logged in.

#1 2010-07-15 01:55:09

rb
Member
From: Argentina
Registered: 2010-05-07
Posts: 143

[Solved] Opening a txt file in different editors, format issue

I wasn't sure where to put this, sorry if this is the wrong place.

This is what's bothering me: I made a text file (.txt) with Vim containing some brief info about it (itself?) to print and have at hand for learning while using it. Then I opened it in Geany to print it, and all the formatting where screwed up (I used tab to format it). For example there were spaces before the tabs, or extra tabs added.

Then I fixed the text I pasted in Geany, printed it and again the formatting where messed up, this time in the printed copy, although the text in the screen looked alright. I tried to print with Terminus, Clean, Dejavu Sans Mono and Monospace fonts. After that I did the same in Google Docs, with the very same results.

What's going on? I mean, why what is printed is different from what I see in the screen? And why when I create a file with A program and open it with B program the formatting is messed up? What should I use to print regular text? I don't like OOs

Thanks

Last edited by rb (2010-07-15 03:08:22)


Sorry for my English. Feel free to point out my errors.

Offline

#2 2010-07-15 02:00:05

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [Solved] Opening a txt file in different editors, format issue

I just print directly from Vim.

If I need to open it on a M$ box at work, I select Wordpad and it respects the Vim formatting - providing you have set a compatible text width.

(untested, but I seem tor recall that gedit does as well. YMMV)

# edit to add text width for clarity

Last edited by jasonwryan (2010-07-15 02:01:07)


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2010-07-15 02:47:01

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,356

Re: [Solved] Opening a txt file in different editors, format issue

For compatibility just don't use tabs, or instruct your editor to replace tabs with spaces. Tab width is not constant between editors.

And that's not even getting into the "windows text file" vs "UNIX text file" stuff.....


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#4 2010-07-15 02:50:17

rb
Member
From: Argentina
Registered: 2010-05-07
Posts: 143

Re: [Solved] Opening a txt file in different editors, format issue

@jasonwryan: Thanks. I wasn't aware that you could print from Vim. I started not long ago with it, and despite the fact that it already is my editor of choice, I still have a LOT to learn.

@ngoonee: So that's was the problem. I'm used to insert tabs instead of spaces. I think I'll edit my .vimrc to, in case of matching a text file, just insert spaces (I think that should be possible).


Sorry for my English. Feel free to point out my errors.

Offline

#5 2010-07-15 02:56:52

splittercode
Member
From: WI, USA
Registered: 2010-03-16
Posts: 203

Re: [Solved] Opening a txt file in different editors, format issue

rb wrote:

I think I'll edit my .vimrc to, in case of matching a text file, just insert spaces (I think that should be possible).

in .vimrc

set expandtab
set ts=4

replace 4 with any number of spaces you'd like.

Last edited by splittercode (2010-07-15 03:03:56)

Offline

#6 2010-07-15 03:04:35

rb
Member
From: Argentina
Registered: 2010-05-07
Posts: 143

Re: [Solved] Opening a txt file in different editors, format issue

Thank you very much. Every single day I learn something new about Vim, and every little thing is really useful. I'll mark the thread as solved, thank you all.


Sorry for my English. Feel free to point out my errors.

Offline

Board footer

Powered by FluxBB