VI editior line numbers


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers VI editior line numbers
# 8  
Old 09-05-2014
Hi,

It is the tab positions in the ruler.

Regards

Dave
# 9  
Old 09-05-2014
Quote:
Originally Posted by gull04
Hi,
It is the tab positions in the ruler.
Regards
Dave
Dave,

I'd appreciate if you can explain it in detail. I am not a vim/vi editor expert but I know good enough to get my stuff done, so if you can provide me with a short description on what you mean the "tab positions in the ruler" it will be helpful.Smilie
# 10  
Old 09-05-2014
Quote:
Originally Posted by RavinderSingh13
Posted by Scrutinizer :


Hello Scrutinizer,

I agree that link will not give the complete solution to the user but if user can go through the link properly he will find many options related to vi and it may clear user's some of the queries too. I am Sorry if I have broken a forum rule here.

Thanks,
R. Singh
Hi Ravinder.. Yes but the information that the OP is looking for cannot be found on that page. That is one of the reasons why it is good practise to quote the part on a page that answers the OP's question as well as provide a link. This practise also forces you to verify / double check if the information can be found and if not come up with a better link..
This User Gave Thanks to Scrutinizer For This Post:
# 11  
Old 09-05-2014
Quote:
Originally Posted by babyPen1985
Thanks Bakunin, here is the information you have asked for:


system: uname -a
Linux x86_64 x86_64 x86_64 GNU/Linux

From: less /etc/redhat\-release
Red Hat Enterprise Linux Server release 5.6 (Tikanga)

VI version:
vi --version
VIM - Vi IMproved 7.0 (2006 May 7, compiled Aug 4 2010 07:21:08)

which vi --> vi=vim
Code:
ls -l $(whereis vi)
ls: vi:: No such file or directory
-rwxr-xr-x 1 root root 632880 Aug  4  2010  /bin/vi
-rw-r--r-- 1 root root  32659 Jul 23  2010      /usr/share/man/man1p/vi.1p.gz
lrwxrwxrwx 1 root root      8 May 10  2012  /usr/share/man/man1/vi.1.gz -> vim.1.gz

---------- Post updated at 11:31 AM ---------- Previous update was at 11:11 AM ----------



Thanks for the link Dave, but I was still not able to find the exactly what it denotes. The link concentrates on how to enable the line number, which in my case is already on.
By exploring a little more it
Code:
12,4-8         3%

line 12
4 is indicating the 4 character need to know what 8 is
a sample record from my file:

Code:
999     050     Primary Unit

the above [4-8] comes when my cursur is right in front of '*050' when i move the cursor over on to 0 it will become [5-9] and when move it over on 5 it will become [6-10] so on an so forth.

hope this helps to understand what it is, its definitely not the width of the column.
In your examples, 12,4-8 means that the cursor is sitting on line 12, the first byte of the character under the cursor is the 4th byte of the line, and the last column position occupied by that character is 8. The 1st three bytes on that line each contain the one byte character "9" and the character under the cursor is the one byte character <tab>. When you move the cursor to cover the "5", that character is the 6th byte on that line and is displayed in column 10.

For another example (using multi-byte characters), if you're using UTF-8 as your code set, if you have a file containing the line:
Code:
aâÂ1

which when viewed using od -bcis:
Code:
0000000   141 303 242 303 202 061 012                                    
           a   â  **   Â  **   1  \n                                    
0000007

when the cursor is over the "a", you'll see 1,1-1; when the cursor is over the "â", you'll see 1,2-2; when the cursor is over the "Â", you'll see 1,4-3; and when the cursor is over the "1", you'll see 1,6-4.
This User Gave Thanks to Don Cragun For This Post:
# 12  
Old 09-05-2014
Thanks a lot Don, that was very helpful.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Grep for a line containing only 5 numbers

How would you grep for a line containing only 5 numbers? Something like this. 10 2 12 1 13 (4 Replies)
Discussion started by: cokedude
4 Replies

2. UNIX for Dummies Questions & Answers

coming out from vi editior

Hi Folks, I have opened a log file through Vi editor in putty itself and I was searching for a pattern in logs , let say 'ABCD' /abcd then I want to come out from vi editor, Please advise what is the command to come out from unix editor..! (1 Reply)
Discussion started by: KAREENA18
1 Replies

3. Shell Programming and Scripting

Assign Line Numbers to each line of the file

Hi! I'm trying to assign line numbers to each line of the file for example consider the following.. The contents of the input file are hello how are you? I'm fine. How about you? I'm trying to get the following output.. 1 hello how are you? 2 I'm fine. 3 How about you? ... (8 Replies)
Discussion started by: abk07
8 Replies

4. UNIX for Dummies Questions & Answers

grep to get line numbers

I know if i use grep -n that the output will have the lines numbered but is there a way to grep the actually line number. so like this grep -n "one" /usr/dict/numbers 1:one 21:twenty-one 31:thirty-one 41:forty-one 51:fifty-one 61:sixty-one 71:seventy-one 81:eighty-one 91:ninety-one ... (1 Reply)
Discussion started by: alindner
1 Replies

5. Shell Programming and Scripting

How to get evenly Line numbers?

hi there , i m new to unix , i d like to ask how can a get only even numbered lines matches with the word i search from txt file for example : 3461:1.D. The copyright laws of the place where you are located also govern 3471:1.E. Unless you have removed all references to Project... (17 Replies)
Discussion started by: brhn
17 Replies

6. Shell Programming and Scripting

More with line numbers

Hi All, How to get line numbers when we more on a file in LINUX thanks firestar (1 Reply)
Discussion started by: firestar
1 Replies

7. Shell Programming and Scripting

Removing Line numbers

Hi all, I have a file consisting of lines in such a format: separated by space and M1 EOS for fullstop (.) ] e.g M1 I M1 have M1 a M1 file M1 consisting M1 of M1 lines M1 in M1 such M1 a M1 format M1 EOS M2 This M2 is M3 an (4 Replies)
Discussion started by: my_Perl
4 Replies

8. UNIX for Advanced & Expert Users

Add line numbers to end of each line

Hi i would like to add line numbers to end of each line in a file. I am able to do it in the front of each line using sed, but not able to add at the end of the file. Can anyone suggest The following code adds line number to start of each line sed = filename | sed 'N;s/\n/\t/' how can i... (5 Replies)
Discussion started by: rudoraj
5 Replies

9. Shell Programming and Scripting

add line numbers

Hello.. I have got one file ... I want to add line numbers with space form starting to ending.. for example...if the file is -------------------------- sand sorcd 2345 345 recds 234 234 5687 yeres 568 988 erfg4 67 -------------------------- I need the output ... (4 Replies)
Discussion started by: esham
4 Replies

10. UNIX for Dummies Questions & Answers

Printing line numbers

Maybe this question is out there, but I searched and didnt see it. To print my files I use more filename | lpr -Pprinter I would like to print my scripts with line numbers. How do I do this? (2 Replies)
Discussion started by: MizzGail
2 Replies
Login or Register to Ask a Question