vim

Getting gvim to automatically translate a cygwin path

I love cygwin and the native windows version of gvim and I use them together all the time. The only problem I have is with cygwin path names. Gvim for windows doesn't understand them so I have to resort to typing things like: gvim `cygpath -wa ~/scripts/myscript.pl` Which is annoying! I was wondering if there's a neat way of usin...

Vim setup for Android development

Can anyone describe a good vim setup for Android Development? I'm using Eclipse for now but I would really like to use vim because it's faster and I like it better. I'm not interested in Eclim for example. I'm interested in what vim plugins are used (for java, autocomplete etc.), how the vimrc looks like and how the whole process of bui...

Execute a script directly within vim/mvim/gvim

TextMate has a nice feature that allows you to execute a script from within the current context and shows you the output in a separate window. This lets you write and test code on the go. I'm almost certain there is a similar feature with MacVim/gVIM, but I'm not sure what it is. Currently I save my buffers to disk, then go to the comman...

Insert empty lines without entering insert mode

I often find myself bouncing on o or O and ctrl{ to insert blank lines and get back out of insert mode. Thinking there must be a simpler way, and hoping to retain my cursor position, I hacked together these sloppy macros: map <Leader>O :let cursorpos = getpos(".")<CR>:i<CR><CR>.<CR>:let cursorpos[1] = cursorpos[1] + 1<CR>:call setpos('...

Recent file history in Vim?

I would like to access recent files that I had opened and then closed in GVim. I open and close GVim frequently. I would like to access recent files from previous sessions as well. Does GVim store recent files somewhere as Word and many other desktop apps store? How to access them? ...

Preventing redefining existing buffer mapping

I want to prevent *noremap command from remapping an existing sequence, but only if this sequence is local to buffer: noremap a b " Will fail, must succeed noremap <buffer> <unique> a c noremap <buffer> a b " Will fail, OK noremap <unique> <buffer> a c noremap a b noremap <buffer> a c " Will fail, OK noremap <unique> <buffer> a d ...

VIM: Preview height

Hello, I am new to vim so I was trying to edit an existing script for the vimrc file. The script will take the content of the current buffer and copy it into a new window and then run Python. The scrip works but the preview window is always 50% of the current window. This is the script: " Preview window for python fu! DoRunPyBuffer2(...

Useful Vim plugins for web development and design (php, html, css, javascript)?

Right now I'm using surround.vim to enclose text in HTML tags, and a plugin that highlights text according to the hex value in the CSS file (e.g. #888 will have gray background in the CSS file). Are there other useful plugins for web development? Recommendations Here is a list of the plugins mentioned in the answers so far: surround...

Vim - run ctags on current python site-packages

This is what I need - have a key that will create ctags of my python site-packages. I have this command, that will print the site-packages path: !python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()" This is how I to the key mapping: map <F11> :!ctags -R -f ./tags *site-packages-path-goes-here*<CR> How...

How do I open Vim's Taglist plugin to the right side of the window?

I have NERDTree on the left side of my Vim's window (and the main files in the center). Every time I open Taglist (:TlistToggle), it is displayed in the left side together with NerdTree. I made a custom remapping for Taglist: nnoremap <F3> :TlistToggle<CR> How can I make Taglist open to the right side instead of the left side? ...

Preprocessing a word before spell checking in Vim

Hi all, I use Vim's spell checking to validate texts in Russian. We have letter ё in our alphabet which is often replaced with simple е. So, for example, word ёжик из written as ежик. It is a bad tone actually. Its like using - (hyphen) where — (em-dash) is required, like using "computer" quotes forgetting about existence of „typographi...

How to set initial caps in VIM?

In VIM, it's really easy to change a word of text to use uppercase or lowercase: # in visual mode # change word to uppercase gUw # change word to lowercase guw Is there a simple way to modify the word to use initial caps? ...

In vim can you split multiple files from the command line?

In vim you can edit multiple files when you launch, a la: $ vim file1 file2 file3 Then you can edit each file one after the other. What I would like to do is have file1, file2, and file3 all open up in different buffers, like they would if I did $ vim, :split file1, :split file2, :split file3 Is this possible? I'd also settle for be...

Vim: Show function hints or signature for PHP

I've got my nice PHP syntax highlighting all set up and it looks great. What I need now is the ability to show built-in function signatures or hints while typing. This is so common in so many IDEs, I would think somebody has a plugin to do this for VIM. Example: While in insert mode, and typing str_replace, somewhere on the vim screen ...

Vim : changing text between html tags

Hello you vimmers! I just wonder how to change the text between html tags right from the normal mode, like the way we can change text within double-quotes thanks to ci" ? Thanks! ...

Vim object-select with syntax-aware text-objects

I just learned about the truly awesome object-select capabilities of vim. With the cursor within some "text object", a set of simple verbs can select or operate on the whole object. For example, with the cursor anywhere inside the quotes below (e.g. over the 'o'): print "Hello, world" ^ The command vi" will select the who...

How to use cscope with paths that contain spaces

There are some folder that contains space, and as a result, those folders can not be indexed using cscope. Can i ask you for help to solve this,or any suggestion. thanks Julius ...

Does anybody have vim syntax file for expressionengine?

I'm mac user, but I really like vim-text-navigation style and other features. I tried to use TextMate, but nothing. I can't use it. So, maybe someone have syntax file for expressionengine and modified matchit plugin. ...

Is there a "verbatim" mode for the vim map command?

Dear all, I am trying to set up some useful coding templates in vim, for example I have mapped map `cl iclass <+CLASSNAME+><CR>{<CR><Esc>Iprotected:<CR><+PROTECTED MEMBERS+><CR><Esc>Ipublic:<CR><+PUBLIC INTERFACE+><CR>};<CR><++><CR><Esc>3kv<0v3k<2k so that when I type `cl in vim I get class <+CLASSNAME+> { protected: <+PROTECTE...

How do I write a vim function to output the result of a system command?

What I have so far: function! GetMarker() return system('echo $random `date` | md5sum | cut -d" " -f1') endfunction I would like to be able to do a :getmarker and have it insert the output of that system command at my cursor, with no new lines. Also what is the difference between function! and function? Edit: before any of you...