vim

Install Ruby support for VIM on Mac OS X

Mac OS X 10.6 (Snow Leopard) has VIM pre-installed (version 7.2), which is great. It also has Ruby pre-installed (version 1.8.7) which is great too. However, I want Ruby autocompletion in VIM. Looking up the VIM version (vim --version) shows -ruby (i.e. ruby support isn't enabled). How to enable ruby for my VIM installation? ...

Easily create a Ruby on Rails partial from an existing block of markup using vim

Is there currently a plugin that you ruby on rails developers that are also using macvim/gvim/vim that allows you to take a quick block of code and create a partial from it? I know that TextMate does this, figured someone has ported it by now to vim also. ...

Vim: gg=G aligns left, does not auto-indent.

When I try to fix the indentation of an HTML file with gg=G, each line looses its indentation and becomes left-justified. Does anybody know what could be going on here? Thanks. ::EDIT:: test.html <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>Indent test</title> </head> <body...

^M at end of lines when editing in CodeBlocks (I think)

I'm on Ubuntu Linux 10.04. I use vim for most of my development and CodeBlocks for debugging. When I first moved from Windows to Linux, I noticed that vim was showing ^Ms for newlines, and found out that this was a Microsoft thing. However, even after removing them I notice that they sometimes reappear in files (files that I edit in Code...

Formatting DateTime in VIM without leading zeroes on Month, Day, and Hour.

Does anyone know if there's a way to format the date generated by strftime in Vim (under MS Windows) such that Month, Day, and Hour are not padded to two digits with a leading zero? For example, the following commands in vimrc: nmap <F3> a<C-R>=strftime("%I:%M %p %m/%d/%Y ")<CR><Esc> imap <F3> <C-R>=strftime("%I:%M %p %m/%d/%Y ")<CR> ...

How can I stop vim from loading a syntax file automatically for certain file types?

I am working on a project writing a GLSL fragment shader, and it just so happens it has the file extension .fs, thus vim automatically loads the forth syntax upon opening the file. This normally would be no problem, I could just change the syntax using au BufRead but for some reason the forth syntax is loaded first, which completely me...

vimrc to be cross-plataform and synced with Dropbox.

I'v been using vim/gVim so far in my Linux Machine, and I have a Windows machine as well. In this windows machine I'm mainly notepad++. I would like to store all my .vimrc settings and .vim folder in Dropbox, and create symbolic links in Linux pointing to them, and them do the same in my Windows machine. I have plenty of "home shortcut...

How to type ASCII 145/146 (quotes) in vim?

Hello Using vim 7.2.330 on a Ubuntu host from an XP host, I'm stuck at how to type/paste the following line in a text file: include_once(‘/full/path/to/app’); The document says it's important to use ASCII 145 and 146, but vim turns them into "<92><93>", and Nano turns them into �. Note that I'm using a European keyboard layout, no...

Vim display wchar text properly

I'm trying to look at a file that was saved without a BOM as wchar text. In my gVim window I see: T^@E^@X^@T^@H^@E^@R^@ ...which is really annoying. I want to edit this file as a regular text document, and I'd like vim to save it in the same format. I've tried doing :set encoding=utf-16 (and other variations such as utf-16le, ucs-2, a...

[vim] -- is there a way to copy up to a search term, _including_ the term?

If I have the following words cat Oliver Louis and the cursor is on "c", I can copy up to the beginning of Louis with y/Louis<CR> (where "CR" is the enter key), which will copy the string "cat Oliver ". Is there a way to copy the search term, "Louis", as well, for a copied string of "cat Oliver Louis"? Thanks in advance. ...

Is there a way to fix vim not-noticing python if statements that have comments?

Consider the following block of code- if (1==1):#Go forever print "Wooo." Vim doesn't see the :, due to the comment, so it insists that the print should be at the same indent level as the "if" using http://www.vim.org/scripts/script.php?script_id=974 Any thoughts would be appreciated. ...

Vim: can global marks switch tabs instead of the file in the current tab?

I'm in the process of learning vim, and i just learned about marks. Before this i found it useful to have all the source code files i'm working on in their own tabs. When i found out about "global" (capital letter) marks i thought it would be a great way to switch to a tab which already has the marked file open, and scroll to the correct...

vim phpdoc multiline comment autoindent

Suppose I have a comment block like this: /** * comment * comment * comment */ And when I open a new line inside this block I want vim to start it with /** * comment * _ * comment * comment */ but autoindent in standard (ubuntu) vim scripts starts an empty line, like this: /** * comment _ * comment * comment */ Is ...

Why is Emacs used by everyone interviewed in Coders At Work?

I'm using both Vim en Emacs (Vim for a few years, emacs for a few months). I like both but I tend to see Emacs as a bit cumbersome and unfinished. For example some very basic action such as copying a word has to be added if you want it. But I love the fact that you can easily customize it. I'm currently reading Coders At Work and I love...

NERDTree vim plugin, trying to add file without success

To my understanding, you can add files directly from MacVim with the NERDTree plugin. I navigate to NERDtree and hit 'm' to bring up the NERDTree filesystem menu as described in this post: http://stackoverflow.com/questions/1459750/vim-and-nerd-tree-extension-adding-a-file The problem is, I get this output after invoking 'm': NERDTree ...

Vim Perl autocomplete displaying a given modules functions

Is it possible to have Vim autocomplete show which functions are available to a given module? So if I include a module called math and then go: math:: and at that i could get a list of the functions available through that module. ...

Programming Ruby with Vim on Windows

Hi, I'm just starting learning Ruby and decided "wth, let's pick up vim and get used to it in the process". That sounded like a great idea until I actually downloaded gvim and started ... staring at it. Ok, I'm not a total noob, I know how really basic things are done in vim, what I'm looking for is how to setup vim and what plugins I n...

Hidden features of Vim

Over the years, I thought I'm a Vim master! Recently I visited a real Vim master! oops! My knowledge is awfully superficial! For example I didn't know it's possible to add a \c to make search case insensitive. (instead of :set ignorecase) I clearly remember when how I'm surprised when I found SuperTab or TagList plugins first time. Vim...

fold all other scopes

hi, is there a trick to fold all other functions but not the function in there my cursor is? ...

Starting Vim at a certain position (line and column) of a file

To start at a specific line I would use: $ vim FILE +LINE But what parameter needs to be passed to vim to position the cursor in a certain column of this line? ...