Questions tagged [vi]

Questions about the text editor "vi"

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

Kate text cursor stopped moving through paragraphs ( [Ctrl] + [Up/Down] )

I lost the function [Ctrl] + [Up/Down] to move the text cursor through paragraphs, as in any other text editor. I just selected the option to override Kate shortcuts to use [Ctrl] + [V] inside VI to --...
user avatar
0 votes
1 answer
315 views

What is the difference between using "echo" command and editing using "vi" when making changes to .bashrc file?

I finished installing a program and some websites tell me to use the echo command to export an environment variable to the .bashrc file while others say to use vi .bashrc to edit the file directly. I ...
user avatar
  • 9
0 votes
0 answers
17 views

vi -p only opens 10 files at a time [duplicate]

I see that vi -p option has a limitation that it can open only 10 files at a time. Is there any other option along with -p to address this issue ? --Harish
user avatar
2 votes
1 answer
547 views

How to edit UTF-8 files with vim

How can I edit UTF-8 files with vim? There is a problem with german special characters like 'Ä', 'ü'. There are some in the comments. vim shows Ã~D instead of 'Ä' and ü instead of 'ü' then. (I hope ...
user avatar
  • 103
1 vote
0 answers
85 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 ...
user avatar
  • 11
-1 votes
1 answer
441 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 ...
user avatar
  • 200
1 vote
1 answer
396 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 ...
user avatar
0 votes
0 answers
150 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 ...
user avatar
  • 413
0 votes
2 answers
66 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 ...
user avatar
  • 1,237
0 votes
0 answers
20 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 ...
user avatar
  • 225
1 vote
2 answers
2k 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 ...
user avatar
  • 13
0 votes
3 answers
3k 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 ...
user avatar
5 votes
2 answers
2k 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 ...
user avatar
0 votes
1 answer
276 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 ...
user avatar
1 vote
1 answer
2k 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 ...
user avatar
0 votes
0 answers
53 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 ...
user avatar
  • 103
0 votes
0 answers
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
user avatar
1 vote
1 answer
196 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 ...
user avatar
0 votes
2 answers
693 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/...
user avatar
0 votes
1 answer
1k 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 ...
user avatar
0 votes
1 answer
247 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 ...
user avatar
  • 545
9 votes
3 answers
17k 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!
user avatar
  • 183
0 votes
1 answer
6k 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?
user avatar
29 votes
1 answer
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 ...
user avatar
  • 5,193
2 votes
2 answers
5k 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 ...
user avatar
4 votes
1 answer
53k 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 ...
user avatar
5 votes
1 answer
20k 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 ...
user avatar
  • 353
0 votes
0 answers
52 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, ...
user avatar
4 votes
1 answer
5k 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 ...
user avatar
  • 51
0 votes
1 answer
6k 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 ...
user avatar
0 votes
0 answers
43 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 ...
user avatar
0 votes
3 answers
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 ...
user avatar
  • 2,931
1 vote
2 answers
538 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 ...
user avatar
4 votes
2 answers
3k 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 ...
user avatar
0 votes
1 answer
119 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 ...
user avatar
23 votes
3 answers
19k 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
user avatar
  • 233
29 votes
7 answers
101k 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 ...
user avatar
  • 401
0 votes
1 answer
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 ...
user avatar
  • 1,417
-1 votes
2 answers
1k 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 ...
user avatar
  • 101
0 votes
1 answer
518 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 ...
user avatar
  • 73
6 votes
1 answer
8k 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) ...
user avatar
  • 73
1 vote
1 answer
1k 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 ...
user avatar
  • 111
0 votes
1 answer
871 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 ...
user avatar
  • 33
9 votes
3 answers
100k 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 ...
user avatar
1 vote
0 answers
471 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 ...
user avatar
8 votes
3 answers
17k 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("...
user avatar
13 votes
5 answers
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 ...
user avatar
1 vote
2 answers
4k 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.
user avatar
0 votes
1 answer
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/...
user avatar
2 votes
1 answer
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 ...
user avatar