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

Toss File

by jbaranski ST3

Sublime Text 3 plugin for copying the current file or all open files to new pre-mapped locations

Details

Installs

  • Total 118
  • Win 79
  • Mac 23
  • Linux 16
May 28 May 27 May 26 May 25 May 24 May 23 May 22 May 21 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
Windows 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
Mac 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 1 0
Linux 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

Readme

Source
raw.​githubusercontent.​com

Toss File

Sublime Text plugin for copying the current file or all open files to new location(s)

Visual Studio Code equivalent: https://github.com/jbaranski/toss-file

Install

Using Package Control:

  1. In Sublime Text press Ctrl+Shift+P or Cmd+Shift+P
  2. Type install, select Package Control: Install Package
  3. Find Toss File and install

Manual:

  1. Download the latest release
  2. Extract the contents of the zip into a folder called Toss File (the space is important in the folder name)
  3. Copy the folder to <SUBLIME_TEXT_HOME>/Data/Packages/

After install add some paths to your settings (see below) and now you're ready to go

Settings

Always use a trailing slash to end the paths you list (default is empty list)

*nix

"paths": [
    {
        "/home/source1/": "/home/destination1/"
    },
    {
        "/home/source2/": "/home/destination2/"
    }
]

Windows

"paths": [
    {
        "C:\\home\\source1\\": "C:\\home\\destination1\\"
    },
    {
        "C:\\home\\source2\\": "C:\\home\\destination2\\"
    }
]

Control how long the status message appears (in seconds) in the footer of the file the command was run in (default is 5)

"statusTimeout": 5

Prevent overwrite exisiting file at the output location if it already exists (default is true)

"replaceIfExists": false,

List of extensions to ignore even if a path match is found (default is empty list)

"extensionExcludes": [
    ".jar",
    ".zip",
    ".class"
]

List of file names to ignore even if a path match is found (default is empty list)

"nameExcludes": [
    "File1.class",
    "File1.java"
]

List of output paths to ignore even if a path match is found (default is empty list) (example output paths are based on *nix “paths” above)

"outputPathExcludes": [
    "/home/destination1/build/",
    "/home/destination1/topsecret/"
]

List of input paths to ignore even if a path match is found (default is empty list) (example output paths are based on *nix “paths” above)

"inputPathExcludes": [
    "/home/source1/build/",
    "/home/source1/topsecret/"
]

Example Scenarios

NOTE: Toss All Files context menu item works exactly the same as Toss File except it includes all currently open files

Invoke the plugin via Toss File context menu item by right clicking on the current file, or pressing Ctrl+Shift+P or Cmd+Shift+P and executing the Toss File command

Example 1 (assume you are using the settings listed above):

  1. Run the toss file command against a file, for example /home/source1/my/special/file/file.txt
  2. The file is copied to /home/destination1/my/special/file/file.txt
  3. If the directory at step 2 doesn't already exist, it will be created

Example 2 (assume you are using the settings listed above):

  1. Run the toss file command against a file, for example /home/source77/my/special/file/file.txt
  2. No matches found, nothing happens