da6fc68 Fish: Use more portable characters in VCS prompt
~hedy pushed to ~hedy/dotfiles git
These are the setup I have on almost all machines I work in, and because I work on many tildes, I make this set of configuration as cross-platform as possible.
Used on (aka loosely tested on):
WSL 2 would probably be a similar experience to any of those corresponding linux distros.
Note that WSL support of clipboard pastes is deprecated on NVIM as of
2023-06-30. Before which, you need to have a pbcopy
/pbpaste
binary in path
that handles clipboard operations with windows.
Repository: SourceHut
Mirrors: tildegit (gitea) | GitHub
Table of Contents
.config/yadm
).config/fish
).gitconfig
, .gitignore_global
).config/jutjutsu
).tmux.conf
).config/kitty/mocha.conf
]
(.config/kitty/mocha.conf)) and Fish ([.config/fish/themes/mocha.theme
]
(.config/fish/themes/mocha.theme)).config/aerc
).config/kitty
).vimrc
) (not used).config/nvim
).config/emacs
) (with chemacs: .emacs-profiles.el).config/helix
).config/doom
)bin/gotagacme
, bin/gotagclean.py
).elinks/elinks.conf
).qutebrowser/config.py
)tmux source ~/.tmux.conf
dotscripts
using dot <type> <target>
such as dot setup fish
to suppress those not-found errors.Here are detailed information for each component of my dotfiles
My default shell is fish because it comes with auto-suggestions and
highlighting without the need of additional plugins. It does have its own
seemingly friendlier syntax, but many times I find myself dropping into bash
while writing shell scripts, so I realized... the only thing that is keeping me
to fish may as well be the auto-suggestions and syntax highlighting...
imrsh seems quite attractive looking at
its goals, plus the fact that it's POSIX-compatible, so if development there
has any progress I may even consider switching.
Despite fish being my primary shell, I still like to keep all my aliases,
scripts, and environment variables synced with the other shells. This is done
in the .startup.sh
script. It should be sourced for
POSIX-compatible shells. see dotscripts/setup/bash
.
I don't track bashrc
or bash_profile
because I like to keep it to the
system's defaults. Maintaining cross-platform versions of them when I use them
rarely is a pain.
The fish shell configuration lives at .config/fish/
. Of which, config.fish
doesn't really anything specific, it just sources the shared environment
variable file (.exportenvs.fish
) and the shared aliases (.aliases
).
The .exportenvs.fish
file is generated by
dotscripts/gen/fish-exportenvs
.
It takes .exportenvs
and translates it into fish syntax.
Instead of using bass to source .exportenvs
on the fly during fish's startup,
fish can source the generated .exportenvs.fish
directly which improves
performance significantly.
I have a symlink .bash_aliases
pointing to .aliases
because bash likes to
look for that file.
.exportenvs
is basically a bunch of environment variables exports. A whole
ton of installation scripts on the internet likes to add export something=something
to bashrc
, so when that happens I tend to just move it
into my .exportenvs
.
Every time .exportenvs
is updated, run dot setup fish
to regenerate
.exportenvs.fish
and reload the environment.
TLDR:
.startup.sh
for POSIX-compatible shell configuration.aliases
,.exportenvs
, and.addpath
.See below section "Local" for machine-specific configuration (untracked in the repo).
Oh My Fish is like a plugin manager for fish.
I don't have a lot of plugins and nor do I use it for theme and prompt, just these utilities:
z
: quickly access a common dirbass
: source bash scripts and expressions in fish (I use this for giving
fish support to nvm
, see the nvm
function)pj
: quickly access projects (NOTE: as of 2024, I've switched to my own
implementation for pj
because this does not support pj project-name/sub/dir/here
, and I do not use multiple project paths, which it
supports.)The fish theme is entirely dependent on the terminal color settings and the prompt is copied from a particular pre-existing prompt style that shows error status and git status. I've modifid the prompt style and added right prompt to show user@hostname.
Setup: dotscripts/setup/fish
Fish functions (located at .config/fish/functions
) are mostly aliases that
require some checking or additional logic.
cat, rm, ll are aliased to ccat, trash, and exa respectively if those programs are installed.
The nvm function adds fish support to nvm (Node Version Manager).
The .config/fish/config_local.fish
file is for configuration specific for a
computer, this could be setting a special $EDITOR, etc.
Other local files recognized:
.addpath_local
- machine specific software that changes PATH.gitconfig-local
- email/name, sendmail.config/kitty/local.conf
- fontsSetup: dotscripts/gen/localfiles
I don't (yet?) use Nushell as my primary shell because:
However, the language is absolutely amazing, and sometimes I might drop into this shell to do some complex pipelining or advanced scripting (without wanting to install external packages). Hence, my Nushell environment is setup up to be satisfactorily usable, ie, same aliases, similar readline keybindings, environment variables and PATH. The latter too is inherited from the parent process, ie, fish.
Config: .config/nushell
Scripts: dotscripts/*/nu
README: .config/nvim/README.norg
Minimum supported version: NVIM 0.5.0
Recommended version: NVIM 0.9.0+
The bin/nv script is an alias to neovim, and runs vim if neovim is not installed.
The vim config is usable, but largely unmaintained. It can be used on systems without neovim or with an unsupported version of neovim.
I use vim-plug as my plugin manager for nvim because it is shorter to type. And it installs plugins asynchronously.
My nvim config directory (.config/nvim
) has separate files for different types
of configuration. general.vim
has mostly the same content as .vimrc
.
The isWSL function checks whether the system is WSL in my (n)vim configs. This is to set up the clipboard correctly and rebind some keys to make alt work correctly in vim.
Lua and LSP for Neovim
If the neovim version on the system >=0.5, LSP will be set up with lua configuration, otherwise (and if node is installed), CoC will be used. I don't use any system with neovim <0.5, so the CoC set up is unmaintained. I might remove it in the future.
LSP servers - See comments in .config/nvim/lua/lsp.lua
.
I'll probably also optimize my vim config so that it can be fast and clean - available for quick editing. No auto-complete, no fancy themes, just some must-have utilities.
Ever since then, my startup time has improved significantly and this switch came with many other advantages including opening up a world of many modern, speedy plugins with very useful (not exactly due to being trendy) functionalities.
I like to choose plugins that are fast, customizable, and generally does not have feature creep.
LSP and completion
I use the official lsp-config plus nvim-cmp.
Linting
Linting is triggered on save. I use nvim-lint.
Treesitter
Treesitter plugin is enabled conditionally if neovim version >= 0.9.
Note that a proper C/C++ compiler toolchain is required for building the parsers.
Telescope
Telescope plugin is enabled conditionally if neovim version >= 0.9.
Setup:
dotscripts/setup/nvim
(no longer needed as I no longer use vim-plug)dotscripts/install/misc
- Includes Vundle setup together with other
software.Additional information: .config/nvim/README.norg
including brief notes about neovim vs emacs.
(I might never complete these since I recently switched to emacs)
I use chemacs2 for switching emacs profiles (for emacs < v29) and it allows me
to use both vanilla emacs and doom emacs at the same time. See
.emacs-profiles.el
.
Setup: dotscripts/setup/emacs
. This script is pretty heavily tested and
it should set up everything you need to start using both emacs and doom
normally. It installs chemacs and doom if not already installed.
My main emacs is vanilla emacs, the configuration lives at ~/.config/emacs
. My
primary emacs version is Emacs 29, because I need better SVG support. I use
Emacs 28 sometimes for testing.
Configuration for both Vanilla and Doom emacs are Literate (org files that get exported "tangled" to indicated Elisp destinations).
Doom itself requires at least emacs 27+ and git 2.23+ among other things. More info on the github repo.
2023: I started to use Doom a lot more, before switching to primarily vanilla emacs in 2023-09. The configuration there is somewhat up to date, but not guaranteed as I don't really use doom anymore.
The emacs directory would be at .doomemacs
(because .emacs.d
is for
chemacs). Relevant environment variables are set in .exportenvs
, also see
.emacs-profiles.el
.
The shell theme depends on the terminal theme. I use Kitty Terminal, where its
config at .config/kitty
. It uses customized Catppuccin Mocha theme. Font
configuration varies depending on the system hence it should be in a separate
file font.conf
. A local.conf
file is recognized. Both of which are not
tracked in this repo as they are platform-dependent.
My primary client is Gelim on the terminal and Lagrange otherwise.
Gelim config is at .config/gelim
. gelim is my own gemini and spartan client
for the terminal that isn't a full-blown TUI and tries to stay simple whilst
offering many features and extensibility. It's still WIP so there won't be much
configuration in there yet.
.addpath
file