Questions tagged [vi]

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

Filter by
Sorted by
Tagged with
1
vote
0answers
34 views

vi cursor not working properly with :set nu

The cursor works as if nonu was set. It starts before the numbers are displayed and the line ends where characters would end when there was nonu set. .exrc has only :set nu. vim works without any ...
-1
votes
1answer
136 views

vi behaves very differently on Ubuntu 18.04 and 20.04, why?

So I've been increasingly making use of Vi for quick file edits, and have actually become fond of it (strange, i know) Anyhow, on *buntu 20.04+ vi behaves as if it's drunk. The arrow keys can't be ...
1
vote
1answer
95 views

How to recover my terminal vim window when I use ctrl-s to save in vim by mistake?

I have been using Visual Studio code a lot lately and like a lot of IDEs you can get used to using CTRL-S to save as it is quicker than using "esc :w" - if you are using vim bindings like I ...
0
votes
0answers
34 views

How to enable swapfiles in vim editor?

I have searched in google but i always found how to disable swapfiles. It said that we have to add set noswapfile in vim configuration file. And i tried to put set swapfile in the same configuration ...
0
votes
2answers
33 views

how to extract arbitrary amount of bytes from the beginning of a big file?

We can truncate a big file to a size we want. For example, if I want to truncate a file to 1K byte, we can do truncate -s 1K file1. But this changes the original file file1. Many times I want to see ...
0
votes
0answers
17 views

Why Vi editor can be “time-efficient” in comparison to using Nano editor? [duplicate]

I'm working through OSCP course where I'm getting familiar with terminal-based text editors. I'm quite comfortable with Nano and this material says that penetration testers have reported that Vi ...
1
vote
2answers
866 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
1k 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 ...
4
votes
2answers
1k 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
136 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 ...
1
vote
1answer
1k 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
52 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
2k 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
170 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
388 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
444 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
157 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
3answers
13k views

How to install vi (not vim)?

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
5k 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
4k 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
35k 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 ...
3
votes
1answer
14k 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, ...
4
votes
1answer
4k 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
4k 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
41 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
2k 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
470 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 ...
4
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
108 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 ...
22
votes
3answers
15k 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
25
votes
6answers
80k 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
2k 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
956 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
463 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 ...
6
votes
1answer
7k 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
963 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
747 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 ...
8
votes
3answers
81k 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
448 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
16k 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
2k 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
3k 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
3k 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
2k 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
228 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
838 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
22k 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 ...