I'm having trouble changing the tab size in Joe.
I have copied joerc
to $HOME
and have edited the -tab
line to -tab 4
but this has开发者_如何学运维n't changed the option in Joe. Also the number 4 is green instead of blue when I edit joerc
so I think its reading it wrong.
The real solution is:
- Create a file
$HOME/.joerc
(NOT.joe
as at least the Debianjoerc
suggests!) - FIRST LINE must be
:include /etc/joe/joerc
- Then, a line containing just a
*
and a newline character - Then,
-tab 4
and-istep 4
, each on a single line. - Add a blank line at the end.
You may also add further options with other masks.
I've wasted about 20 mins trying to set tab size too. Here is the solution:
I. Open:
/etc/joe/joerc
II. Find row containing -tab nnn and change it to:
-tab 4
(I assume that you want to change tab size to 4. If you want different value, please replace all the 4s with your value)
III. Find -istep nnn and change it to:
-istep 4
IV. Save & exit
This will set tab size 4 for files WITHOUT extension. If you want to change tab size for files with common extensions like *.java:
I. open /etc/joe/ftyperc
II. Find your extension, for example *.java. Initially it looks like:
JAVA
*.java
-autoindent
-syntax java
-smarthome
-smartbacks
-purify
-cpara >#!;*/%
III. You have to comment (insert tab before it) -autoindent and add -istep 4 bellow -cpara. It should look like:
JAVA
*.java
-autoindent
-syntax java
-smarthome
-smartbacks
-purify
-cpara >#!;*/%
-istep 4
In case anyone else runs into this, I am running an ancient version of joe on AIX and after some painful trial and error it turned out that -smartbacks was the problem for me. I commented that line out and tabs work, put it back and they go back to 2. Probably fixed in a later version, but hopefully this helps someone else with the same problem.
JAVA
*.java
-spaces
-tab 4
-istep 4
-indentc 32
-autoindent
-syntax java
-smarthome
-smartbacks
-purify
Each time the tab key is pressed (using joe 4.6) it inserts 4 spaces after having followed those steps:
Execute
sudo joe /etc/joe/joerc
Find the row containing
-tab nnn Tab width
, change it to-tab 4 Tab width
and make sure that there is no whitespace at its left side.A few lines down, find the row containing
-spaces TAB inserts spaces instead of tabs
and make sure that there is no whitespace at its left side.Save and exit
This works here for files without extension, for .cpp files, for .java files, for .c files, for .txt files, etc.
精彩评论