Quick question about set number


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Quick question about set number
# 1  
Old 09-01-2010
Quick question about set number

In my .exrc file I have line numbers turned on but it adds an indent. I don't like this, is there a way to have the line numbers at the left edge of my terminal instead of indented? Here's my .exrc

Code:
     1  set ignorecase noslowopen report=0 autoindent showmatch showmode nu
     2  set tabstop=4 shiftwidth=4
     3  map @ :w^M:!g++ *.cpp && a.out^M
     4  map ^ :w^M:!make && a.out < input^M
     5  map ^P :w^M:!gcc *.c && a.out < input^M
     6  map ^A :w^M:!g++ % && a.out^M
     7  map! ^A ^[:w^M:!g++ % && a.out^M

# 2  
Old 09-01-2010
Code:
:se -nonu (for removing line nos)
:se -noai (for no indentation)

# 3  
Old 09-01-2010
Okay, let me be more specific:

I like the line numbers.
I also like that fact that vi currently keeps my indentations.
It's just since I turned on line numbers every line starts indented, is there a way to fix that?
# 4  
Old 09-01-2010
The problem is that vi is expecting the line numbers to become quite long (many digits) and is reserving space for these long numbers. There is probably no way to change this behavior, because otherwise it would run the risk of this:

Code:
...
8 line 8
9 line 9
10 line 10      <- this would mess up the display of text

I hope this helps (understanding).

bakunin
This User Gave Thanks to bakunin For This Post:
# 5  
Old 09-01-2010
That makes perfect sense and it's a lot less annoying now that I know it serves a purpose.

Thanks a lot!
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl - quick inverse of a number range

Hello, I'm trying to find an nice solution for the following: 1) I have ranges of numbers (begin-end): 10-15, 20-30, 45-50 2) I have begin limit=0 and end limit=60. 3) I need to find out number ranges between begin limit and end limit that do not overlap with the ranges in item1. In this... (6 Replies)
Discussion started by: pn8830
6 Replies

2. Shell Programming and Scripting

Would appreciate a quick second set of eyes on a script (regarding doing things in the background)

What I'm trying to do is leave a tcpdump running all the time on a server, and at the end of every day kill it and start a new one. For some reason my boss doesn't want to set this up as a cron job, so I've come up with the following.: #!/bin/bash PCAPFILE=/tmp/mgmt.$(date... (8 Replies)
Discussion started by: DeCoTwc
8 Replies

3. UNIX for Dummies Questions & Answers

Quick question.

I'd like to list all userid's on the system that have a .bashrc file in their home directory with a command like "cat /etc/passwd | grep -f", however I'm not quite familiar with using grep. Any suggestions? (2 Replies)
Discussion started by: raidkridley
2 Replies

4. Shell Programming and Scripting

quick question

I am using sed to find a pattern in a line and then I want to retain the pattern + the rest of the line. How is this possible? ie: line is: 14158 05-15-08 20:00 123-1234-A21/deliverable/dhm.a search for 123-1234-A21 ie: echo $line | sed 's/.*\(\{3\}-\{4\}-\{3\}\{5\}\).*/\1/' ... (1 Reply)
Discussion started by: phreezr
1 Replies

5. UNIX for Dummies Questions & Answers

quick question

from command prompt I did grep two words on a same line for eg: grep abc | grep xyz and I got tht particular line, but I want to know when I vi that file how to directly search for that particular line? I appreciate if any one can provide answer, thanks in advance (2 Replies)
Discussion started by: pkolishetty
2 Replies

6. UNIX for Dummies Questions & Answers

Quick question

Hi, Is there a simple way, using ksh, to find the byte position in a file that a stated character appears? Many thanks Helen (2 Replies)
Discussion started by: Bab00shka
2 Replies

7. UNIX for Dummies Questions & Answers

Quick Question

Hi, I am new to UNIX, and am learning from this tutorial : http://www.ee.surrey.ac.uk/Teaching/Unix/index.html It keeps telling me to files downloaded from the internet (like .txt files) to the directory, and I dont know how to. How do I add .txt files to my directory? Thanks. (6 Replies)
Discussion started by: IAMTHEEVILBEAN
6 Replies

8. UNIX for Dummies Questions & Answers

quick question

hi guys trying to understand what this line means sed is a stream editor and i understand that, i have a file already selected i want to edit so i use -e sed -e the next stesp is s/$* s is a subsititute replacement sed -e s/$*//g $ is in reference of the last line /g makes it... (2 Replies)
Discussion started by: hamoudzz
2 Replies

9. UNIX for Dummies Questions & Answers

A Quick Question

Wat is the difference between the cp mv ln etc in /usr/sbin/static and cp mv ln functions in /usr/bin (4 Replies)
Discussion started by: DPAI
4 Replies

10. UNIX for Dummies Questions & Answers

Quick Question

I know in DOS, when you want to pull up your last/previous command, you hit the up/down arrows. How do you do that with UNIX? (3 Replies)
Discussion started by: Tracy Hunt
3 Replies
Login or Register to Ask a Question