Skip to content

Instantly share code, notes, and snippets.

@lukepighetti
Last active April 9, 2024 11:59
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save lukepighetti/393845a6751c0b00c20d5cfbac1f8bd1 to your computer and use it in GitHub Desktop.
Save lukepighetti/393845a6751c0b00c20d5cfbac1f8bd1 to your computer and use it in GitHub Desktop.
zsh functions I use for Helix / Flutter development
function flutter-watch(){
local PID_FILE="/tmp/tf$$.pid"
tmux new-session \;\
send-keys "flutter run --pid-file=$PID_FILE" Enter \;\
split-window -v \;\
send-keys "npx -y nodemon -e dart -x \"cat $PID_FILE | xargs kill -s USR1\"" Enter \;\
resize-pane -y 5 -t 1 \;\
select-pane -t 0 \;
rm $PID_FILE;
}
function hx-find(){
hx $(ag . | fzf | cut -d : -f 1,2)
}
theme = "tokyonight_storm"
[editor]
true-color = true # ssh compatibility
line-number = "relative"
mouse = false
rulers = [80]
shell = ["zsh", "-c"]
bufferline = "multiple"
[keys.normal]
C-p = ["move_line_up", "scroll_up"]
C-n = ["move_line_down", "scroll_down"]
esc = ["collapse_selection", "keep_primary_selection"]
[editor.cursor-shape]
insert = "bar"
normal = "block"
select = "underline"
[editor.file-picker]
hidden = false
@tlvenn
Copy link

tlvenn commented Mar 9, 2023

Hi @lukepighetti, thanks a lot for this and your videos on helix, super helpful.
I though I would contribute back a little with my setup for people using Fish / Zellij combo.

function flutter-watch
  set PID_FILE "/tmp/tf$fish_pid.pid"
  zellij run -d down -n flutter_run -- flutter run --pid-file=$PID_FILE
  fswatch -1 /tmp
  zellij run -d left -n flutter_watch -- npx -y nodemon -e dart -x "cat $PID_FILE | xargs kill -s USR1"
  #rm $PID_FILE
end

Of course, you will have to setup Helix to use fish as shell with shell = ["fish", "-c"] instead of shell = ["zsh", "-c"]

@lukepighetti
Copy link
Author

Thank you!

@haryandb
Copy link

Work, Thanks

@lukepighetti
Copy link
Author

updated flutter-watch to support multiple devices concurrently

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment