vim

What's the traditional way to navigate a project

Having just moved from textmate to vim I'm curious. To be able to navigate my project efficiently I've installed command-t and ack.vim. These both seem like relatively new projects in the history of vim. What do people traditionally do to move around a project when they work in vim, do they just use the file explorer or is there some old...

Is it possible to not display a "tilde" for blank lines in vim

This confuses MacVim's scrollbar. And I quite don't like them ...

Make Vim's glob() also match hidden dot files.

In a Linux or Mac environment, Vim's glob() function doesn't match dot files such as .vimrc or .hiddenfile. Is there a way to get it to match ALL files including hidden ones? The command I'm using: let s:BackupFiles = glob("~/.vimbackup/*") I've even tried setting the mysterious {flag} parameter to 1 and yet it still doesn't return t...

Waiting for window before executing a command for Vim keybinding?

I currently have the following keybinding in my .vimrc: nnoremap <Leader>gs :Gstatus<Enter><C-n> I'm using vim-fugitive plugin here. The intention is to pull up the Git status window and then move the cursor to the next file (<C-n>). It works, except the <C-n> part, and it seems to be because Vim executes it before the status window lo...

Any vim command to enter insert mode after paste?

If I use 'p' to paste, vim will remain at normal mode. Is there a command where I can paste and enter insert mode? ...

Copy between matches, not the lines, but things between match-points

:/From book:/,/$/ cmd_copy chapters_from_match_@From_book@_until_end_of_line.txt I tried not to use words "write", "put" or "read" as VIM has special meaning for them. I try to copy (sorry not referring to VIM's copy-command) the thing between matches to a file. How do you do it, without copying the whole lines? Dummy example TEXT: ...

How do I exclusively indent a code block in vim?

There are a surprising number of questions on this subject, yet some how none of them answer what I want. I have a code block as follows: void foo { somecodehere morecode ... } As you can see the guts of my function are indents on the same level as the rest of my code block. What I currently do is >% on the end of my block (ie the...

Vim using the wrong spell file?

I've been using vim for a long time, but recently I built a new server, and when I opened vim, I found it wasn't using my spell file. Historically vim would load ~/.vim/spell/en.utf-8.add as it's spell file, but when I tried adding a word to the dictionary, it added it to en.latin1.add instead. ls ~/.vim/spell en.latin1.add en.latin1...

Is there a plugin for vim to auto-import python libraries?

In eclipse you can hit Ctrl+Shift+o to automatically import all the libraries you reference in your code. Is there any similar plugin for vim to have this feature with python? ...

Automatically expand Java directory structures in NERDTree

Java by convention is pretty keen on directories. Because of this, all the code in my current Grails project is nested 5 directories deep, e.g.... ~controllers ~com ~companyname ~teamname ~productname |-[code actually here] There's a similar folder structure under every core Gra...

How do I dump output of an external command to a new buffer in Vim?

:enew lets me create a new buffer and :.!<command> lets me dump the output of an external command to that buffer. Can I combine the two into a one liner? Thanks. ...

Do developers actually use vim to write code (Java) on a Windows OS?

...or is vi/vim only used when developing on a non-Windows OS? If not, what feature(s) does vim provide that modern IDEs such as Eclipse do not? Why would one elect to use vim over Eclipse (or IntelliJ, Websphere, or other feature-rich IDEs) when developing on a Windows workstation? Note that I'm referring to Java development and to som...

How to use cscope?

I am using cscope to get familiar with all the keywords used in socket programming. I went to the directory with c files. I used cscope. and then I searched for AF_INET. I got this : #define AF_FILE PF_FILE #define AF_INET PF_INET #define AF_AX25 PF_AX25 This was a full page. I only published part of it. Now I ...

Vim Markdown Folding?

I just realized that VIM 7.3 has built-in support for highlighting Markdown files. Excellent. However, it doesn't fold on the headings. Can any offer suggestions on how to get this working? Alternatively, I'm using Markdown only as a way to get simple structured text. If there is a better alternative format, please also suggest. But ...

How to get short option name from long option name in vim

I have a list of vim long option names as strings (e.g. ["tabstop","shiftwidth"]). What would be the best way to convert it into a list containing only short names (e.g. ["ts,"sw"]). What about if the original list is a mix of short and long names? ...

textmate >> vim for python - teething troubles: especially indenting

I'm (attempting) to move from textmate to vim [macvim to be exact] as my primary editor. I have already installed snipmate - wondering if there are other plugins you would suggest I install? In particular I seem to be having a lot of trouble with indenting (<< seems to really do some very strange/unpredictable things), and I can't seem ...

Vim omnicompletion for C#

I was wondering if there is any tool like OmniCppComplete for C# (method signature shown in the abbreviation is what I'm most interested in). I've searched everywhere with not avail. Update: I'll be editing mostly from a shell terminal so please refrain from suggesting GUI alternatives to Vim. ...

Howto organize Vim buffers, windows and tabs when working with many files

Hi there, I used VIM whole my life but recently I am a bit tired of it because I am lost in buffers, windows, and tabs when working simultaneously with 20 files or so in a big project (with 500k LOC, and hundreds files). Whenever i do :make, :grep etc new buffers are jumping out in the current window. The same happens for the tags. At ...

Vim or Emacs for Rails development... any advantages?

Getting ready to try out vim or emacs for rails development. Does one of these support rails development any better than the other? This is on windows if that matters. Edit I'm not looking for reasons why or why not to use vim or emacs and I don't want opinions on which is a better editor. I mainly just want to know if one or the ot...

Why does Vim on windows use \n for searching?

So I was changing code from foo() { to foo() { and I noticed that the searching pattern required me to search for \n, but when I tried to replace it with \n I got the ^@ character, and I had to instead replace with \r. It seems strange to me that I search with \n and replace with \r, any idea why this might be? For reference my ...