vim

Vim, automatically remove swap file when file is saved.

Is it possible to automatically remove the swapfile when the file is saved, and automatically create it again when the file is changed? And is this a good idea? EDIT: The reason for wanting to to this is so that I don't have to go through the diff process for files that had no changes after last save if the computer suddenly ran out of...

Vim Taglist Navigation

Hello: I am trying to configure taglist with vim. I ran :TlistAddFilesRecursive at the root of my java source. Say I have a class class Foo extends Bar { } I place my cursor is on Bar and I do Ctrl-] I get E433: No tags file E426: tag not found: Bar Press ENTER or type command to continue However, if I :TlistToggle and search fo...

using idioms in vim for perl

I have the perl-support plugin enabled. now, I tried the \idd idiom shortcut which would give you a my ($,$); statement with the cursor placed on the first var. Now the second var is displayed as <+name+>. In effect the my line after entering the first variables name would be my ( $top, $<+name+> ); If it was a code snippet I could ...

VimClojure and Clojure 1.2

Hello all. What's the latest for using VimClojure with Clojure 1.2? I've tried the instructions from a number of different pages that tell me how to set up Clojure, Leiningen and VimClojure, but I can't get any of them to properly start the REPL. There is always an exception raised from a forName() call. I read this could possibly be ...

Easiest way to swap occurrences of two strings in Vim?

What is the easiest way to replace all occurrences of string_a with string_b while at the same time changing anything that was already string_b into string_a? My current method is as follows: :s/string_a/string_c/g :s/string_b/string_a/g :s/string_c/string_b/g Although this works, it requires extra typing and seems inefficient. ...

Dynamically Detect HTML5 in vim

This is related to http://stackoverflow.com/questions/3232518/how-to-update-vim-to-color-code-new-html-elements, but I want the syntax highlighter to only highlight the elements if it detects the html5 doctype at the first line of the file. Is there an easy way to do this? ...

Vim: Replacing the End of the Line

In Vim, how is it possible to replace the remaining of a line with the yanked text? If I press "D", the yanked text will be replaced with the deleted text. Also, how is it possible to yank to the end of the line? If I press "Y", it will yank the whole line. ...

Vim: Eclipse-like Ctrl-Backspace and Ctrl-Del

In Eclipse, there is the nice feature of deleting the word until the next capital letter when you press Ctrl+Backspace. For example: ThisIsSomeText If you press Ctrl-Backspace, only "Text" will be deleted, where as in VS all the "ThisIsSomeText" will be deleted. Is there anyway to implement the same in VIM? If yes, is there similar m...

How to show a vertical rule at the beginning of the current line?

I'm looking for a way in vim to easily visualize the various indent levels of python code. It would help if there was always a vertical rule at the beginning of the current line. That way I can scan down the code to see where the current block ends. Are there any plugins out there that do this? ...

How can you delete old text in Insert Mode in GVIM

I've just downloaded GVIM for the PC and MacVIM for the Mac and they both have different behaviour to the VIM I was using in MSYS. Here's the problem. I bring up a file in VIM and enter insert mode. I can no longer delete any of old text. I can insert new text and delete them just fine so I know my backspace and delete keys are worki...

VIM in GNU screen in Mac Terminal.app scrambled text

Trying to use Vim in Mac's Terminal.app but it's unusable, terminal is only refreshing line or column where the cursor is, so scrolling is quite bizarre. Text is being updated only on the line where the cursor is, but the rest is not changing. Very weird behavior, I've seen this on linux too, with nvidia driver, the bufferes somehow were...

Can I give the quick fix window a different status line in vim?

I'd like to give the Quick Fix window a different status line than all my other windows. I want it to have: set statusline=\ %n\ \ %f%=%L\ lines\ When I'm in the quick fix window, I can use :setlocal, but how in my .vimrc can I make it have a different status line? ...

php + vim - बंगलौर (Bangalore) has a break before the last character र

I used http://translate.google.com/#en|hi|Bangalore to get the Hindi for Bangalore and बंगलौर. But when I pasted it in vim there is a break before the last character र. I am using preg_replace with the regex pattern /[^\p{L}\p{Nd}\p{Mn}_]/u for matching words. But this is treating the last character as a separate word. This is my input...

mapping already exists for ^I in vim

I have added the following lines to the vimrc file so that i could use s-tab for indenting map <esc>[Z <s-tab> ounmap <esc>[Z After i have added this , i get the following error. I use SnippetsEmu plugin Error detected while processing function <SNR>15_SnipMapKeys: line 10: E227: mapping already exists for ^I How do i solve this ...

Vim: Del in Insert Mode

Is there any key combination that simulate the Del in Vim insert mode? For the Backspace, there is the Ctrl-H which is very convenient, and make it easier than pushing the far away Backspace button. ...

Cannot move cursor in Insert mode

Just noted I can't move cursor to left or right (up and down works correctly) in Insert mode while editing an .sql file, with other files it works ok also. Any hint?. Vim: 7.2.330 - Ubuntu 10.04 x86_64 ...

vi, find line and output/output to separate file

I'm looking for a command in VI/VIM to search for particular text in the file and grab the whole line and output in either on the screen or separate file. e.g. This is some line with this _word_ and some other text. This is some line with this some other text and some other text. so this would output only the first line.. ...

Why does VIM have its own regex syntax?

Why do you have to make your regex "very magic" so that you don't have to escape your capture quotes? And if you set your environment to very magic, you are non-standard and may have compliance issues. I am just wondering why vim uses a different regex syntax than say, perl? ...

VIM and Scala -- indentation problems?

I downloaded Scala 2.8, installed the vim scripts included and tried to type in some Scala code. When I typed in val x = 1 + 2 and hit ENTER, the indentation goes to below the v. When I type in val x = (1 + 2), the indentation is below the x! If VIM is used by anyone at all for Scala, this bug should've been seen long ago. Or am I the ...

vim folding messes up syntax highlighting

I'm using vim for LaTeX and I'm using latex-suite. It gives me nice syntax highlighting and folding, but in large files syntax highlighting gets "confused". If I open all folds, the syntax highlighting turns OK. I would like it to "just work" all the time though. I seem to recall an option that would increase the number of lines that is...