ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Goto With Common Suffix

by ivantsepp ST3

Find the common suffix path with the project folder

Details

Installs

  • Total 43
  • Win 25
  • OS X 12
  • Linux 6
May 20 May 19 May 18 May 17 May 16 May 15 May 14 May 13 May 12 May 11 May 10 May 9 May 8 May 7 May 6 May 5 May 4 May 3 May 2 May 1 Apr 30 Apr 29 Apr 28 Apr 27 Apr 26 Apr 25 Apr 24 Apr 23 Apr 22 Apr 21 Apr 20 Apr 19 Apr 18 Apr 17 Apr 16 Apr 15 Apr 14 Apr 13 Apr 12 Apr 11 Apr 10 Apr 9 Apr 8 Apr 7 Apr 6
Windows 0 0 0 0 1 0 1 0 0 0 0 1 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
OS X 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

Goto With Common Suffix plugin

This plugin extends the usage of Sublime's File navigation by allowing you to use common suffix paths.

For example, I have opened up a Sublime window at /Users/ivan/projects and I have a file located at /Users/ivan/projects/example/readme.txt. I can use any arrangement of prefixes and input paths like /var/www/example/readme.txt and the plugin will correctly determine the common suffix (example/readme.txt) and opens the Goto Anything with it.

The use case is that I sometimes get GitHub urls that point to a file. I would like to simply copy that address and use this plugin to determine the file I want. It removes the step of me manually figuring out the common suffix to put in the quick finder. Other times, stack traces from other machines include file location but those locations are specific to that machine's file system. This plugin can help you get to the file you want.

Installation

Install via Package Control or you can manually install the package.

Usage

There is now a method named goto_with_common_suffix and command name Goto With common suffix that invokes it. You can use this plugin by opening the Command Palette and selecting this command.

You can also set your custom key binding to invoke the command. Here's my user sublime key map file:

[
    { "keys": ["ctrl+p"], "command": "goto_with_common_suffix"}
]

Here is a gif showing how I have this project opened in sublime and that by invoking this plugin (with ctrl+p), I can paste https://github.com/ivantsepp/goto-with-common-suffix/blob/master/goto_with_common_suffix.py and it will correctly find the common suffix.

screencast