Switched theme of zsh, just to declutter a little and make startup
slightly faster.
Removed nvm from automatically initializing to majorly speed up zsh
startup times - removing around 750ms on my system.
TODO could potentially move to a conditional startup system, in which
nvm only gets sourced on its first invocation or similar workarounds.
Previously enabled the search through shell history with ^r on the
commandline. This is still the case, though now the results of the
search can be cycled through with ^p (earlier) and ^n (later).
The key combinations are only active in incremental search and will only
search through the previous results.
When in normal more, or command mode, ^p/^n will cycle through the
history of the shell, taking into account what has already been typed
and going through the history on the basis of this.
Enabled zsh option to automatically prepend directories with `cd` if
they are the only command on the line, essentially enabling you to just
write `/var/lib/docker` to go to the respective directory.
Previously the key was space (when in vi command mode), but that can too
easily be accidentally hit.
Using ctrl-e (when in vi command mode) makes mnemonic sense ('edit'),
and is hard to hit accidentally. It also mirrors the c-x c-e mapping
that bash (and zsh?) use when in emacs mode rather than vim.
Allows pressing <alt-.> when in insertion mode in zsh to add the first
(then second, third, ...) argument from the last line to the end of the
current line.
Especially useful for things like:
```
mkdir -p my/folder/deeply nested
cd <alt-.>
```
to instantly move to the folder!
Make use of colorful action groups and query input option.
By default, will group the different completion actions (if they have
been set up for the respective zsh completion) as different color sets.
When entering an input and nothing fits (or something else than
intended), it is now possible to simply hit alt+enter instead of just
enter to add whatever you typed into the zle instead of whatever fzf
provided you with (or nothing at all, if it didn't).
Will now contain additional functionality for ps, kill, and cd (preview
etc). Will also color things which have LS_COLORS set (done
automatically through lscolors-git file).
Moved mode indicator to more immediately visible prompt location.
Allowed deletions and adding spaces regardless of mode.
Allow moving backwards through history and searching through terminal
input history.
Plugins are managed directly through pacman packages now. Since I am
only using six zsh plugins and they are staying relatively constant and
not changing much, pacman seems a much more sane way to manage them
without cluttering up my zsh initialization routine. All zgen management
can go and just needs 6 `source` lines in order to load the plugin
entrypoints.
Added `$XDG_CONFIG_HOME/zsh/completions` to fpath for zsh to source
completions from. Any stow modules creating scripts and functions which
should be auto-completable can add their own completion scripts to this
directory for zsh to automatically pick them up.
Add zsh-users/zsh-completions plugin to provide completions for a wide
array of applications (e.g. glances, nvm).
The only file left in $HOME is .zshenv, which sets up zsh to source everything from XDG_CONFIG_HOME/zsh.
Shell files are split into sh and zsh directories, for global assignments (which should be posix compliant, work on any posix shell) like environemnt variables, xdg vars, and global aliases. zsh contains zsh specific customization (prompt customization, plugin loading, zsh completions).
Zsh initialization will pull from sh directory first, loading the respective mirror to its startup file (`.zprofile` loads `sh/profile` and `profile.d/*`, `.zshenv` loads `sh/env` and `sh/env.d/*` and `zsh/env.d/*`, `.zshrc` loads `sh/alias`, `sh/alias.d/*` and `zsh/alias.d/*`)
Once all is done, it will have loaded both global variables, aliases and settings, and zsh-only specifications. Other stow modules, if they want to add shell functionality, can include their aliases and functions in one of the above directories to automatically be picked up by zsh.