My Dotfiles, Refreshed

I previously had a pretty extensive set of customizations I had for behavior in my shells. This ended up being not the greatest because I’d come to rely on the tons of shortcuts I had set up. When moving between systems, this ended up being a point of friction.

My config files have evolved to be theme and usability tweaks. For example, cleaning up my shell prompt in my .zshrc. Here, I’ve also added status info to vim & tmux’s status bars, and adding customizing their appearance / themes. The only major thing I have done is enable mouse support within both.

Files

  • .zshrc - shell config
  • .vimrc - vim config (my preferred editor)
  • .tmux.conf - tmux config (my preferred terminal multiplexer)

Clone Repo

This is available to clone: git clone https://rich.sh/repos/dotfiles.git

.zshrc

For my shell, I now only set the prompts and configure vim as my default editor.

Download
# Rich's zsh config
# rich.sh/2024/04/07/dotfiles-refreshed

# left-aligned prompt of form "$USER $FOLDER %"
export PROMPT='%B%F{green}%n%f: %~%f%b %# '

# right-aligned prompt (current time)
export RPROMPT='%t'

# set vim as editor
export EDITOR='vim'

# https://github.com/babun/babun/issues/527#issuecomment-804176221
# Fix ^R inside tmux
bindkey '^R' history-incremental-search-backward

# Fix ^A / ^E cursor movement
bindkey '^A' beginning-of-line
bindkey '^E' end-of-line

.vimrc

In vim, I mainly enable line numbers, syntax highlighting, and mouse support, along some small tweaks. I used some code from https://www.freecodecamp.org/news/vimrc-configuration-guide-customize-your-vim-editor#how-to-configure-the-status-bar-in-vim for the status bar.

Download
" Rich's vim config
" rich.sh/2024/04/07/dotfiles-refreshed
" Disable vi compatibility
set nocompatible

" Enable syntax highlighting
syntax on

" file detection
filetype on

" enable line numbers
set number

" enable mouse support
set mouse=a

" OPTIONAL: color scheme
" https://github.com/cocopon/iceberg.vim
" colorscheme iceberg

" fix backspace behavior
set backspace=indent,eol,start

" highlight cursor line
set cursorline

" convert tabs -> spaces, use 2 spaces.
" CUSTOMIZE THIS TO YOUR PREFERENCE
set expandtab
set tabstop=2
set smarttab

" Auto-indent next line
set autoindent

" show insert mode on last line
set showmode

" Disable bell
set noerrorbells

" Enable 'wildmenu' expansion for file completion
set wildmenu
" OPTIONAL: use longest,full for wildmenu
" set wildmode=list:longest,full

" use bash as our shell
set shell=bash

" Enable spell-checking
set spell

" use system clipboard
set clipboard=unnamed

" STATUS LINE ------------------------------------------------------------ {{{
" https://www.freecodecamp.org/news/vimrc-configuration-guide-customize-your-vim-editor#how-to-configure-the-status-bar-in-vim

" Clear status line when vimrc is reloaded.
set statusline=

" Status line left side.
set statusline+=\ %F\ %M\ %Y\ %R

" Use a divider to separate the left side from the right side.
set statusline+=%=

" Status line right side.
set statusline+=\ ascii:\ %b\ hex:\ 0x%B\ row:\ %l\ col:\ %c\ percent:\ %p%%

" Show the status on the second to last line.
set laststatus=2

" }}}

.tmux.conf

For tmux, I mainly enable mouse support, and configure the status bar / colors to match my dark green theme.

Download
# Rich's tmux configuration
# rich.sh/2024/04/07/dotfiles-refreshed

# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on

set -g default-terminal "screen-256color"
set -g mouse on

set-option -g display-time 1000

# increased history size
set-option -g history-limit 10000

# Color Scheme
# default statusbar colors
set-option -g status-bg colour236 # gray
set-option -g status-fg colour255 # white

# active window title colors
set -g status-left '[#S] '
set -g status-right '"#H" %Y-%m-%d %H:%M:%S'
set -g status-right-length 50  # increase length so we can see the full hostname and clock
set -g status-interval 1  # refresh status every second

# window tabs
set -g window-status-format " #I:#W "
set -g window-status-current-format " #I:#W * "
set-window-option -g window-status-current-style bg=colour47,fg=black

# pane number display
set-option -g display-panes-active-colour colour47 # green
set-option -g display-panes-colour colour236 # gray

# clock
set-window-option -g clock-mode-colour colour47 # green
git icon
Git Repo
The code for this project is mirrored on this website:
git clone https://rich.sh/repos/dotfiles.git

Change Log

  • 4/7/2024 - Initial Revision

Found a typo or technical problem? file an issue!