Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [vi]

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

5
votes
2answers
193 views

How to install vi?

How do I install the vi editor in Ubuntu 18.04? I want to try vi, not vim. I am just curious to see how it works. Thanks!
0
votes
1answer
164 views

Is there an easier way to edit a text file in ubuntu? [duplicate]

I need to edit the etc/bash.bashrc file but the VI is being a little complicated. Is there a way to access the folder directly? Not by cmd, and edit by the text editor?
0
votes
2answers
259 views

Problem with `vi` editor

When I open a new file using vi command: vi <new file name> After entering into file and typing the data I am getting the characters like A, B, C, D when I use <, > arrows in order to ...
1
vote
1answer
3k views

E325: ATTENTION swap file already present error in Vi

I have changed my environment variables before now. When I am trying to use the following command: sudo vi /etc/environment I am getting following warning/error and I am confused about what to do ...
0
votes
1answer
300 views

How to remove carriage return in vi

I have a file that's failing due to a single carriage return at the end (0x0D). It was originally a carriage return/new line combination (0x0D, 0x0A). I've tried: deleting it in INSERT mode (deletes ...
0
votes
0answers
40 views

Functions of the vi editor working differently after updates

It appears that after some of the updates for my ubuntu 16.04, certain keys in the vi editor started to work differently. In particular, the function of returning to the previous position, ...
3
votes
1answer
497 views

Why does Vi add the letters ABCD when I press arrow keys in insert mode? [duplicate]

I am using Ubuntu 16.04 LTS. I have a file I open in the terminal with vi abc.txt, and to edit/insert some text into it I press the insert button. When I press the arrow keys ↑/→/↓/← it inserts the ...
0
votes
0answers
31 views

Why is default vim without clipboard?

Is there any reason why default vi and vim come without clipboard support? I'd expect global register to be active by default. Don't know why I have to install vim-gnome or vim-gtk to enable this.
0
votes
1answer
372 views

How to set environment variable through vi in Ubuntu 16.04

I'm trying to set my java environment variable but I am new to Ubuntu so don't know how to update it through Vi. I want to do the following things: Edit the environment file # vi /etc/environment ...
0
votes
0answers
26 views

Why No Action on GVIM crashes on 17.04 Unity

I do not understand why there has apparently been no action on the constant crashes in vim-gtk3 in Unity. The askubuntu entry shows no activity in the last 6 months. I would actually like to go to ...
0
votes
0answers
336 views

“Insert” Key in not working in vi mode

The "insert" key on the keyboard is not working, pressing Insert key does not take to Insert mode, whereas pressing Shift+i is taking to Insert mode.
-1
votes
2answers
669 views

16.04: crontab -e editor settings / Python syntax highlighting in vim

crontab -e defaults to using vi for editing. This is not usually a problem. vi is an excellent editor, and easy to learn. Recently I've begun to use vim which is installed by sudo apt-get update ...
1
vote
2answers
103 views

how to replace word in vi editor globally in ubuntu

I want to replace the word "windows" globally in vi editor, by using any command. The text to modify is: windows is choice of everyone windows is choice of student windows is choice of engineer ...
3
votes
2answers
668 views

How to substitute the nth occurrence pattern in VI editor

The contents of the file This is a demo file ******************* This is the 1st line the the the. This is the 2nd line the the. This is the third line the the. This is the 5th line. This is the 6th ...
0
votes
1answer
63 views

How to enable syntax highlighting in vi while using the global command?

Opening a file with vi nicely highlights its contents. However, I want to view the file with all lines containing clock_gettime hidden. By using the global command :g!/clock_gettime I get the ...
18
votes
3answers
4k views

How to open two different files using the vi editor?

I have two files in different locations and I want to open these two files with the same vi command. How can I do it? File 1 location: /home/rs/rest.pl File 2 location: /home/dev/grd.pl
9
votes
5answers
22k views

What editor can I use as a simple vi/vim alternative?

I'm a Windows user coming to Ubuntu's Bash thanks to WSL. Now I need to edit some files and I really hate Vi. Do I just have to deal with it, or is there a simpler alternative? The features I am ...
0
votes
1answer
664 views

How do I make the cursor color the inverse of the character color?

If I type {} inside the gnome terminal and move the cursor over { or } the color of the cursor changes to the color of the { character, so I can't see the { character. How do I make the cursor color ...
-1
votes
2answers
432 views

vi settings look off in 16.04 [duplicate]

After starting to use Ubuntu 16.04, I find that many reasonable vi settings are off (before that I was on Scientific Linux, don't remember which version). This includes things like language ...
0
votes
1answer
237 views

vim `set nocompatible` not work in tmux

i install vim and tmux and config both of them, when i open vim directly everything is fine and works very well , but when i run tmux and inside tmux open vim , vim act like vi!. i don't know what is ...
0
votes
0answers
41 views

In VI editor some keys are not working [duplicate]

I am using the improved version of vi editor. However, in vi some keys like backspace, up and down are not working. If I want to erase any character it is not deleted. How can I solve this? I'm using ...
2
votes
1answer
3k views

Syntax Highlighting vi editor [duplicate]

How to enable syntax highlighting features in vi editor ? I am currently using ubuntu 16.10. Here is the output of vi --version. VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Nov 24 2016 22:32:42) ...
1
vote
0answers
464 views

Syntax highlighting error in syncolor.vim with VIM 8.0 on Ubuntu

I recently installed VIM 8.0 on my Ubuntu 14.04 machine. When I open vim, it outputs an error: > vim ~/.vimrc Error detected while processing /usr/local/share/vim/vim80/syntax/syncolor.vim: line ...
0
votes
1answer
286 views

How to Fix Vi Editor?

A couple of days back, I was trying undergoing a tutorial from KernelNewbies and as it asked, I did made some changes to vi editor. But, it seems that I have messed up something. I am unable to find ...
2
votes
3answers
33k views

paste the contents of one file into another file using Vi [closed]

How can I copy content from one file, and in another file somehow delete the original content and then paste the contents of the first file using vi editor? Or can it be done using another editor ...
1
vote
0answers
312 views

syntax highlighting in vi changed after upgrading Ubuntu 16.04

First, read this question below: problem in terminal syntax highlighting It also changed the default syntax highlighting in terminal after upgrading UBUNTU. There is a difference between ver.14 and ...
7
votes
3answers
7k views

jump to some specific line on vi editor

Can anyone suggest , how to jump the line in vi editor ? Once I open any file using vi editor and I have such a line : printf("...
12
votes
5answers
756 views

Finding file name οf currently open file in vi on terminal

How do I check the file name that is open in the terminal? That is, how do I check which file is open now in the terminal? Now whenever I want to see the file name I have to exit and then have to ...
-1
votes
2answers
847 views

Show insert/command in vi

I remember somehow being able to show at the bottom of the screen that I am in --insert-- or I am in command mode. I am running Ubuntu 16.04 LTS.
0
votes
1answer
1k views

How do I save after editing a file in terminal using Vi in Edubuntu? [duplicate]

In page it says in order to solve a problem in Apache 2.4, we have to create a configuration file inside the conf-available directory. For example servername.conf. sudo vi /etc/apache2/conf-available/...
1
vote
1answer
606 views

How to make vim code folding colors more readable

I use code folding in vim, e.g. za, zc, zR, ZM But when the code is folded the resulting color - light blue on white is very hard to read for me with poor contrast I have tried changing my profile's ...
-1
votes
1answer
704 views

Command-Line: nano VS vi

What is the difference between the command-line text editors 'vi' and 'nano'? Can someone explain this in detail and why many people prefer 'vi' over 'nano'? Thank you.
1
vote
2answers
213 views

On Aquarius M10 Ubuntu Tablet— Terminal-Created Files Aren't Recognized By Gedit and LibreOffice

When I use the Aquarius M10 with the Terminal app, I can use the "vi" command in the Terminal to create a file and save it in $HOME. When I subsequently launch Gedit, the "Open File" dialogue in ...
0
votes
3answers
216 views

Is it possible to have both vi and vim installed so that they can be used separately?

I can't use vi, well, I can, but I would much prefer vim, however I need to share a computer with someone who hates vim and can only use vi... After installing vim I find that if I use the vi command ...
3
votes
1answer
5k views

Edit crontab with an editor other than the default

I would like to edit crontab with vi once. My default editor is nano, and I want to keep it that way. I only want to edit with vi one time. I don't want to change the default to vi then back to ...
0
votes
1answer
98 views

facing problems with vi editor in CLT

My keyboard keys are not working properly in Command line terminal when i use "vi" command to edit a file or write a program.backspace doesn't work. arrow keys doesn't work and are printing A B C D ...
3
votes
2answers
143 views

What is the difference between /: and : in vi?

Is the a difference between /: and : in vi?
3
votes
1answer
6k views

How do I set line number in VI Editor [duplicate]

I am using the VI editor in Ubuntu and I have maximum usage of VI editor. to see the line number in vi i am using like below: :set nu I want to set it default when I open a file in vi editor, that ...
0
votes
0answers
34 views
0
votes
1answer
99 views

Problem on terminal of Ubuntu 12.04 LTS [duplicate]

I installed Ubuntu 12.04 LTS in Windows 8.1 using vmware workstation. When I open a file in the terminal using vi filename.c, the arrow buttons will not work properly, pressing up arrow prints A, down ...
0
votes
2answers
1k views

Remap Caps Lock to Esc and Ctrl

After watching some videos about tmux and vim collaboration I wanna remap Caps Lock on my ubuntu. Remapping Caps Lock to Esc is easy I used gnome-tweak-tool, but now I wanna change Caps Lock ...
0
votes
2answers
278 views

apt-get problem and arrow

hey guys I am new to ubuntu I am trying to use the command "apt-get install vim" but it actually not installing I cannot understand what that means so i am copying it down what the terminal is ...
4
votes
4answers
3k views

How to copy a line in vi and paste it to console?

There is a text file with bash commands. Is there a way to copy a line from that file using vi and paste it to console? It may be nano as well. It is console only server installation. No mouse to be ...
1
vote
1answer
86 views

Vim in shell allows <alt>[a-z] to circumvent having to press <escape> to get out of INSERT mode. How can I apply this to Gui implimentations of Vim?

Vim in shell allows <alt>[a-z] to circumvent having to press Esc to get out of INSERT mode. For example, Open up a terminal and set its editing mode away from emacs, to vi set -o vi Now enter ...
0
votes
1answer
289 views

vi is coded and I cannot read it

I don't know why, but my vi editor seems to be encrypted. This is the test I ran. gnome-open /usr/share/doc/xdemorse/examples/xdemorserc.example.gz When I did this I could read it just fine. ...
3
votes
3answers
966 views

vim mapping from q! to Q!

I was trying to map 'q!' to 'Q!' in .vimrc ? I tried the following but not working. :command Q! q! Please provide any suggestion to mitigate this issue. Thank you.
2
votes
2answers
383 views

Remove vim indents when I paste directly from system clipboard

I have a problem with vim when I paste something it puts them in by placing in each newline. How can I set default settings of vim.
1
vote
1answer
102 views

plain text can be enctypted like password in vi editor? [duplicate]

Can anyone tell me, How to plain text can be enctypted like password (********) in vi editor or using vi editor or any other method ?
2
votes
2answers
4k views

Using “dd” in Vi (delete multi lines) not accepted if number of lines > file length

I often edit a file locally then cut and paste it into a remote ssh session inside a vi session. The first step is to delete the entire contents by doing something like 9999dd Which will delete up ...
0
votes
1answer
188 views

How to make geany or vi understand Maxima (or any other less known) syntax

I tend to program a lot in a symbolic language called Maxima, but I haven't found any editor that highlights its syntax. Is there I way I can make vi or geany (or whatever) understand this syntax and ...