Tagged Questions

Questions about the text editor "vi" or "vim"

learn more… | top users | synonyms

2
votes
1answer
39 views

Vi syntax highlighting for words followed by a parenthesis

I want to change the color of a keyword that is followed by a left parenthesis in a .R file. For instance, when I type length(), I want the word length to be highlighted (and not the parentheses), ...
0
votes
1answer
34 views

Working with plain vi not vim

I was trying to learn working with vi, the plain 'vi' that ships with most of the operating system, but that 'vi' seems to be missing lot of features. When I tried to excute ":ls", it gave me error ...
1
vote
0answers
20 views

pressing arrow keys in vi inserts alphabets? [duplicate]

I am new to vi editor.I am using to edit one of my file. But when i opened it through vi i can't edit it properly. when pressing arrowkeys it inserts ...
1
vote
2answers
130 views

Why ubuntu has vi , emacs ,nano with os default?

I am new to ubuntu ..So basically an OS has an app for a purpose.. But ubuntu has three basic text-editors..like nano, vi, emacs ... So what is the reason for that? and what are the advantages and ...
0
votes
1answer
79 views

vim NERDTree | Auto fresh the directory pane

How can you auto refresh the directory panes automatically in vim NERDTree? I know you can press R to refresh manually but I want to have it refresh automatically. This is particularly helpful when ...
1
vote
1answer
59 views

Error detected while processing /home/kiran/.vimrc:

I m getting an error message when I am opening vi editor. the error message is here. kiran@kiran-HP:~/Desktop$ vi hello.c Error detected while processing /home/kiran/.vimrc: line 1: E481: No range ...
21
votes
9answers
4k views

Are there cases where vi is the only option?

Are there scenarios where vi is the only option to create, edit or modify a file in an Ubuntu environment? My question is basically to really know if there is such a case where I would be forced to ...
0
votes
1answer
204 views

Why do I get these .vimrc errors in Ubuntu 14 after upgrade from Ubuntu 13?

I get errors for all these commands when I try to use vim (though vim then works): autocmd BufWritePre *.rb :%s/\s\+$//e set filetype off filetype plugin on filetype indent on syntax on " Turn on ...
7
votes
4answers
697 views

how to redirect bash command output to vim

I am trying to redirect the output of a bash command into a new file. If I try the pipe as below : ls -la | vim Bash shows me the errors : Vim: Error reading input, exiting... Vim: preserving ...
2
votes
1answer
303 views

Uninstalled vim, now can't install it again

I have removeded vim-tiny to get full installation following this tutorial and now I can't install vim by: $ sudo apt-get install vim Reading package lists... Done Building dependency tree ...
1
vote
2answers
38 views

how does ! effect sort in vim

I am trying to sort the contents in my text file using the command :1,$sort This results in lines arranged in order based on the starting character - symbols, capital letters and then small letters ...
3
votes
1answer
110 views

how to re-use last vi command

How does one re-use a just-executed command in vim? For example, I open a file with: vi myTestFile Then in normal mode, I search for a word using: /mysearchword\c <Enter> Now I want to ...
3
votes
1answer
260 views

vim command does not work

I am trying to open vim on my Ubuntu 14.04 64 bit by entering the command in the terminal : vim But i get the response : The program 'vim' can be found in the following packages: * vim * ...
0
votes
2answers
86 views

Can I write a file with only read permission?

I just set a read only permission to a file using chmod 400 filename.txt after that I open the file via vi editor and edit and try to save using :w then is says E45: 'readonly' option is set (add ! to ...
0
votes
0answers
20 views

key mismatch in vi editor

I have installed ubuntu 14.04 lts in my acer laptop. All the functions are working except vi editor. When I try to enter some text using vi editor,the responces are mismatching. For example when I ...
0
votes
0answers
56 views

How to clear the screen on vi exit?

In my experience on many different servers, vi has always cleared the screen when returning to the shell. But on my new Ubuntu VPS, it does not. The contents of the file stay on the screen until new ...
3
votes
2answers
128 views

Geany symbol menu in VIM

On the Geany editor there is symbol tab which when you pass one C program to Geany it shows all functions and classes and variables and macros in the list . So is there any ability like that in VIM? ...
15
votes
4answers
6k views

What does Vi stand for?

I was just wondering what "Vi" means in Linux (the command used for editing files)?
0
votes
1answer
64 views

show only few lines after match pattern found in vi editor

I would like to see only first 5 lines after the match found in vi editor. What is the command? I only know these commands /Incident Id: Gives all lines from first to last :g/Incident ID: gives ...
0
votes
3answers
67 views

Shell Commands for System Administration, and gudie to Vi editor [closed]

I'm very much interested in shell commands In fact,I know some basic commands. But I want to learn more about them. Are there any good resources? I'm interested to learn more about vi editor too.
5
votes
5answers
2k views

How do I install and get started with vim/vi?

I really hope someone on this subject can help me. I recently enrolled for a programming course and one subject requires me to program in c/c++ on Linux os. I've had previous c++ experience on the ...
0
votes
1answer
173 views

How to uninstall the vi text editor preinstalled in Ubuntu?

I would like to uninstall the vi text editor which is pre-installed in Ubuntu. How would I achieve that?
2
votes
2answers
140 views

Unable to use 'vi' on Ubuntu 12.04

Whenever I try to open any text file using vi or vim, I get the following error, vim: error while loading shared libraries: libtcl8.5.so.0: cannot open shared object file: No such file or directory ...
0
votes
3answers
427 views

Unable to edit using vi

I'm trying to edit my /etc/network/interfaces file to add a line for a proxy server. I first "sudo su -" to be root, and then "vi /etc/network/interfaces". But once I'm in there, I'm unable to edit. ...
0
votes
1answer
79 views

What do these vi commands do?

The first one is: .,+15s/first/second/g I know that the . simply repeats the last operation but i'm not familiar with the rest of it. The other vi command I would like to know is: 10yy (followed ...
3
votes
3answers
483 views

Executing vi on directory does not list files

This seems like a new bug (feature ?) that’s creep into Ubuntu 13.10. When I execute vi on a directory it doesn't list the files which I can navigate to with the arrow keys; it just shows an empty ...
0
votes
1answer
252 views

Terminal/Putty showing control characters (^M) after updating

I updated my system yesterday afternoon using the recommended updates from Update Manager. After it completed, I shutdown my system and went home for the day. I come in this morning and I am getting ...
7
votes
3answers
9k views

Hitting arrow keys adds characters in vi editor [duplicate]

When I tried to use arrow keys in insert mode in vi editor the following characters are being inserted in the editor: for ↓ I get B, for ↑ I get A, for ← I get D, for → I get C. Please help me in ...
1
vote
0answers
110 views

backspace in vi editor in ubuntu12.04.2 LTS doesn't work

As we know that vi editor has three modes namely: command mode,input mode & ex mode.By default,we get the command mode when the editor is evoked. Also we can navigate to other modes by using ...
0
votes
1answer
317 views

VI Editor messed up.. Even the old vi is not working now

I am a newbie in Ubuntu. I am using a Windows XP machine (32 bit) OS and in that I installed VMPlayer and got iso image of Ubuntu 12.04 (downloaded from online). I started the Ubuntu and everything ...
-2
votes
2answers
120 views

Is there a vi file editor in ubuntu like in unix?

I was a unix and redhat user, just started to use ubuntu. Is there a vi command to edit files? Is there a change mode command to change a file status to executable?
2
votes
3answers
376 views

Problem with text deletion in vi editor

When I am writing C code on the vi editor, I am not able to use the backspace keys or my arrow keys to delete or navigate through lines. Some unexpected special characters occur on the screen that is ...
0
votes
1answer
786 views

cannot type in vi when trying to edit the interfaces file

I am trying to edit the interfaces file so I can put in my network settings. This is what I'm typing: sudo vi /etc/network/interfaces The file pulls up fine. I seem to be able to delete all rows, ...
1
vote
1answer
509 views

vi default editor - command-line find/replace [duplicate]

New to linux :-) In my .bashrc I have set -o vi. That way when I'm in the terminal I can press CTRL +{ and then use VI commands to navigate, edit and search the command history. One thing I cannot ...
0
votes
2answers
129 views

Is using vi to view log files in PROD servers not recommended?

We have Ubuntu servers in production. Our lead architect tells me we should not use VI to view log files. Instead use cat. I want to know if there is any inherent risk associated with using vi/vim to ...
0
votes
1answer
2k views

Backspace and arrow keys not working in vi editor

The backspace is unable to erase the characters. The navigation keys produce alphabets. Can anyone tell me how to fix this?
2
votes
1answer
909 views

Solarized color name not defined

I recently installed the Solarized theme for gnome-terminal in Ubuntu 12.04, but now, every time I used vim, I receive the warning "Warning: Color name "S_base03" is not defined". This warning is ...
13
votes
3answers
19k views

Backspace in insert mode in vi doesn't erase the character

I am new to vi, actually I have started learning vi from today and I have got stuck at the behavior of the backspace key. Actually when I fired up vi on my Ubuntu 12.04 for the first time my ...
0
votes
1answer
108 views

Getting VI to auto syntax highlight and autoindent

I prefer using vi from tty1 as I hate GUI. I've just begun programming in C and would like to know how to get vi to auto indent for me. I would like the following code to appear just like the way I've ...
3
votes
4answers
5k views

ubuntu terminal is not working properly in vi editor

Recently I installed ubuntu in my laptop for using c programming. but when I open the terminal and typed vi test.c, It open it but it will not work properly. when i pressed backspace it will not work ...
9
votes
1answer
3k views

vi, getting multiple “Sorry, the command is not available in this version…” after reinstall

From my .vimrc, getting: line 16: E319: Sorry, the command is not available in this version: filetype on line 17: E319: Sorry, the command is not available in this version: filetype plugin on ...
2
votes
2answers
3k views

How to delete the .swp files when working remotely

I opened a file in vi, but unfortunately while changing it the terminal crashed. Now when I Try to open the same file again in a new session it displays the following message E325: ATTENTION Found a ...
6
votes
2answers
345 views

Terminal got hanged when editing something in vi

I was making some changes to a remote file in vi using the terminal when I accidently pressed Ctrl+S instead of :wq. Now everything got hanged. I tried Escape,:q! and all sorts of vi commans but ...
43
votes
7answers
91k views

How to copy paste contents in VI editor?

I tried using CTRL + V for pasting contents in a VI editor document, but CTRL + V is not interpreted as a paste.
6
votes
3answers
7k views

Vi - Insert mode doesn't work in ubuntu 12.10

I am working on ubuntu 12.10, and my insert mode in vi isn't working. When I hit i to go insert mode, nothing happens. On hitting i again writes i on terminal, but <-backspace doesn't remove ...
7
votes
3answers
42k views

How do I save files edited with vim?

I can't save changes after editing sudo vi /etc/network/interfaces Text before editing: auto lo iface lo inet ... Edited to: auto eth0 iface eth0 inet dhcp What key combination or sequence ...
2
votes
2answers
592 views

use output from alias command as filename to open in vi

I set up an alias this morning to help finding the latest log file in a directory. My alias looks like alias latest="ls -lat | grep ^- | awk '{print \$8}' | head -1" In my research so far this ...
12
votes
3answers
6k views

vim is not remembering last position

My Ubuntu LTS 12.04 has vim editor. If I open a file, move to a paragraph and reopen vim, then the cursor goes to beginning of the file always. This is not the expected behavior. How the vim can ...
4
votes
2answers
14k views

How to edit a file in vi editor (arrow keys prints letters)?

I am open a file in vi: vi index.php Here the problem is: when I press the down arrow and it prints 'B'. Why it prints 'B'?
-3
votes
1answer
60 views

UNIX or Vi fixing list [closed]

this is in a file called numbers.txt in the current working directory. Starting from a UNIX prompt, give the sequence of UNIX/vi commands, that will "fix" the list of numbers in as few keystrokes as ...