vim

How do I install a plugin for vim?

I'd like to try the plugin for Vim linked below. It adds syntax highlighting for .haml and (perhaps) .sass files. http://github.com/tpope/vim-haml I did this... $ cd ~/.vim $ git clone git://github.com/tpope/vim-haml.git I opened a .haml file in Vim, but there's no highlighting. There must be another step I need to perform. ...

Combined HTML, PHP and Javascript indenting and syntax highlighting in vim

Hi all, I use vim for web development. These are almost always .php files, which also contain HTML and sometimes Javascript. While working in a block of PHP, indenting works fine. The syntax highlighting is okay, but only really useful for the PHP-code. When I want to edit an HTML block, I usually switch: :set ft=html, so that highlight...

How to save a session in Vim

Depending on my task in Vim I have several tabs open. How can I save different sessions for later use? Thanks!! ...

Vim using gf with spaces in filenames

In gVim if the cursor is over a filename (like "C:\Program Files\Vim\vim71\README.txt" ) which contains spaces then using 'gf' fails. I found the isfname option but the documentation says one should avoid using spaces. Is there I can make gVim open files under these circumstances ? ...

Eclipse PDT: How do I get it to format my PHP arrays like VIM?

I've been struggling to get Eclipse to format my php arrays like vim indentation does. What eclipse does (press CTRL+SHIFT+F) <?php $array = array( 'key1' => 'value1', 'key2' => array( 'child_key1' => 'child_value1', 'child_key2' => 'child_value2', ), ); What vim does (press keys:gg=G) <?php $array = array( 'key1' => 'value1', '...

How can I map Ctrl-TAB to something in Vim?

I'd like to map Ctrl-TAB to gt in Vim so that I can switch tabs with one keystroke. I tried... nmap <C-T> gt nmap <C-Tab> gt nmap <C-TAB> gt That didn't work. How do you say "the tab key" in Vimese? ...

In Vim, can I format a whole file and end with the cursor where it started?

I set up this mapping in my .vimrc and it works great... " Auto indent entire file nmap <C-f> gg=G imap <C-f> <ESC>gg=G However, after the operation the cursor has moved to line 1, column 1. Is there a way to do it so that if I'm in the middle of the file somewhere the cursor will remain where it is? ...

Is there a rails.vim equivalent for Django?

I love Tim Pope's rails.vim, and I'm wondering if there's an equivalent vim plugin for Django. I'm especially looking for easy navigation of the Django file structure via vim command mode. ...

minibufexpl vs. bufexplorer in Vim

I think about to install a buffer explorer for vim. In vim.org both (minibufexpl and bufexplorer) have very good rating. Can anyone explain the differences or the pros and cons. Or is only a matter of taste? Thanks! ...

How would you make this into a VIM macro?

So one of the common tasks that I do as a programmer is debugging a live system. And one of the ways that I debug a live system is to capture a verbose log from the console. Typically the log file has around 20 extra lines for every one line I am interested. To minimize my macro script I went about creating a macro that will grab ONLY ...

How can I enter a line break in the middle of a line?

In Vim, how do I break a line of text with a newline? For example, I'm in INSERT mode and I'd like to get from here... $('#toggle_contact_search_mode').click([CURSOR IS HERE]); To here... $('#toggle_contact_search_mode').click( [CURSOR IS HERE] ); The result I'm getting is that when I'm in insert mode and I have the cursor in th...

How can I format JS code in Vim?

I have this bit of JavaScript... 15 $('.ajax_edit_address').each(function() { 16 $(this).ajaxForm({ 17 target: $(this).parents('table.address').find('tr.address_header').children(':first'), 18 success: function(response) { 19 $('input, select, textarea', '.ajax_edit_address').removeClass('updating'); 20 ...

How can I activate Vim color schemes in OS X's Terminal?

I'm working with the Vim 7.2 that comes with Mac OS 10.6.1 (Leopard), using the Mac's "Terminal" app. I'd like to use a fancy color scheme. I did this... :syntax on Then this... :colorscheme slate :colorscheme elflord :colorscheme desert etc... Syntax highlighting is working, but I'm finding that regardless of the scheme I choos...

Does vim provide tiered intellisense support through phpdoc?

The one thing I really miss in vim is a tiered intellisense support, just like we have one in PHP Eclipse. For example: /** * Get the config object * * @return Config */ public function getConfig() { return $this->_config; } I find this explicit return type setting very useful and time saving feature. Do we have something si...

What's a good command line JavaScript code beautifier?

I recently asked a question about formatting JavaScript code in Vim. And I've also noticed this question, and did some Google searching. Nonetheless, my quest continues. I've given up on a Vim plugin that will properly format contemporary JS code. But maybe there's a command line tool I could call from within Vim. Here are my desiderata...

What are some good plugins for developing Java in VIM?

I love vim, but not having things like IntelliSense/Code completion from Eclipse makes it pretty difficult. I know, I know, I should be able to look at method signatures and java docs for the API I am interested in using. I'd love to, but I'd like it to be accessible from my fingertips instead of having to browse the source tree manually...

How to jump back to NERDTree from file in tab?

When I've just opened some project in NERDTree and then want to modify any file I do the following: Choose needed file Open it in tab(t character, by default) But how I can jump back to NERDTRee to open one more file it tab? I've read NERDTree help file but still don't know how to do it? Temporary solution I use now in my .vimrc fi...

How do I configure indentation in vim in a specific way?

If I type the following void main(int blah, and then press enter, I want to continue here: float blah); How can I achieve this? ...

what's the syntax for telling VI to read/write a source file with soft-tabs and a specified indentation?

Someplace I saw a snippet of code which told vi to use soft tabs and set the size of a tab. If you put this snippet at the bottom of a source file, then vi would magically use those settings for that file. What is the syntax and rules for including that snippet in a source file? Can emacs be made to use these settings as well? ...

Getting VIM to be efficient in Actionscript like Flex

I'm trying to setup VIM for editing Actionscript 3 for some upcoming Flash projects. I dislike working in an IDE and prefer VIM. Right now, I know that I want: Omnicomplete (with tab completion) Syntax highlighting (there is an actionscript.vim file on vim.org but the highlighting is not as good as other syntax files) AS3 compiler acce...