Ditch sidebar and browse your files in a normal tab with keyboard, like a pro!
Ditch sidebar and browse your files in a normal tab with keyboard, like a pro!
Ditch sidebar and browse your files in a normal tab with keyboard, like a pro!
You can also use it as a sidebar that you can put on right or left side
You can install via Sublime Package Control
Or clone this repo into your SublimeText Packages directory and rename it to FileBrowser, in this
case, if you want to make auto-refresh work (note it is an optional feature you may ignore it) then
some extra steps might be required:
pathtoolswatchdogpathtools must be loaded before
watchdog, and watchdog and package_events must be loaded before FileBrowser,
that is why we recommend to use Package Control, but there is option for workaroundThis plugin does not add any keybindings for opening a new tab in Browse Mode. Although, the
commands to do that are available in Command Palette but it is recommended to bind F1
to open the current file directory in Browse Mode with this piece of code (that you can add to
your Key Bindings - User file):
{
"keys": ["f1"],
"command": "dired",
"args": { "immediate": true }
}You also can use optional arguments to tweak behavior:
"single_pane": true — always use a single File Browser view, i.e. prefer to reuse existing one
rather than create a new."other_group": "left" (or "right) — open FileBrowser in other group, i.e. like sidebar; if
you use "left" then all other tabs from left group will be moved into the right one."project": true — always prefer project's directory(s) rather than path of current view.You can mix these arguments as you like (perhaps, even bind several shortcuts for different cases); e.g. to completely mimic sidebar, it would be:
{
"keys": ["f1"],
"command": "dired",
"args": {
"immediate": true,
"single_pane": true,
"other_group": "left",
"project": true
}
}| Commands | Description |
|---|---|
| Browse Mode... | Asks for a directory to open in browse mode |
| Browse Mode: Current file or project | Opens the directory of current file or project in browse mode |
| Browse Mode: Left Sidebar | Opens in browse mode as a sidebar on the left |
| Browse Mode: Right Sidebar | Opens in browse mode as a sidebar on the right |
| Browse Mode: Jump List | Shows the jump list view (see jump list section below) |
| Browse Mode: Jump List Quick Panel | Shows the jump list in quick panel |
| Command | Shortcut |
|---|---|
| Shortcuts page | ? |
| Refresh view | r |
| Command | Shortcut |
|---|---|
| Move to previous | k or ↑ |
| Move to next | j or ↓ |
| Expand directory | l or → |
| Collapse directory | h or ← |
| Toggle expand/collapse | o |
| Go to parent directory | backspace |
| Go to first | ⌘+↑ or ctrl+home |
| Go to last | ⌘+↓ or ctrl+end |
| Jump to | / |
| Go to directory | g |
| Quick jump to directory | p |
| Find in files | s |
| Toggle mark | m |
| Toggle mark and move down | shift+↓ |
| Toggle mark and move up | shift+↑ |
| Toggle all marks | t |
| Unmark all | u |
| Mark by extension | * |
| Command | Shortcut |
|---|---|
| Rename | R |
| Delete to trash | D |
| Delete (does not send to trash) | alt+shift+d |
| Create directory | cd, enter |
| Create directory and open it | cd, ⌘+enter |
| Create file | cf, enter |
| Create file and open it | cf, ⌘+enter |
| Create/Edit/Remove jump point | P |
| Toggle hidden files | H |
| Open in Finder/File Explorer | \ |
| Open in new window | W |
| Open file in another group | enter |
| Open all marked items in new tabs | ⌘+enter / ctrl+enter |
| Preview file in another group | shift+enter |
| Toggle add directory to project | f |
| Set current directory as the only one for the project | F |
| Quicklook for Mac or open in default app on other OSs | space |
If you prefer to open file(s) on Mac in default app instead of Quicklook, add the following code in your user key bindings file:
{
"keys": [" "],
"command": "dired_quick_look", "args": { "preview": false},
"context": [
{ "key": "selector", "operator": "equal", "operand": "text.dired" },
{ "key": "setting.dired_rename_mode", "operand": false }
]
}| Command | Shortcut |
|---|---|
| Apply changes | enter |
| Discard changes | escape |
NOTE: All these keyboard shortcuts can be customized in your own key-binding file. Open the
default key-bindings file (Preferences → Package Settings → FileBrowser →
Keybinding — Default) and copy the ones you want to change to your Keybinding — User
file.
You can select files and/or directories by marking them with m, or Shift + ↑/↓ or just use SublimeText multiple cursor feature and extend your cursor to the line that has those files/directories.
You can expand or collapse a directory (or multiple directories using marking or multiple cursors) by pressing o. l or → will also expand directories inline and h or ← will collapse.
Besides incremental search available by /, you also may use build-in "Goto Symbol…" (⌘+r or ctrl + r) for fuzzy search.
Press s to summon "Find in Files…" panel — if you've marked some files they will fill Where field, otherwise it will be filled by current directory path.
The rename command puts the view into rename mode. The view is made editable so files can be renamed directly in the view using all of your SublimeText tools: multiple cursors, search and replace, etc.
After you are done with editing press enter to commit your changes or escape to cancel them.
You can move and copy files/folders. Shortcuts are quite standard: x, c, v with ⌘ or ctrl.
You can copy and/or cut as many items and from many locations as you like — status-bar will show
amounts of copied and cut items.
If you change your mind — ⌘+z or ctrl+z will clear both lists. Note, those
lists are stored in FileBrowser settings file, so you can edit it by hand if need.
As soon as you paste, each item will be either copied or moved into folder under cursor.
If you want to alter the destination path without moving cursor, you may do so with
⌘+shift+v or ctrl+shift+v to open prompt; you may use prompt without copy/cut
before, i.e. if those lists in settings file are empty then prompt will take marked or selected
item(s) and suggest copying them.
On Windows all operations will be done via system API with all its features (renaming semantics, interactive overwrite, progress-bar, pause/cancel, and so on).
On other OSes all operations will be done via Python API, which is not that cool, but you will see
a vague progress in status-bar and can choose what to do in case of conflicts (overwrite, duplicate,
skip), however, there are some restrictions, e.g. folders cannot be overwritten or merged.
Duplication adds separator and generic number to old name, e.g. duplicate of file.ext would be
file — 2.ext, you can change separator to any string (beware illegal path characters),
e.g.
{
"dired_dup_separator": "_"
}so new filename would be file_2.ext
Selecting a couple of files and/or directories (either by marking them or using the normal multiple cursor feature of SublimeText) and pressing w will open them in a new window.
Add the following code in your user key bindings file:
{
"keys": ["enter"],
"command": "dired_select", "args": {"and_close": true},
"context": [
{ "key": "selector", "operator": "equal", "operand": "text.dired" },
{ "key": "setting.dired_rename_mode", "operand": false }
]
}While in Browse Mode, you can press P(Shift + p) to add the current directory to your Jump List, we call it a Jump Point. It's like Bookmarks or Favorites in other file managers.
There are several ways to view your Jump list:
While in Browse Mode, you can press p to view the Jump List in a Sublime quick panel.
NOTE: This command does NOT create a new window or project. it lets you jump quickly to a particular location.
Bring up Command Palette and search for `B
No open issues yet, or sync has not completed.