Questions tagged [vi]

Vi is a screen-oriented text editor originally created for the Unix operating system.

Filter by
Sorted by
Tagged with
0 votes
1 answer
91 views

Always hung on Vi, vim, but not nano when using company VPN

I have a strange problem. IT changed the VPN to a newer Cisco device. After connecting to the VPN, I can ssh to one of our corporate server. I can ls, cd, cat, sudo. BUT if I tried any editing using ...
user avatar
0 votes
1 answer
107 views

vi: write relative range of lines to a file

I need to be able to write a range of lines from a file to another file, I've found the :<start>,<end>w <new file> solution but what I need is to be able to search for a string and ...
user avatar
0 votes
2 answers
34 views

Return/edit "slash" search string in vi(m)

I've tried searching the web but the phrases are too general or I didn't know what to search for. If I use /(some IP address) in vi I know I can simply enter / (Enter) again and find the next ...
user avatar
1 vote
1 answer
242 views

Home and End keys not working in vi on Ubuntu 16.04

In Insert mode, when I press End I get an F where the cursor is and Insert mode is canceled. This works on one system and not another. I have checked what is installed (vim, vim-common, vim-runtime,...
user avatar
2 votes
3 answers
643 views

Disable VIM Syntax Highlighting

I am a system administrator and not a programmer. I frequently su to different system users for task so a .vimrc file for each system user is cumbersome. I need to be able to read the comments in ...
user avatar
  • 536
0 votes
1 answer
156 views

nano/vi open write protected file as a unauthorized user- Can I escalate to save?

More times than I want to admit I will open a config as a non-super user and will go about making the changes I need. As soon as I save in nano, or vi I am met with permissions errors. At this point ...
user avatar
1 vote
1 answer
358 views

Solaris "crontab -e" locking via vi

I ran into an issue yesterday with locking on Solaris and crontab editing that has me wondering what the best way to protect multiple concurrent edits of the same crontab are on Solaris. I've ...
user avatar
  • 116
-1 votes
1 answer
135 views

Why does nvi think I have files being editing?

I've got a couple of FreeBSD servers that throw several copies of the following error on reboot: On Wed Oct 10 15:13:16 2012, the user root was editing a file named /tmp/crontab.s00huOAZD2 on the ...
user avatar
1 vote
1 answer
7k views

Modifying xml definition of a running KVM domain via script

How can I modify the xml definition of a VM over ssh? I know that I can do this interactively by logging into the host and using: virsh edit <domain name> But I want to automate this ...
user avatar
7 votes
1 answer
2k views

Linux: Lost internet while using vipw. How can I unlock the file?

I was editing the passwd file with vipw, when I briefly lost internet connectivity. When I logged back in and tried to edit again I get the error: vipw: Couldn't lock file: Interrupted system call ...
user avatar
-1 votes
1 answer
225 views

is it possible to know whether someone else has opened file in ec2-linux [closed]

We guys work collaboratively. Sometimes more then 1 have opened same file in vi editor. Can I know there who else has opened that file in amazon ec2 instance? Also if I can know what changes made by ...
user avatar
-2 votes
1 answer
820 views

Unable to set a cron job in Centos [closed]

I recently got an VPS to experiment, I have installed Centos and is trying to see if I can setup hostbill and run it from there. The installation all worked out well but I am stumped when it comes to ...
user avatar
  • 215
-3 votes
1 answer
125 views

editing files on remote server with Vi not recognised when I refresh my browser [closed]

My server is running on Apache Linux. I'm very new to this area. Is there a default folder where the website files are stored? I mean I thought I had it - the first one in the list below, but it doesn'...
user avatar
  • 101
7 votes
7 answers
14k views

How can I open a file with line numbers displayed from the command line in 'vi'?

I've seen so many examples/usages about how to display/hide line numbers in vi edit mode. To turn on line numbers: Type :set number in edit mode To turn off line numbers: Type :set nonumber in edit ...
user avatar
  • 1,419
0 votes
1 answer
155 views

how to monitor any changes to any file by using vi command

Im looking for a tools (script) for monitoring my systems for any changes on any files by using vi command. For example: one dba open alert.log with vi and modify it and save.. i need to trace these ...
user avatar
4 votes
2 answers
243 views

best ways allowing a group to edit some /etc files

we have a group called JBossAdmins and users of this group must edit some /etc files on a RHEL 6: /etc/httpd/* /etc/java/* /etc/jboss/* my first idea was to give the following sudo permissions: %...
user avatar
  • 1,451
2 votes
1 answer
1k views

Linode Lish Shell Vim and Nano rendering troubles: lines not appearing / cursor positions wrong

I'm using a linode VPS and I just cloned one of my servers to my development server as I've done many times before. As usual SSH is inaccessible until /etc/network/interfaces is correctly updated. I ...
user avatar
2 votes
5 answers
453 views

Textmate alternative with vim? [closed]

Is there a way to use the vim editor like the mac textmate editor ? I am searching a easy configuration or plugin. a split screen or a panel for directorys currently opend files or many cool stuff ...
user avatar
  • 239
10 votes
5 answers
21k views

How to enable color in Vim over SSH? [closed]

I have two remote servers: Server 1: Linux 2.6.18-238.12.1.el5PAE i686 / VIM - Vi IMproved - version 7.0.237 Server 2: Linux 2.6.18-338.19.1.el5.lve0.8.36 x86_64 / VIM - Vi IMproved version 7.0.237 ...
user avatar
  • 2,683
-2 votes
1 answer
1k views

Vi how to search for numbers [closed]

I want to search for the occurrence of 100169200 I typed /100169200 but vi says Pattern not found Edit Since the question has been downvotes, I would like to make it clear that grep can find the ...
user avatar
  • 229
11 votes
4 answers
129k views

How to save + close file when editing in bash?

OK - I am linux newbie - I am trying to edit a file from bash via edit <filename> command in whatever the default mode is (I am assuming 'vi'?). Problem is for the hell of me I cannot how to ...
user avatar
  • 435
2 votes
2 answers
122 views

How to keep the top lines of a file while scrolling down the page in vi editor

I have a file opened with vim, how do I keep the top 10 header lines at the top all the time while I scroll down the page?
user avatar
  • 21
0 votes
2 answers
2k views

cat or vi a file, hangs

we're having some issue on a SUN 5.8 machine. first of all, the server is on his network (i.e. 10.x.x.x) and we can login using an ssh server which is on another network (196.x.x.x), so there're ...
user avatar
  • 3
2 votes
3 answers
333 views

alias to replace a text in file

here is a practical situation.I facing some of my files where there is a common string in these files.I usually will open vi and do some thing like :%s/text/replacement/g and I have to do it in ...
user avatar
3 votes
1 answer
376 views

Command output in vi editor

I open a text file using vi editor in linux and want to insert date command output without exiting vi editor. What is the trick? Thanks
user avatar
  • 836
10 votes
3 answers
3k views

Can I log vi activity?

Is there any method to log vi activities? I suspect that another user is issuing commands by going into the shell inside the vi editor, apparently those command doesn't record into history.
user avatar
  • 836
1 vote
6 answers
4k views

How to set up "vi" shell environment as default

I'd like to use vi (set -o vi can do the trick) as default in my shell instead of emacs, but I do not want to put it into bash startup scripts. Why? Because I work as verification engineer and I am ...
user avatar
  • 1,191
2 votes
2 answers
1k views

ctrl-v key on AIX

I'm new to AIX and I miss some tricks that work well on other *nix flavors. I need a CTRL sequence in a ksh scripts, like ^[ (CTRL-[) and to do that I'm habit to use the ctrl-v [ , but here it doesn'...
user avatar
  • 1,187
30 votes
7 answers
29k views

Why do I not have syntax highlighting when I sudo vi <filename>?

I don't understand how to allow syntax highlighting in files I'm editing via vi when using sudo. When I sudo vi <filename> the terminal is only black & white of my terminal settings. In vi ...
user avatar
1 vote
4 answers
2k views

Is linux VI editor different from vim editor

I want to use one editor which is available across all the system. Someone told me VIM is best and i tried on ubuntu and VIM was not there but vi is there. SO which one should i use
user avatar
3 votes
4 answers
1k views

How to use cursor keys in vi under screen?

If you run vi/vim in screen, when you press a cursor in insert mode, you get a new line + a character, which is a pain. How can I configure vim to move around instead?
user avatar
  • 1,301
0 votes
7 answers
2k views

vi syntax to comment out non-commented lines (cron)

Anyone know if it's possible in vi to replace only uncommented/non-blank lines with comments? If I want to replace a commented line with something I know I can use :%s/^#/##foo##/g -- but I am ...
user avatar
4 votes
7 answers
25k views

how do I use the # key in vi? [closed]

How can I make a number sign show up???
user avatar
  • 839
2 votes
3 answers
2k views

VI Editor on Ubuntu using VIM Short Cuts?

I installed Ubuntu and I tried to use the terminal's vi editor. The editor is using a different set of short cut keys that I'm not familiar with. Someone told me it's probably using the VIM short ...
user avatar
  • 7,063
13 votes
4 answers
3k views

Save file after forgetting to open as root / sudo vi [duplicate]

Possible Duplicate: vim re-edit as root I could have sworn I saw this question asked. But after looking though every search result for "vi" I'm stumped/lazy. I've opened a file, made an edit and ...
user avatar
  • 6,837
3 votes
1 answer
1k views

Can vim execute buffer without addons?

If editing some script in vim, a file with .py or .sh extension, is it any build-in vim command that allows to run such file? I know it's a lot of IDE-like addons for VIM that allows to execute files ...
user avatar
  • 3,295
6 votes
3 answers
3k views

bad interpreter: Text file busy

For ages I've gotten used to editing Perl CGI scripts in "vi" and simultaneously having a browser open to test them. Lately, I've been getting "500" server errors when I do that, and when I run the ...
user avatar
  • 2,135
10 votes
4 answers
22k views

Change default crontab editor to nano in FreeBSD

When I edit the crontab using crontab -e it opens the crontab in vi. I'd prefer it to use nano. How can I change this? EDIT: For some reason the export command returns command not found. And ...
user avatar
  • 1,468