This repository contains my dotfiles for my very custom set up of nvim. I do about all my work in nvim, and use it not only as a text editor but also as a terminal multiplexer. I also have configuration for bash and zsh which I use interchangeably, and alacritty which I commonly use on Windows and Mac, but not often on Linux (using gnome-terminal instead).
In addition I have a custom prompt written in python, a vim cheatsheet for common commands I use, and some snippets.
Clone this repository (I recommend to ~/dotfiles), and run bash install.sh. This will: 1. Create an empty directory ~/dotfiles/old_dotfiles
2. Check that the command nvr exists, otherwise install it with python3 -m pip
3. Symlink the following files, copying the existing ones to ~/dotfiles/old_dotfiles
a. ~/.bashrc -> shell_config.sh
b. ~/.bash_profile -> shell_config.sh
c. ~/.zshrc -> shell_config.sh
d. ~/.vimrc -> vimrc
e. ~/.config/alacritty/alacritty.yml -> config/alacritty/alacritty.yml
4. Download/install vim-plug
5. Create a file ~/dotfiles/machine.sh if it doesn't exist
6. Source ~/shell_config.sh
I recommend post installation that you open vim and run :PlugInstall to install all plugins.
You may notice that ~/.zshrc and ~/.bashrc are both symlinked to shell_config.sh. This script has some conditionals to tell if it is being sources by zsh or bash for settings that differ between them, and outside of this all syntax is valid for both shells. The first thing this file does is source ~/dotfiles/machine.sh, so if you have any machine specific settings (such as changes to $PATH, aliases, environment variables, etc), feel free to put them there. This script does a couple things:
- sources
~/dotfiles/machine.sh - adds
~/.cargo/binand~/.local/binto $PATH. This is subject to change. - Returns at this point if not in an interactive session
- Sets the prompt to the output of
~/dotfiles/prompt.pyif that file exists - Aliases
vito the first matching condition: a.nvrif running a terminal embedded in anviminstance b.nvimif it exists c.vimif it exists d.vi - Then it sets $EDITOR and $VISUAL to
viand sets $GIT_EDITOR toviunless running in an nvim embedded terminal, in which case it is anvrcommand - aliases
cdso thatlsis run when switching directories. When running in an embeddednvimterminal,cdwill also set thenvimworking directory to whatever directory you just changed to withcd - sets
fzfenvironment variables based off what programs are available - sets sane defaults for completion and case sensitivity, sets a large history
- sources
fzffiles if available
- make aliases executables (i.e. bash scripts in PATH) so that processes that don't source bashrc or zshrc can leverage them. Primary candidates are vi and docker for now