Comments (7)
I just added support for setting a buffer local variable to disable supertab (344016d).
So now you can add
let b:SuperTabDisabled = 1
to an ftplugin to disable supertab for an entire filetype or wrap the setting of that var in a
if expand('%:p') =~ '/some/path/'
...
endif
to disable supertab based on path.
Does that give you the functionality you need?
from supertab.
I'm sorry, but I'm not very proficient with vim - when you say I can add this setting to an ftplugin, what exactly does that entail? You can have a look at my vim config here https://github.com/sardaukar/dotvim
from supertab.
You can type :h ftplugin
in vim for more info, but what I mean is that if you wanted to disable supertab for an entire filetype (ruby, java, python, etc.) you would add the setting to the ~/.vim/ftplugin/<filetype>.vim
file or create one if necessary. In your case, rspec files seem to be ruby files with no dedicated file type in vim so you'd want to add something like the following to your ~/.vim/ftplugin/ruby.vim
:
if expand('%:p') =~ '^/some/path/to/rspec/files/'
let b:SuperTabDisabled = 1
endif
from supertab.
thing is, I don't want to disable SuperTab. I just want to include the /spec// files IF I'm editing a file in the /spec/ folder. Otherwise, keep them out of the completion suggestions. Is this possible?
from supertab.
Ah, I see what you want now. Well this is outside the scope of supertab, but can be controlled somewhat by vim's complete
option (see :h 'complete'
for info). If your rspec files are loaded in buffers then I don't think there is any way to selectively choose which open buffers are scanned for completion and which are not. If you simply want to scan other rspec files that are not loaded when editing another rspec file, then you can probably use the k
or s
values for complete
to do that. You may want to see what your complete
value is set to now (:set complete?
) and decide if removing one or more of the options from that will help (Ex. :set complete-=u
).
from supertab.
OK, thanks anyway! :)
from supertab.
I was just doing some research on this, and while I'm not very familiar with vim (or programming for that matter). I think I can help. If you have vim and supertab installed already and don't have the latest version of supertab from this github repo, you'll have to add the line manually to your plugin folder.
On linux it's probably located in:
~/.vim/plugins/supertab.vim
Search for this line:
function! s:SuperTab(command)
Directly below it, add the fix:
if exists('b:SuperTabDisabled') && b:SuperTabDisabled
return ""
endif
Now you can add this line to ~/.vimrc:
if expand('%:p') =~ '^/some/path/to/rspec/files/'
let b:SuperTabDisabled = 1
endif
the path is just a regex so personally, I was looking to disable autocomplete for tabs, and I added this:
if expand('%:p') =~ '.tsv$'
let b:SuperTabDisabled = 1
endif
from supertab.
Related Issues (20)
- Supertab doesn't work in command-line window HOT 4
- Mirror-like auto-completion pop-up when there is no space above the cursor!
- vim writes 4 spaces instead of a tab when supertab is installed HOT 4
- Tab inserts the highlighted word
- Inconsistency with inserting highlighted word HOT 1
- Remap tab when no completion is active HOT 2
- Toggle supertab plugin HOT 1
- Completion seems to offer key word in preference to omni completion HOT 1
- E432: Tags file not sorted: tags HOT 1
- Make tab cycle through completions
- Using mac os native command+tab to swap between elements enters in fast loop
- Supertab don't complete local path HOT 1
- Disable for a filetype HOT 3
- How to complete function name without '(' char? HOT 1
- On-the-fly completion HOT 1
- Supertab shows other suggestions as OmniComplete HOT 1
- Missing highlight update in popup completion menu HOT 4
- Select the last item when pressing Tab HOT 2
- [feature request] - incremental/partial completion instead of longest/complete match HOT 1
- Suptertab chaining is not working with neovim LSP HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from supertab.