67 lines
2.1 KiB
Nix
67 lines
2.1 KiB
Nix
{config, lib, pkgs, inputs, ...} : {
|
|
programs.helix = {
|
|
enable = true ;
|
|
defaultEditor = true ;
|
|
settings = {
|
|
theme = "horizon-dark" ;
|
|
editor = {
|
|
scrolloff = 4 ;
|
|
auto-format = true ;
|
|
auto-pairs = false ;
|
|
color-modes = true ;
|
|
lsp.snippets = true ;
|
|
cursor-shape.insert = "bar" ;
|
|
shell = [ "fish" "-c" ] ;
|
|
idle-timeout = 250 ;
|
|
whitespace = {
|
|
render.tab = "all" ;
|
|
characters.tab = "│" ;
|
|
} ;
|
|
soft-wrap = {
|
|
enable = true ;
|
|
wrap-at-text-width = true ;
|
|
} ;
|
|
} ;
|
|
keys = {
|
|
normal = {
|
|
} ;
|
|
} ;
|
|
} ;
|
|
};
|
|
|
|
home.packages = let
|
|
edit = (pkgs.writeShellApplication {
|
|
name = "edit";
|
|
text = ''
|
|
CMND=$(cat <<'END'
|
|
BUFFER_NAME=''$(echo -n "''$PWD" | xxd -ps -c 200 | tr -d '\n' | shasum | head -c -4)
|
|
|
|
tmux -L "$BUFFER_NAME" has-session -t "$BUFFER_NAME" || {
|
|
tmux -L "$BUFFER_NAME" new-session -d -s "$BUFFER_NAME" "BUFFER_NAME=$BUFFER_NAME EDITOR=wraphx lf"
|
|
tmux -L "$BUFFER_NAME" set -g status off
|
|
tmux -L "$BUFFER_NAME" set -g pane-border-style fg=#0c0c0c
|
|
tmux -L "$BUFFER_NAME" set -g pane-active-border-style "bg=default fg=#0c0c0c"
|
|
}
|
|
|
|
tmux -L "$BUFFER_NAME" attach -t "$BUFFER_NAME"
|
|
END
|
|
)
|
|
|
|
if [ -f "shell.nix" ] && [ -z ''${IN_NIX_SHELL+x} ]; then
|
|
nix-shell --command "$CMND"
|
|
else
|
|
eval "$CMND"
|
|
fi
|
|
'';
|
|
});
|
|
wraphx = (pkgs.writeShellApplication {
|
|
name = "wraphx";
|
|
text = ''
|
|
test "$(tmux -L "$BUFFER_NAME" list-panes | wc -l)" -eq 1 && {
|
|
tmux -L "$BUFFER_NAME" split-window -h hx "$1"
|
|
}
|
|
'';
|
|
});
|
|
in [ edit wraphx ];
|
|
|
|
} |