Questions tagged [vi]

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

Filter by
Sorted by
Tagged with
0
votes
2answers
86 views

How do I copy in vi editor?

I am using vi editor and I want to do copy operation but unable to do it. When I select the word and right click on it, there is no "copy"option but only "paste" option is there. What is wrong going ...
-1
votes
3answers
63 views

Ubuntu 18.04 change default editor

I am using Ubuntu 18.04. The default text editor now appears to be nano. I want to set it to always be vi. Other posts suggest the following command, however this command does not list the vi I want ...
0
votes
0answers
17 views

Unicode not showing in UXterm after modifying .Xresources

I use nvim within Xterm. But it has no unicode characters (if I write for example CtrlV u2713 nothing appears, just a blank space). So I decided to switch to UXterm, where the unicode characters do ...
4
votes
2answers
234 views

How can I install the minimap plugin for vi or vim?

My System Ubuntu Desktop 18.04 LTS Window Manager: i3WM No virtualization. Native install. Parts of this question comes from my post on Facebook Some days ago I was trying to identify this ...
0
votes
1answer
78 views

How to paste code into vim without super indenting issue

I paste into the gedit text editor and that' s ok (on the left). But when I paste into vim (on the right) i get the weird 'too much indenting' issue. Also it's not immediately fixable with selecting ...
0
votes
0answers
54 views

Why does middle-click paste under terminal suddenly put Vi in insert mode?

I use vi in many cases for mass editing. In some cases, I have to repeat certain complex commands many times. I'm used to selecting my commands in a text file, then repeatedly middle-click to put ...
1
vote
1answer
530 views

When I modify /etc/security/limits.conf I get “E45: 'readonly' option is set (add ! to override)” [duplicate]

I'm trying to increase the open files limit for Ubuntu 16.04 version by using vi /etc/security/limits.conf Then I add two lines like: #* soft nofile 4096 #* hard nofile 4096 But when I use :x to ...
0
votes
0answers
50 views

E45 'Readonly' option is set, vi won't save file changes even with sudo [duplicate]

I am the only user on my laptop. I want to do some changes on readonly .conf file for netbeans and after hit ESC and try to save I get this error E45 'Readonly' option is set. Even though I opened the ...
0
votes
0answers
46 views

code alignment in the file

after writing a piece of code if it is not alligned we go into ESC mode and press v then select entire text and press = . This will allign the entire code, but how to set permanent alignment without ...
0
votes
0answers
1k views

Vim: Warning: Output is not to a terminal while using vi and grep

I am running the following command to view error log vi mysite_com_error.log-2019060 | grep 'Jun 08:23' but I am getting the following error: Vim: Warning: Output is not to a terminal
1
vote
1answer
112 views

Dockerfile ubuntu and docker builds and commands

I'm curious on how to write to a file with docker commands etc.. Let's say i want to build a file like so: RUN touch newfile.php Now how do i write to that file after it's built in the dockerfile ...
0
votes
2answers
108 views

Add # (pound) sign at begining of the line matching.(search string : file path)

file: sh xyz/abc/www/def/gef/rqs/ sh xyz/toh/aaa/def/gef/rqs/ sh xyz/123/qqq/def/gef/rqs/ I want changes like this sh xyz/abc/www/def/gef/rqs/ #sh xyz/toh/aaa/def/gef/rqs/ sh xyz/123/qqq/def/gef/...
0
votes
1answer
81 views

how to save terminal files that you opened with “$ sudo vi” [duplicate]

I am currently following a tutorial that asked to open a file with "sudo vi /..." first and formost I have half an understanding of how to type but I managed and now I need to save the file but how do ...
0
votes
1answer
82 views

gnome : where does my keyboard input go?

I run Ubuntu 16.04, terminals using gnome-terminal, and bash as shell. Sometimes, one of my terminal becomes unresponsive : when I press keys on my keyboard while the terminal is focused, nothing ...
8
votes
2answers
9k 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
3k 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 command line, and edit by the GUI text editor?
29
votes
1answer
5k views

What is '@!' file?

I have a filename @! in my home folder. When I open it, it has the same content that my other bash file myscript.sh has. I have not assign execute permission to original bash file. When I have ...
0
votes
2answers
2k 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 ...
3
votes
1answer
22k 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
8k 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
51 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
2k 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
1answer
2k 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
39 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 ...
-1
votes
3answers
1k 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
338 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
2k 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
91 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 ...
21
votes
3answers
10k 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
19
votes
5answers
58k 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
1k 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
840 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
396 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
45 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 ...
6
votes
1answer
6k 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
1answer
812 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
545 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 ...
7
votes
3answers
65k 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
426 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 ...
8
votes
3answers
13k views

Jump to some specific line in the vi editor

How can I jump the line in the vi editor? Once I open any file using the vi editor and I have such a line: printf("...
12
votes
5answers
1k 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 ...
0
votes
2answers
2k 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
2k 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/...
2
votes
1answer
1k 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
2k 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
226 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
719 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 ...
9
votes
2answers
13k 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
145 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
1k views

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

Is the a difference between /: and : in vi?