vi is a text editor of the Unix operating system.

learn more… | top users | synonyms

3
votes
3answers
7k views

How can I enable backspace key in VI?

I have bare-bone FreeBSD installation. No package installed. And VI doesn't accept backspace key. (I pressed backspace key but nothing happen) How can I enable backspace key in VI? Oh, and I'm using ...
6
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 ...
10
votes
3answers
3k views

Any IRC clients with VI key binds?

Is there any IRC client that supports VI keys? The ''obvious'' script VimIRC is and has been broken for so long it's not even funny. Do you know any IRC clients on Linux, GUI or Curses, that provides ...
2
votes
1answer
754 views

Can I use vi keybindings in the Chrome/Safari JavaScript console?

I'd like to be able to use vi keybindings in the Chrome JavaScript console (cmd-opt-J in OS X, ctrl-shift-J elsewhere, I think). Basically, I want to be able to hop around and edit like I do in vim. ...
3
votes
2answers
219 views

How to delete password in vim without storing it in a register?

I have a password in a text file. I'm editing the file in vim and I want to delete the password. If I just delete it, say with 'dw', it's stored in several registers. I want to avoid keeping any track ...
47
votes
11answers
145k 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?
3
votes
4answers
401 views

Indenting an X number of lines in vim

I've been coding in Java for a job recently and I've noticed that I'll write some code and then determine that I need to wrap the code in a try/catch block. I've just been moving to the beginning of ...
3
votes
3answers
6k views

changing the color of comments in vim

I use vim to browse the source code. In java source files comments appear in blue color on black background which is difficult to read, how to change this color scheme so that comments can appear in ...
2
votes
1answer
2k views

How to move x lines up in vi/vim editor

nenter moves the cursor to n lines down from the current position. is there any shortcut to move n lines up?
1
vote
1answer
459 views

GVIM to find and replace with a carriage return

I'm trying to automatically globally search through a file in a Windows system and replace certain strings with the found string, plus a carriage return (^r^n, or something like that). Here is what ...
5
votes
1answer
821 views

Close VIM session over ssh

I work remotely some days and I left vim open with some unsaved changes at the office. Now I'd like to save and close those sessions so I can work on those files at home. I am logged into that machine ...
8
votes
6answers
18k 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
1answer
42 views

How do I view and edit last expression used in a find in vi?

Is there a way to bring up the last regular expression used in vi for a search? If I enter a long regular expression, it would be nice to just edit the expression if it was incorrect or other ...
1
vote
2answers
2k views

in VI and man command, how to exactly match a string?

in VI and man command, how to exactly match a string? I don't know how to exact match a string~
0
votes
1answer
219 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 ...
2
votes
2answers
23k views

How do I save changes after editing vi /etc/hosts?

I am doing a Linux installation. I installed the system fine and am trying to change the vi /etc/hosts file. I have edited the file but am not sure how to save it. I have --INSERT-- showing at the ...
4
votes
3answers
2k views

Vi-Vim like control keybindings for Windows

I've been using gVim for a while and love the interface. I'm in love with my keyboard-fu skillz. I was wondering if there was any application that would extend its functionality to all parts of ...
3
votes
9answers
1k views

emacs or vi which should a windows user learn?

I am currently reading a book on bash and it recommends learning either emacs or vi. I am primarily a windows user and not very experienced with linux yet. So which would be best to learn, or is there ...
7
votes
1answer
2k views

vi: what is verbose mode and when/how do I use it?

Sometimes When I'm using vi I accidentally hit caps lock when I'm in command mode. This apparently puts vi into verbose mode which I'm having trouble finding documentation about how to use. How and ...
1
vote
2answers
60 views

Ignoring repeated lines in a text file

I have a file with repeated lines that have particular text on them. I need to view the file content ignoring these lines. Is there anyway I can achieve this using vi?
2
votes
2answers
2k views

How do I remove a newline from text in vi on Cygwin

I'm trying to ammend a commit comment on a git commit, so I git commit --amend then vi opens with text from the last commit's comment. Then I delete all of the text on the first line, but I cannot ...
2
votes
2answers
878 views

FreeBSD console broken?

It seems my FreeBSD console is misconfigured (i guess). I cannot use home or end buttons in command line (it prints ~), and in vi left arrow is switching me from edit to command mode, which makes ...
1
vote
3answers
2k views

Linux weird problem touch : command not found?

I occurred a really weired problem, which is touch : command not found. I was going to create a blank file, so I type the touch command which didn't work. I'm running centOS 5. Any ideas? BTW: the ...
5
votes
2answers
4k views

Moving the the very bottom of the file with vi

No, I'm not talking about vim, I'm talking about old-school vi; because in vim you can actually issue a :bot and it'll move to the bottom of the file.
3
votes
1answer
1k views

What's the difference between tiny, huge and small in vim on MacPorts?

I'm trying to install vim via MacPorts. I found this port at http://trac.macports.org/browser/trunk/dports/editors/vim/Portfile. There are variants like tiny, small and huge. Is there any way to tell ...
1
vote
2answers
821 views

Vi editor key customization

Is there any way to customize the vi editor keys in Solaris Unix?
1
vote
9answers
156 views

How to make it easier when using the vim command in unix?

Recently i try to learn something about the unix. when i try to edit something using the vi command, it is very difficult for me since i have to switch the edit mode and control mode time by time. It ...
0
votes
1answer
55 views

What's the command to open a file and jump to an specific line in vi?

It was something like vi -line:123 myfile.txt
2
votes
3answers
599 views

When going from insert to escape mode in Vi or Vim, is there a way to not have it move the cursor left one space?

Changing modes shouldn't move the text cursor IMO. Any setting to disable this?
5
votes
4answers
3k views

vi visual mode doesn't work

I'm running vim (7.0.237) after sshing to a remote CentOS box, and it just won't enter visual mode. When I press 'v', it just beeps and does nothing. I'm running Ubuntu with GNOME Terminal, and the ...
8
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 ...
0
votes
2answers
2k views

Help installing vim fuzzyfinder plugin

This plugin (here) looks really great but whenever I try to install it vim doesnt seem to recognize that it exists. I unzip the archive in my .vim dir but when I run vim and try to execute a ...
6
votes
5answers
7k views

Is there a VI equivalent I can use on Windows XP and later?

I get frustrated using Notepad on my Windows XP machine when I want to do more complicated text manipulation. Having used VI on various versions of UNIX I'd like to get something with its power on my ...
1
vote
3answers
1k views

VIM has stopped using my _vimrc and I can't figure out where it is getting set?

My _vimrc looks like this set nocompatible source $VIMRUNTIME/vimrc_example.vim colorscheme pablo set backup=~/vimfiles/backup set directory=~/vimfiles/tmp set diffexpr=MyDiff() function MyDiff() ...
2
votes
4answers
2k views

Snippets in Vim not working

I've been trying to get snippets to work with Vim (specifically, MacVim). I have tried both snippetsEmu and snipMate (preferred). Other plugins are working fine. I have been able to get snippetsEmu ...
20
votes
6answers
22k 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
2
votes
3answers
3k views

How to get Transparent Background in VI Editor?

I am using gvim in Windows and novice to it. I want to have a transparent background for my VI (in Windows) , like console which creates a transparent command prompt. I asked the same question in ...
12
votes
5answers
3k views

How to show the current Vi mode when using Vi keybindings in the shell?

I use the vi keybindings in my tcsh shell. Now, I don't know which vi mode I'm in (insert mode or command mode), which leads to a lot of frustration. Does anyone know of a way to show the current ...
13
votes
13answers
1k views

What Vim features do you use? [closed]

I spend almost all day programming in Vim and I am sure that a lot of you do too. What features do you use that make your day to day coding that much better? One that I use is gv, which will let ...
0
votes
2answers
4k views

Tab complete in VI mode KSH 'vi-tabcomplete' gives bad options

When I try stuff like in my .profile: set -o vi-tabcomplete I get: .profile[292]: vi-tabcomplete: bad option(s) Does anyone know of a workaround?