VI whitespace and tab settings

Asked by Andrius Bentkus

It i's possible to save VI whitespace and tab settings into one line in every file, so everytime you open up VI with that file it will automatically notice the tab settings.
My personal preference is 1 tab = 2 space, while the hipl preference is 1 tab = 4 space and it is getting annoying to double tab all the time.
Could we incorporate these settings into the file's ? Or would it be non appropriate since others might start enter configuration strings of their favorite editing application end it would end up in a weired 12 liner in the beginning of every file?

Question information

Language:
English Edit question
Status:
Answered
For:
HIPL Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Christof Mroz (christof-mroz) said :
#1

:h 'exrc'
:h 'secure'

Assuming that you star tvim in your working copy's root dir... there's also a script that loads the first .vimrc encountered in the parent directories (anew for every :edit), AFAIK.

Revision history for this message
Stefan Götz (stefan.goetz-deactivatedaccount) said :
#2

Personally (and admittedly as a non-VI user) I would say that
a) only a part of the hipl developer community benefits
b) for everyone else, all files contain some additional clutter
So I'd recommend against adding personal, tool-specific text into all hipl files.

Revision history for this message
Mircea Gherzan (mgherzan) said :
#3

You are talking here about modelines. PISA has such a line at the beginning of every code file.

However, in HIPL we went for another solution: exrc. In the "root" HIPL folder there's a .vimrc file with the indentation settings (ts=4 sw=4 et). So all you need to do is add "set exrc" to your vimrc and edit HIPL files starting vim from the root HIPL folder.

Can you help with this problem?

Provide an answer of your own, or ask Andrius Bentkus for more information if necessary.

To post a message you must log in.