Replies: 2 comments 1 reply
-
If you are using WezTerm, try this:
#!/bin/sh
pane_id=$(wezterm cli get-pane-direction down)
if [ -z "${pane_id}" ]; then
pane_id=$(wezterm cli split-pane)
fi
wezterm cli activate-pane-direction --pane-id $pane_id down
#!/bin/sh
source wezterm-split-pane.sh
program=$(wezterm cli list | awk -v pane_id="$pane_id" '$3==pane_id { print $6 }')
if [ "$program" = "lazygit" ]; then
echo "q" | wezterm cli send-text --pane-id $pane_id --no-paste
fi
filename="$1"
basedir=$(dirname "$filename")
basename=$(basename "$filename")
basename_without_extension="${basename%.*}"
extension="${filename##*.}"
case "$extension" in
"c")
run_command="clang -lcmocka -lmpfr -Wall -O3 $filename -o $basedir/$basename_without_extension && $basedir/$basename_without_extension"
;;
"go")
run_command="go run $filename"
;;
"scm"|"rkt")
run_command="racket $filename"
;;
esac
echo "${run_command}" | wezterm cli send-text --pane-id $pane_id --no-paste
# wezterm cli activate-pane-direction up
[keys.normal.";"]
r = ":sh run.sh %val{filename} > /tmp/run.log 2>&1" Now you can just press And to jump to the error positions, you need:
config.hyperlink_rules = wezterm.default_hyperlink_rules()
table.insert(config.hyperlink_rules, {
regex = '^/[^/\r\n]+(?:/[^/\r\n]+)*:\\d+:\\d+',
format = "$0",
})
wezterm.on("open-uri", function(window, pane, uri)
local user = os.getenv("USER")
local start, _ = string.find(uri, '/Users/' .. user)
if start == 1 then
local hx_pane = pane:tab():get_pane_direction("Up")
local action = wezterm.action.SendString(":open " .. uri .. "\r\n")
-- and spawn it!
window:perform_action(action, hx_pane);
-- prevent the default action from opening in a browser
return false
end
-- otherwise, by not specifying a return value, we allow later
-- handlers and ultimately the default action to caused the
-- URI to be opened in the browser
end) Hope this helps. |
Beta Was this translation helpful? Give feedback.
1 reply
-
While specifically for rust, this is an exciting Neovim focused project to make errors better in UX and also jump to the line of the error in Neovim... other editor are possible: https://github.com/alopatindev/cargo-limit#text-editoride-integrations 👀 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
How do you run and work with the output of build tools in the helix editor?
For example, "make" on a simple c project create the following lines between stdout and stderr:
Every code editor I have ever used allows starting a build and stepping through the build errors. Vim does it with its quickfix list. IDE's tend to do it with an errors pane.
Is Helix currently limited to using the diagnostics kicked out by the LSP protocol for fixing compile/linting errors? Or am I missing something?
Is there any quickfix support or ability to load the output of a build tool into a new buffer and jump to file positions from that file, such as the 'F' key in vim?
Beta Was this translation helpful? Give feedback.
All reactions