Giter Club home page Giter Club logo

sublime-fscompletion's Introduction

FileSystem AutoCompletion

Enable auto-completion of paths from the file system à la VIM.

File completion can be explicitly triggered by Ctrl+Alt+/ (on OSX, Cmd instead of Ctrl) shortcut.

This combination can be always rebound to a different key combination in usual SublimeText manner, by opening the User keybindings file (see menu: Preferences/Package Settings/FileSystem Autocompletion).

For example, you should also be able to use the Vim shortcut Ctrl+X,Ctrl+F by adding the following to your Keybindings - User file:

   { "keys": ["ctrl+x","ctrl+f"], "command": "file_system_comp_trigger"}

This plugin handles spaces in file names and find the correct file path beginning. If you find any problem, please open an issue.

Current directory

The project-file directory will be used by default (if found). However, a path starting with '.' will use the current view's directory instead. The path search order can be configured via the usual settings file:

"path_search_order": ["project", "view", "window"]

Installation

Either by using the package manager or manually by cloning/downloading the latest snapshot of the master branch into the Sublime's package folder (e.g. ~/Library/Application Support/Sublime Text 3/Packages/ on OSX).

Spaces

This plugin should handle file paths that contains spaces including escaped spaces with \.

For example if there are three files:

quick test
quick test 1
quick test 2

Then quick test followed by our shortcut will display all three options and when selecting the second one for instance it will get expanded to quick test 1. On the other hand quick\ test followed by our shortcut with the same selection will be expanded to quick\ test\ 1. If the path is detected to be escaped it will continue to escape all the followed spaces.

File path beginning

The problem is that a file name can be contain many special characters. For example \input{some file} is a valid file. However, it is also a way how to include a file in LaTeX document and more likely we want to have a completion of the path some file rather than path \input{some file}. This plugin, therefore, tries to determine the beginning of a path from which it should look for the completion by finding the longest possible path that exists. For the example above, with the cursor positioned at the end of some file, it will try:

/Users/user/\input{some file
Users/user/\input{some file
krikava/\input{some file
\input{some file
input{some file
some file
file

and it will stop as soon as any of these path exists (a glob pattern with appended * returns something).

License

All parts of this plugin are licensed under GPL v3 (see LICENSE.txt).

sublime-fscompletion's People

Contributors

corbanmailloux avatar fikovnik avatar lingo 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

Watchers

 avatar  avatar  avatar

sublime-fscompletion's Issues

It must be me... but it just doesn't work.

Hey Luke

I love the idea of this plugin and it would really help me with my workflow. Unfortunately, I just cannot get it to work.

I'm use Sublime Text 3. Whenever I type the beginning of a path that I know exists (such as /Users/ or  ~/) I just won't get any autocompletion suggestions. Control + space just throws the message "No available completion", while the package's own shortcut won't do anything, altogether.

I must be missing something... Are there any specific conditions that need to be met for this plugin to work? Does it only work for certain file types?

Best wishes,
Simon-Claudius

Simply doesn't work

Running under ST3, no completion is happening.
This is all I get (even in debug mode)

FSAutocompletion: guessed_path: C:\da
FSAutocompletion: view_path: F:\
FSAutocompletion: get_view_cwd: folder found {'path': 'F:\\'}
get_view_cwd: <function get_cwd_from_project at 0x000000FAFFD60D08> => F:\
FSAutocompletion: guessed_path: C:\da
FSAutocompletion: view_path: F:\
FSAutocompletion: get_view_cwd: folder found {'path': 'F:\\'}
get_view_cwd: <function get_cwd_from_project at 0x000000FAFFD60D08> => F:\
FSAutocompletion: guessed_path: C:\da
FSAutocompletion: view_path: F:\

Autocomplete in all buffers

It would be really nice if the plugin could work regardless whether it's being invoked in a file that has been saved or not.

This would enable it to be used in projects like SublimeREPL for example, resulting in an autocompleting shell within sublime.

Change default shortcut?

Took me 30 minutes to find why standard "Ctrl-X" command (Cut) works strange - waits for another key to be pressed.

How to make it work? any demo?

This is the 5th package about filename completion that I install and none is working so I'm probably doing something wrong

How to test the package to verify it works plz?

Path in quotes

Path in quotes (double or single) won't start autocomplete:

'/va'
or
'/va

don't work

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.