How to override vim plugin ctrl-p bindinds - vim

I was using a vim config : https://github.com/astrails/dotvim
In this config I was able to bind ctrl+p to nerdtree and I got used to it. Now I'm trying to build my own vim config and even though I bind nerdtree to ctrl-p in my vim config using nmap <leader>p :NERDTreeFind<CR>, it's being overridden by the plugin Ctrl-P.
How can I get vim to use my binding and not the ctrlp one?
I know it's possible because somewhere in the package I was using it was done, but I can't figure out where. Any help would be most appreciated.

let g:ctrlp_map = '<c-p>'
Change as needed (this is the default). You can see all the configuration variables by typing :help ctrlp<CR>.

Related

spf13-vim tagbar is not working

I have already mounted ctags, but it still not working at all. I pressed ,tt , and nothing happened. Is that any way to solve this problem in spf13-vim? Did Anyone suffer the same problem as me?
Have you remapped your <Leader> key to ,?
The tagbar toggle in spf13 is <Leader>tt, and the leader key is \ by default.
Try to toggle the tagbar with \tt. Alternatively, add let mapleader="," to your .vimrc.
I found that tagbar plugin is not installed if ctags command is not available on spf13 installation.
Search tagbar in installed plugins list: :BundleList then /tagbar.
If it's not found, install ctags first.
Running :BundleInstall within vim and restarting vim will fix the problem.

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

Missing NERDTree Commands

I am relatively new to vim and have an issue with NERDTree that I can't seem to figure out.
I seem to be missing a whole bunch of commands so when I map them to keys, I get the message (for example)
Not an editor command: NERDTreeMapToggleBookmarks
If I run :command I can see all the NERDTree global commands in there (those in section 2.1 of the docs) and these all seem to work but that's it.
I am using NERDTree 4.1.0 which I downloaded fresh from the github repo.
I suspect I may have either missed a step when setting up the plugin or am missing something in my .vimrc but I am at a bit of a loss.
Anyone have any pointers? Like I say, I am new to vim so it could be something really stupid or obvious!! ;)
Many thanks
I had the same issue after updating Vundle to the new interface.
Make sure you have
call vundle#begin()
and
call vundle#end()
wrapping your Plugin calls.
I recently ran into errors like Not an editor command: NERDTree*. What broke it for me was changing the line call vundle#rc() in my vimrc to call vundle#begin() because that's what I saw being used in the Vundle README. Switching back fixed the issue.
I am using this plugin for a long time. I have checked it and there is only one file in my ./plugins directory and 2 lines in my .vimrc configuration.
put NERD_tree.vim into .vim/plugins/ directory
add settings to your .vimrc config file:
" NERDTree configuration
let NERDTreeWinSize=35
" map to toggle NERDTree window
nmap :NERDTreeToggle
And that is all.

Vim: Recommendations for vimball plugins in pathogen

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.

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.

Resources