vim

Highlight Code Block Backgrounds with Vim

While I am working in Vim I'd like to have a slight background color change for all code inside the php tags. So for example, the background is solid black for regular XHTML markup, then displays slighly lighter inside the php tags to help me identify it quickly. Is this something I can/should do with the color scheme or is there another...

Editing xml files with long lines is really slow in vim. What can I do to fix this?

I edit a lot of xml files with vim. The problem is that, because of the long lines, navigation/editing in vim is extremely slow. Is there something I can do (besides turning off syntax highlighting/filetype plugins and filetype indentation) to be able to edit these files without all that lag? It's really frustrating that a trivial thing...

Unable to stop the creation of backups to root by Vim/Emacs

Problem 1: my Vim makes backups with the extension ~ to my root I have the following line in my .vimrc set backup backupdir=~/tmp/vim//,~/tmp//,.//,/var/tmp//,/tmp//$ However, I cannot see a root directory in the line. Why does my Vim make backups of my shell scripts with the extension ~ to my root? Problem 2: my Zsh run my shel...

Unable to edit a title without opening a fold in Vim

Let's assume you have a cursor at a closed fold as in the picture. How can you edit the title of SMALLAPPS without opening the fold in Vim? ...

How to perform File Extension based Actions in VIM?

I want to perform rubyf action in VIM when I press F5 if the file is of .rb extension. Right now I just have map <F5> :rubyf % <CR>. But I also want to interpret scheme files if its .scm or compile tex etc using the same F5. How do I check the file extension and perform the correct binding? How do you guys compile different files in ...

Which default setting does make Vim very slow in Mac's Screen?

The problem is not solved although I accepted one answer. Problem: Vim updates very slowly the screen in Screen in Mac, although lazyredraw and showcmd are off. The line numbers get on the foldColumn as below, for instance, when I have line numbers When I have nothing in my .vimrc, the problem can be seen by multiplied comment line...

Prevent splitting Window when using pythoncomplete in Vim

I'm using VIM with pythoncomplete. When I'm making a completion, the current window is splitted and calltips are shown in the upper pane. I hate that! Is there a way to prevent that behavior or at least limit the size of the upper pane automaticly? ...

Unable to make gray eol character by .vimrc

I want to have a gray eol character set by set list listchars=tab:>>,trail:$ where there are no spaces next to the character ":" I get no eol character for the above code if I use no spaces next to ":". I get a green trailing character if I use one space at - - tab:[space]>> -- although I have not set it up explicitly such tha...

Resources concerning Python scripting in Vim

I'm trying to learn a little about python scripting in GVim, but I'm having trouble with starting. Elementary things, really. Are there any resources / tutorials concerting python scripting in Vim out there ? Simple examples which show the basic principles, would be welcomed also. ...

How to copy yanked text to VI command prompt

I want to know if there is any way by which I can paste yanked text to the command window. For eg. if I have yanked a word and I want to grep it in some location I cant simply paste the word using 'p'. However if I copy it to clipboard, Shift-Insert will paste the same thing. Is there any tweak available which would allow me to paste y...

Opening (c)tags in new tab in (G)Vim

Ctrl+w Ctrl+i and :stj is nice, but how do I jump to a tag (under the cursor) in a new tab in GVim/Vim? ...

How do I get Vim Omni Completion working in Makefiles?

I'd like to be able to use Vim omni-completion in Makefiles, so that I can get auto-complete for target dependencies and such. Anybody know how to do this? ...

How can I keep a file in memory during editing?

Short version : echo "testing" | vim - | grep "good" This doesn't work as vim won't output to a pipe. It says : "Vim: Warning: Output is not to a terminal". Any way to do this? Cross-editor support would be nice too. I've tried named pipes, but vim won't open them. Long version : echo $passw | gpg -q -d --passphrase-fd 0 $filename | v...

How to edit multi-gigabyte text files? Vim doesn't work =(

Are there any editors that can edit multi-gigabyte text files, perhaps by only loading small portions into memory at once? It doesn't seem like Vim can handle it =( ...

Regex for combining digits

I have a sequence of digits like below. I want to combine digits to group of 4. Can someone give a vim regex to do that? Input : 1234 56 7890 1234 The output should be: 1234 5678 9012 34 ...

do not include required files into vim omnicompletion

If I try to autocomplete smth in a Ruby file, that has require 'xxx' statement, it starts to scan all files required (and files required by required files as well). and it does that every freakin time! Is it possible to make vim autocomplete to NOT scan required files or just files in particular path (e.g. app/ only)? ...

Easily open include filenames in vim?

Basically, I'm editing files that have include file names and I want a quick way of opening the file without having to type the path/filename: include('inc/doctype.inc.php'); Is there an easy way to do this? (Ideally, I'd like to use :tabnew to open the file in a new tab.) Thanks. ...

Yank file name / path of current buffer in Vim

Assuming the current buffer is a file open for edit, so :e does not display E32: No file name. I would like to yank one or all of: The file name exactly as show on the status line, e.g. ~\myfile.txt A full path to the file, e.g. c:\foo\bar\myfile.txt Just the file name, e.g. myfile.txt ...

Vim visual mode scripting: searching the text surrounding the visual selection

I'll try to explain by example.. If we have a piece of code like this in vim: if ($feck == true && $drink == false) { echo 'They lie in wait like wolves..'; } And I go to visual mode and select "$drink" for example, is there a way to: detect whether the current selection is one of vim's text-objects (word, WORD, inner {, etc.) ...

Why doesn't Vims errorformat take regular expressions?

Vims errorformat (for parsing compile/build errors) uses an arcane format from c for parsing errors. Trying to set up an errorformat for nant seems almost impossible, I've tried for many hours and can't get it. I also see from my searches that alot of people seem to be having the same problem. A regex to solve this would take minutesto ...