Commit graph

23 commits

Author SHA1 Message Date
201c482f2b
zsh: Revert vi-mode plugin
This commit removes the vi-mode plugin for zsh again. I have found that
the normal included vi mode of zsh is more than enough for most of my
needs.

The only two issues I have with it are that it sometimes does not
correctly go back into insert mode and it does not support word surround
commands (ysaw" for example).

While vi-mode adds the ability for such surround commands it comes at
the cost of taking longer to go into vi mode. And with my constant
switching back and for between the modes this is a much more egregious
issue than the others unfortunately.
2022-12-20 23:13:41 +01:00
f325456e60
zsh: Check for additional plugins
Checking for a couple additional plugins and automatically sourcing them
- mostly alternate versions of previous plugins.
2022-12-08 13:31:07 +01:00
7a18bc4a21
zsh: Make c-e always switch to editor
Added always listening to c-e to switch to edit current line in editor,
regardless of already being in vi-command mode or not.
2022-10-08 17:55:27 +02:00
13ec6ed600
zsh: Fix fzf-tab to make use of refactored options
Use new option structure for fzf-tab, see fzf-tab wiki for more
information.
2022-07-08 23:54:39 +02:00
aad5d67aab
zsh: Make c-e always send zle to editor
Whereas previously, zsh needed to be in vi mode to enter the editor with
current zle now we can *always* enter the mode with c-e. Since the
combination is not used for going to the end of the line or anything
anymore anyway, we can make it a bit easier to get into vim from the
zle.
2022-07-08 23:53:06 +02:00
7356d8c58f
zsh: Use fzf for c-r, c-t and a-c binds
Make fzf the default for searching history with c-r in zsh. The
incremental history searfch has been moved to c-o instead.

Also can insert a directory path at cursor position with binding c-t
using fzf, and cd into a directory using alt-c. Will use these less
often but they're part of the package and should not be in the way as
well.
2022-07-08 23:52:51 +02:00
08a46ed691
zsh: Remove powerline10k settings file
Removed leftover configuration file for the p10k zsh prompt, since I
switched away from it long ago.
2022-01-16 15:20:16 +01:00
6a86deef87
zsh: Fix shell history settings
For the longest time, shell history ignore was set to the bash version
of the setting. Zsh uses both a different variable and a different
format to ignore various commands in the history.

Additionally increased the history size one order of magnitude,
so we really don't lose anything. Should still be fine for personal
computing work anyway.
2021-11-16 12:18:39 +01:00
658e07e1b8
zsh: Add stash display to pure prompt
Added stash being shown in git repositories (if there is a stash),
moved some initialization slightly.
2021-08-25 20:47:07 +02:00
ebdfb17bb1
sh: Added date stamps to history command
Prepending history with datestamps (which are already correctly saved in
my shell history), so I know WHEN I last run a command (roughly) and can
also search for the dates using `fzfhistory`.
2021-03-27 22:19:43 +01:00
da52dad3d7
zsh: Switch from powerlevel10k to pure prompt
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.
2021-02-19 12:45:36 +01:00
201cd58f3f
zsh: Enable incremental backward search cycling
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.
2020-11-06 15:14:25 +01:00
42907f3733
zsh: Enable auto input of cd before directories
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.
2020-11-02 19:10:25 +01:00
285e74f1a7
zsh: Change key to edit in vim to ctrl-e
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.
2020-10-22 09:40:35 +02:00
454073b408
zsh: Add bash-like alt-dot hotkey
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!
2020-10-21 17:15:48 +02:00
5dde9db2e4
zsh: Update fzf-tab
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).
2020-10-08 10:28:56 +02:00
fc121e7fd0
[zsh] Expand fzf-tab functionality
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).
2020-06-20 00:17:45 +02:00
3e2d17aa5f
[zsh] Enable command line editing in vim
Needs vim-mode enabled for zsh (which it is in this zshrc). When in
normal mode press <space> to move the current command into vim and edit
it.
2020-05-05 22:27:17 +02:00
3dac8e5034
Source fzf-tab plugin, installed from custom repo 2020-02-16 14:23:05 +01:00
a29ce0aabf
Improve zsh vi-mode handling
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.
2020-02-10 21:07:00 +01:00
40b6d2220c
Remove zsh plugin manager
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.
2020-02-08 16:28:36 +01:00
fbc1c44652 Add zsh completion path, completions plugin
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).
2020-02-02 23:32:37 +01:00
6380affb6f Add basic XDG compliant sh architecture
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.
2020-02-02 15:08:40 +00:00