Visit Our UNIX and Linux User Community


how to change the tab size in vi?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers how to change the tab size in vi?
# 1  
Old 04-11-2002
Computer how to change the tab size in vi?

the default size is 8. i found it's too big.

how can i change the tab size in vi? is it a good idea to change it at all?

thks
# 2  
Old 04-11-2002
In vi at the ":" prompt type:

Quote:
set ts=4
for a tab size of 4
# 3  
Old 04-12-2002
but,

Thxs Neo

how to setup for all vi. I mean every time i go into vi, the tab size is 4.
do i want too much?
# 4  
Old 04-12-2002
no problem, just use the your resource file...


Some useful set options for your ~/.exrc file:

:set all Display all Set options
:set autoindent Indent following lines to the indentation of previous line.
:set ts=4 set tab stop to 4 char
:set ignorecase Ignore case during pattern matching.
:set list Show special characters in the file.
:set number Display line numbers.
:set shiftwidth=n Width for shifting operators << and >>
:set showmode Display when in Insert, Append, or Replace mode.
:set wrapmargin=n Set right margin 80-n for autowrapping lines (inserting newlines). 0 turns it off.
# 5  
Old 04-12-2002
Neo,

Where can I find the .exrc file? It doesnt exist in the $HOME directory or the root (/)
# 6  
Old 04-12-2002
You should create it in your $HOME and vi should read it on startup...
# 7  
Old 04-15-2002
After creating the .exrc file in my $HOME dir...

I managed to get vi to read the .exrc file by using the :'source .exrc' command.

But is there a way you can get vi to read it automatically?
 

Previous Thread | Next Thread
Test Your Knowledge in Computers #318
Difficulty: Easy
MacOS is based on Linux.
True or False?

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Change size of watermark

I'm using this code to watermark images (add a logo). How do I change the size of the watermark to cover a certain percentage of the image ffmpeg -i folder/s886_01.jpg -i watermark.png -filter_complex overlay=15:15 output.png (2 Replies)
Discussion started by: locoroco
2 Replies

2. Ubuntu

How to change ffmpeg default font size?

Hello, I have a problem with Greek subtitle font size when I map a subtitle file into a video in ffmpeg. I ran below code: ffmpeg -i video.mp4 -sub_charenc CP1253 -i video_sub.srt -c:v copy -c:a copy \ -c:s mov_text -metadata:s:s:0 language=gr mapped_video.mp4 When I play it in VLC,... (2 Replies)
Discussion started by: baris35
2 Replies

3. Programming

Java JOptionPanel change text field with TAB

So I don't really know anything about Frames, Windows, or Panels.. I just got interested in Java because a coworker is doing classes in it. I know some other languages but never did GUI things...I literally just got NetBeans, and drew up a dialog using it's Design view. All I want is for the TAB... (0 Replies)
Discussion started by: neutronscott
0 Replies

4. Windows & DOS: Issues & Discussions

Change tab size to 4

forum members, gvim version 6.0.150.0 Vi has been my favorite editor for over 30 years. Mostly with Unix but now with windows XP. It works fine but I want to change the tab to 4 spaces instead of 8. I read on the internet that I can edit the .vimrc file but I only have an _vimrc... (12 Replies)
Discussion started by: jerryd
12 Replies

5. Linux

kde 4.3 and tab size

Hi Guys I have just upgraded to kde4 and i noticed that the default tab size in konsole are massive, i cannot see the setting to change this any hlep thanks Adam (0 Replies)
Discussion started by: ab52
0 Replies

6. UNIX for Dummies Questions & Answers

How to get directories colored when doing change directory and tab

I am trying to navigate between directories using cd. However, the only way to distinguish directories now is by seeing the "/' after the directory names, which is quite inefficient. How can I make the directories look in color when typing cd and then using the tab key to list the files and... (1 Reply)
Discussion started by: genehunter
1 Replies

7. Shell Programming and Scripting

formatting tab with even size

I have a number of columns separated by tabs but the spacing between them are of different sizes. Is there any way of separating them with tab of even size? Thank you. (4 Replies)
Discussion started by: ivpz
4 Replies

8. AIX

Change the Block size of AIX 6.1

Friends , I know the most cases the unix operation system holds the default block size 4MB . In AIX 5.3 and AIX 6.1 , also use upto 4 MB as its default block size .Now I want to change this value from 4MB to 8MB as AIX block size . Is it possible to change the block size value in AIX 6.1/5.3... (2 Replies)
Discussion started by: shipon_97
2 Replies

9. Shell Programming and Scripting

change the font size in bash

Hi, I would like to change the font size in bash. I know how do it in ksh: F_VDOBLE="\033#6" print "${F_VDOBLE}Esto es..." But in bash I don't know Could you help me please? Many thanks! (5 Replies)
Discussion started by: mierdatuti
5 Replies

10. UNIX for Advanced & Expert Users

File system size change

Good morning folks! I'm new here.. trying to find an answer on how to resize filesystem. Need to add some space to c0t0d0s5, /var... Is it possible at all? JV (9 Replies)
Discussion started by: jvinn
9 Replies

Featured Tech Videos