Commit graph

76 commits

Author SHA1 Message Date
Kiran Ostrolenk 9a2ce65697
zsh: generalize zsh-history-substring-search
Specifically, allow variable expansion for the key codes by switching
from single to double quotes.

This also adds a helpful suggestion to descriptions. Taken from the
project's README, see

  4abed97b6e/README.md?plain=1#L71-L74)
2023-10-15 00:09:13 +02:00
Lena Fuhrimann 15043a6591
zsh: Add zsh.history.ignoreAllDups config option (#4248) 2023-08-04 12:12:57 +02:00
Emily 9f9e277b60 treewide: remove now-redundant lib.mdDoc calls
These (and the `*MD` functions apart from `literalMD`) are now no-ops
in nixpkgs and serve no purpose other than to add additional noise and
potentially mislead people into thinking unmarked DocBook documentation
will still be accepted.

Note that if backporting changes including documentation to 23.05,
the `mdDoc` calls will need to be re-added.

To reproduce this commit, run:

    $ NIX_PATH=nixpkgs=flake:nixpkgs/e7e69199f0372364a6106a1e735f68604f4c5a25 \
      nix shell nixpkgs#coreutils \
      -c find . -name '*.nix' \
      -exec nix run -- github:emilazy/nix-doc-munge/98dadf1f77351c2ba5dcb709a2a171d655f15099 \
      --strip {} +
    $ ./format
2023-07-17 18:49:09 +01:00
Emily 36a53d9f26 treewide: convert all option docs to Markdown
This process was automated by [my fork of `nix-doc-munge`]. All
conversions were automatically checked to produce the same DocBook
result when converted back, modulo minor typographical/formatting
differences on the acceptable-to-desirable spectrum.

To reproduce this commit, run:

  $ NIX_PATH=nixpkgs=flake:nixpkgs/e7e69199f0372364a6106a1e735f68604f4c5a25 \
    nix shell nixpkgs#coreutils \
    -c find . -name '*.nix' \
    -exec nix run -- github:emilazy/nix-doc-munge/98dadf1f77351c2ba5dcb709a2a171d655f15099 \
    {} +
  $ ./format

[my fork of `nix-doc-munge`]: https://github.com/emilazy/nix-doc-munge/tree/home-manager
2023-07-17 18:40:56 +01:00
Emily e04de5b308 treewide: mkPackageOption -> mkPackageOptionMD 2023-07-17 16:49:35 +01:00
Emily 3228f92b90 treewide: manually convert some docs to Markdown
These files all have options that trip up the `nix-doc-munge`
conversion tool for one reason or another (syntax that clashes with
Markdown, options that were already using Markdown syntax despite not
being marked that way, output that differs slightly after conversion,
syntax too elaborate to convert with some cheap regular expressions,
...). Translate them manually and do a little copyediting to options
in the vicinity while we're at it.
2023-07-17 16:49:35 +01:00
Aaron Pietscher 5598567489
zsh: fix custom syntax highlighting styles (#4236)
Previously, lines in .zshrc were added with quotes in keys
(e.g. ZSH_HIGHLIGHT_STYLES['comment']='fg=#6c6c6c'). However, zsh
considered these quotes to be part of the key, so the "comment" key
remained unchanged.
2023-07-15 11:49:12 +02:00
ThinkChaos f5f64ac022
zsh: allow setting custom syntax highlighting styles (#4122)
* zsh: allow setting custom syntax highlighting styles

Custom styles allow overriding the default colors.
Example:
```nix
zsh.syntaxHighlighting.styles.comment = "fg=#6c6c6c";
```

See https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/docs/highlighters.md

* zsh: allow configuring syntax-highlighting package
2023-06-28 11:12:58 +02:00
Christoph Heiss 010c269877
zsh: add package option (#3945)
Signed-off-by: Christoph Heiss <christoph@c8h4.io>
2023-05-10 17:54:34 -06:00
Bernardo Meurer 3144311f31
zsh: allow multiple bindings to history-substring-search (#3929)
It's pretty common to need multiple bindings to
history-substring-search, since different terminals will send different
keys for up/down.

This does not break back-compatibility, and introduces a new test
2023-04-29 16:53:09 +02:00
winston 6169690ae3
zsh: add package option to oh-my-zsh
Allow setting a custom package for `programs.zsh.oh-my-zsh`.
2023-04-22 17:13:06 +02:00
Matthieu Coudron 948d1f8a5c
programs.zsh: generate a more compact config (#3170) 2022-11-18 09:27:43 -07:00
Kiran 60c6bfe322
zsh: add option for zsh-history-substring-search (#3156) 2022-09-13 16:06:52 -04:00
Robert Helgesson 76fbb1b15e
treewide: replace <link> by <xref> where appropriate 2022-08-26 00:07:08 +02:00
Maxime Brunet 8160b3b45b
zsh: source zsh-syntax-highlighting at the end of .zshrc (#3068)
zsh-syntax-highlighting.zsh must be sourced at the end of the .zshrc file, otherwise widgets created after are not properly highlighted (e.g. from oh-my-zsh): https://github.com/zsh-users/zsh-syntax-highlighting#faq
2022-07-07 18:57:27 -06:00
Jian Lin 2116fe6b50
zsh: move sessionVariables from .zshrc to .zshenv (#2708)
This patch moves both home.sessionVariables and
programs.zsh.sessionVariables from .zshrc to .zshenv. Additionally,
these two kinds of session variables will not be sourced more than
once to allow user-customized ones to take effect.

Before, session variables are in .zshrc, which causes non-interactive
shells to not be able to get those variables. For example, running a
command through SSH is in a non-interactive and non-login shell, which
suffers from this. With this patch, all kinds of shells can get
session variables.

The reason why these session variables are not moved to .zprofile is
that programs started by systemd user instances are not able to get
variables defined in that file. For example, GNOME
Terminal (gnome-terminal-server.service) is one of these programs and
doesn't get variables defined in .zprofile. As a result, the shells it
starts, which are interactive and non-login, do not get those
variables.

Fixes #2445

Related NixOS/nixpkgs#33219
Related NixOS/nixpkgs#45784

This file is not formatted before and is excluded by ./format, so I don't format it.
2022-02-17 10:20:56 +01:00
Naïm Favier bd11e2c5e6
Replace usage of literalExample
Instead use the new function `literalExpression`. See

  https://github.com/NixOS/nixpkgs/pull/136909
2021-10-13 00:16:10 +02:00
DG a17bc3217f
zsh: add enableSyntaxHighlighting option (#2144)
Add a simple way to enable syntax highlighting for zsh using https://github.com/zsh-users/zsh-syntax-highlighting
2021-06-28 00:04:38 -06:00
bb010g 42847469b3
zsh: add completionInit option (#2046)
Factored out from original .zshrc construction.
2021-06-09 11:15:10 -04:00
Robert Helgesson 90dd375eba
zsh: break configuration dependency in documentation
Before the documentation for the `programs.zsh.history.path` had a
dependency on the configuration.
2021-05-06 00:00:45 +02:00
oxalica 5709b5f953
zsh: add history.ignorePatterns option (#1933)
The corresponding variable is `HISTORY_IGNORE` described in zshparam(1).
2021-05-01 16:33:45 -04:00
Pablo Ovelleiro Corral b220d5c446
prezto: fix #1773 (#1778)
* zsh: update prezto path structure

The path structure was changed in Nixpkgs and this commit updates
the module to match.

Fixes #1773

* zsh-prezto: fix tests, small tidyup

Co-authored-by: Nick Hu <me@nickhu.co.uk>
2021-02-09 02:11:56 +00:00
Tyler Benster c6263347de
zsh: add initExtraFirst option 2020-11-29 19:39:47 +01:00
Ashish SHUKLA 9e01441c5c
zsh: Add dirHashes option 2020-11-15 23:49:55 +01:00
zimbatm 014d8deb60
tree-wide: update url to the repo 2020-10-22 22:41:56 +02:00
Nick Hu 18a05a9604
zsh: add support for prezto configuration framework (#655) 2020-10-12 01:27:44 +01:00
James Ottaway 9a473b693a
zsh: add cdpath option (#1418) 2020-08-14 22:36:23 +02:00
Robert Helgesson 8ad5580021
zsh: fix trailing white space 2020-07-21 01:10:54 +02:00
dawidsowa e2e8b7371d
zsh: add shellGlobalAliases (#1381) 2020-07-20 19:54:30 +02:00
Carlos Tomé 7fa890462d
zsh: support extra settings in oh-my-zsh plugins (#1106)
Co-Authored-By: Robert Helgesson <robert@rycee.net>
2020-03-25 15:40:42 +01:00
Robert Helgesson 2f726bbd1c
bash, fish, zsh: fix shellAliases example
Unfortunately the document generator is not smart enough to quote the
`..` alias in the documentation which is very misleading. By making it
a literal example the quotes stay.
2020-02-26 22:44:54 +01:00
Owen Shepherd a591e8f9e4
zsh: add 'ignoreSpace' option
This option sets HIST_IGNORE_SPACE, which determines whether commands starting with a
space are put in the history or not.
2020-01-26 21:36:03 +01:00
Robert Helgesson cff9ee7cce
zsh: use attribute set to define files
To avoid warning message concerning deprecation of the `loaOf` type.
2020-01-13 21:45:18 +01:00
Nikita Uvarov 4505710565
zsh: fix history.path issues
- Default value is set to static '$HOME/.zsh_history' -- dotDir is not
prepended anymore
- $HOME is not prepended to the option value
- Ensure history path directory exists

Fixes #886, replaces #427.
2019-11-05 23:04:06 +01:00
Tobias Happ 5203340b64 zsh: add envExtra option 2019-08-16 17:00:08 +09:00
Tobias Happ ed0e40dee8 zsh: add initExtraBeforeCompInit config option
The new initExtraBeforeCompInit option enables the user to inject
commands in zshrc before compinit is executed.
2019-08-16 16:57:52 +09:00
Nikita Uvarov 7310cfc557
zsh: fix completion when oh-my-zsh is enabled
enableCompletion option not only calls compinit but also adds
nix-zsh-completions package to home.packages which should still happen
even if oh-my-zsh is enabled.

The double compinit call will still be eliminated by moving guarding condition
down to the compinit call itself.

Fixes #771.
2019-08-09 15:02:31 +02:00
Nikita Uvarov 42ad0effdd
zsh: create oh-my-zsh cache directory
Fixes #761.
2019-08-09 14:53:03 +02:00
kalium 02a07f19a1
zsh: add autocd option 2019-05-17 09:39:26 +02:00
Robert Helgesson b6e613c771
Fix type of various sessionVariables options
Unfortunately, using `attrsOf` is not possible since it results in too
eager evaluation. In particular, the

    home.sessionVariables = {
      FOO = "Hello";
      BAR = "${config.home.sessionVariables.FOO} World!";
    };

example will cause an infinite recursion.

This commit restores the option type of

- `home.sessionVariables`,
- `pam.sessionVariables`,
- `programs.bash.sessionVariables`, and
- `programs.zsh.sessionVariables`

to `attrs`. It also adds test cases for the above options to avoid
regressions.

Fixes #659
2019-04-27 01:07:09 +02:00
Robert Helgesson fd50f5465f
zsh: use attrsOf instead of attrs 2019-04-03 00:09:55 +02:00
Robert Helgesson a09196c4ae
docs: add language attribute to program listings 2019-03-06 18:52:54 +01:00
Maximilian Bosch 465d08d99f
programs/zsh: properly escape shell aliases
Otherwise all aliases break that use single quotes inside.

Already fixed in the nixpkgs module in 1e211a70cbdaf230a18ea4cb67a959039d5c2ddb.
2019-02-28 14:10:14 +01:00
Marcial Gaißert 9052131aef
programs.zsh: option localVariables
Add option "extraLocalVars" for additional local variable definitions
in .zshrc, at the top of the file.

Some zsh plugins/themes expect configuration in local variables before they
are loaded (example: https://github.com/bhilburn/powerlevel9k). Exporting
those clutters the environment and is unnecessary.
2019-01-11 10:26:13 +01:00
Marcial Gaißert 6b5e0efd1e
programs.zsh: generate export statements in zsh syntax
Use the new module lib.zsh to generate export statements in zsh syntax, using
zsh arrays for lists.

Being a zsh script, this seems more intuitive for .zshrc
2019-01-11 10:26:12 +01:00
Olli Helenius 16946a6f00
Address review comments 2019-01-03 10:51:37 +01:00
Olli Helenius a4383075af
zsh: add default keymap configuration 2019-01-03 10:51:37 +01:00
Malte Brandy c18b1328a5
Parametrize path to profile directory 2018-07-31 16:04:19 +02:00
Robert Helgesson f3473b9eba
zsh: add missing periods in descriptions 2018-06-09 10:29:02 +02:00
Mats Rauhala 06a984e4ff
zsh: add extended, expireDuplicatesFirst history options 2018-06-09 10:26:41 +02:00