Held back a little by the issue that you can't really set aliases
conditionally (yet?) in nushell, which is kind of fundamental to my
zsh/sh alias setup. If a program exists, we add some nice aliases -- if
not, we simply degrade gracefully and don't add anything.
PR to track issue:
https://github.com/nushell/nushell/issues/5068
`<leader><c-s-Q>` activates the pane selector and lets you decide which
pane to detach from the current _window_ and move to a new one.
This mirrors the `<leader><c-q>` mapping moving a pane to a new tab,
only 'bigger', thus using shift in addition.
The binding is a little awkward, but with how rarely I have needed to
use it this was fine for me so far.
The suggested history completion on the reedline (i.e. fish-like
autosuggestion) can be fully completed with the `l` key in vi cmd mode.
This change adds the ability to complete the suggestion partially by
completing the current word using `e`. If no history suggestion exists
it moves to the end of the current word as usual.
This mimics the partial completion I have set up in zsh with the help of
the `zsh-autosuggestions` plugin.
Using <c-z> when a process is running backgrounds it (default behavior)
using the new nushell job control system (since v0.103).
This change also lets you re-foreground the backgrounded program with
the same <c-z> key mapping.
Additionally we add the `fg` alias which does the same and thus mimics
the fg command of other shells like zsh.
Enabled transient prompt for nushell so we only display the line
character and attempt to display command durations for past prompts.
Not sure if command duration is working correctly. If not, might have to
revert this change.
Removed the buffer editor hardcoding to 'nvim', should use the EDITOR
env var instead.
Added the (currently undocumented?) config option to enable fuzzy
completion matching - essentially enables exactly the behavior the
'fzf-tab-complete' plugin does for zsh, only natively in the nushell
program.
See: https://github.com/nushell/nushell/issues/1275#issuecomment-2964573062
Explicitly enable terraform and typst version displays (if in directory
with terraform state files or .typ files for typst), and change the
symbol for the typst module to a feather (which is much nicer than the
plain 't' it would display otherwise).
Added little single-character displays at the front of the prompt if we
are in a shell different from zsh to remind myself (since they all look
exactly the same with starship).
Toggle sudo prefix for command line with <alt-s>. Not sure if I will
keep this binding in the long run but it is a good example of command
execution using nushell through a key binding.
From: https://github.com/nushell/nushell/discussions/16043
With the power of dotter for dotfile management we can move the files we
want to link anywhere in our repository.
So finally we're making use of it to keep the bash config files in the
`terminal/.config/bash` directory, as well as removing the leading dot
from both the zsh configuration files.
The following is added to all three shells bash, zsh, nushell:
Pressing c-t at any time lets you insert a file/dir at the current
cursor location using fzf. Same for 'T' in vicmd mode.
Pressing alt-c at any time lets you jump to that directory using zoxide,
with the zle editor content intact. Same for 'C' in vicmd mode.
Zsh implementation from: https://github.com/ajeetdsouza/zoxide/issues/357
Bash implementation: https://github.com/ajeetdsouza/zoxide/issues/516
Nushell implementation taken from: https://github.com/junegunn/fzf/issues/4122
TODO: Nushell fzf mapping has one problem in that it does not quote the
selected file in any way. So any file with e.g. a space in it will have
to be manually fixed afterwards.
Rename tabs with `<leader><S-R>`. This will provide a (full-screen)
prompt in which you can exit with esc (not changing anything), provide a
static name for the tab, or hit enter with nothing on the prompt to
return to the default naming behavior.
Unmap the custom set Debug overlay mapping since I haven't had to use it
in absolute ages. Additionally we also unmap the default mapping for the
debug overlay - which frees up the key combination to be passed through
to TUIs.
As mentioned in
https://github.com/carapace-sh/carapace-bin/issues/2819#issuecomment-3092307945,
fzf-tab directory completes are empty if you try to complete on a
directory without any prior input.
I.e.:
`ls -hal ~/.config/a<tab>` shows output (dirs starting with a).
`ls -hal ~/.config/<tab>` is empty.
This fixes the issue by making the query string use the full inserted
value.
We are using chafa to preview the image and video files but would always
default to the iterm implementation. This has been removed: The foot
terminal does not support iTerm and hard-coding makes us too tightly
coupled to wezterm. But even wezterm functions well with chafa without
the forced iterm usage - we simply use sixels instead.
Remove video preview frame hard-coded file caching and instead pipe
directly into chafa preview.
We add an additional 'core' user service (i.e. one that gets loaded
before all others by turnstile) which populates the TURNSTILE_ENV_DIR
with all manner of custom set env vars that are important for other
applications.
Most importantly, this sets up the XDG directory compliance for
applications either managed by turnstile or applications started through
turnstile on my system. So, for example `pass` knows to search for its
database in `XDG_DATA_HOME` and river knows to search for binaries in a
PATH which has been prefixed with my custom user binary location.
Remove most of the old cruft that was left over from nushell version
0.87 - we are now on version 0.102!
Many of the old options are actually not helpful anymore so let's just
get rid of them entirely (never configured the shell for me too much).
Also there was a lot of 'default' commented code which made it harder to
keep an overview rather than help.
For now just set up a minimal shell experience with vi editing mode, and
the trifecta of startship prompt, zoxide movement and atuin history
enabled.
While there are errors that pop up when inserting text (_each time_), it
is still much preferable to the unbearable slowdowns that happen after a
while when running it in XWayland mode.
We load the 'run-help' function to quickly show us documentation for the
command under cursor when we enter vi mode and then hit 'K'.
This mimics the actual vim setup where K will generally show
documentation/hover info/help as well.
The command invocation requires an 'even amount of arguments' which I
don't fully understand but have no time to read into and fix currently,
so it just gets another superfluous 'run-help' tacked on at the end.
Since wezterm on wayland is an older release (does not track nightlies,
so currently last release is 2024023, a year old) it does not work as
well with wayland as I would hope.
There are two major issues:
- Cursor errors whenever a mouse pointer is above the window (can be
partly fixed with the xcursor_theme option, though still erroring when
hovering over links).
- Constant errors that inactive text input is sending updates in river
logs.
Until those are fixed, or I jump to a nightly version, we keep it
xwayland.
By default we use the 'zr' plugin manager for zsh. It is quick and
painless and takes managing the plugins across two environments not our
problem anymore.
Prefer regular 'Iosevka' font in most cases, not the highly specific
'Iosevka Nerd Font'. This may break some things back in Archlinux-land
but it is required for iosevka to be correctly displayed in Voidlinux,
and, to be honest, also feels more clean than using such a highly
specialized font for everything.
Additionally, we generally make use of both where possible, defaulting
to the more specific 'Nerd Font' family variant but falling back to
regular old Iosevka.
One exception is 'wezterm' which, though it nicely includes a font
fallback option (and a very configurable one at that), _always_ produces
a warning when the first font in a fallback list is not found -- even
when the specific 'warn_about_missing_glyphs' option is ticked. No clue
why but for now this works well enough for me.
For some reason (glow 2.0.0 release?) markdown preview with glow does
_not_ work anymore within my vifm. It regresses to showing errors all
over the place instead.
Only create shortcuts for external commands if those have associated
executables on the system. If we don't have an `atool` installed, it
does not make sense to have shortcuts for invoking it - likewise for
vidir, find, and so on.
edir is a slightly improved version of the morutils tool 'vidir'. We
switch to it to change directories, files and only sub-directories
(Invoked with ,rr / ,rf / ,rd respectively).
While I never disliked tmux I have not been using it for absolute ages
now, ever since starting to multiplex with wezterm. Wezterm can (at
least with my current setup) *not* replace all tmux functionality -
especially running multiple sessions in a detachable way on a remote
server - but I have never needed those in a long time now.
Detachable sessions I can create instead with `abduco`.
If zoxide is found on the system, vifm will automatically add any paths
traversed into the zoxide database.
It will also have a new internal command 'zoxide' with which you can
open a menu to search all zoxide-known paths - it is also added as a
mapping to <space>z.
This is something I used to use quite a bit in tmux. I have a feeling I
will not be making extensive use of it in wezterm, but can always remove
it if I reach the point of forgetting the mapping later.
Added mapping `<leader><c-q>` to select a pane which will be moved out
to a new tab.
Slightly changed pane switching on `<leader><s-q>` to keep focus on the
pane instead of switching to the other pane.
Finally, added two simple relative tab movement maps to cycle forward
with `<leader>.` and reverse with `<leader>,`. This replaces the old tab
movement (moving the actual tab around) left and right which are now on
`<leader><s-,>` and `<ledaer><s-.>` respectively.