vim (Vi IMproved) is a text editor supporting different editing modes.

learn more… | top users | synonyms

2
votes
1answer
737 views

Vim shared copy register

When working with Vim I often work from multiple monitors and multiple split terminals so I have multiple instances of VIM running at all time. Is there a way to have a persistent shared register that ...
4
votes
1answer
127 views

How to write any Unicode Key without Pre-programmed key for it in kbd?

I am trying to find some Unix tool to input any Unicode key. I am fine with X application or console but I use Vi/m and it may have this property. For example, suppose I want to input key "U+0303" or ...
4
votes
1answer
237 views

How to store Vim tabstop settings in the file?

I need different tab widths for different files when using Vim. Is there a way to store this information in the file, and let Vim apply the setting automatically?
3
votes
2answers
193 views

Open up many files in panes at once

When I need to edit multiple files, it's really a pain to have to open them one by one. Is there a way to open multiple files in VIM from the commandline?
2
votes
2answers
812 views

How to Display Hidden Characters While Typing?

How can I configure vim to display hidden characters like tabs or spaces ONLY while those characters are typed? I do not want tabs and/or space replaced with special characters like ">" or "_" when ...
2
votes
1answer
68 views

How to Re-Create Missing Vim Directory?

The /etc/vim directory and the symlinks from /usr/share/vim to it are missing. Does anyone know how to re-create the directory and links?
3
votes
2answers
2k views

(G)VIM uses a different $PATH than my system

Because Ubuntu provides no up-to-date packages for TeXLive, I installed it manually. However, some programs need TeXLive as dependency. So what I did is I installed the TeXLive package from the Ubuntu ...
4
votes
2answers
1k views

How to install light-weight vim and to be able to efficiently load files into one instance vim?

On my laptop with Ubuntu I'm able to have just one instance of vim, launched with vim --servername VIM After this I'm able to open files from console with vim --remote-silent filename I use ...
1
vote
2answers
80 views

VIM: Create a function to generate several lines of buffer

I have about ninety configuration files that I need to add an almost identical block of additional code to, with only two instances of a single word differing each time. I would very much like to ...
3
votes
5answers
2k views

vi - how to join differents specific lines

I'm looking for a solution about a "paste" problem on vi/vim . How to join specific lines in a text file? I have a file like this: 15/10/2011 Revolution day 16/10/2011 About Rome - differents ...
6
votes
3answers
408 views

vim regex not need \ to escape

In Vim is there an option to write regexs in the same style as Awk for example/sp\{0,\}/ Would be /sp{0,}/
27
votes
2answers
21k views

How can I set VIM's default encoding to UTF-8?

I'd like to contribute to an open source project providing translated strings. One of their requirements is that contributors must use UTF-8 as the encoding for the PO files. I'm using VIM 7.3 on ...
9
votes
1answer
944 views

Why am I getting 'Name collision between …' errors and how can I fix them?

Every time I try to launch vim or emacs or even top (I think it's actually any command that uses ncurses) in a unix terminal (on a cluster computer over ssh), I get a a continuous stream of 'Name ...
2
votes
1answer
383 views

How to open a file in the last closed position in VI

I want to open a file which is closed in line xxx. So I can easily continue editing
7
votes
1answer
6k views

Switch VI to use backspace key instead of Control+H for backspace?

I'm on Solaris 10 and by default vi version SVR4.0, Solaris 2.5.0 is installed. The system was set up so that when I ssh to it Control+H does backspace, and backspace outputs ^? I added stty erase ...
4
votes
1answer
482 views

How to run gVim in a single instance

I want it in such a way that on double clicking an already opened file, or a new file, gVim uses the same window. From this question asked previously on Stackoverflow I figured out how to do this by ...
15
votes
3answers
4k views

ESC key causes a small delay in terminal due to its Alt+ behavior

My terminal setup is gnome-terminal + tmux + zsh with vi bindings. In applications like vim or even in the zsh's command line vi editing mode, I need to frequently hit the ESC key but there is a ...
3
votes
6answers
4k views

How can I check what version of the VI editor I have?

How can I check what version of the vi editor I have? What's the best way to upgrade it or install vim on Solaris?
2
votes
1answer
2k views

Install Gvim after vim

I would like to run vim via X11 (over SSH). Vim comes pre-installed on my NAS (running Debian), however the GUI is not. When I run vim -g, I get this error: E25: GUI cannot be used: Not enabled at ...
6
votes
4answers
1k views

Block editing *live* in Emacs or Vim

jEdit supports block editing, but Emacs and Vim seem to have some serious usability issues on the same subject. If someone could fill in the unknowns here it would be much more bearable to use either ...
6
votes
2answers
244 views

How to write a column of consecutive integers in Vim over existing text?

For example, imagine I had the following text: / apple / orange / banana / bread How could I efficiently add consecutive integers in a column to make? /1 apple /2 orange /3 banana /4 bread Note ...
4
votes
1answer
159 views

How to preserve special characters highlighting when converting to HTML?

I have an issue with the :TOhtml command. It works great, but it doesn't preserve the list option. If I do: :set list listchars=tab:>-,trail:.,extends:> :TOhtml The special characters ...
3
votes
2answers
462 views

Move to next capital letter

Is there an easy way to move to the next capital letter with vim? I'm often working with camel-cased variables and it could be useful.
4
votes
1answer
171 views

creating vim plugins

I would like to attempt my first VIM plugin and wondered where there are some good docs on this? From going threw the plugins I use it seems to me that it is a mix of BASH and some sorts of VIM api is ...
6
votes
2answers
453 views

vim - don't highlight search term after a search & replace?

After performing a search and replace, my installation of GVIM highlights any text remaining that still matches the search pattern. Example input text: foo foo fighters I run :%s/foo/bar/gc and ...
5
votes
1answer
143 views

Vim syntax highlight certain lines

I have php files well any file type in general that I would like vim to highlight here docs sections using a different syntax highlighting. <?php echo <<<HTMLDOC <h1> I am ...
1
vote
1answer
41 views

Vim remembering settings of edited files

I read some where about creating files in vim to save things like open windows and folds. I tried to Google it but had trouble finding reference to it. What should I be looking for?
1
vote
5answers
988 views

Display output to console while grep is used

In vim I use the following command to compile a tex file: pdflatex\ \-file\-line\-error\ \-shell\-escape\ \-interaction=nonstopmode\ $*\\\|\ grep\ \-P\ ':\\d{1,5}:\ ' this works in terms of getting ...
1
vote
2answers
2k views

Filetype not detected

I'm using vim to try a template system named handlebars, and I installed a vim plugin to get some syntax-highlighting for *.handlebars. I can get coloration if I do this : :set filetype=handlebars, ...
8
votes
2answers
196 views

VIM: show all lines edited in session

Is there a command or plugin that I can use to show all the lines I have edited in a Vim session? I would like to be able to have all the changes I have made highlighted when working in co-workers ...
3
votes
3answers
622 views

Vim multiple windows / hide

If I had x or more windows open in a VIM session and I wanted to quickly hide all but the active one for a moment then return the windows to the layout I had them int how would I do it?
3
votes
3answers
206 views

What does . match?

In working with regular expressions, I have been told that a dot character . will match everything. Except for newlines \n. Are there any other exceptions? What about the NUL character \0, or the ...
7
votes
1answer
3k views

Jump to specific character in a line in VI

In VI, I know that if you do :some_number and hit enter, you will jump to the line specified by "some_number". Is there an equivalent for jumping to a specific character in a single line? ...
7
votes
1answer
468 views

Note-taking and outlining using Vi: On startup, highlight tags and display tags in a preview window [duplicate]

I am using vi as a note-taking and outlining tool and therefore I thought that this stackexchange site would be appropriate to ask this question. I am constructing the "tags" file by myself. What I ...
3
votes
2answers
398 views

Issues with Vim while using ZSH

I just changed my shell to ZSH. However, when I tried to edit a .py file in vim I got a strange error: "test.py" [New File] Error detected while processing ...
4
votes
1answer
538 views

Select between given characters in vim

Given three sample lines: some('lorem _ ipsum'); $some['lorem _ ipsum']; <span class="some _ class"> (cursor is in _ position) Which is the fastest way to select (for pasting in other ...
2
votes
2answers
227 views

What does :p[rint] do in vim?

The help text is a little vague as to what this command achieves. Print [range] lines (default current line). Note: If you are looking for a way to print your ...
8
votes
2answers
2k views

Make sed ask for confirmation before each replacement?

Is there a way to make sed ask me for confirmation before each replace? Something similar to 'c' when using replace inside vim. Does sed do this at all?
2
votes
1answer
115 views

Getting vim to be silent when using -s {scriptin}

The vim man page describes -s {scriptin} option which allows for automation of file edits. This works fine, but I'd like for vim not to grab the console in this case (and flash the file with edits), ...
6
votes
4answers
9k views

Auto indent / format code for Vim?

I'm trying to use Vim more and more when I can. One of my biggest grip between Vim and an IDE like Aptana is the ability to auto indent. Is there a means of auto formatting code (HTML, CSS, PHP) so ...
9
votes
1answer
3k views

Setting vim filetype with modeline not working as expected

As per the accepted answer to this question, I'm attempting to use modelines in vim to force filetype detection in some files. For example, at the top of a file named gitconfig (note there is no ...
6
votes
2answers
2k views

Is there a way to place a comment in a file which vim will process in order to set filetype?

For example, if I want to have a file with the name gitconfig (no leading .) be recognised by vim as being of filetype=gitconfig, is there a means of indicating this in a comment or something similar ...
0
votes
1answer
66 views

vim always shows help/documentation

Whenever I run vim, it randomly shows the help/documentation at a non particular time. How do I disable that. It's irritating.
4
votes
1answer
234 views

How can I make VIM a full fledged IDE [closed]

How could I make VIM a full fledged IDE by using different supported plugins for YUI, JQuery and git integration etc.
5
votes
1answer
821 views

Type from right to left

Is there a command to make Vim type from right to left? If not us any one aware of this plugin?
1
vote
1answer
414 views

How to set keycodes manually in vim?

Sometimes when I fire up vim, my Insert key doesn't work (need to use i) and my arrows don't work (they give me letters instead). I'm guessing this has to do with my keys not being mapped correctly. ...
2
votes
1answer
494 views

vim script: how to change “put =” to an append?

I'm trying to hack the c-vim plugin because I don't like the way it inserts comments. I want this: /* comment */ but it gives me this: /* comment */ I'm sure it has its reasons, but I don't ...
2
votes
1answer
130 views

Vim Highlight only the characters, which produce comments

I am trying to achieve the following. If I have a file, e.g. a tex document and I want to have the following with commenting characters (% symbols) highlighted: % Some text and end of the ...
5
votes
2answers
3k views

Using vim to view the contents of a directory file

As I understand, in Linux directories are mostly normal files w/ some special handling (e.g. 'rm' a file is ok; 'rm' a dir will complain w/o -r). When I execute the following bash commands: mkdir ...
2
votes
1answer
170 views

Why does Vim have different cursor positions for different modes?

Why does vim have different cursor positions for the different modes? First, in insert mode, the cursor is between characters (like every other editor), second, in command mode, the cursor is under a ...