SublimeFileBrowser
SublimeFileBrowser copied to clipboard
Don't open new windows
Hi, for the life of me I can't configure sensible behavior.
- I don't want it to open a new window ever.
- I want either a new full screen tab or a left panel to show me a directory. The following gives me a left panel.
{ "keys": ["super+k", "o"], "command": "dired",
"args": {
"immediate": true,
"single_pane": false,
"other_group": "left",
} },
I then window to select my file(s), open them in the right/main panel and have the left panel close. It looks likes this is supposed to do this, but this opens the selected files in the thin left panel!
{"keys": ["enter"],
"command": "dired_select", "args": {"and_close": true},
"context": [
{ "key": "selector", "operator": "equal", "operand": "text.dired" },
{ "key": "setting.dired_rename_mode", "operand": false }
]
},
If I can figure this much out, then I'll move on to asking the same thing for jumping.
"command": "dired_select", "args": {"other_group": true, "and_close": true},
Jumping does not support panels.
I'm sorry, I still don't understand. My keybindings are below.
When I press super+k,j and select the jump directory, my current tab is replaced (hey, where'd my editing go?) by a full tab FileBrowser tab in which I can move around, but pressing enter on a key does nothing, and when I close it I'm prompted that I haven't saved this file?
{ "keys": ["super+k", "o"], "command": "dired",
"args": {
"immediate": true,
"single_pane": false,
"other_group": "left",
} },
{"keys": ["super+k", "j"],
"command": "dired_jump",
"args": { "new_window": false}
},
{"keys": ["enter"],
"command": "dired_select", "args": {"other_group": true, "and_close": true},
"context": [
{ "key": "selector", "operator": "equal", "operand": "text.dired" },
{ "key": "setting.dired_rename_mode", "operand": false }
]
},
Okay, I figured it (ignore my prev message, I removed it)
"dired_jump" must be restricted to FileBrowser view (just add same context as for "dired_select")
But if you use "new_window": true then "dired_jump" may be unrestricted.
So you can do this:
{"keys": ["super+k", "j"],
"command": "dired_jump",
"context": [
{ "key": "selector", "operator": "equal", "operand": "text.dired" },
{ "key": "setting.dired_rename_mode", "operand": false }
]
},
{"keys": ["super+k", "j"],
"command": "dired_jump",
"args": { "new_window": true},
"context": [
{ "key": "selector", "operator": "not_equal", "operand": "text.dired" }
]
},
But I don't want a new window. I prefer to do my tab and pane management in a single ST3 window. The following is working when I open with dired in the current directory, but jumping is eluding me. I want the jump to resemble the open (open thin left pane, let me navigate & select, open file in new tab, then disappear) but with the jump directory rather than the documents current directory.
Maybe what I'm asking isn't possible?
{ "keys": ["super+k", "o"], "command": "dired",
"args": {
"immediate": true,
"single_pane": false,
"other_group": "left",
} },
{"keys": ["super+k", "j"],
"command": "dired_jump",
"context": [
{ "key": "selector", "operator": "equal", "operand": "text.dired" },
{ "key": "setting.dired_rename_mode", "operand": false }
]
},
{"keys": ["super+k", "j"],
"command": "dired_jump",
"args": { "new_window": true},
"context": [
{ "key": "selector", "operator": "not_equal", "operand": "text.dired" }
]
},
{"keys": ["enter"],
"command": "dired_select", "args": {"other_group": true, "and_close": true},
"context": [
{ "key": "selector", "operator": "equal", "operand": "text.dired" },
{ "key": "setting.dired_rename_mode", "operand": false }
]
},
You can try Chain of Command, to call dired & dired_jump commands with one keybinding.
Or feel free to send a pull request for additional arguments for jumping commands.
Both of those are beyond me at the moment, but thanks for your help.
Chain of Command is pretty simple, you just have to understand the syntax, something like this:
{
"keys": ["super+k", "j"],
"command": "chain",
"args": {
"commands": [
["dired", {"immediate": true, "other_group": "left"}],
["dired_jump"]
]
},
"context": [
{ "key": "selector", "operator": "not_equal", "operand": "text.dired" }
]
},
{"keys": ["super+k", "j"],
"command": "dired_jump",
"context": [
{ "key": "selector", "operator": "equal", "operand": "text.dired" },
{ "key": "setting.dired_rename_mode", "operand": false }
]
},
That doesn't work well: it opens the dired_jump pop-up in a thin left panel and can't be seen properly because it is cut off.
If I remove "other_group": "left" (see below), I get a full tab dired tab, a legible jump pop-up, but when I select something any pre-existing tabs I had are smushed into a left pane.
{ "keys": ["super+k", "o"], "command": "dired",
"args": {
"immediate": true,
"single_pane": false,
"other_group": "left",
} },
{
"keys": ["super+k", "j"],
"command": "chain",
"args": {
"commands": [
["dired", {"immediate": true}],
["dired_jump"]
]
},
"context": [
{ "key": "selector", "operator": "not_equal", "operand": "text.dired" }
]
},
{"keys": ["super+k", "j"],
"command": "dired_jump",
"context": [
{ "key": "selector", "operator": "equal", "operand": "text.dired" },
{ "key": "setting.dired_rename_mode", "operand": false }
]
},
This looks to do what I want to do. I thought what I wanted was simple: jump pop-up, navigate, select files to open, open files -- after which there should be no changes to the panes.
{
"keys": ["super+k", "j"],
"command": "chain",
"args": {
"commands": [
["dired", {"immediate": true, "single_pane": true}],
["dired_jump"]
]
},
"context": [
{ "key": "selector", "operator": "not_equal", "operand": "text.dired" }
]
},
{"keys": ["super+k", "j"],
"command": ["dired_jump", {"immediate": true, "single_pane": true}],
"context": [
{ "key": "selector", "operator": "equal", "operand": "text.dired" },
{ "key": "setting.dired_rename_mode", "operand": false }
]
},
{"keys": ["enter"],
"command": "dired_select", "args": {"other_group": false, "and_close": true},
"context": [
{ "key": "selector", "operator": "equal", "operand": "text.dired" },
{ "key": "setting.dired_rename_mode", "operand": false }
]
},