Personal Dotfiles

This is a collection of my dotfiles currently in use. I'll update them if anything changes. This post can be accessed through visiting the code section which is linked in the page header.

As my color scheme, I'm using frappe from catppuccin.

The following applications are currently in use:

vim

"# minimal subset
"## view
syntax enable
set number

"## editor
set autoindent
set smartindent
set tabstop=2
set softtabstop=2
set shiftwidth=2
set expandtab

set ignorecase
set smartcase
set hlsearch
set incsearch
set showmatch

"## input
nnoremap <SPACE> :noh<CR>
"# full
"# editor
set autoindent
set smartindent
set tabstop=2
set softtabstop=2
set shiftwidth=2
set expandtab
set textwidth=79
set wrapmargin=0
set formatoptions+=t
set linebreak

set ignorecase
set smartcase
set hlsearch
set incsearch
set showmatch
set matchpairs+=<:>

set encoding=utf-8
set fileencoding=utf-8
scriptencoding utf-8
set fileformats=unix,dos
language en_US.utf-8

set noshowmode
set noswapfile
set nojoinspaces
set confirm
set novisualbell noerrorbells
set history=500
set autowrite

"## setup undofile
if !isdirectory($HOME . '/.local/vim/undo')
    call mkdir($HOME . '/.local/vim/undo', 'p', 0700)
endif
set undodir=~/.local/vim/undo
set undofile

"# view
"## adjust cursor
let &t_SI = "\<esc>[6 q"
let &t_EI = "\<esc>[2 q"
if exists('&t_SR')
  let &t_SR = "\<esc>[4 q"
endif
set t_Co=256
syntax enable
set synmaxcol=1000
filetype plugin on
colorscheme frappe

set laststatus=2
set number
set relativenumber
set cursorline
set colorcolumn=80
set nocursorcolumn
set scrolloff=3

set splitbelow splitright
set wildmode=list:full
set wildmenu

set virtualedit=block

"# input
set timeoutlen=500
set tildeop
set mouse=
set pastetoggle=<F12>

nnoremap <Tab> %
nnoremap <SPACE> :noh<CR>

nnoremap <silent> <M-h> <C-w><
nnoremap <silent> <M-l> <C-w>>
nnoremap <silent> <M-j> <C-W>-
nnoremap <silent> <M-k> <C-W>+
nnoremap <silent> <M-left> <C-w>h
nnoremap <silent> <M-right> <C-w>l
nnoremap <silent> <M-down> <C-w>j
nnoremap <silent> <M-up> <C-w>k

"## statusline
let g:currentmode={
  \ 'n'     : 'NORMAL ',
  \ 'v'     : 'VISUAL ',
  \ 'V'     : 'V-Line ',
  \ "\<C-V>": 'V-Block ',
  \ 'i'     : 'INSERT ',
  \ 'R'     : 'R ',
  \ 'Rv'    : 'V-Replace ',
  \ 'c'     : 'Command ',
  \ 't'     : 'TERMINAL'
  \}

set statusline=
set statusline+=%1*
"### current mode
set statusline+=\ %{toupper(g:currentmode[mode()])}
set statusline+=%#WarningMsg#
set statusline+=%{&paste?'[PASTE]':''}
set statusline+=%2*
"### file path, typed or relative
set statusline+=\ %F
set statusline+=%{&modified?'\ [+]':''}
set statusline+=%{&readonly?'\ []':''}
"### truncate & seperate (l/r)
set statusline+=%<
set statusline+=%=
"### encoding & fileformat
set statusline+=%{&filetype!=#''?&filetype.'\ ':'none\ '}
set statusline+=%#WarningMsg#
set statusline+=%{&fileencoding!='utf-8'?'['.&fileencoding.']':''}
set statusline+=%2*
set statusline+=%-7([%{&fileformat}]%)
"### byte order
set statusline+=%#WarningMsg#
set statusline+=%{&bomb?'[BOM]':''}
set statusline+=%1*
"### cursor position
set statusline+=[%l/%L]
set statusline+=\ col:%2c

nvi

"# display
set autoprint
set number
set report=1
set ruler
set showmatch
set showmode

"# edit
set altwerase
set autoindent
set expandtab
set shiftwidth=2
set tabstop=2
set wraplen=79

"# function
set cedit=:
set extended
set iclower

tmux

set-option -g mouse on

set-option -g focus-events on
set-option -g default-terminal "screen-256color"
set-option -sa terminal-overrides ',screen:RGB'

set-option -g prefix C-a
unbind-key C-b
bind-key C-a send-prefix

bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
bind -n WheelDownPane select-pane -t= \; send-keys -M
bind -n C-WheelUpPane select-pane -t= \; copy-mode -e \; send-keys -M
bind-key S capture-pane -b temp-capture-buffer -S - \; save-buffer -b temp-capture-buffer ~/tmux.log \; delete-buffer -b capture-buffer
bind-key K send-keys -R \; clear-history

setw -g mode-keys vi
set-window-option -g mode-keys vi
set -g status-keys vi
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "wl-copy"
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "wl-copy"

bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D

set-option -g display-time 4000
set -g automatic-rename off
set -g base-index 1
setw -g pane-base-index 1

set-option -g visual-activity off
set-option -g visual-bell off
set-option -g visual-silence off
set-window-option -g monitor-activity off
set-option -g bell-action none

setw -g clock-mode-colour '#ea999c'
setw -g mode-style 'fg=#8caaee bg=#737994 bold'

set -g pane-border-style 'fg=#737994 bg=#232634'
set -g pane-active-border-style 'fg=#b5bfe2 bg=#232634'

set -g status-position bottom
set -g status-justify left
set -g status-style 'fg=#838ba7 bg=#232634'
set -g status-left ''
set -g status-right '#[fg=#c6d0f5,bg=#232634,bold] %d.%m #[fg=#c6d0f5,bg=#303446,bold] %H:%M '
set -g status-right-length 50
set -g status-left-length 20

setw -g window-status-current-style 'fg=#e78284 bg=#414559 bold'
setw -g window-status-current-format ' #I#[fg=#c6d0f5]:#[fg=#c6d0f0]#W#[fg=c6d0f5]#F '

setw -g window-status-style 'fg=#eebebe bg=#232634 none'
setw -g window-status-format ' #I#[fg=#a5adce]:#[fg=#a5adce]#W#[fg=#a5adce]#F '

setw -g window-status-bell-style 'fg=#e5c890 bg=#292c3c bold'

set -g message-style 'fg=#ea999c bg=#414559 bold'
set -s escape-time 0

sway

# swaylock
color=303446
bs-hl-color=f2d5cf
caps-lock-bs-hl-color=f2d5cf
caps-lock-key-hl-color=a6d189
font=Terminus Nerd Font
font-size=24
indicator-idle-visible
indicator-radius=100
indicator-thickness=9
inside-color=303446
inside-clear-color=303446
inside-caps-lock-color=303446
inside-ver-color=303446
inside-wrong-color=303446
key-hl-color=a6d189
layout-bg-color=000000
layout-border-color=000000
layout-text-color=c6d0f5
line-color=000000
line-clear-color=000000
line-caps-lock-color=000000
line-ver-color=000000
line-wrong-color=000000
ring-color=414559
ring-clear-color=f2d5cf
ring-caps-lock-color=ef9f76
ring-ver-color=8caaee
ring-wrong-color=ea999c
separator-color=000000
text-color=c6d0f5
text-clear-color=f2d5cf
text-caps-lock-color=ef9f76
text-ver-color=8caaee
text-wrong-color=ea999c
# status.sh
c="˄"
if grep -q Discharging "/sys/class/power_supply/BAT0/status"; then
    c="˅"
fi
b=$(brightnessctl | awk '/%/ {gsub("[()%]",""); print $4;}')
s=$(pamixer --get-volume)
printf "🔊 %s 💡 %s 🔋%s %s 📆 %s" "$s" "$b" "$c" "$(cat /sys/class/power_supply/BAT0/capacity)" "$(date +'%d.%m.| %H:%M ')"
# config
# includes
include colors

# variables / other
set $term foot -w 800x600
set $menu  wmenu -f "Terminus Nerd Font 14" -i -N 414559 -n c6d0f5 -S ca9ee6 -s 303446 "$@" < ~/.config/sway/apps.txt | bash &
set $passmenu wmenu -f "Terminus Nerd Font 14" -i -N 414559 -n c6d0f5 -S f2d5cf -s 303446 "$@" < <(find ~/.password-store/ -type f -name '*.gpg' -printf '%P\n' | sed 's/\.gpg$//' | sort) | xargs pass show -c 2>/dev/null

exec swayidle before-sleep 'swaylock -fL'

input "type:keyboard" {
  xkb_layout de
  xkb_variant nodeadkeys
}

# ui
output * bg #303446 solid_color
default_border pixel 1
default_floating_border pixel 1

# key bindings
## applications
bindsym Mod4+Shift+q kill
bindsym Mod4+Return exec $term
bindsym Mod4+d exec $menu
bindsym Mod4+p exec $passmenu
bindsym Mod4+Shift+x exec 'swaylock -fL'

## organisation
floating_modifier Mod4 normal
bindsym Mod4+Shift+c reload
bindsym Mod4+Shift+e exec swaynag -t warning -m 'Exit?' -B 'Yes.' 'swaymsg exit'

bindsym Mod4+h focus left
bindsym Mod4+j focus down
bindsym Mod4+k focus up
bindsym Mod4+l focus right
bindsym Mod4+Left focus left
bindsym Mod4+Down focus down
bindsym Mod4+Up focus up
bindsym Mod4+Right focus right

bindsym Mod4+Shift+h move left
bindsym Mod4+Shift+j move down
bindsym Mod4+Shift+k move up
bindsym Mod4+Shift+l move right
bindsym Mod4+Shift+Left move left
bindsym Mod4+Shift+Down move down
bindsym Mod4+Shift+Up move up
bindsym Mod4+Shift+Right move right

bindsym Mod4+1 workspace ←
bindsym Mod4+2 workspace ↑
bindsym Mod4+3 workspace →
bindsym Mod4+4 workspace ↓
bindsym Mod4+Shift+1 move container to workspace ←
bindsym Mod4+Shift+2 move container to workspace ↑
bindsym Mod4+Shift+3 move container to workspace →
bindsym Mod4+Shift+4 move container to workspace ↓

bindsym Mod4+b splith
bindsym Mod4+v splitv
bindsym Mod4+s layout stacking
bindsym Mod4+w layout tabbed
bindsym Mod4+e layout toggle split
bindsym Mod4+f fullscreen
bindsym Mod4+Shift+space floating toggle
bindsym Mod4+space focus mode_toggle
bindsym Mod4+a focus parent

bindsym Mod4+Shift+minus move scratchpad
bindsym Mod4+minus scratchpad show

mode "resize" {
  bindsym h resize shrink width 10px
  bindsym j resize grow height 10px
  bindsym k resize shrink height 10px
  bindsym l resize grow width 10px
  bindsym Left resize shrink width 10px
  bindsym Down resize grow height 10px
  bindsym Up resize shrink height 10px
  bindsym Right resize grow width 10px
  bindsym Return mode "default"
  bindsym Escape mode "default"
}
bindsym Mod4+r mode "resize"

## special keys
bindsym --locked XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle
bindsym --locked XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5%
bindsym --locked XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5%
bindsym --locked XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle
bindsym --locked XF86MonBrightnessDown exec brightnessctl set 5%-
bindsym --locked XF86MonBrightnessUp exec brightnessctl set 5%+


# status bar
bar {
  position top
  status_command while ~/.config/sway/status.sh; do sleep 1; done
  font 
  colors {
    statusline $text
    background $base
    inactive_workspace $base $base $text
    focused_workspace $base $mauve $crust
    urgent_workspace $base $red $crust
  }
}

# window rules
for_window [class="[pico8_dyn]*"] floating enable

# color configuration
# class                  border    back. text   indicator  child_border
client.focused           $lavender $base $text  $rosewater $lavender
client.focused_inactive  $overlay0 $base $text  $rosewater $overlay0
client.unfocused         $overlay0 $base $text  $rosewater $overlay0
client.urgent            $peach    $base $peach $overlay0  $peach
client.placeholder       $overlay0 $base $text  $overlay0  $overlay0
client.background        $base