Search code examples
sublimetext3sublimetext

How to copy file name of currently opened file in sublime text 3?


How do you copy the file name of the currently opened file in sublime text 3 ? If this is not possible by default, perhaps you know some sublime extension which does that job using keyboard shortcut.


Solution

  • You can do this if you have the SideBarEnhancements plugin installed.

    1. Open up the command palette with Ctrl+Shift+P (on Mac it is +Shift+P)

    2. Type File: Copy Name and press Enter

    The file name has now been copied to your clipboard.


    Setting a hotkey for this command:

    1. Go to your Key Bindings -> User file

    2. Add this line to your file: { "keys": ["ctrl+shift+l"], "command": "side_bar_copy_name" }

    3. Change "ctrl+shift+l" to whatever command you want to use.