Skip to content

Autocomplete relative or absolute file paths in Sublime Text project folder

License

Notifications You must be signed in to change notification settings

evandroforks/FuzzyFilePath

 
 

Repository files navigation

Sublime Text Plugin

Fuzzy search and insert filenames inside your current project directory. Highly customizable.


Basic settings support Javascript, HTML, CSS, PHP and glsl, but may be adjusted for most languages

Installation

By Package Control

  1. Download & Install Sublime Text 3 (https://www.sublimetext.com/3)
  2. Go to the menu Tools -> Install Package Control, then, wait few seconds until the installation finishes up
  3. Now, Go to the menu Preferences -> Package Control
  4. Type Add Channel on the opened quick panel and press Enter
  5. Then, input the following address and press Enter
    https://raw.githubusercontent.com/evandrocoan/StudioChannel/master/channel.json
    
  6. Go to the menu Tools -> Command Palette... (Ctrl+Shift+P)
  7. Type Preferences: Package Control Settings – User on the opened quick panel and press Enter
  8. Then, find the following setting on your Package Control.sublime-settings file:
    "channels":
    [
        "https://packagecontrol.io/channel_v3.json",
        "https://raw.githubusercontent.com/evandrocoan/StudioChannel/master/channel.json",
    ],
  9. And, change it to the following, i.e., put the https://raw.githubusercontent... line as first:
    "channels":
    [
        "https://raw.githubusercontent.com/evandrocoan/StudioChannel/master/channel.json",
        "https://packagecontrol.io/channel_v3.json",
    ],
    • The https://raw.githubusercontent... line must to be added before the https://packagecontrol.io... one, otherwise, you will not install this forked version of the package, but the original available on the Package Control default channel https://packagecontrol.io...
  10. Now, go to the menu Preferences -> Package Control
  11. Type Install Package on the opened quick panel and press Enter
  12. Then, search for FuzzyFilePath and press Enter

See also:

  1. ITE - Integrated Toolset Environment
  2. Package control docs for details.

Filepaths will be suggested if there is a matching trigger for the current context and its property auto is set to true. For a matching trigger, filepath completions may be forced (ignoring auto property) by the following shorcuts:

  • Ctrl+Alt+Space inserts filepaths relative, overriding possible settings
  • Ctrl+Shift+Space inserts filepaths absolute, overriding possible settings

The current string may modify the suggested filepaths by the following rules:

  • word suggests all matching files by the type (relative or absolute) as specified in the matched rule
  • ./ suggests matching files within the current directory and inserts selection relative
  • ../ suggests all matching files and inserts selection relative
  • /folder suggests all matching files and insert selection absolute

FuzzyFilePath is disabled for single files or files outside the opened folder.

Open File

Use Alt+Enter to open the file under cursor

Configure Completion Panel

Ensure you have autocompletion activated for Sublime. In those cases, where the autocompletion panel is still not opened (for any type of completions), you may extend auto_complete_triggers to add special rules for the completion panel to show up. i.e. enabling autocompletion for latex \input{"path/to/asset"}, you could add:

"auto_complete_triggers":
[
	{
		"characters": "abcdefghijklmnopqrstuvwxyz",
		"selector": "text.tex.latex"
	}
]

or enabling html completion for <script src="path/to/script">

"auto_complete_triggers":
[
	{
		"characters": "abcdefghijklmnopqrstuvwxyz",
		"selector": "string.quoted.double.html"
	}
]

Special Characters

If your projects contains filenames with special characters, consider modifying Sublime Texts word_separators.

i.e. in AngularJs filenames may start with $. In Sublime Text | Preferences | Settings - User redeclare word separators, removing $:

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

Customization

For further details about troubleshooting, customization, settings and keybindings please refer to the Wiki

Trying to integrate other languages? See the auto complete Python package tutorial

Related Plugins

  • uses file discovery based on current directory instead of fuzzy search
  • adds properties for images in autocompletion description

License

All files in this repository are released under GNU General Public License v3.0 or the latest version available on http://www.gnu.org/licenses/gpl.html

  1. The LICENSE file for the GPL v3.0 license
  2. The website https://www.gnu.org/licenses/gpl-3.0.en.html

For more information.

About

Autocomplete relative or absolute file paths in Sublime Text project folder

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 97.6%
  • HTML 1.2%
  • CSS 0.4%
  • JavaScript 0.3%
  • SCSS 0.2%
  • TypeScript 0.2%
  • Other 0.1%