Skip to content

Commit

Permalink
add homemanger configuration in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
hitsmaxft authored and ianthehenry committed Jun 10, 2023
1 parent 1307b4f commit 89f8ece
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,12 +265,53 @@ plugins+=(sd)
source "$ZSH/oh-my-zsh.sh"
```

## Installation as home-manager module with nix package manager

add config in your `$HOME/.config/home-manager/home.nix`

```nix
{...}: {
# start script directory
home.programs.script-directory = {
script-directory = {
enable = true;
settings = {
SD_ROOT = "${config.home.homeDirectory}/scripts";
SD_EDITOR = "vim";
};
};
};
home.programs.zsh = {
# script directory module don't config zsh completion automatically
# manually append fpath into zsh.initExtra
initExtra = ''
fpath+="${pkgs.script-directory}/share/zsh/site-functions"
'';
};
# end script directory
}
```

read more from [home-manager module source code](https://github.com/nix-community/home-manager/blob/master/modules/programs/script-directory.nix)


# bash/fish autocompletion support

Patrick Jackson contributed [an unofficial fish completion script](https://gist.github.com/patricksjackson/5065e4a9d8e825dafc7824112f17a5e6), which should be usable with some modification (as written it does not respect `SD_ROOT`, but it should act as a very good starting point if you use fish).

Bash doesn't support the fancy completion-with-description feature that is sort of the whole point of `sd`, but there are apparently ways to hack something similar.


# Changelog

## v1.1.0 2022-10-30
Expand Down

0 comments on commit 89f8ece

Please sign in to comment.