Vim: Recommendations for vimball plugins in pathogen - vim

I plan to switch to vim 7.3 in the next days on my windows box - linux will soon follow. I also plan to switch my vim setup and let pathogen handle my plugins.
I've googled but not yet found a solution how to handle plugins using vimball technique for setup. Any hints?

You are looking for :UseVimball [path]
Open the vimball up with vim. Instead of sourcing it with :so % do
$ vim somthing.vba
:!mkdir ~/.vim/bundle/bundle-dir-name-here
:UseVimball ~/.vim/bundle/bundle-dir-name-here
Note you will have to make sure the path exists before you execute this command.
:h :UseVimball

You can try vim-addon-manager: it is able to put every plugin in a separate directory and correctly handles Vimball.

Related

Vim picking up Cscope command instead of ctags?

I have installed ctags but not installed cscope.
When I press Ctrl-], vim correctly takes me to the definition.
However, when I press Ctrl-t, it replies back with error - "E567: no cscope connections".
vim --version has +cscope in it.
I tried setting "set nocst" in my vimrc, but to no avail.
Try:
:set csto=1
From the documentation http://vimdoc.sourceforge.net/htmldoc/if_cscop.html#csto
The value of 'csto' determines the order in which |:cstag| performs a search.
If 'csto' is set to zero, cscope database(s) are searched first, followed
by tag file(s) if cscope did not return any matches. If 'csto' is set to
one, tag file(s) are searched before cscope database(s). The default is zero.
I hope this will help you.
You may have cscope_maps.vim installed. Or, perhaps another related cscope related plugin/bundle. If so, you'll need to remove it.
If you already have ctags installed and you are trying to use an outline viewer for your code, I would recommend using https://github.com/majutsushi/tagbar. It works really well with just ctags.
If you are are using Vundle, install using
Plugin 'majutsushi/tagbar'

vim-go autocompletion not working

I recently installed vim-go using pathogen, but the autocompletion feature is not working. If I am using it only shows commands I've already used.
My .vimrc has
filetype plugin on
" Enable autocompletion
set omnifunc=syntaxcomplete#Complete
" Select keyword as you type
:set completeopt=longest,menuone
Do I need more than just this plugin? The other feature I have tested so far are working (:GoRun, syntax highlighting).
This is on a Ubuntu machine.
Are you typing C-X C-O to open the autocompletation window? This works fine for me.
On the other hand, if you want to get real-time completion (completion by type) install the following plugins YCM or neocomplete
The syntaxcomplete#Complete ships with Vim, not the Go filetype plugin, and it has very limited capabilities (basically, just offering the language's keywords). No wonder you're disappointed.
The ftplugin/go.vim file sets the correct, custom completion of the vim-go plugin:
setlocal omnifunc=go#complete#Complete
So, just ensure that the 'filetype' setting is correct (go), and that you don't have any additional configuration that overrides the plugin's.
:verbose setlocal omnifunc?
can tell you.
If none of these suggestions solves your problem, try killing gocode from a terminal:
gocode exit (or killall gocode it that fails)
gocode -s -debug
In case of startup failure due to a lingering unix socket, simply remove it and try again. Once everything is working, you can terminate the debug enabled gocode process (the plugin will autostart as needed)
This is what worked for me. default gocode pkg seems to be no longer maitained. so update it with the one below.
my go and vim versions:
VIM - Vi IMproved 8.2
go version go1.16.4
follow the steps below:
gocode exit
go get -u github.com/mdempsky/gocode
run gocode in debug mode
gocode -s -debug
try the autocomplete.(vim-go C+X C+O)
viola! you should see the list like so:

vimrc test for if_lua during vundle BundleInstall

I use the same .vimrc file on lots of systems. I'd like to bypass vundle installing some modules that I know won't work if 'if_lua' is not present.
Is there a vim script way of conditionally doing
Bundle 'Shougo/neocomplete.vim'
only if vim was compiled with lua to avoid the start up error:
$ vim myprogram.c
neocomplete does not work this version of Vim.
It requires Vim 7.3.885 or above and "if_lua" enabled Vim.
Press ENTER or type command to continue
thx
if has('lua')
Bundle 'Shougo/neocomplete.vim'
end

gVim 7.3 in fullscreen mode

I'm using the script to open gVim in fullscreen downloaded from here: http://www.vim.org/scripts/script.php?script_id=2596.
I've also added this line to the startup settings:
:call libcallnr("gvimfullscreen.dll", "ToggleFullScreen", 0)
When running gVim with this setting, I get the following error:
Error detected while processing _virmc:
E364: Library call failed for "ToggleFullScreen()"
Is there anything else I need to do with the files from that script? If I need to compile it somehow, would like someone to guide me through that process as I'm fairly new to Vim. Thanks!
Edit: I'm running Windows 7
I guess you mean ~/.vimrc or ~/.gvimrc by "startup settings". When that is executed, the GUI isn't initialized yet. Try delaying the execution with an autocmd:
:autocmd GUIEnter * call libcallnr("gvimfullscreen.dll", "ToggleFullScreen", 0)
It doesn't seem to be working if you place that call line in your vimrc. It should be called after Vim has finished loading. I suggest using that mapping from the readme:
map <F11> <Esc>:call libcallnr("gvimfullscreen.dll", "ToggleFullScreen", 0)<CR>
It worked for me.
I had the same problem when I was install this script through Vundle.
It's solved the problem:
Copy the DLL to the folder where GVIM.EXE is located.
An alternative to copying the gvimfullscreen.dll to the executable directory is to specify the file path, like this:
call libcallnr(expand("$VIM") . "/bundle/gvimfullscreen_win32/gvimfullscreen.dll", "ToggleFullScreen", 0)
In this example, I'm using $VIM and the bundle directory, but you can change this to a full path, or use another variable/path that works better for you.
This isn't a direct answer, but after searching for a solution for quite a while, I've decided that the prettiest way to run Vim on Windows is via Cygwin, via the (bundled) mintty terminal. It has a genuine full screen and even transparencies!

fresh installation of gvim on ubuntu. where should I put my plugins?

I just installed gvim on fresh installation of ubuntu lucid. I've messed this up before that's why I want to start on the correct step here.
Where should I keep all my plugins and my .vimrc??
my current runtimepath on gvim is:
runtimepath=~/.vim,/var/lib/vim/addons,/usr/share/vim/vimfiles,/usr/share/vim/vim72,/usr/share/vim/vimfiles/after,/var/lib/vim/addons/after,~/.vim/after
one thing that i've never been able to get working on gvim is snipMate. Anyone has pointers on having that work with gvim?
I use pathogen with ~/.vimrc and plugins in ~/.vim/bundle, more details here. You can see an example here.
Plugin folder is always under ~home/.vim or ~home/vimfiles your vim configuration file or .vimrc always in your ~home/ as for example: ~home/.vimrc
Snipmate fully works for me under Ubuntu. unzip it correclty and it should work right. BTW a great great plugin.

Resources