Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I prevent vim from tab-completing .class files?

Tags:

vim

When I use :e in vim, it will tab-complete .class files before the .java files. As I never want to edit .class files, how do I prevent vim from showing .class files in the tab-completion?

like image 860
carl Avatar asked May 12 '10 01:05

carl


2 Answers

You can use the suffixes option in your vimrc to de-prioritize or ignore files with .class extensions.

Here's a simple example:

" suffixes to put to the end of the list when completing file names
set suffixes=.bak,~,.o,.h,.info,.swp,.class
like image 123
Ben Hoffstein Avatar answered Sep 30 '22 12:09

Ben Hoffstein


Use the following in your vimrc file:

set wildignore=*.class

You can comma delimit it to add more than one pattern

set wildignore=*.class,*.rbc

See the wildignore documentation for more details (though there's not much more to add)

like image 38
Xavier Shay Avatar answered Sep 30 '22 11:09

Xavier Shay