compiler plugins not loaded - vim

i tried to use this python compiler plugin to be able to "compile" a py script and see the errors in qucikfix windows and jump directly to the linenumers.
http://www.vim.org/scripts/script.php?script_id=1439
i placed it in /compiler/python.vim
but: the script is not loaded when i open a python file. even :filetype detect doesnt help.
(according to :scriptnames)
i also tried to put the stuff into _vimrc. but it is overwritten by some other stuff thats useless. i dont know where it comes from i searched all plugin directories but there is no plugin that does set makeprg and errorformat!
im lost. plz help.
thanks!

Compiler-plugins are never loaded automatically. You'll have to load it explicitly with :compiler python.

you could add this to your filetype.vim file:
autocmd! BufRead,BufNewFile *.py compiler python

Related

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!

Vim script not loaded?

When I work with some Python files, and run :set filetype? in Vim, I get filetype=python, so the file is recognized correctly as Python code.
I've downloaded this plugin: http://www.vim.org/scripts/script.php?script_id=1494
and put it in ftplugin folder, but its f/F keys bindings are not working, and running its :call ReFold() gives E117: Unknown Function indicating that the plugin hasn't been loaded.
Any troubleshooting tips on how to load the plugin?
Try removing this part at the top of the script:
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
And possibly moving the script to after/ftplugin directory (:help after-directory).
I think you have another python specific plugin that comes first at 'runtimepath' and defines b:did_ftplugin, which is OK, but this python script (python_editing.vim) shouldn't check for and define b:did_ftplugin since it doesn't implement the functionality of original plugin, it just extends it.
So the script is loaded, but does nothing. By running :script command without arguments one can check if some script is loaded at all.

Vim + Pathogen not loading help docs

Currently I use Pathogen to organize my vim plugins. It seems to do this fine and without a hitch but for some reason the helptags are not generated. I don't think my file structure is at fault (although it could be) because as far as I can tell I've set it up correctly, e.g: pathogen.vim is in ~/.vim/autoload and all my plugins are in ~/.vim/bundle
My .vimrc is aliased to the HOME directory so I can quickly find it and open it and the pathogen related part looks like this:
filetype off
call pathogen#runtime_append_all_bundles()
call pathogen#helptags()
I feel like I've tried every iteration of this I've found on the internet as well and nothing has been successful. The plugins seem to work just fine every time but I can never get the help docs using the helptags. I'm using Mac OSX 10.6 if that helps.
Any advice is appreciated. Thanks.
I had the same problem of not finding the help when updating pathogen - I just had to run the following command to generate the helptags:
:Helptags
If you simply add the line to start pathogen to:
call pathogen#infect()
Helptags
It will generate them on startup and you will have the help as always.
To quote tpope from the vim-pathogen README:
Normally to generate documentation, Vim expects you to run :helptags on each directory with documentation (e.g., :helptags ~/.vim/doc). Provided with pathogen.vim is a :Helptags command that does this on every directory in your 'runtimepath'. If you really want to get crazy, you could even invoke Helptags in your vimrc. I don't like to get crazy.
On 4/13/2011 a :Helptags command was added, which generates help tags along the 'runtimepath'
The preferred way of initializing the plugin is now:
call pathogen#infect()
syntax on
filetype plugin indent on
All this and more in the docs
Take a look at my reply to "Pathogen does not load plugins". I think it might address your problem. Once you follow what I mentioned there, you should get the documentation for your plugins as wanted.

How can I debug a Vim plugin not being loaded?

I'm trying to use the Vim snipMate plugin, and I've installed it as it directs, but when I press tab nothing happens.
How can I debug this? Are there log files Vim makes when it tries to load stuff?
How can I see what plugins its loaded correctly?
I've tried :sni<tab> to see if there's anything called snipsomething installed but nothing completes.
In the installation tutorial it doesn't mention adding anything into my vimrc but I guess it finds the /plugin/ dir automatically?
I'm running on Windows and Unix and I have the same profile with the same problem.
Other plugins like NerdTree are loading OK.
Update: Following another question, I've tried :inoremap and :snoremap and the <Tab> entry mentioning TriggerSnippet() is there:
e.g.
s <Tab> * <Esc>i <Right><C-R>=TriggerSnippet()<CR>
Does this mean it's enabled?
:verbose imap <tab>
will tell you what is bound to <tab>
:scriptnames will tell you what scripts were loaded.
You can insert echo "Loaded so far" and the like inside the plugin code - the text will be displayed in the bottom line if the echo is executed. Debugging by printf :) Crude, but simple and works.
Also: plugin is loaded automagically. plugins is not.
It looks like I had something dodgy in C:\Program Files\Vim\vimfiles\ directory which was superceding my user preferences. I just blew away that directory and it works now.

Pathogen does not load plugins

Pathogen does not work for me. I am following Adam Lowe's hints posted here (and few more) without any success...
My vimrc:
filetype off
call pathogen#runtime_append_all_bundles()
filetype plugin indent on
set nocompatible
syntax on
set tabstop=2
set smarttab
set shiftwidth=2
set autoindent
set expandtab
set number
colorscheme darkblue
Contents of .vim - ls .vim/*:
.vim/autoload:
pathogen.vim
.vim/bundle:
nerdcommenter/ vim-haml/ vim-surround/
vim-endwise/ vim-rails/ vim-vividchalk/
All plugins in bundle were installed by cloning them from GitHub into bundle directory.
I have tried with pathogen 1.1 and 1.2 and even the latest from GitHub without any result. Vividchalk, Vim-rails and nerdcommenter are not working. I have very little experience with other plugs so I am not sure about them, but I suppose they are not working too.
I am using ArchLinux, vim 7.2.385-1 (not the latest because the latest requires me to install ruby1.9, but it is still 7.2). It has been installed via pacman - ArchLinux package manager. No vim plugins were installed the other way than using pathogen (I have even reinstalled vim package with cleaning /usr/share/vim).
What am I doing wrong?
EDIT:
/etc/vimrc http://hpaste.org/fastcgi/hpaste.fcgi/view?id=29685#a29685
/usr/share/vim/vimfiles/archlinux.vim http://hpaste.org/fastcgi/hpaste.fcgi/view?id=29686#a29686
This seems to be common problem caused by the "system" vimrc in some distributions setting filetype on before you set up pathogen. So turning it off and back on again forces plugins to load correctly:
call pathogen#runtime_append_all_bundles()
filetype off
syntax on
filetype plugin indent on
More info here.
I was having a similar problem. Pathogen was loading some of my plugins while not all of them.
After some fiddling and wondering I discovered (I don't know if it's mentioned in the documentation) that in each bundle/'plugin_name' folder, there should be another folder called plugin that contains the *.vim file.
Then, when vim starts will look, not in bundle, but in those folders within bundle that contain a folder called plugin... and will create other folders (in each plugin folder).
So, if the plugin is just a .vim file make a folder for it...
instead of:
~/.vim/bundle/vimexplorer/vimExplorer.vim
you need:
~/.vim/bundle/vimexplorer/plugin/vimExplorer.vim
And everything works like a charm.
I've had problems loading particular plugins: specifically, plugins with a plugin subdirectory. For example, on a fresh MacVim install, a plugin in ~/.vim/bundle/surround/plugin/surround.vim wasn't being loaded, even though ~/.vim/bundle/surround appeared in the output of :scriptnames.
The problem was that I was loading Pathogen in .gvimrc, not .vimrc. For whatever reason, stuff in .vim/bundle/*/plugin subdirectories won't load if you do that, so do it in .vimrc!
I've opened an issue on github—I don't know if it can be made to work even if it loads from .gvimrc, but there should at least be some sort of warning in the documentation for idiots like me.
If your .vim is based on a git repo and submodules, DO REMEMBER to run git submodule init and git submodule update after cloning the repo. i.e.
git submodule init
git submodule update
I had the same error and tried all of the above, but it didn't work. Until I initialized and updated the git submodules.
Hope this helps for anyone who has a similar error.
Maybe Arch's default vimrc (possibly /etc/vim/vimrc) doesn't play well with Pathogen. Try starting Vim without loading config files:
vim -u NONE
and then load your vimrc from within vim:
:so ~/.vimrc
Do the plugins work then?
Fixed by (mattn & tpope) after raising issue via github
set nocp
call pathogen#infect()
syntax on
filetype plugin indent on
call pathogen#infect()
see https://github.com/tpope/vim-pathogen/issues/50#issuecomment-3137909
My environment is Vim 7.3.35 and Ubuntu 11.04.
I spent some time trying to resolve it. I clone the project https://github.com:r00k/dotfiles and follow the instructions to install.
When started vi a got the so commented
E117: Unknown function: pathogen#runtime_append_all_bundles
and the solution:
filetype off
call pathogen#runtime_append_all_bundles()
filetype on
did not work.
I found the .vim symlink in my home directory where no properly set. The install script made a .vim DIRECTORY with a symlink vim inside of it pointing to my .dotfiles/vim. The solution was to delete the .vim directory and make a symlink .vim pointing .dotfiles/vim.
A kept the filetype off/on in my .vimrc also.
filetype off
call pathogen#runtime_append_all_bundles()
call pathogen#helptags()
Try to check your runtime path using command:
:set runtimepath?
First entry should be something like ~/.vim.
My problem with not loading plugins/pathogen was that i placed my vim environment in ~/.dotfiles/vim where my vimrc and rest of the stuff (plugins etc.) lives.
After creating symlink to ~/.dotfiles/vim/vimrc in ~/.vimrc i forgot to make second symlink ~/.vim -> ~/.dotfiles/vim/ which caused vim to be confused cause he was looking for stuff in ~/.vim (default). After i made proper symlink everything poped in right place.
I hope it will help someone who forgot about second symlink like I did ;-)
Instead of call pathogen#runtime_append_all_bundles(), I used call pathogen#infect('~/.vim/bundle') and it worked for me.
I was having the same problem with Ubuntu. The log was:
linha 4: executando "/usr/share/vim/vim73/ftoff.vim"
Erro detectado ao processar /usr/share/vim/vim73/ftoff.vim:
linha 11:
E216: Grupo ou evento inexistente: filetypedetect *
fim da execução de /usr/share/vim/vim73/ftoff.vim
The solution was to add "\n"s at the end from file /usr/share/vim/vim73/ftoff.vim to execute it properly.
set nocp
call pathogen#infect()
syntax on
filetype plugin indent on
call pathogen#infect()
The above helped me fix the issue, can't leave a comment on other peoples however thank you for posting the code above.
I have it in mine as:
silent! call pathogen#runtime_append_all_bundles()
After spending waaaay too long trying to solve this problem with nerd-commenter/pathogen, I broke down and just used Debian's OS provided nerd-commenter plugin:
vim-addons install nerd-commenter
If you're on Debian and need to get back to work, try it out. You probably need "vim-addon-manager" and "vim-scripts" packages installed from apt if you don't have it already.
In my case I cloned to a folder ~/dotfiles but vun looks for a folder ~/.vim, as a result he carried no plugins or color schemes to solve the problem I did this:
ln -s ~/.dotfiles ~/.vim
I had the same problem. I tried every possible combination.
Finally I found that if I use mksession to save my Vim workspace and have it load on Vim startup, it made pathogen not load new plugins I put into the bundle folder.
After installing a new plugin I now always delete my session file and start Vim fresh and every plugin loads fine.
filetype off
set nocompatible
set laststatus=2
execute pathogen#infect()
syntax on
filetype plugin indent on
For the sake of completion I'll add my solution for this problem.
I just renamed my ~/.gvimrc file to ~/.vimrc, and all my problems were solved. I literally copied my .vim and my .gvimrc from linux and did this change and everything works as expected.
I was facing the same issue, finally after lot of google and tweaking the vimrc file, found the solution. Hope the following code snippet would resolve the issue.
set nocp
source /home/ameet/.vim/autoload/pathogen.vim "location of my pathogen.vim
call pathogen#infect()
call pathogen#helptags()
i had the same problem , solved by copying this file into ~/.vim/autoload:
https://github.com/sontek/dotfiles/blob/master/_vim/autoload/pathogen.vim

Resources