vi is a text editor of the Unix operating system.

learn more… | top users | synonyms

1
vote
2answers
66 views

In VIM, how do you delete to end of line while in command mode :?

While in VIM, I have a leader shortcut for the following: :!git commit % -m 'updated '; git push; ...
2
votes
2answers
199 views

Why does the 'vi' command open 'vim' editor?

I am using Ubuntu 12.04. Not that I am complaining as I like my vim and prefer its many features. However, I’m curious as to why it does it. It is not aliased in .bashrc or .bash_profile. I am not ...
3
votes
4answers
2k views

How to copy and paste between cygwin's vi/emacs and windows clipboard?

I tried to paste what I copied in windows clipboard into cygwin's vi or emacs, and it doesn't seem to work with yy (vi) or M-w (emacs). Is there a way to do it? I learned that /etc/clipboard has the ...
0
votes
0answers
13 views

Cygwin terminal jumps into vi-mode when using back arrow, bug or config issue?

I'm new to Cygwin64 on Windows (Vista) and still working through optimizing the environment--while using it. I've already resolved Cygwin VIM editing issues by adding ~/.vimrc. In this problem, Cygwin ...
0
votes
1answer
79 views

Getting rid of characters when doing gf in vim

I am using vim for coding. When I have something like the following: SomeModule->actualMethod() if I take the cursor to SomeModule and I do a gf I get a complaint that SomeModule- does not exist in ...
0
votes
2answers
192 views

What does shiftwidth do in VIM editor

I read this about shiftwidth option on Google: To change the number of space characters inserted for indentation, use the 'shiftwidth' option. Ok Ok, but what's that more exactly? How can I try this ...
0
votes
1answer
210 views

Setting active window on Vim startup

I'm using MacVim with the Taglist plugin, which I want to be open all the time when I start MacVim. So in my .gvimrc I have the following :TlistToggle Which opens the sidebar when I load my MacVim ...
4
votes
2answers
805 views

Whats the difference between vi editor in Red Hat linux and Ubuntu?

I realize a difference in vi editor of ReD Hat and Ubuntu. In my company, I'm working in Red Hat. In that, the vi editing commands working as usual. Say, 'dd' to delete,'p' to paste, 'yy' to yank, ...
1
vote
2answers
884 views

Increase the space between lines in vim

I think the title says it all. I've done my homework and the only command that I found was: :set linespace=3 but it doesn't seem to work, neither on the Mac nor in Linux. Edit: In Mac OSX you can ...
2
votes
1answer
56 views

How to change BASH “editing-mode vi” shortcuts?

I'm trying to change my bash vi mode keys to enter and exit insert mode, I would like to set these shortcuts: Ctrl-\ : Enter moviment mode Alt-\ : Enter insert mode how can I do that? I'm trying ...
0
votes
0answers
12 views

Vi Editior Navigator Not Working Properly in Solaris 10

I am using ViEditor : This is my code of line : sh /u02/oraprod/prod/db/tech_st/11.1.0/appsutil/scripts/PROD_hooradb2/adautocfg.sh appspass=apps > $HOME/LOG/autocfg.log perl ...
5
votes
3answers
505 views

Edit text areas using vi key bindings, inside the textbox, in Firefox (without opening a separate window)

I'm using Firefox. Is there any way to edit the contents of a textbox using vi key bindings, inside the text area (not in a separate window)? For instance, is there a Firefox extension for that? I ...
7
votes
4answers
12k views

How to get rid of the warnings when opening a file that has a .swp file?

How can I get rid of the annoying warnings when I open a file that has a .swp file? Or, how do I not generate the .swp files at all? Example warning: E325: ATTENTION Found a swap file by the name ...
0
votes
0answers
21 views

PuTTY causes vi to open help.txt on SSH session

When I connect to my server running openSuse 13.1 via ssh and open any file in vi, after some time it automatically opens the help.txt (just like the action on pressing F1). If you close the "help" ...
0
votes
0answers
6 views

Show previous line of search pattern

I want to display the previous line for a search pattern for example - "TELEVISION"."CHANNEL" (TableId 0211H 4A90H) bypassed due to pending FastSearch. The pattern I use to search for is FastSearch ...
0
votes
0answers
34 views

Vi scrolling in Firefox/Chrome

Is there a way to rebind j and k to scroll pages in Firefox or Chrome, or addons available just for vi-like scrolling that aren't entire emulators like vimperator and vimium? All I want to do is ...
1
vote
1answer
54 views

VIM - How to search and replace multiple strings using leader?

I'd like to make a leader shortcut for doing multiple global search and replaces in the current buffer. For example, pressing leader then "fq", I'd like it to search and replace 3 times globally, ...
-1
votes
2answers
34 views

vi: How do I save without exiting the editor?

Any way to save changes in vi without exiting the editor? I'm experimenting with php and checking my work in the browser. To get back to my code I have to reopen the php file which is an extra step. ...
0
votes
0answers
12 views

How to make vi hex edit display similar to UltraEdit?

UltraEdit and vi both support hex edit. In UltraEdit content is very readable and easy to understand, but in vi it looks very different. How do I make both display in the same way? I use "%!xxd" ...
1
vote
2answers
422 views

Notepad++ visibility for BOM

How to use the 6.2.3 version of Notepad++.I want to know how to make visible of BOM chanracters.I tried with menu list available but no use. But those characters are available only at Linux ...
37
votes
9answers
107k views

How do i select all text in Vi/Vim?

I always use vi for editing config files. Today I wanted to select all the text in a file (around 1000 lines), copy it, then paste into Google Docs. How can I do that?
1
vote
2answers
357 views

home/end in INSERT mode in vi on a Mac

On a Mac I can go to the start and end of an line in vi, when not in INSERT mode: ^ (start of line) $ (end of line) This is for example explained here: How do I do “end” , “home”, “page up” and ...
0
votes
1answer
20 views

How to read shell and insert in text (using Emacs)?

I want to read and insert output from shell (bash) in a text using Emacs. My idea is to do something like :r!ls in vi, but using emacs.
0
votes
2answers
62 views

Terminal Program To Save VI State

For a few years now at work I have been using the GNOME Terminal, and have gotten very used to that. I usually organize my work by categorizing each task on its own virtual desktop, then within each ...
0
votes
1answer
38 views

How to apply “set number” to vi on root?

I'm using vi on centos 6.5 and added "set number" script to /etc/bashrc in order to look line numbers whenever boot. It works well to show it on user login but not root. How to apply "set number" of ...
5
votes
3answers
4k views

Display invisible characters in vim

When I compile my source with Latex, I get the following error message Unicode char \u8:  not set up for use with LaTeX. Now I suspect that this is due to an invisible character. The command ...
1
vote
1answer
66 views

Is there such thing as a .virc for the vi editor?

I know that you can modify Vim with a .vimrc. Does Vi , the older version of Vim, have a .virc? If so, where can I find info on it? I am trying to turn on line numbers permanently instead of ...
6
votes
3answers
1k views

Logged in to vi, made changes, forgot to sudo first - now what

I made lengthy changes to a configuration file on a Ubuntu Linux computer with the vi editor. Unfortunately, I forgot to sudo first, so now I'm in the editor, but can't save my changes because of ...
2
votes
1answer
254 views

vim: insert enough spaces to align text to column number

COMP_ID=` echo $SRC | sed -e 's/.*COMP_ID=//' -e 's/:.*$//'` SRC_TYP=` echo $SRC | sed -e 's/.*SRC_TYP=//' -e 's/:.*$//'` DOC_TYP=` echo $SRC | sed -e 's/.*DOC_TYP=//' -e ...
0
votes
1answer
142 views

How to add a prefix to every row of a particular column in a csv file via command line on linux

So basically i am trying to achieve the following.    File before editing.  column-1,   column-2,  column-3,  column-4,  column-5 Row-1-c1, ...
0
votes
2answers
97 views

vi copy entire line in PuTTY

I have a very long XML string in a line of a log in vi/PuTTY. It is too long to drag the mouse over to copy to clipboard. Is there a shortcut to select/copy to clipboard the entire line? I do not want ...
0
votes
1answer
50 views

inputrc windows for ipdb kybinding

I am trying to get vi bindings for python debugger ipdb. I am not running cygwin's python but the windows version from the dos command prompt. I have tried creating .inputrc in my %HOMEPATH% ...
0
votes
2answers
103 views

Insert numbered text on every even/odd line

In Vim I have the following text: Door Chair Table Uganda And I want to add numbered text on every odd line, which should give this: >item1 Door >item2 Chair >item3 Table >item4 ...
2
votes
1answer
57 views

Why does Vim still have vi-compatibility mode? [closed]

Could anyone explain why does Vim still have vi-compatibility mode? Why would one use it? As a consequence, we have to keep set nocompatible in our .vimrc; there is much noise in docs like {not in ...
-1
votes
2answers
41 views

Can I remove a file frome inside` vi `?

I want to open several files with vi or even less and delete those I don't care without going back to the shell and go to the next.
7
votes
4answers
7k views

How to get vim color mode to work in vim under cygwin

I have installed vim 7.3 under cygwin. And I have this in my ~/.vimrc $ cat .vimrc colorscheme wombat And then I have this file wombat.vim under '.vim/colors'. $ ls -la .vim/colors/ total 8.0K ...
0
votes
1answer
25 views

How do I use / interpret vi shortcuts on linux?

I've found myself in the dreadful predicament of having to use vi, and I don't understand this list of shortcuts for it. I'm in insert mode, and I want to save the changes that I've made so far and ...
0
votes
1answer
459 views

vi Error | Out of memory saving lines for undo - try using ed

While executing the following command on a large file: vi largeFile.log I get the following error: Out of memory saving lines for undo - try using ed My environment is: AIX6 I cannot add any ...
0
votes
1answer
43 views

Arrow keys not working correctly in remote vi

I'm on a linux box connected with ssh to another linux box. When editing a file with vi, arrow keys work in default mode, but when I switch to edit mode ('a' or 'i') arrow keys output letters (like ...
1
vote
1answer
3k views

Why does VIM say there are trailing characters on this command?

I am trying to write a beautify CSS command in vim that sorts and alphabetizes all of the CSS properties as well as checks to see if there is not a space after the colon and inserts one. Here is my ...
4
votes
5answers
855 views

In Vi, how do I map “:t” equal to “:tabnew”?

I don't want to always type the word. it's annoying.
0
votes
0answers
29 views

with rlwrap vi file edit not happening

Am using rlwrap,with that history fetch commands editing works fine. But in vi mode am not able to edit the file, and not able to exit from vi mode. I added following entries in inputrc, set ...
0
votes
1answer
50 views

What does “vi-move” keymap in Bash's vi mode actually do?

The keymap section in the Bash Reference Manual says that one of the acceptable options is "vi-move". There doesn't seem to be any description for what this corresponds to. I'm well acquainted with ...
17
votes
6answers
19k views

Vim to replace Vi

Guys, anyone know how to change linux console editor from vi into vim everytime we execute vi? I'm using Ubuntu and Fedora Core
0
votes
1answer
232 views

How to find special characters in Linux Vim

I want to find special characters in a text file. It is known that the UTF-8 encoded file contains Chinese characters , "-", "^A"(control-A, which is one of special characters), numbers, ...
4
votes
1answer
154 views

Abort a vim paste

Sometimes I paste a lot of data into vim (>5000 rows) and forget to enable paste mode. In that case, vim is busy for several minutes, trying to correctly indent all the text (which gets REALLY bad ...
1
vote
3answers
57 views

what's the meaning of ^@, ^I and $ in vi?

When I try to use Context.write(k,v) in MapReduce(using Java) to write data to a file ,I find the following contents in file(opened with vi, have :set list): ^@R^@u^@n^@^I1$ ^@a^@c^@c^@e^@s^@s^@^I1$ ...
2
votes
3answers
2k views

Vim is not reading gzipped files automatically

I want to see some zipped log files .gz in unix through putty. When I open them in vim the contents are not readable. I think vim is not able to unzip them.
-1
votes
1answer
73 views

When editing hosts file with vi , the added line gets repeated ad infinitum

Sometimes when I edit the hosts file by adding a new line, and when I do Esc, :, W, Q to save and exit, that line gets repeated infinite times in the file, and then gets saved. What am I doing wrong? ...
0
votes
2answers
53 views

In vi, how can I navigate to the function declaration?

In Vi, if I am in the middle of a function, how can I navigate back to the function declaration?