vi is a text editor of the Unix operating system.

learn more… | top users | synonyms

2
votes
2answers
196 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 ...
1
vote
1answer
57 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; ...
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
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 ...
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
votes
2answers
33 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. ...
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

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" ...
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
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 ...
1
vote
1answer
65 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 ...
2
votes
1answer
248 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
136 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
95 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
48 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.
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 ...
1
vote
2answers
349 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
456 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
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, ...
0
votes
0answers
28 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
49 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 ...
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, ...
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$ ...
1
vote
2answers
419 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 ...
-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
1answer
26 views

Replacing values in a file using vi

I have a file which as multiple entries like "allowed_users 100", "allowed_hits 100", "allowed_users 10000". Want to replace the values of "allowed_users 100" to "allowed_users 1000". Best Wishes, ...
1
vote
0answers
111 views

Tmux and Vi in PuTTY = No arrow keys in Vi

I'm using PuTTY as my terminal with tmux. At first I couldn't resize panes so based on this thread I added the below to my .tmux.conf" set -g terminal-overrides ...
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
3answers
211 views

Unnecessary indenting in bash

I have been trying to paste text from one file to another in bash. I'm working in Putty. To be more clear, I have a file hotel.txt with some lines of text that are indented, thus have tabs and ...
4
votes
1answer
430 views

Hiding vim command-line when it's not being used?

Is there any way to hide the vim command-line (ideally, automatically) when it's not being used? On small screens it takes up one valuable line. I'm thinking it would be 'normally' hidden, and appear ...
2
votes
1answer
853 views

Why config file of vi is not named .virc but .exrc? [closed]

Just from curiosity I want to know why .exrc is not named .virc? Is there reason for it?
1
vote
1answer
31 views

How do I save from VI to a pipe?

I've seen lots of ways to redirect input from stdin to VI, but I'd like to redirect VI to save to a pipe rather than a file. For example, I'd like to pipe VI's entire pipe buffer to another text ...
1
vote
1answer
84 views

how to type foreign language in vi editor

I want to type text as \documentclass{article} \usepackage{fontspec} \setmainfont{Aparajita} \begin{document} \section*{इनपुट साधने ऑनलाइन वापरून पहा} आपण निवडलेल्‍या भाषेमध्‍ये टाइप करणे सोपे बनवतात ...
0
votes
3answers
547 views

Is there a command to split lines in vim?

In vim, the J key joins two lines together. Is there a similar, built-in, key combination to split lines with a newline (at the cursor position, or similar)? Alternatively, what would be the most ...
3
votes
1answer
279 views

How to cut and paste tabbed lines with auto indent set to on in vi

Not sure which stack exchange group this question goes so please move to the correct one if this is the wrong one. What's happening is if I highlight something with tabs/indents from one ...
13
votes
4answers
2k views

Inserting a blank line in vim?

I quite often find I have a need to insert a blank line either below or above the current line when editing in vim. o and O will do this, but they subsequently switch into insert mode, which is ...
0
votes
1answer
265 views

Selecting all text in Vi/Vim through PuTTY

I need to select the text in a log file (~900 lines) and paste it into a normal text file. However, I am on my server via PuTTY so when I do :%y+ or gg"+yG it does not let me paste it. By any ...
0
votes
2answers
275 views

vim - open files containing a specific string in new tabs

I am looking for a way to open all files that contain a specific string in new vim tabs. The files are not in a specific directory, but scattered across a directory tree. Ideally I want to jump to ...
0
votes
1answer
90 views

Creating a file through a dangling symlink with vi

This is the content of my typescript file, /mac>ln -s non_exist ~/link /mac>vi ~/link Hi! I am a link. /mac>cat ~/link Hi! I am a link. /mac>cat non_exist cat: non_exist: No such file or ...
4
votes
1answer
248 views

how do I go from typing `/foo` to `:%s/foo/bar` efficiently

In vim, I typed /foo Enter and found some matches. Now I want to replace all instances of foo with bar (i.e. :%s/foo/bar). Can this be done without retyping the foo? (e.g. into the command line ...
1
vote
2answers
877 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 ...
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
1answer
108 views

Is there a way to filter out filenames from vim's “oldfiles”, perhaps using a pattern?

I use vim's :browse oldfiles a lot to edit files I've recently worked with. However, there are some files, such as git's auto-generated COMMIT_EDITMSG, which clutter that list and which I never need ...
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 ...