Questions tagged [vi]

Questions about the text editor "vi"

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

Set nocompatible not working in vi/vim on 22.04

I have recently installed a fresh copy of Ubuntu 22.04. When I use vi or vim, it defaults to compatible mode (i.e. arrow keys become ABCD). I have tried creating ~/.exrc and ~/.vimrc with set ...
Lexicon's user avatar
  • 339
0 votes
0 answers
183 views

Cannot scroll terminal window when in vi

With terminal settings Default/Layout/Screen Buffer Size/Height = 9999 Properties/Layout/Screen Buffer Size/Height = 9999 I can scroll in the window using the mouse wheel. Now I enter vi (a ...
wideseen's user avatar
  • 101
0 votes
1 answer
69 views

why doesn't my map command work in vi/ex?

I'm just learning how to use the vi editor, and was trying to make use of the following map command in my .exrc file: map K 0I^I^[j0O^I^[j0 That is what appeared when I created the map in ex mode and ...
user1013210's user avatar
0 votes
3 answers
422 views

How to replace a word using "vi editor"?

I have here a sample text file called employees.txt. It contains the name, streets and cities of the employees. My question is: How can I replace all city instances of "Victoria" with "...
shengton's user avatar
1 vote
0 answers
102 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 --...
Joshua Salazar's user avatar
1 vote
2 answers
1k 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 ...
Alex's user avatar
  • 19
3 votes
2 answers
3k 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 ...
Andy A.'s user avatar
  • 133
1 vote
0 answers
173 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 ...
liuqt's user avatar
  • 11
-1 votes
1 answer
1k 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 ...
rasmus91's user avatar
  • 200
1 vote
1 answer
795 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 ...
Michael Durrant's user avatar
0 votes
0 answers
470 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 ...
Zozzizzez's user avatar
  • 465
0 votes
2 answers
522 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 ...
Chan Kim's user avatar
  • 1,959
0 votes
0 answers
28 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 ...
Mark's user avatar
  • 225
1 vote
2 answers
4k 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 ...
AMITk's user avatar
  • 13
0 votes
3 answers
6k 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 ...
Peter Prographo's user avatar
5 votes
2 answers
3k 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 ...
Geppettvs D'Constanzo's user avatar
0 votes
1 answer
608 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 ...
Michael Durrant's user avatar
1 vote
1 answer
4k 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 ...
nebras junaid's user avatar
0 votes
0 answers
55 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 ...
Nano's user avatar
  • 113
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
Sugumar Venkatesan's user avatar
1 vote
1 answer
229 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 ...
yesyesyes's user avatar
0 votes
2 answers
1k 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/...
Tohid Tamboli's user avatar
0 votes
1 answer
3k 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 ...
Genesis Of Gaming's user avatar
0 votes
1 answer
376 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 ...
LeGEC's user avatar
  • 749
12 votes
3 answers
27k 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!
eeze's user avatar
  • 213
0 votes
1 answer
7k 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?
Lorena Tavares's 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 ...
d a i s y's user avatar
  • 5,511
3 votes
2 answers
7k 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
5 votes
1 answer
87k 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 ...
user716691's user avatar
9 votes
1 answer
27k 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 ...
CJ Dennis's user avatar
  • 453
0 votes
0 answers
60 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, ...
Naftali Tsitverblit's user avatar
5 votes
1 answer
8k 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 ...
D.H.N's user avatar
  • 61
0 votes
1 answer
9k 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 ...
user716691's 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 ...
James Cobban's user avatar
0 votes
3 answers
3k 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 ...
SDsolar's user avatar
  • 3,169
1 vote
2 answers
930 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 ...
muhammadmadni haider's user avatar
4 votes
2 answers
4k 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 ...
user5499810's user avatar
0 votes
1 answer
176 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 ...
Snackoverflow's user avatar
26 votes
3 answers
24k 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
sandy's user avatar
  • 263
33 votes
9 answers
139k 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 ...
sebagomez's user avatar
  • 441
1 vote
1 answer
3k 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 ...
Ole's user avatar
  • 1,477
-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 ...
Helen's user avatar
  • 101
0 votes
1 answer
651 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 ...
Bahram's user avatar
  • 73
6 votes
1 answer
10k 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) ...
Kaushal's user avatar
  • 73
1 vote
1 answer
2k 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 ...
AaronM's user avatar
  • 111
0 votes
1 answer
1k 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 ...
Doherty's user avatar
  • 33
11 votes
3 answers
117k 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 ...
Avani badheka's user avatar
1 vote
0 answers
489 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 ...
Kwangil Cho's user avatar
8 votes
3 answers
18k 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("...
Avani badheka's user avatar
13 votes
5 answers
3k 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 ...
Avani badheka's user avatar