add task runner
This commit is contained in:
parent
dd9c225fd9
commit
d03776e583
4 changed files with 43 additions and 0 deletions
31
Configs/fish/.config/fish/functions/split_run.fish
Normal file
31
Configs/fish/.config/fish/functions/split_run.fish
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
function split_run
|
||||
argparse mask r/restart -- $argv
|
||||
or return
|
||||
|
||||
if not set -qg MPROCS_PORT
|
||||
set -gx MPROCS_PORT $(random 1024 2048)
|
||||
kitten @ env "MPROCS_PORT=$MPROCS_PORT"
|
||||
end
|
||||
|
||||
if set -ql _flag_restart
|
||||
# Send commands to server
|
||||
mprocs --server "127.0.0.1:$MPROCS_PORT" --ctl "{c: restart-proc}"
|
||||
return 0
|
||||
end
|
||||
|
||||
|
||||
if set -ql _flag_mask
|
||||
set -l cmd "mask $(mask --introspect | jq ".commands[] | [.name, .description] | @tsv" -r | fzf --accept-nth=1)"
|
||||
# check if server is running
|
||||
if nc -w 1 -zv 127.0.0.1 $MPROCS_PORT &>/dev/null
|
||||
mprocs --server "127.0.0.1:$MPROCS_PORT" --ctl "{c: add-proc, cmd: \"$cmd\"}"
|
||||
mprocs --server "127.0.0.1:$MPROCS_PORT" --ctl "{c: select-proc, index: 0}"
|
||||
mprocs --server "127.0.0.1:$MPROCS_PORT" --ctl "{c: prev-proc}"
|
||||
else
|
||||
# Start server
|
||||
kitten @ launch --cwd=current --location last --dont-take-focus mprocs --server "127.0.0.1:$MPROCS_PORT" "$cmd"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
|
@ -2003,6 +2003,8 @@ map ctrl+space>ctrl+v launch --location=split
|
|||
#:: <https://sw.kovidgoyal.net/kitty/launch/>.
|
||||
|
||||
map ctrl+space>g launch --cwd=current --type=overlay --var lazy_float=true lazygit
|
||||
map ctrl+p>ctrl+p launch --cwd=current --type=background fish -c 'split_run --restart'
|
||||
map ctrl+space>p launch --cwd=current --type=overlay fish -c 'split_run --mask'
|
||||
|
||||
#: New OS window
|
||||
|
||||
|
|
|
|||
|
|
@ -8,11 +8,13 @@
|
|||
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
|
||||
"fzf-lua": { "branch": "main", "commit": "758173f499d15410ecb50c5519a41b27c33e645d" },
|
||||
"grapple.nvim": { "branch": "main", "commit": "b41ddfc1c39f87f3d1799b99c2f0f1daa524c5f7" },
|
||||
"hardtime.nvim": { "branch": "main", "commit": "3541ad24faff78274669eceaf130502eb7f1261a" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
|
||||
"lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" },
|
||||
"mason.nvim": { "branch": "main", "commit": "8024d64e1330b86044fed4c8494ef3dcd483a67c" },
|
||||
"mini.nvim": { "branch": "main", "commit": "94cae4660a8b2d95dbbd56e1fbc6fcfa2716d152" },
|
||||
"neogen": { "branch": "main", "commit": "b2e78708876f4da507839726816010a68e33fec8" },
|
||||
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
|
||||
"nvim-lint": { "branch": "master", "commit": "b47cbb249351873e3a571751c3fb66ed6369852f" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "b8e7957bde4cbb3cb25a13a62548f7c273b026e9" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
return {
|
||||
{
|
||||
"m4xshen/hardtime.nvim",
|
||||
lazy = false,
|
||||
dependencies = { "MunifTanjim/nui.nvim" },
|
||||
opts = {},
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue