Command-T: Is it possible to have project-specific ignore-patterns? - vim

so I read through the documentation and a couple of search-results on google but I can't seem to find a solution for my problem.
I'm using Command-T and set up a "global" ignore pattern in my vimrc:
let g:CommandTWildIgnore="**/*.min.*,**/*.jpg,**/*.png,*/dist,*/docs,*/node_modules,*/nginx,*/tmp"
This works fine so far.
Now I wanted to add to this global-pattern a project-specific setting so the global one wouldn't get too long.
For example I have set up something similiar for AG where I have a "global" .agignore-file in my vimrc-folder and then a project-specific .agignore-file in the project-folder.
Is this possible with Command-T too? I know I can add to the global-pattern using the vim-commandline but this only lasts until I close vim. I would like a similiar setup to AG but I don't know where to put the command or how to name the file.
Any ideas? :)
Greetings.

Not sure if this is possible with stand alone command-T, but a workaround might be the use of this plugin:
http://www.vim.org/scripts/script.php?script_id=1860
It allows you to define project-specific vim settings, so you could use it to override or add to your command-T ignore cases.
Or perhaps an eaiser way, for each project add something like this to your .vimrc:
autocmd BufNewFile,BufRead /path/to/project/* let g:CommandTWildIgnore="..."

Related

Does anyone have extra «» generated from lh-brackets

Can't seem to find any reason for this, but I have been using Ycm, syntastic, and all the lh- plugins with vim for a while now. In the case of lh-brackets, I used to have a problem with it generating "«»" every time it 'automatically' generated the other bracket, paren, quote, etc. But it was only happening in .vim files, so i turned it off for vim files in my vimrc. Now nothing has changed, no new scripts installed, and all of the sudden, this happens with ALL files (cpp, h, pl, py, etc). Like i said, not using heavy customization, and everything is default except the disabling of lh-brackets when editing vim files, but that has now become a hotkey since i cant use it anywhere.
My Question is this: does anyone have this or similar problem with lh-brackets, and if so, any idea how to fix it, or is there some setting I am missing?
My first thoughts are to go though and check any updated vim scripts (this just happened a day ago) that could have been updated when doing an apt-get upgrade (like debian.vim) but after that I've got nothing...
The placeholders characters can be jumped to (:h <Plug>MarkersJumpF -> <C-J> with vim, <m-ins> with gvim). That's their purpose.
If you have installed lh-cpp, see :h lh-cpp-first-steps, you'll find a quick guide to my C++ suite (and lh-brackets incidentally).
EDIT: The plugin was badly designed. I've patched the plugin to rely on g:usemarks in order to fix the ergonomic of plugin .
In the (now-) past, if you wanted to set b:usemarks to 0, you'd have needed to add an autocommand that'd set b:usemarks to 0 in all new buffers.
Now, (lh-brackets v2.2.0), if you want to always disable the placeholders/marker characters, you need to set g:usemarks to 0, not b:usemarks. Buffer-local variables are meant to be set from ftplugins, or tree/project-local plugins which are supported thanks to plugins like local_vimrc.
And as romainl has pointed out, don't hesitate to use the bug trackers, or even to contact me.
hmm found it:
:let b:usemarks=0
now needs to be set, apparently that was a marker for integration to another plugin, though i dont use it.

javacomplete plugin for vim

I have two questions but they are both related to the use of same plugin so I decided to ask them in the same question.
I have started using javacomplete plugin for omnicomplete in vim. I have set omnicomplete using:
setlocal omnifunc=javacomplete#Complete
and it seems to be working with C-xC-o but there is also a mention of completefunc in the documentation such as:
setlocal completefunc=javacomplete#CompleteParamsInfo
which doesn't seem to be doing anything with C-xC-u and I'm not sure what it is supposed to do anyways. Has anyone managed to set this up?
Also I was wondering if it's possible to move Reflection.class somehow from $HOME to ~/.vim so that it won't pollute the system?
That's <C-x><C-o> and <C-x><C-u>, not <C-o>/<C-u>.
The doc says to put javacomplete.vim, java_parser.vim and Reflection.java in ~/.vim/autoload/, did you do that?
The plugin doesn't seem to include an option for the path to Reflection.class but, reading the GetJavaCompleteClassPath function at line 1748 of javacomplete.vim it looks like the script is expecting that file to be in one of two locations: ~/.vim/autoload/Reflection.class or ~/Reflection.class.
So yes. You can move it safely to ~/.vim/autoload, with its friends.

How to add another file extension (e.g. 'style.less') to Vim's snipMate plugin?

I would like to write snippets for Less (.less) and Stylus (.styl) and use then in Vim's snipMate plugin. How can I accomplish that?
EDIT: I know that the first step is to create a file inside the snippets folder with a name like this: less.snippets or stylus.snippets but after that I'm not sure what to do.
Yes right that is the first step. And after that you have to set the filetype of the files you want to edit with multiple snippets to:
set filetype=less.styl
or
set filetype=styl.less
I've just tested it with the snipmate "official" fork and it works fine but I'm sure enough it should work with the original plugin too.

How can I configure VIM so that files with extension .less are edited with zen-coding?

How can I configure VIM so that files with extension .less are edited with zen-coding?
I can use within the zencoding notepad + + on windows normally. But now I want to use the same way inside vim.
ZenCoding is probably activated on a per-filetype basis, if that's the case, just type :set filetype=css.
If you want this setting to stick, add this line to your .vimrc:
autocmd BufRead,BufNewFile *.less set filetype=css
If you want to retain the normal features that go with .less files (if any) you can do :set ft=less.css but some plugins don't like that.
I first tried to write a comment, but found then something that could be an answer.
So I think the question is: How can I configure VIM so that files with extension .less are edited with zen-coding?
At the official site for zen-coding, there are lists of editors that support zen-coding:
Official
third-party
Unofficial
There for VIM, the following sites are mentioned:
Sparkup
Zen Coding for VIM
I have read into both, and both seem to expand shortcuts to HTML code, not to less-code. But perhaps I have misunderstood the question.
I didn't know you could use Zencoding for css. I use it in Vim for html.It s great!I started using Less and I was wondering an hour ago ,If something like this existed. I guess it's something to work on.

How do you disable a specific plugin in Vim?

I have Vim set up to use the excellent NERDTree plugin. However, there are some environments where I do not want this plugin to be loaded.
In my .vimrc I have a sections that are only run when specific environment variables are true. In one of these sections I would like to disable the loading of NERDTree but all of the information I've come across states how to disable all plugins, not just one.
Could someone demonstrate how to disable the loading of one specific plugin in Vim?
Most plugins have a (re)inclusion guard.
Open the plugin, see the name of the guard, if any (if not, add one by yourself, and contact the author to make him fix his plugin), and finally set its value to 1 in your .vimrc.
That's all.
I can't be more specific as "open, and look for the guard" as not all plugins use the same guards-naming policy. It's often g:loaded_pluginname though.
Regarding ftplugins, it becomes more tricky. The guard is a buffer-local variable. As such, it can't be specified into your .vimrc (as it would apply only to the first buffer you open).
The easiest way would be to move your ftplugin from .vim/ftplugin to .vim/after/ftplugin, and to set the relevant anti-reinclusion guard to 1 in a ftplugin in your non-after hierarchy. As long as the ftplugin does not expect to be placed in after/ (or the contrary, it should be fine).
Note: most ftplugins believe they are unique and (mis-)use the variable b:did_ftplugin as reinclusion guard.
Add this line to your .vimrc
let g:loaded_nerdtree_exec_menuitem = 1

Resources