Discussion:
[9fans] tabstops
(too old to reply)
Steve Simon
2012-11-16 11:12:38 UTC
Permalink
I am working on a project that insists on 4 space indentation of code.

I can change the tabstop environment variable so I layout the code
how they want but I am still inderting tabs into my source.

I can use russ's tab(1) to convert the tabs to whitespace before every
checkin, but thats a bit painful.

anyone hacked sam to replace tabs with spaces or found a similar workaround?

I know this is horrid but what can I do, I am outnumbered (as usual).

-Steve
dexen deVries
2012-11-16 11:37:51 UTC
Permalink
Post by Steve Simon
I am working on a project that insists on 4 space indentation of code.
I can change the tabstop environment variable so I layout the code
how they want but I am still inderting tabs into my source.
I can use russ's tab(1) to convert the tabs to whitespace before every
checkin, but thats a bit painful.
create tabfs, a stacking FS? convert leading tabs to spaces on write(3),
convert leading quartets of spaces to tabs on read(3).

IIRC there was already some stacking FS doing somet ranslation, perhaps it was
CRLF <->LF
--
dexen deVries

[[[↓][→]]]


Reality is just a convenient measure of complexity.
-- Alvy Ray Smith
Nemo
2012-11-16 11:58:05 UTC
Permalink
or a script that does everything for you.
you edit at one tree and Rin the script
which copies to another replaces and submits.
Post by dexen deVries
Post by Steve Simon
I am working on a project that insists on 4 space indentation of code.
I can change the tabstop environment variable so I layout the code
how they want but I am still inderting tabs into my source.
I can use russ's tab(1) to convert the tabs to whitespace before every
checkin, but thats a bit painful.
create tabfs, a stacking FS? convert leading tabs to spaces on write(3),
convert leading quartets of spaces to tabs on read(3).
IIRC there was already some stacking FS doing somet ranslation, perhaps it was
CRLF <->LF
--
dexen deVries
[[[↓][→]]]
Reality is just a convenient measure of complexity.
-- Alvy Ray Smith
l***@proxima.alt.za
2012-11-16 12:11:37 UTC
Permalink
Post by Nemo
or a script that does everything for you.
Check-in functions in most version control systems allow you to run a
script, so that may also be an option.

++L
l***@proxima.alt.za
2012-11-16 12:09:10 UTC
Permalink
Post by Steve Simon
anyone hacked sam to replace tabs with spaces or found a similar workaround?
Would it not be most practical to hook tab(1) onto Sam's "w" command?

++L
Juan Fuentes
2012-11-16 13:12:26 UTC
Permalink
I'm working a lot in Python and feel your pain, what I do is:

X/.* / ,|tab -n 4 -u

I normally work with several python files open in Sam, this has
worked well for me.

As already pointed out another solution is to run a script to do the
conversion for you on a pre-commit hook.

Continue reading on narkive:
Loading...