vi is a text editor of the Unix operating system.
Questions tagged [vi]
246 questions
33
votes
3 answers
vi: how can I jump to end of file with a new line appended?
Here's an answer I want about 5 times a day.
In vi, the command to go to the end of the file is G.
But that always leaves me at the start of the last line of the file, if files don't have a blank line at the end.
How can I jump to the end of the…
Richard
- 995
7
votes
3 answers
vi: How do I save without exiting the editor?
Any way to save changes in vi without exiting the editor? I'm experimenting with php and checking my work in the browser. To get back to my code I have to reopen the php file which is an extra step.
Thanks.
Scandalist
- 3,091
6
votes
1 answer
Is there such thing as a .virc for the vi editor?
I know that you can modify Vim with a .vimrc. Does Vi , the older version of Vim, have a .virc? If so, where can I find info on it? I am trying to turn on line numbers permanently instead of activating them every time I go into vi.
Tara Roys
- 163
4
votes
1 answer
How can I save settings in VI?
I have changed tab settings in VI with set tabstop=4. But when I restart VI, the settings are restored. How can I save the settings?
Eonil
- 5,734
3
votes
1 answer
Why config file of vi is not named .virc but .exrc?
Just from curiosity I want to know why .exrc is not named .virc?
Is there reason for it?
ironsand
- 2,299
3
votes
1 answer
Close multiple files in vi
If I open multiple files in vi using vi *.py then how do I exit the whole vi session instead of editing each and every file? Seems like a simple enough issue but can't find anything on google.
Salil Surendran
- 171
1
vote
2 answers
need to get rid of strange symbols in text
I need to process the following text to get rid of the strange symbols such as:
â<80><99> â<80><9c> â<80>?
Example text:
With the mystery unexplained, the Hyatt tried to give its guests a sense of security by posting a guard in its lobby. But…
querystack
0
votes
1 answer
What's the command to open a file and jump to an specific line in vi?
It was something like
vi -line:123 myfile.txt
OscarRyz
- 4,131
0
votes
2 answers
In vi, how can I navigate to the function declaration?
In Vi, if I am in the middle of a function, how can I navigate back to the function declaration?
michael
- 5,945
0
votes
3 answers
Insert text with vi editor
I was using nano before.
I'm a bit confused on how to start inserting text, sometimes I just start typing and on the bottom I see -- insert -- and I can edit and save fine. But sometimes I just skip around without being able to go in edit mode, what…
user98645
0
votes
1 answer
How to navigate word-wrapped text files in vi
I find that navigating text files that have been word wrapped somewhat difficult in vi. If there is a line that is word-wrapped and it goes down several lines, then it is hard to navigate around this line using the arrow keys. If you're on a line…
tony_sid
- 14,321
- 53
- 141
- 195
0
votes
1 answer
Want to add # for perticular line vi editor
Hello I want to add # at the beginning for few lines where content like /vol/home12 & vol/home14, line number not in sequence so I want to change with global option for file instead of going with sequence number
Avinash
- 1
0
votes
0 answers
when I'm trying to open file in vi mode its prompting help.txt, How to resolve this issue
When I'm trying to open file in vi mode its prompting help.txt as shown below. I tried to close it by using :q, for few seconds its closing again im getting help.txt. i;m not able to edit my file. recently i;m facing this issue. can any one help me…
Aswani
- 1
0
votes
1 answer
Copying/Pasting a block of lines in vi editor
I have a strange problem when copying/pasting a group of lines within vi. For example, let us say we have a group of lines as follows:
AAAAAAAA AAAAAAAAAAAAAA
BBBBBB BBBBB BBBBBBBBBB
CCCCC CCC CCCCCCCC CCCC
If I copy these lines and paste…
0
votes
1 answer
Can tab be remapped in nvi?
I want to map tab in nvi(1). When I try to map a literal tab by typing Ctrl+V then Tab, it does not get rendered as ^I and nvi(1) shows "Usage: map[!] [keys replace]". Can tab be remapped in nvi?
Eric Pruitt
- 173