atom-community / autocomplete-paths

Autocomplete Paths for Atom
MIT License
151 stars 62 forks source link

Enable for all Atom scopes using ./ everywhere #210

Open hackhowtofaq opened 6 years ago

hackhowtofaq commented 6 years ago

Since I lost a couple of hours trying to short this out, I'm pasting my config.cson for future use by someone with the same needs...

...
"autocomplete-paths":
    enableHtmlSupport: true
    maxFileCount: 10000
    normalizeSlashes: false
    scopes: [
      {
        scopes: [
          "source.c"
          "source.cake"
          "source.clojure"
          "source.coffee"
          "source.coffee.jsx"
          "source.cpp"
          "source.cs"
          "source.css"
          "source.css.less"
          "source.css.scss"
          "source.csx"
          "source.gfm"
          "source.git-config"
          "source.go"
          "source.gotemplate"
          "source.java"
          "source.java-properties"
          "source.js"
          "source.js.jsx"
          "source.js.rails source.js.jquery"
          "source.js.regexp"
          "source.js.regexp.replacement"
          "source.json"
          "source.litcoffee"
          "source.makefile"
          "source.nant-build"
          "source.objc"
          "source.objcpp"
          "source.perl"
          "source.perl6"
          "source.plist"
          "source.python"
          "source.regexp.python"
          "source.ruby"
          "source.ruby.rails"
          "source.ruby.rails.rjs"
          "source.sass"
          "source.shell"
          "source.sql"
          "source.sql.mustache"
          "source.sql.ruby"
          "source.strings"
          "source.toml"
          "source.yaml"
          "text.git-commit"
          "text.git-rebase"
          "text.html.basic"
          "text.html.erb"
          "text.html.gohtml"
          "text.html.jsp"
          "text.html.mustache"
          "text.html.php"
          "text.html.ruby"
          "text.hyperlink"
          "text.junit-test-report"
          "text.plain"
          "text.plain.null-grammar"
          "text.python.console"
          "text.python.traceback"
          "text.shell-session"
          "text.todo"
          "text.xml"
          "text.xml.plist"
          "text.xml.xsl"
        ]
        includeCurrentDirectory: false
        prefixes: [
          "\\.\\/"
        ]
        projectRelativePath: false
        relative: true
      }
    ]
...

PS

To get a list of all scope names registered in your Atom instance, open the Developer Tools Console and execute the following:

Object.keys(atom.grammars.grammarsByScopeName).sort().join('\n')

Ref: file-types

Rodrigo-Barros commented 5 years ago

Thanks this help a lot, I was getting frusted for not can configure atom to work like brackets that have autocomplete by default and for some reason I'm not fan to see the signal of "./" in my files, I just prefer only the name of file, and with your help I can replace the default comportament, just to clarify:

before: <img src="./foo.ext" />

after: <img src="foo.ext"/> # looks better at least for me.