Skip to content

Commit

Permalink
Enable dprint completions in each main shells
Browse files Browse the repository at this point in the history
eval style makes 8~10ms slower
  • Loading branch information
kachick committed Aug 7, 2023
1 parent 26b2101 commit 3ab29c0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions home-manager/bash.nix
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@
}
# shellcheck disable=SC2034
starship_precmd_user_func="set_win_title"
eval "$(${lib.getBin pkgs.dprint}/bin/dprint completions bash)"
'' + builtins.readFile ./initExtra.bash;

logoutExtra = ''
Expand Down
4 changes: 3 additions & 1 deletion home-manager/fish.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ pkgs, ... }:
{ pkgs, lib, ... }:

{
programs.starship.enableFishIntegration = true;
Expand Down Expand Up @@ -41,6 +41,8 @@
# I define another la as a homemade scripts
# See https://stackoverflow.com/a/36700734/1212807 for using `--erase`
functions --erase la
${lib.getBin pkgs.dprint}/bin/dprint completions fish | source
'';

plugins = [{
Expand Down
2 changes: 2 additions & 0 deletions home-manager/zsh.nix
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@
}
precmd_functions+=(set_win_title)
eval "$(${lib.getBin pkgs.dprint}/bin/dprint completions zsh)"
zshaddhistory() { whence ''${''${(z)1}[1]} >| /dev/null || return 1 }
'';

Expand Down

0 comments on commit 3ab29c0

Please sign in to comment.