Giter Club home page Giter Club logo

sublimeallautocomplete's Introduction

All Autocomplete Sublime Text

Extends the default autocomplete to find matches in all open files.

By default Sublime only considers words found in the current file.

Install

If you have Package Control installed in Sublime just press ctrl+shift+p (Windows, Linux) or cmd+shift+p (OS X) to open the Command Pallete. Start typing 'install' to select 'Package Control: Install Package', then search for AllAutocomplete and select it. That's it.

You can also install this package manually by entering the Packages directory of Sublime Text 2/3 and issuing on a terminal:

git clone https://github.com/alienhard/SublimeAllAutocomplete

Settings

You can disable the additional autocompletion provided by this package for specific source files and even select syntax within files. In the Sublime menu go to Preferences > Package Settings > All Autocomplete > Settings – User.

Example: the following Setting would disable completions when you're editing CSS or JavaScript code, and would not source any completions from Markdown files:

"exclude_from_completion": [
	"css",
	"js"
],
"exclude_sources": [
  "markdown"
],
"min_word_size": 5, // don't show completions for words with fewer than this many chars
"max_word_size": 40 // don't show completions for words with more than this many chars

The names provided in this list are matched against the so-called "syntax scope" of the currently autocompleted input. For example, in a CSS file, when you start typing a new CSS class name, the syntax scope is "source.css meta.selector.css". The names you provide in the config above are partially matched against this scope. This means, you can completely disable All Autocomplete for all CSS code by specifying "css" – or you can disable it only for specific parts, for example, CSS selectors by specifying "selector.css". Or to disable completion in comments, include "comment" in the list.

Note, if you want to disable it in C source, but not in CSS, add "source.c" in the list (since "c" alone would also match css).

You can find the syntax scope of code at the current cursor position with Control+Shift+P.

LICENSE

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE Version 2, December 2004

Copyright (C) 2013 Adrian Lienhard [email protected]

Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed.

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

  1. You just DO WHAT THE FUCK YOU WANT TO.

sublimeallautocomplete's People

Contributors

alienhard avatar bencao avatar dpidan avatar forivall avatar kylebebak avatar miraks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sublimeallautocomplete's Issues

Syntax specific

Hi, would it be possible to add support for syntax exclusions? So that for example I can disable completions in javascript or css? Thank you.

Adding a dash (-) breaks autocomplete

Lets say that I have 2 files opened - main.html and main.js.

In main.html I have an element ID that's called 'big-video'.
In the main.js file, the autocomplete would only suggest 'big', instead of 'big-video'.
I checked if an underscore works and it does, but the dash seems to be breaking the autocompletion feature.

Forgets variable from current tab in favor of variable.onObject from another (coffee/html)

This is really strange bug, and requires a bit strange sequence to reproduce. And probably it's a conflict with some other plugin, but here it is:

If you have 2 files: one_file_with.html and another_one_with.coffee script

in html file put: stc.someVar
in coffee file: @somevar

now when you are in coffee file and type @som you only get suggestion for stc.someVar and not @someVar ... I got really annoyed by this because it would not suggest a variable from current file.

SublimeText3 on Ubuntu 16.04

Option to exclude paths

It would be great if it was possible to exclude some path / drive from the search (for empty drives, like SD readers etc. checking for file names will cause a "No Disk" error!)

thx,

,m

conflict with emmet plugin

I have a trouble with this plugin (AllAutocomplete). When i write in my CSS file some emmet alias, like "dib" and press a tab key, i get some words from my files, but not required property. Can i create some settings to your plugin for press some else button for call plugin work? Or maybe you know better solution. I am very grateful for the help.

Overrides php function autocomplete

It would seem this plugin overrides php autocomplete from CodeIntel. For example, if I type "in_array" I will be given the autocomplete. I press enter, but do not get the variables. If I backspace part of the function name, I then get two autocomplete suggestions, the second being the one I actually want.

Maybe it could be set so autocomplete is never overriden from other already set autocomplete items? Sorry I don't have time to delve into the code to look at making a pull request right now.

Thanks in advance for your work on this plugin =]

Words without last letter

I got strange issue -- some words in two variants in list like "is_owne" and "is_owner"
and i am sure there is no "is_owne" in my project.)

Do you know what it could be?

Autocomplete classes in CSS/SCSS

When I start typing with a dot to write a class, the autocomplete doesn't kick in, I have to force it manually with ctrl+space. But if instead, I start writing the name of the class, without the dot, it works normally.

I'm in ST3 build 3047. (When I was in ST2 this worked normally)

search both uppercase and lowercase?

If I have a string "FORMAT_JSON" in one open file, and type lowercase "format" in another file, the uppercased "FORMAT_JSON" is not showing in suggestion list.

Attempted fixes for All Autocomplete issues I have encountered

After a couple of years of using All AutoComplete I have finally decided to look at the code carefully to see how I might explain some things I have seen over the years.

The first thing I noticed was the 20 view limit. I often have way more views open than that and I found it very confusing when some things completed but others did not. Also I saw the code that works around a "sublime bug" relating to words that are missing the last letter, or other words that just don't show up at all.

So I decided to write my own all autocomplete as part of the sublemacspro plugin with the following properties:

  • no limit on the views
  • uses view.find_all and not the view.extract_completions, since that can fail due to syntax implementation details
  • searches views in order of last access
  • is more memory and CPU efficient

This is a different approach (not using view.extract_completions) but I have found it to be more to my liking. Shall I try to apply what I've learned and issue a pull request, or does this sound like too much of a departure?

No Licensing

Your project doesn't have a license, you should consider adding one, and preferably not a bad one like GPLv3 ;)

Enabling both autocomplete and sublimetext completion box.

Adding that bit from the default keymap file

    { "keys": ["tab"], "command": "commit_completion", "context":
        [
            { "key": "auto_complete_visible" },
            { "key": "setting.auto_complete_commit_on_tab" }
        ]
    }

to the end of Tabs.sublime-keymap
allows us to use tab to trigger autocomplete as well as to apply a completion when sublimetext native completion popup appears.
I came up with this because the popup still appeared althgough I had no way to pick a completion (I'm using auto_complete_commit_on_tab)

switch statements?

Great package.

Any auto completeion for switch statements?

If so how can i add it manually?

Autocomplete for Sass variables (and CSS classes) with dashes doesn't work

We've split our Sass into multiple files; one of the files contains all our variables. The variables look like this $variable-name-example. Unfortunately dashes seam to be a problem currently.

Testcase:

$button-color-secondary: #f00 /* will auto complete only the word $button */
$button_color_main: #0f0 /* works as expected */

Thank you for your plugin, Adrian. Keep up the good work.

Auto complete for variable $scope erases variable after choosing it from suggestions.

I have the all autocomplete plugin installed

I type in $sc and press tab or enter to choose "$scope" from the suggestions, the characters that I typed in simply get erased.

So far this is the only variable that this happens w/, it works fine all other words.

These are my installed packages beyond the defaults:
{ "auto_upgrade_last_run": null, "installed_packages": [ "Alignment", "All Autocomplete", "AngularJS", "BracketHighlighter", "Color Highlighter", "ColorPicker", "DocBlockr", "Git", "HTML5", "Indent XML", "Markdown Preview", "Package Control", "Phpcs", "Pretty JSON", "sublime-github", "Sublime-HTMLPrettify", "SublimeCodeIntel", "SublimeLinter", "Theme - Soda", "Web Inspector", "xmllint" ] }

I'm using ST 2.0.2 on OSX 10.8.4

Suggestions?

Slow when lots of (large) files are open

A trie style datastructure would be great for improving the efficiency. a ~1s pause when typing any word in a file is not ideal, and it hardly takes more than 20k lines of opened files to cause this.

It looks like an O(n^2) approach is used (bad!!) and the hard limits placed on number of words and number of views is basically the only factor that is limiting the pause to around 1s.

Can't get it to work

I'm running build 3065 on Linux (elementary OS 0.2) and I can't seem to get this package to work.

I type and nothing happens, I'm not even sure how this package should work because I see nothing.

Other packages installed:

  • Alignment
  • Autowrap
  • Dictionaries
  • Git
  • LatexTools
  • oauthlib
  • Package Control
  • Sublime Bookmarks
  • Wrap Plus

Low performance with long working

I have performance issue after several minutes of working with ST3. After module disabling and ST fully restarted, issues leave off. In work I can open many JavaScript files.

I'm using ST on my MacMini, but with more powerfull machine under Ubuntu I have not this problem with many files.

ST3

Hey there,

Will this work with Sublime Text 3? I tried installing it via package control, but couldn't find it. Assuming it's because Package Control filters out stuff that isn't supported on your platform.

If not, can I help port it to ST3? I really want this feature!

Missing suggestions from active tab

Hi!
I seem to have a problem, where the autosuggest does not include words from the active tab - only all others.

I tried changing

views = [v for v in sublime.active_window().views() if v.id() != view.id()]

to

views = [v for v in sublime.active_window().views()]

and it seems to solve the problem. But as I have no experience with neither Python nor Sublime plugin development, I don't know if this is a good idea or not.

Suggestion add file to search for completions

is there a way to manually add files or directories to the search. I want auto completion for SDL graphics lib and respective header files, but I don't want to have to open every header file.

Sublime Text 3 support

I get the following backtrace when using SublimeAllAutocomplete with the new Sublime Text 3 beta:

Traceback (most recent call last):
  File "/opt/sublime_text/sublime_plugin.py", line 238, in on_query_completions
    res = callback.on_query_completions(v, prefix, locations)
  File "/home/rrerolle/.config/sublime-text-3/Packages/SublimeAllAutocomplete/all_views_completions.py", line 23, in on_query_completions
    views = set(views[0:MAX_VIEWS])
TypeError: unhashable type: 'View'

Breaks the AdvancedNewFile Plugin autocomplete

I really like this plugin but I can't use it because it breaks the AdvancedNewFile plugin.

Without AllAutocomplete, AdvancedNewFile autocompletes based on my folder structure and is really fast an efficient for creating new files.

When I enable AllAutocomplete, AdvancedNewFile uses all the files that are open to autocomplete and is impossible to create a file in the folder I want without typing the whole path. This makes the AllAutocomplete plugin useless for me as my directory structure can be deep and I don't want to type out all the directories.

AllAutocomplete should only work in the code your working on. Not outside inputs.

Project-wide Autocomplete?

Is it possible to autocomplete not only open tabs, but autocomplete from any file in Sublime project folder?

Possible to automatically show autocompletion?

Great plugin! But if I don't know the first letter of the function or variable I'm looking for you need to start guessing. Is it possible to open autocompletion automatically, or even have it assigned to popup once CTRL+SPACE is pressed as it's normally?

For example typing "this." will not open the autocompletion, you need to type another letter after that to get the list.

"Disable" in 'All Autocomplete.sublime-settings' doesn't work as expected

I love this plugin for all my coding, but it really gets in the way when I'm writing.

Whenever I want to indent a hyphen list like…

- A
- B
    - C

… I end ud with something like this…

- A
- B
--verbose C

I tried disabling All Autocomplete for Markdown and Plain Text documents:

{
    "exclude_from_completion": [
        "md",
        "txt"
    ]
}

I also tried using the Syntax Names ("Plain Text", etc.), but I still get the lovely autocompletion.

Am I doing something wrong here?

Prefer Sublime's default completion for CSS

This plugin works great for most things. I like it. 👍

However, in CSS (or SCSS) files I prefer sublime's own auto-completion because it recognizes keywords, inserts colons, spaces and semicolons.

Sublime's options are still available, but they aren't the ones first selected so you would need to scroll down.

/* · = space */
/* | = cursor */

/* CSS keywords */
padding|            /* AllAutoComplete */
padding:·|          /* Sublime built in completion */

/* CSS values */
padding:·inherit|   /* AllAutoComplete */
padding:·inherit;|  /* Sublime built in completion */

Different suggestions when pressing CTRL+Space

I found a (strange) issue in using this plugin.
Without the plugin, this is the autocomplete shown by ST3:
1_withoutplugin

When "All Autocomplete" is active, this is the list of suggestions shown:
2_allautocomplete
In here, the problem for me is that the item "IfxScuEru_InputChannel_4", which is what I meant to write, is missing.

The strange behaviour is this: with the plugin, pressing CTRL+Space shows this list (different from above, and the missing item is now there!!)
3_ctrlspace

SublimeAllAutocomplete picks up long base64 strings

Hi,

I do web development; when it makes sense, I put images in CSS encoded with base64. SublimeAllAutocomplete picks up these (usually very long) strings. This causes a significant slowdown.

How can I set the maximum length of characters that SublimeAllAutocomplete will autocomplete?

Thanks in advance!
Martin

autocomplete_all_base64

All Autocomplete shadows completion files.

If I have "FooBar" specified in in my sublime-completions file and I have "FoorBarSomeText" that exists thecurrently open file, the completion "FooBar" will not even show up in the completions list.

If I uninstall All Autocompletions, both entries properly show up, and the proper priority is given to "Foobar" first, and then to "FooBarSomeText".

Autocomple does not appear automatically in new Build

Hello

With the new SublimeText Build 2221, the automatically opening Autocomple-dropdown does not include the AllAutomplete results. I need to close it with [esc], and reopen it with [ctrl-space] to get them.

Thanks for help

Autocomplete for php code works incorrectly in some cases

To reproduce you must change settings parameter word_separators and remove character $ there, like this (in Preferences.sublime-settings):

"word_separators": "./\\()\"'-:,.;<>~!@%^&*|+=[]{}`~?",

After that create new file with the following content:

<?php

$test = 'aaaaa'

and try to auto-complete word $test there, you should fail, word just disappears.

It looks like somethere inside sublimetext character $ treated as something special (incorrect regexp generation maybe) so if returned value from on_query_completions starts with $ it will break the completion.

don't mess with system's autocomplete

Hi,

I have my sublime customized autocomplete and sublime default autocomplete. They work great. Now I have this tabs related autocomplete, great too.

One problem, allAutoComplete will suggest what I already had by default, in a different way.

I normally have completion like console.log($0), what I do is I press con + tab to get that.

Now when I do that, I get console.log or console. You can see there is missing ()

I understand this plugin will suggest keyword using indexing from open tabs. Now if you could teach the plugin to ignore the autocompletes already in in the system, don't try to suggest that. It will awesome.

Not all autocomplete options are shown for all entities

Here's an example: I have an HTML file open and a CSS file that it links to. If I add a class to the body tag, AllAutocomplete will return all class names from the open CSS file. But, if I create an anchor and try the same, not all class names will be returned - sometimes none of the class names will appear at all. It seems that only certain entities will return all the class names.

sublime_test

CPU spike when typing

Today, whenever I am typing in Sublime Text 2 the program hangs turns dark grey with the text I am inputting not visible on the screen. When I stop typing and wait patiently, the text will eventually appear again. I watched the CPU activity while typing and it would jump up to 95%+ until it calmed down again. This appears to be caused by the All Autocomplete package - when I uninstall it, ST2 works fine, and when I reinstall it, the problem returns.

Suggestion

could you makeup a usage to complete the matching string in the files under all the open folder.:)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.