I want to mention how to get gVim working with unity (so that double clicking an error in the error console, for example, opens the offending script at the correct line number in a tab in an existing gVim window (or a new window, if none exist))
I know that the wiki would be a better place for this, but I’m swamped with work atm and don’t want to spend time learning how to edit wikis. I hope it’s ok to just make a post here
To set up Vim for use with Unity, a wrapper application is necessary. Unity does not pass information about the line an error has occured on, when using external editors. The only time Unity passes on line information to an editor, is when the built-in UniScite option is used.
UniScite receives 2 params. Param 1 = script filename, param2 = “-goto:”, followed by a line number. So the wrapper application must parse the 2nd argument and then execute:
<path_to_gvim>\gVim.exe --remote-tab-silent "%1":%2
where %1 is the script filename and %2 is the parsed line number. (You can replace --remote-tab-silent with --remote-silent to open the file in existing vim window but not in a new tab. Or remove it altogether to open the file in a new window)
Furthermore, to have vim actually scroll to the specified line, you need the following plugin:
http://www.vim.org/scripts/script.php?script_id=2184
Without the plugin, gvim interprets the line information as part of the filename.
So there you have it, that’s the information you need to set up gVim with Unity. I have attached the source to the wrapper application (in C++) that I used, so you can just grab it and use that. I’m not very proficient with C++, though, so don’t expect anything elegant
Alternatively, after getting it to work, I noticed that this thread (http://forum.unity3d.com/viewtopic.php?p=225663) has C# code attached for a UniSciTE wrapper that could be modified for use with gVim.
I hope this is helpful to someone. gVim is a great editor
240501–8605–$main_103.cpp (1.52 KB)