Jean-Pierre Chauvel
Jean-Pierre Chauvel

Reputation: 984

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.

Upvotes: 19

Views: 3120

Answers (5)

idbrii
idbrii

Reputation: 11966

You can try OmniSharp. Its omnicompletion shows method signatures:

omnicompletion shows method signatures

The latest version includes an installer (for linux/mac/unix and windows) to eliminate installation issues. (It was much easier than last time I tried!)

Upvotes: 1

lzap
lzap

Reputation: 17173

Very easy. Download and install Exuberant ctags (http://ctags.sourceforge.net/) (part of any linux distribution even works on Windows).

In your project directory do this:

# ctags -R .

That generates file named "tags".

Now start up your vim in the same directory. Open a file, enjoy OmniCompletion and other things you can do with tags.

Please not while this is not ideal solution (it completely ignores the context) it gives you at least something. Big advantage is you can do the same with any other language that ctags do support (more than 40 computer languages). Also you can jump to definition (function, constant etc). Read: http://vim.wikia.com/wiki/Browsing_programs_with_tags

Upvotes: 5

Chris Nicola
Chris Nicola

Reputation: 14574

I use this plugin to get a semi-automatic completion behaviour for everything:

https://github.com/shougo/neocomplcache

You may want to check out these resources to get the settings for C# correct:

http://arun.wordpress.com/2009/04/10/c-and-vim/

http://www.vim.org/scripts/script.php?script_id=1265

Upvotes: 1

Jan
Jan

Reputation: 2490

This may only be a workaround, but you can press Ctrl+P to auto-complete to any word previously typed in the file (use Ctrl+N for word typed after your current cursor position).

Upvotes: 2

evan
evan

Reputation: 12553

This seems to be a bit stale. You may just want to download the PHP omnicomplete file (or any other one, but I know that's available). Then change the names of functions, classes, keywords, etc. to be the C# equivalents. Add it to your plugins directory and upload for all to use!

Upvotes: -2

Related Questions