AutoYADM commit: 2025-02-12 12:05:05
This commit is contained in:
parent
02c7130b8d
commit
263cb2c1c0
6 changed files with 70 additions and 3 deletions
|
@ -264,7 +264,7 @@ keymap = [
|
||||||
{ on = "_", run = "move first-char", desc = "Move to the first non-whitespace character" },
|
{ on = "_", run = "move first-char", desc = "Move to the first non-whitespace character" },
|
||||||
{ on = "^", run = "move first-char", desc = "Move to the first non-whitespace character" },
|
{ on = "^", run = "move first-char", desc = "Move to the first non-whitespace character" },
|
||||||
{ on = "<C-a>", run = "move bol", desc = "Move to the BOL" },
|
{ on = "<C-a>", run = "move bol", desc = "Move to the BOL" },
|
||||||
{ on = "<C-e>", run = "move eol", desc = "Move to the EOL" },
|
{ on = "<C-l>", run = "move eol", desc = "Move to the EOL" },
|
||||||
{ on = "<Home>", run = "move bol", desc = "Move to the BOL" },
|
{ on = "<Home>", run = "move bol", desc = "Move to the BOL" },
|
||||||
{ on = "<End>", run = "move eol", desc = "Move to the EOL" },
|
{ on = "<End>", run = "move eol", desc = "Move to the EOL" },
|
||||||
|
|
||||||
|
|
|
@ -42,6 +42,7 @@ prepend_keymap = [
|
||||||
"g",
|
"g",
|
||||||
"r",
|
"r",
|
||||||
], run = 'shell -- ya emit cd "$(git rev-parse --show-toplevel)"', desc = "Goto git root"},
|
], run = 'shell -- ya emit cd "$(git rev-parse --show-toplevel)"', desc = "Goto git root"},
|
||||||
|
# {on = "<C-e>", run = 'o'}
|
||||||
]
|
]
|
||||||
|
|
||||||
[input]
|
[input]
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
[plugin]
|
[[plugin.deps]]
|
||||||
deps = []
|
use = "Ape/open-with-cmd"
|
||||||
|
rev = "433cf30"
|
||||||
|
hash = "86e0312b01bc5762813c6c1d0517f073"
|
||||||
|
|
||||||
[[flavor.deps]]
|
[[flavor.deps]]
|
||||||
use = "ashen-org/ashen:ashen"
|
use = "ashen-org/ashen:ashen"
|
||||||
|
|
19
.config/yazi/plugins/open-with-cmd.yazi/LICENSE
Normal file
19
.config/yazi/plugins/open-with-cmd.yazi/LICENSE
Normal file
|
@ -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.
|
25
.config/yazi/plugins/open-with-cmd.yazi/README.md
Normal file
25
.config/yazi/plugins/open-with-cmd.yazi/README.md
Normal file
|
@ -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 pack -a Ape/open-with-cmd
|
||||||
|
```
|
||||||
|
|
||||||
|
Create `~/.config/yazi/keymap.toml` and add:
|
||||||
|
|
||||||
|
```
|
||||||
|
[[manager.prepend_keymap]]
|
||||||
|
on = "o"
|
||||||
|
run = "plugin open-with-cmd --args=block"
|
||||||
|
desc = "Open with command in the terminal"
|
||||||
|
|
||||||
|
[[manager.prepend_keymap]]
|
||||||
|
on = "O"
|
||||||
|
run = "plugin open-with-cmd"
|
||||||
|
desc = "Open with command"
|
||||||
|
```
|
20
.config/yazi/plugins/open-with-cmd.yazi/main.lua
Normal file
20
.config/yazi/plugins/open-with-cmd.yazi/main.lua
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
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:",
|
||||||
|
position = { "hovered", y = 1, w = 50 },
|
||||||
|
})
|
||||||
|
|
||||||
|
if event == 1 then
|
||||||
|
local s = ya.target_family() == "windows" and " %*" or ' "$@"'
|
||||||
|
ya.manager_emit("shell", {
|
||||||
|
value .. s,
|
||||||
|
block = block,
|
||||||
|
orphan = true,
|
||||||
|
confirm = true,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue