[*] Updated configs
This commit is contained in:
@@ -99,10 +99,10 @@ title_error = { fg = "#a85361" }
|
||||
[filetype]
|
||||
rules = [
|
||||
# directories
|
||||
{ name = "*/", fg = "#1f6f88" },
|
||||
{ url = "*/", fg = "#1f6f88" },
|
||||
|
||||
# executables
|
||||
{ name = "*", is = "exec", fg = "#7e9350" },
|
||||
{ url = "*", is = "exec", fg = "#7e9350" },
|
||||
|
||||
# images
|
||||
{ mime = "image/*", fg = "#c2a05c" },
|
||||
@@ -122,16 +122,16 @@ rules = [
|
||||
{ mime = "text/x-{c,c++}", fg = "#1f6f88" },
|
||||
|
||||
# config files
|
||||
{ name = "*.json", fg = "#c2a05c" },
|
||||
{ name = "*.yml", fg = "#1f6f88" },
|
||||
{ name = "*.toml", fg = "#9464b6" },
|
||||
{ url = "*.json", fg = "#c2a05c" },
|
||||
{ url = "*.yml", fg = "#1f6f88" },
|
||||
{ url = "*.toml", fg = "#9464b6" },
|
||||
|
||||
# special files
|
||||
{ name = "*", is = "orphan", bg = "#0a0e14" },
|
||||
{ url = "*", is = "orphan", bg = "#0a0e14" },
|
||||
|
||||
# dummy files
|
||||
{ name = "*", is = "dummy", bg = "#0a0e14" },
|
||||
{ url = "*", is = "dummy", bg = "#0a0e14" },
|
||||
|
||||
# fallback
|
||||
{ name = "*/", fg = "#1f6f88" },
|
||||
{ url = "*/", fg = "#1f6f88" },
|
||||
]
|
||||
|
||||
@@ -2,3 +2,18 @@
|
||||
on = [ "g", "s" ]
|
||||
run = "cd sftp://pebble"
|
||||
desc = "Go to pebble"
|
||||
|
||||
[[mgr.prepend_keymap]]
|
||||
on = "o"
|
||||
run = "plugin open-with-cmd -- block"
|
||||
desc = "Open with command in the terminal"
|
||||
|
||||
[[mgr.prepend_keymap]]
|
||||
on = "O"
|
||||
run = "plugin open-with-cmd"
|
||||
desc = "Open with command"
|
||||
|
||||
[[mgr.prepend_keymap]]
|
||||
on = "l"
|
||||
run = "plugin smart-enter"
|
||||
desc = "Enter the child directory, or open the file"
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
[plugin]
|
||||
deps = []
|
||||
[[plugin.deps]]
|
||||
use = "Ape/open-with-cmd"
|
||||
rev = "e3d430f"
|
||||
hash = "d29c1ffa99099181faf8c01d1f59aa4c"
|
||||
|
||||
[[plugin.deps]]
|
||||
use = "yazi-rs/plugins:smart-enter"
|
||||
rev = "1962818"
|
||||
hash = "187cc58ba7ac3befd49c342129e6f1b6"
|
||||
|
||||
[[flavor.deps]]
|
||||
use = "kmlupreti/ayu-dark"
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
Copyright (c) 2024 Lauri Niskanen
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -0,0 +1,25 @@
|
||||
# open-with-cmd.yazi
|
||||
|
||||
This is a Yazi plugin for opening files with a prompted command.
|
||||
|
||||
## Installation
|
||||
|
||||
Install the plugin:
|
||||
|
||||
```
|
||||
ya pkg add Ape/open-with-cmd
|
||||
```
|
||||
|
||||
Create `~/.config/yazi/keymap.toml` and add:
|
||||
|
||||
```
|
||||
[[manager.prepend_keymap]]
|
||||
on = "o"
|
||||
run = "plugin open-with-cmd -- block"
|
||||
desc = "Open with command in the terminal"
|
||||
|
||||
[[manager.prepend_keymap]]
|
||||
on = "O"
|
||||
run = "plugin open-with-cmd"
|
||||
desc = "Open with command"
|
||||
```
|
||||
@@ -0,0 +1,19 @@
|
||||
return {
|
||||
entry = function(_, job)
|
||||
local block = job.args[1] and job.args[1] == "block"
|
||||
|
||||
local value, event = ya.input({
|
||||
title = block and "Open with (block):" or "Open with:",
|
||||
pos = { "hovered", y = 1, w = 50 },
|
||||
})
|
||||
|
||||
if event == 1 then
|
||||
local s = ya.target_family() == "windows" and " %*" or ' "$@"'
|
||||
ya.mgr_emit("shell", {
|
||||
value .. s,
|
||||
block = block,
|
||||
orphan = not block,
|
||||
})
|
||||
end
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2023 yazi-rs
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -0,0 +1,40 @@
|
||||
# smart-enter.yazi
|
||||
|
||||
[`Open`][open] files or [`enter`][enter] directories all in one key!
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
ya pkg add yazi-rs/plugins:smart-enter
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Bind your <kbd>l</kbd> key to the plugin, in your `~/.config/yazi/keymap.toml`:
|
||||
|
||||
```toml
|
||||
[[mgr.prepend_keymap]]
|
||||
on = "l"
|
||||
run = "plugin smart-enter"
|
||||
desc = "Enter the child directory, or open the file"
|
||||
```
|
||||
|
||||
## Advanced
|
||||
|
||||
By default, `--hovered` is passed to the [`open`][open] action, make the behavior consistent with [`enter`][enter] avoiding accidental triggers,
|
||||
which means both will only target the currently hovered file.
|
||||
|
||||
If you still want `open` to target multiple selected files, add this to your `~/.config/yazi/init.lua`:
|
||||
|
||||
```lua
|
||||
require("smart-enter"):setup {
|
||||
open_multi = true,
|
||||
}
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
This plugin is MIT-licensed. For more information check the [LICENSE](LICENSE) file.
|
||||
|
||||
[open]: https://yazi-rs.github.io/docs/configuration/keymap/#mgr.open
|
||||
[enter]: https://yazi-rs.github.io/docs/configuration/keymap/#mgr.enter
|
||||
@@ -0,0 +1,11 @@
|
||||
--- @since 25.5.31
|
||||
--- @sync entry
|
||||
|
||||
local function setup(self, opts) self.open_multi = opts.open_multi end
|
||||
|
||||
local function entry(self)
|
||||
local h = cx.active.current.hovered
|
||||
ya.emit(h and h.cha.is_dir and "enter" or "open", { hovered = not self.open_multi })
|
||||
end
|
||||
|
||||
return { entry = entry, setup = setup }
|
||||
Reference in New Issue
Block a user