vim

Why don't more people use emacs with viper-mode?

I've started to use emacs, and I've found out that while the editor-specific features of emacs are better than those of vi, the text-manipulation methods of vi are better than those of emacs (and easier on your control-pinky!). It seems that viper-mode, a marriage of the two best parts of each editor, is the ideal solution for someone t...

How to move or create a window on the right side on Vimscript?

I'm trying to modify project.vim to open the project window on the right side instead of in the left. I see several references in the source to "vertical new", "vertical split" and "vertical resize". Trying them I see that a new vertical split is opened to the left, but I can't find how can I make a new vertical split open (or move) to t...

vim command to jump to a tab (tabpage) containing the filename

Is there any command in vim with which I can jump to an already open tab containing the file which is open in the tab. And that too with possibility of completion among all the open buffers. For example you have following files open in different tabs. readme.txt pom.xml Then the command jt will autocoplete the buffer names and jump...

Vim: Indent current (blank) line and insert

Say I have the current text in the buffer, where _ marks the cursor int main(int argc, char **argv) { printf("Hello, world!\n"); _ } I have indentexpr on (though a solution with cindent or autoindent will probably work, too). How do I begin inserting so my cursor is placed at the appropriate column to follow the indention rules,...

Using cscope to browse Python code with VIM?

Has anyone managed successfully using cscope with Python code? I have VIM 7.2 and the latest version of cscope installed, however it doesn't get my code's tags correctly (always off by a couple of lines). I tried the pycscope script but its output isn't supported by the modern version of cscope. Any ideas? Or an alternative for browsing...

Vim: Error format matches everything

I am trying to match the following error with efm: AssertionError: 1 == 2 at /home/strager/projects/blah/blah.js:13:37 The error message can be anything (i.e. it doesn't always match the AssertionError: .* or .*Error: .* formats). The general format is: errormessage at filename:line:column My problem is that the error mess...

Full width background color highlighting of codeblock in Vim

I have Vim documents that have codeblock regions that use 'syntax include' regions to have different syntax highlighting from the main document. For example, I have a syntax region named 'pyregion' defined that I use when I input Python code. The pyregion areas of the document are then highlighted using setup in Python's syntax file, w...

Latex and Vim usage

How can I use Latex effectively in VIM? Is there a way to configure compile errors by highlighting the line in vim? I have syntax highlight. What are other recommended add-ons? Is a makefile the recommended way to compile a latex file to pdf? TexWorks lets you open and replace the opened pdf everytime it's recompiled. Is there a plug...

Fast switching between two lines in file in vim

Hi, sometimes I have to switch between 2 lines. To do this, I have to pass line number. Are there shortcuts to moving between 2 last 'visited' list. Something similar to '. (it moves to last edited line) ...

How do I change the character Vim uses to number blank lines in buffer?

Currently, when my window is bigger than the buffer being displayed, blank lines are shown with a ~ in the line number column. By blank lines I obviously don't mean blank lines in the buffer itself, but lines that extend beyond the end of the buffer. I'd prefer for the line number to be blank. Is this possible? ...

VIM - Move through wrapped lines (in insert mode)

I'm not a fan of 80(or 72) characters pr. line followed by a line-break even if your VIM inserts the line-break itself - you'll easily run into inconsistency problems when editing that line of text afterwards. Otherwise I have nothing against the editor, but somehow editing text as I do in a GUI editor makes me sleep better at night. S...

How to jump back and forth between previous/next cursor positions, limited to current buffer only?

I like the functionality of <C-O> and <C-I> to go back and forth to different positions. But many times I would prefer to stay within the current buffer, and always get taken by surprise when a new buffer opens up replacing the one I was looking at. (1) Is there a way to achieve this? i.e., limit <C-O> and <C-I> to the same buffer? (2)...

Vim save then make automatically?

I want to call an command when I save the file. I am calling it by :make manually now. but I wish it could be called when I execute :w and :wq I also want enable this feature in any subfolders where not contains a Makefile but it's parents contains one. Just like this topic said, but it doesn't works for me. http://stackoverflow.com/qu...

How to tame vim's ":find" command

Say, I have files foo.js and bar.css in my project. There is a ":find" command in vim, which find files, matching string. But this command, alas, has some limitations. For example, if I launch this way - "vim", or even this way - "vim ." - there's nothing to be find in js subdirectory. But if I launch vim this way - "vim js/any_file_othe...

What version of eclipse is safe for development for android?

Apparently, eclipse 3.6 doesn't work well with the android sdk, but I'd like to use eclim which requires this version of eclipse. Does anyone have any recent experience developing for android with eclipse 3.6? Recommendations for someone who wants to use vim for android development? I'd appreciate any help. ...

few vim autoinserts for ruby needed

I want to try the following things in vim insert mode: to have closing bracket/parenthesis inserted (after the cursor) every time I type the opening one to have #{} inserted whenever I type # inside "" (optionally, inside %() too) I know it is possible, but my competence in this part of vim does not even reach the self-starter level....

Automatic syntax/headers in vim for c++ files [solved]

I want that whenever i open a new c++ file in vim in linux ( mandriva 2010 ) the following code gets inserted in it automatically : Default code : #include <iostream> using namespace std; int main() { return 0; } Is there any way to get it done. also can i bind .py, .pl, .java files with similar things. Moreover i should be ...

Compiling C in Windows XP

Hi, I want to learn Vim editor and I'm trying to compile a C file. I've installed MinGW and I've added gcc.exe to System Path: %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Arquivos de programas\TortoiseSVN\bin;c:\Arquivos de programas\Microsoft SQL Server\100\Tools\Binn\;c:\Arquivos de programas\Microsoft SQL Server\...

How do you select a whole column in visual block mode?

Say that I have this simple text in (g)Vim: a b c a b c a b c a b c a b c after changing to visual block selection mode how can I can select the whole 3rd column? Ctrl+V G selects whole text. I am looking for a keyboard shortcut for selecting a whole column selection, if any exist. Thanks. ...

Remove a file's "read only" attribute in vim after editing it and saving with :w!

I want to change the read only attribute from a file when I save it with :w! in vim. How do I do it? (I don't mind if I have to call an external script). I'm using Linux. I know I can use an external script using this command: autocmd BufWrite /tmp/* !sh /tmp/script.sh. So, I would like to call a chmod command when :w! is invoked: the ...