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

learn more… | top users | synonyms

2
votes
3answers
55 views

Find and change certain LaTeX coding in vim, using regular expressions?

How can I change the following LaTeX coding: \cite{1,3-7,9} to \cite{1,3,4,5,6,7,9} in vim? I would prefer to use regular expressions.
2
votes
1answer
23 views

Vim: Exit single character replace mode with <C-C> when using `nnoremap <C-C> <silent> <C-C>`

I've become far too trained to use <C-C> to return to normal mode. I understand there is a difference between <C-C> and <ESC> but that's beside the point of this question. I use the ...
10
votes
4answers
1k views

How can I paste (overwriting) with vim?

In vim I use yy and p all the time to yank and paste lines. However, if I want to replace one line multiple places in the file, I can't use yy p dd p because the dd deletes the line to the clipboard ...
5
votes
2answers
26 views

Color coding html color sequeces in vim

It it possible to setup syntax highlighting in vim so that a html color sequence is colored in that color, e.g. #FF0000 would show up as red. I'd also be ok with it underlining the text that color ...
10
votes
4answers
19k views

How do I quit from Vi?

I started Vi on my Ubuntu machine. However I don't know Vi, and now I can not quit. I see the editor and I can write text, at the bottom line there is a label "recording". How do I quit from Vi?
0
votes
1answer
536 views

How to install vim-gtk in debian wheezy

this is the terminal trace root@wheezy:/home/me# sudo apt-get install vim-gtk Reading package lists... Done Building dependency tree Reading state information... Done ...
-2
votes
0answers
17 views

vim switches split afer entering/leaving a folder

I'm using vim as a browser/navigator (e.g., with :e ./). Now, when I enter/leave a folder (e.g. with -), vim switches to another split. This does not occur always, but often enough to irritate me ...
1
vote
2answers
27 views

How can I replace ^I into tab spaces in vim editor for .java file?

When I open my .java file in vim, I could see a couple of lines prefixed with one / more ^I characters. It looks like tabs in Eclipse that has got converted into ^I. I would like to replace a single ...
1
vote
1answer
37 views

Vim delay when using Ctrl+C, but only in SQL files

I'm working on a side project with both JavaScript and SQL source files. When I'm editing the JavaScript, Vim behaves normally. However, when I'm editing the SQL files, there's about a one-second ...
1
vote
1answer
12 views

Using vim-latex with latexmk and evince results in garbled text (GLib-GObject-CRITICAL)

When I compile a latex file in vim with the vim-latex plugin with \ll usinglatexmk, my vim terminal text content gets littered with error messages like the following dispersed through the text: ...
1
vote
2answers
75 views

Vim: join lines by replacing ^M

I have a file which has embedded ^M characters. I wish to join the lines at the ^M character. ie: change this: ^M être, ^M étant, ^M ...
1
vote
0answers
13 views

how to create a v.imrc [duplicate]

I created a macro in vim and stores in key s. example let @s='sample'. I want to write this macro in q.vimrc. How can this possible?. please give a simple sample program.
1
vote
2answers
313 views

How to fix weird vim polluting the terminal behaviour on arrow keys and on delete in insert mode?

My terminal gets polluted by B, C,A,D when I try to navigate within vim using arrow keys and on delete using backspace it only scrolls back without deleting the characters on screen while the ...
1
vote
0answers
30 views

How to make a vimrc? [closed]

I made a macro and stored in key 's' and stored by using like that: :let @s='macro_name' I want to write this macro in q.vimrc (for the use of my collegues). How is this possible?
2
votes
2answers
83 views

How do I change the colour of text matching a regex in vim?

Suppose I want to make all text that matches some regex persistently and automatically (and without affecting / searches) appear in a different color. How would I do this in vim 7.4?
1
vote
1answer
286 views

Vim colorscheme background not filling terminal

I am using vim with lxterminal, and the colorscheme kolor, and I am experiencing an issue where vim's background color does not fill the entire terminal. It can be seen clearly at the bottom of ...
0
votes
2answers
33 views

Skip search and replace after a heading in Vim

I have to replace a pattern, but I don't want to replace it after a particular word. This is my program: :vnoremap ::silent! call Bib() function! Bib() %s/\s*\n*{\\&}\s*\n*/ /g ...
3
votes
2answers
557 views

How to enable vim addon packages?

I have installed vim-nox as well as vim-latexsuite and vim-outliner on Ubuntu 12.10. There's nothing wrong with Vim but neither of the add-on packages does anything. What do I have to do to in order ...
6
votes
5answers
1k views

Indent several lines with VIM?

For eample, I'm editing this code: <html> <body> <script> var a = 10; a += 100; </script> </body> </html> now I need to indent the script line: ...
1
vote
2answers
48 views

How do I open all files in the current directory and all subdirectories using vim?

So far I've been using vim */** which seems to open all files in subdirectories but not those in the current directory, and vim * which opens all files in the current directory. But how do I open all ...
2
votes
1answer
112 views

How to reload a file in vim?

Various editors like gedit detect if the file is changed and asks to reload it. Sometimes in vim when I got many files to edit, I sometimes end up opening same file in different tabs for quick look ...
1
vote
2answers
25 views

refresh changed content of file opened in vi(m)

I have a config-file that I keep open in vim, but that sometimes gets changed on disk, without these changes being reflected on the terminal. Can I refresh the content on the screen without closing ...
1
vote
1answer
27 views

Can you further integrate and present sequential moreutils vipe command output in vim using successive splits etc?

I have used the moreutils suite a few times and I find it makes you think further about base utilities and is insightful(and fun). For instance, vipe allows running an editor - like vim - in the ...
3
votes
2answers
32 views

Keymaping for re-indent source code in Vim

I have key mapping in my ~/.vimrc file that re-indents edited source code on the fly. It looks like as follows: " press F4 to fix indentation in whole file; overwrites marker 'q' position noremap ...
6
votes
4answers
5k 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 ...
1
vote
2answers
26 views

Specifying height for vertical splits in vim

Usually I am editing two files, A and B, split horizontally. I set it up, so that one buffer would only occupy the first 2 lines at the top of the screen, and the rest is for the other buffer. ...
24
votes
5answers
3k views

Why does `ESC` move the cursor back in vim?

In vim, when I hit ESC to return to command mode, the cursor moves one character to the left. This is not what I would hope for, occasional I immediately hit l to move back to that spot, perhaps to ...
11
votes
4answers
548 views

How am I supposed to edit files on a network with Vim?

Currently I'm doing it by SSHing into a server, and executing Vim on the server. This has the benefit of not having to deal with cumbersome syntax of opening files from a remote server over SCP, and, ...
1
vote
1answer
706 views

vim install on freebsd has taken 5 hours and counting

Ok, so installed portmaster and I'm trying with it, I'm hoping it won't take time. So I've been up all night and my vim installation is still going on. I have an amazon ec2 freebsd server setup. I ...
5
votes
0answers
158 views

Bash inside Vim not working properly

In MacVim I'm using Conque to run bash commands inside Vim. I have a problem with the text navigation while using Conque. If I'm at the end of a line of text and press down Alt← I skip a word to the ...
7
votes
4answers
2k views

How do I make Vim behave like “tail -f”?

I would like to know if there is a way to make Vim behave like tail -f. Even the best Vim plugin I've found so far doesn't do what I expect. I really want to see the file update in real-time. Even ...
1
vote
1answer
320 views

Configuring Vim with clientserver and clipboard

On OS X I have vim working just fine from homebrew. The default homebrew install compiles vim with these flags. ./configure --prefix=/usr/local --mandir=/usr/local/Cellar/vim/7.4.161/share/man ...
1
vote
1answer
67 views

Show status lines of vim and tmux on the same line

I would like to figure out a way to get my vim statusline and tmux statusline on the same line if such a thing is possible and not immensely difficult (ideally, the vim prompt, or whatever it's called ...
3
votes
1answer
80 views

VIM as c++ IDE - autocomplete

I'm still learning C++, but I know already some stuff. I used to use Visual Studio, but after I switched to Debian, I was working with Code Blocks. Recently I heard about using VIM as IDE and started ...
4
votes
1answer
307 views

Vi: On startup, highlight tags and display tags in a preview window

I am using vi as a note-taking and outlining tool. I am constructing the "tags" file by myself. What I would like to do is that when I open my notes or outline file, vi reads the tags present in this ...
6
votes
1answer
83 views

Can I specify the layout of a vsplit command?

When I do the :vsplit command, it always opens the new file on the left side of the screen. Is there a way I can specify I want the new file to open to the right?
0
votes
1answer
26 views

Where should xt.vim be put on osX?

Cracking xDebug open, finally and looking to add the vim formatting file from xDebug.org. It says to "copy" the file to ~/.vim/syntax. But such a directory doesn't exist on osx 10.6. I don't see ...
0
votes
0answers
15 views

Vim FoldColumn color different on Debian / Ubuntu

I sync my .vimrc file between two machines, one running Debian testing and the other Ubuntu. On Debian everything works fine. On Ubuntu, the fold column is gray instead of black, even though black is ...
0
votes
0answers
116 views

YouCompleteMe not working after default install

I was trying to install YouCompleteMe with Vundle and it installed fine (it downloaded the git repository I pointed it to). I went into the folder and ran install.sh with the clang semantics and ...
3
votes
3answers
2k views

Problem with vim when logged in as root

When I login as root or edit a file by sudo mode all of the options in my /etc/vimrc are not working (e.g. highlight line-number etc.)
20
votes
6answers
2k views

Using VI keys to edit shell commands in UNIX

I used to have a co-worker who was really good at UNIX. He showed me how to use Vi key bindings to edit my shell commands. He placed the command in a file that ran every time I logged in. Since ...
37
votes
5answers
3k views

Becoming root from inside Vim

Sometimes I start editing configuration files in /etc using Vim, but forget to use sudo to start Vim. The inevitable result then is that after finishing my edits I encounter the dreaded notice that I ...
2
votes
2answers
833 views

Using CtrlP isn't giving very good results - am I using it wrong?

I was hoping that I could just type "job.php" and be directed to the job.php in my /lib/model/ folder, but I've mostly just get many other files returned: [No name] > ...
3
votes
1answer
32 views

Hide Vim fold characters

When using Vim to write prose my folds look like this: + # Section A expanded | Lorem ipsum dolor sit amet, consectetur adipisicing elit, | sed do eiusmod tempor incididunt ut labore et dolore magna ...
2
votes
1answer
38 views

How to get vimchat to work in linux

I added Bundle 'throughnothing/vimchat' to my ~/.vimrc file and ran :PluginInstall. That all ran fine, then I added an account and password to the ~/.vim/Bundle/vimchat/config file like this: ...
10
votes
4answers
374 views

vim: hide first n letters of all lines in a file

I am analyzing log file using vim and the format looks like this YYYY-MM-DD HH:MM:SS.USEC PID Name LogText Since Most of the times I don't care about date and time. I want to hide them and just ...
9
votes
3answers
108 views

Bash autocomplete with vim command

In bash, autocompletion of paths has recently stopped working when issuing vim commands where the path is deeper than two directories (it continues to work as expected with other commands, such as ls ...
0
votes
3answers
297 views

Text editor with indented word wrapping

I've been using Notepad++ in windows for a while and it has a cool feature for word wrapping so that the wrapped text is indented. That is the start of the sentence starts at column 1, but wrapped ...
1
vote
1answer
951 views

Copy/paste into SSH'd VIM from local (Windows) clipboard

I would like to copy from a local machine and paste into vim on a remote box which I am SSH'd into. That's it. I have tried "+p and "*p, mouse middle-clicking, and a couple other things to no ...
6
votes
1answer
254 views

How to change Vim's command type mode programmatically?

Is there a simple way to switch from one command type mode to another without loosing the current command line? In my ~/.vimrc file I remap the <space> and <c-space> character, coming ...