Skip to content
Snippets Groups Projects
Commit 7c3f527d authored by Obedi Ferreira's avatar Obedi Ferreira
Browse files

helix+term: integrate with yazi for a file tree hackaround

parent 29c8aa82
Branches
No related tags found
No related merge requests found
......@@ -20,6 +20,7 @@ config/config/nvim/lua/config/local.lua
!config/config/nvim/lua/
!config/config/nvim/snippets/
!config/config/wezterm/
!config/config/yazi/
# so that it's possible to version a few specific files
!config/config/efm-langserver
!config/config/fish/config.fish
......
......@@ -121,6 +121,23 @@ config.keys = {
-- Fix readline "undo"
{ mods = 'CTRL', key = '/', action = act { SendString = '\x1f' } },
-- Yazi integration
{
key = '0',
mods = 'CMD',
action = wezterm.action.SplitPane {
direction = 'Left',
command = {
args = { 'yazi' },
set_environment_variables = {
PATH = '/opt/homebrew/bin:' .. os.getenv 'PATH',
YAZI_CONFIG_HOME = '~/.config/yazi/filetree',
},
},
size = { Percent = 25 },
},
},
}
return config
# A TOML linter such as https://taplo.tamasfe.dev/ can use this schema to validate your config.
# If you encounter any issues, please make an issue at https://github.com/yazi-rs/schemas.
"$schema" = "https://yazi-rs.github.io/schemas/keymap.json"
[[manager.prepend_keymap]]
on = ['l']
exec = 'plugin --sync smart-enter'
desc = 'Enter the child directory, or open the file'
return {
entry = function()
local h = cx.active.current.hovered
if h.cha.is_dir then
ya.manager_emit('enter' or 'open', { hovered = true })
else
-- Send ":" to start command input in Helix
os.execute 'wezterm cli send-text --pane-id "$(wezterm cli get-pane-direction Right)" --no-paste ":"'
-- Send the "open" command with file path(s) to the pane
local file_path = tostring(h.url)
os.execute('wezterm cli send-text --pane-id "$(wezterm cli get-pane-direction Right)" "open ' .. file_path .. '"')
-- Simulate 'Enter' key to execute the command
os.execute 'printf "\r" | wezterm cli send-text --pane-id "$(wezterm cli get-pane-direction Right)" --no-paste'
end
end,
}
# A TOML linter such as https://taplo.tamasfe.dev/ can use this schema to validate your config.
# If you encounter any issues, please make an issue at https://github.com/yazi-rs/schemas.
"$schema" = "https://yazi-rs.github.io/schemas/yazi.json"
[manager]
ratio = [0, 8, 0]
show_hidden = true
sort_dir_first = true
# A TOML linter such as https://taplo.tamasfe.dev/ can use this schema to validate your config.
# If you encounter any issues, please make an issue at https://github.com/yazi-rs/schemas.
"$schema" = "https://yazi-rs.github.io/schemas/yazi.json"
[manager]
show_hidden = true
sort_dir_first = true
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment