summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Zhao <jeff.no.zhao@gmail.com>2023-07-02 11:22:22 -0400
committerJeff Zhao <jeff.no.zhao@gmail.com>2023-07-02 11:22:22 -0400
commit00d011fd22ac56bd1add71cc8110ac2956333d1a (patch)
tree7a84af1b7e67b9170c13952de95a083965a4a4f2
parente10fae7255557df4e6c2b63a944357cae6b7d94f (diff)
parentf15b58d19cf0a3096e0cf37b83ec5c1dee691a47 (diff)
Merge branch 'main' of github.com:kamiyaa/joshuto
-rw-r--r--config/keymap.toml2
-rw-r--r--docs/misc.md31
-rw-r--r--src/ui/views/tui_folder_view.rs1
3 files changed, 34 insertions, 0 deletions
diff --git a/config/keymap.toml b/config/keymap.toml
index 2d522c2..5e9e6d6 100644
--- a/config/keymap.toml
+++ b/config/keymap.toml
@@ -45,6 +45,8 @@ keymap = [
{ keys = ["page_down"], command = "cursor_move_page_down" },
{ keys = ["ctrl+u"], command = "cursor_move_page_up 0.5" },
{ keys = ["ctrl+d"], command = "cursor_move_page_down 0.5" },
+ { keys = ["ctrl+b"], command = "cursor_move_page_up" },
+ { keys = ["ctrl+f"], command = "cursor_move_page_down" },
# vim-like keybindings
{ keys = ["j"], command = "cursor_move_down" },
diff --git a/docs/misc.md b/docs/misc.md
index 8a58e08..6252c46 100644
--- a/docs/misc.md
+++ b/docs/misc.md
@@ -69,3 +69,34 @@ Unlike ranger, it’s currently not possible to scroll the children-panel or a p
with the mouse wheel.
Unlike ranger, Joshuto allows to set the cursor in the children-panel with a right click.
+
+## Using joshuto with [qutebrowser](https://qutebrowser.org/)
+
+In order to use joshuto as the file picker in qutebrowser, you need to first add a quit
+keybind that outputs the selected files. You can do this in `keymap.toml` like so:
+
+
+```toml
+[default_view]
+
+keymap = [
+ { keys = ["o"], command = "quit --output-selected-files" },
+ # other keybinds...
+]
+```
+
+Next, you need to edit qutebrowser's `config.py` to open joshuto in your terminal of choice,
+then output the resulting directory, file, or files to a file named `{}`. Here's an example
+with [kitty](https://sw.kovidgoyal.net/kitty/index.html):
+
+```python
+# Use joshuto as the file selector
+c.fileselect.handler = 'external'
+c.fileselect.folder.command = ['kitty', '-e', 'joshuto', '--output-file', '{}']
+c.fileselect.multiple_files.command = ['kitty', '-e', 'joshuto', '--output-file', '{}']
+c.fileselect.single_file.command = ['kitty', '-e', 'joshuto', '--output-file', '{}']
+```
+
+Now when the file picker opens in qutebrowser, you should see joshuto in your terminal emulator
+of choice. Use the visual selector (default `V`) if you need to select multiple files and press
+the key you defined earlier to send the file or files you highlighted back to qutebrowser.
diff --git a/src/ui/views/tui_folder_view.rs b/src/ui/views/tui_folder_view.rs
index e2700f0..199acf4 100644
--- a/src/ui/views/tui_folder_view.rs
+++ b/src/ui/views/tui_folder_view.rs
@@ -293,6 +293,7 @@ pub fn get_constraints(context: &AppContext) -> &[Constraint; 3] {
Some(PreviewFileState::Success { data }) if data.status.code() != Some(1) => {
&display_options.default_layout
}
+ Some(PreviewFileState::Loading) => &display_options.default_layout,
_ => &display_options.no_preview_layout,
},
},