Sublime Forum

Feedback: plugin to add selection contents to file

#1

I’ve recently found out plugins are written in Python - the only language I actually know! I am working on a plugin which allows me to copy the selection contents and add it to the end of a chosen file. So far I’ve got it up and running with some extra features like key bindings and a settings file. See it here.

In summary, when run, a quick panel appears which contains a list of the current open files. This popup can be configured to show file names or paths and to include a text preview to aid with files with similar names. When one is selected, the selection contents are inserted at the end of the file.

In addition, a New File option can be configured to appear in the popup to copy to a new file. I’ve also added support for these new files which obviously don’t have a path, so they just appear as untitled.

There is also small features such as a customisable status bar message to appear; keeping the focus on the ‘source’ file or the ‘destination’ file; **scrolling to the bottom** where the text was copied; and automatically copying to the next file if there is only 1 other open file to copy to (assuming the ‘New File’ option is disabled).

Any feedback would be greatly appreciated, or ideas for other features. I also need a quick confirmation that the f8 key binding is free on Linux/Mac platforms since that’s what I’ve chosen but I only have access to a Windows platform.

0 Likes

#2

Indeed F8 is not bound by default on Linux or MacOS. For reference, the Default package contains the default keybindings for all of the platforms, so you can use the internal View Package File command from the command palette to view them, if you wish.

0 Likes

#3

Thanks, I probably wouldn’t have thought of that! I’ve pretty much completed it now. Just need to have a look at submitting it to package control. (Edit 2: This plugin can now be downloaded manually. Follow the quick installation instructions in the README inside the repository.

0 Likes