~wrm/dotfiles

a80e0629ee6b2249a8c546145e736871e4328664 — +wrm 4 months ago 009efab
Add most everything else!
A .config/git/matt => .config/git/matt +4 -0
@@ 0,0 1,4 @@
[user]
	name = murlin
	email = matt@murr.dev
	signingkey = 1A022575584A5E860B60B5C227E7DF4E1D61DD38

A .config/git/wrm => .config/git/wrm +4 -0
@@ 0,0 1,4 @@
[user]
	name = +wrm
	email = wrm@wrmhl.me
	signingkey = 07DFE36560F3E8A13AF918EF3462309CDA0E10A8

A .config/keymaps/keymaps => .config/keymaps/keymaps +3 -0
@@ 0,0 1,3 @@
keymaps 0
include "/usr/share/kbd/keymaps/i386/qwerty/uk.map.gz"
keycode 58 = Escape

A .config/nvim/init.vim => .config/nvim/init.vim +132 -0
@@ 0,0 1,132 @@
" TODO Port LaTeX setup.
" TODO Review and port plugins:
" tagbar
" vim-fswitch
" ferret
" c.vim
" greputils
" vim-bufferline
" SuperTab
" autoalign
" vimwiki
" vim-surround

" ---------
"  General
" ---------

let mapleader=" "

" Things that should be vim defaults:
set nocompatible
filetype plugin indent on
syntax on
set encoding=utf-8
set number
set hidden
set splitbelow
set splitright
set title

" Search defaults
set ignorecase
set smartcase

" Read local .vimrc in parent dirs
set exrc
set secure

" Toggle between relative and absolute linenums if in insert mode
set relativenumber

augroup relativenumbering
	autocmd!
	autocmd InsertEnter * :set norelativenumber
	autocmd InsertLeave * :set relativenumber
augroup end

" Delete trailing whitespace on save
autocmd BufWritePre * %s/\s\+$//e

" Command-line mode autocompletion
set path+=**
set wildmode=longest,list,full
set wildmenu

" Auto-wrap common non-code files
autocmd BufRead,BufNewFile *.txt,*.md,*.tex setlocal tw=80

" Highlight others
set t_Co=256 " Not needed anymore but doesn't hurt.
set colorcolumn=80
highlight ColorColumn ctermbg=233

" Steal code faster
set clipboard+=unnamedplus

" Disable comments carrying onto newlines
autocmd filetype * setlocal formatoptions-=c formatoptions-=r formatoptions-=o

" Treat CNatural files as having C++ syntax
autocmd BufNewFile,BufRead *.cn setfiletype cn
autocmd FileType cn setlocal syntax=cpp

" Treat .html.sh extra specially.
autocmd BufNewFile,BufRead *.html.sh setlocal syntax=htmlsh

" Transparent editing of gpg encrypted files
" Based on https://vim.fandom.com/wiki/Edit_gpg_encrypted_files

" Don't save backups of *.gpg files
set backupskip+=*.gpg
augroup gpgencrypted
	autocmd!
	" To avoid that parts of the file is saved to shared data when yanking
	" or deleting, empty the 'viminfo/shada' option.
	autocmd BufReadPre,FileReadPre *.gpg set shada=
	" Disable swap files, and set binary file format before reading the file
	autocmd BufReadPre,FileReadPre *.gpg setlocal noswapfile bin
	" Decrypt the contents after reading the file, reset binary file format
	" and run any BufReadPost autocmds matching the file name without the
	" .gpg extension
	autocmd BufReadPost,FileReadPost *.gpg
		\ execute "'[,']!gpg --decrypt --default-recipient-self" |
		\ setlocal nobin |
		\ execute "doautocmd BufReadPost " . expand("%:r")
	" Set binary file format and encrypt the contents before writing the file
	autocmd BufWritePre,FileWritePre *.gpg
		\ setlocal bin |
		\ '[,']!gpg --quiet --encrypt --default-recipient-self
	" After writing the file, do an :undo to revert the encryption in the
	" buffer, and reset binary file format
	autocmd BufWritePost,FileWritePost *.gpg
		\ silent undo |
		\ setlocal nobin
augroup END

" Shortcuts
" ---------

" Spell check
map <F6> :setlocal spell! spelllang=en_gb<CR>

" Disable search highlighting
nnoremap <leader>/ :nohlsearch<CR>

" Split navigation
map <C-h> <C-w>h
map <C-j> <C-w>j
map <C-k> <C-w>k
map <C-l> <C-w>l

" Replace all
nnoremap S :%s//g<Left><Left>

" Buffer movement
nnoremap <Left> :bp<CR>
nnoremap <Right> :bn<CR>

" Skeletons n Snippets
let closet = "~/.local/share/skeletons/"
nnoremap ,sh :read <C-r>=closet<CR>sh/
imap ,sh <Esc>,sh

A .config/nvim/syntax/htmlsh.vim => .config/nvim/syntax/htmlsh.vim +13 -0
@@ 0,0 1,13 @@
let b:current_syntax = ''
unlet b:current_syntax
runtime! syntax/sh.vim

unlet b:current_syntax
syntax include @Sh syntax/sh.vim

unlet b:current_syntax
syntax include @Html syntax/html.vim
syntax region htmlCode matchgroup=Snip start="'" end="'" containedin=@Sh contains=@Html

highlight link Snip SpecialComment
let b:current_syntax = 'htmlsh'

A .config/qutebrowser/config.py => .config/qutebrowser/config.py +10 -0
@@ 0,0 1,10 @@
config.load_autoconfig()

#c.url.default_page = "https://start.stillwarm.host"

c.downloads.location.directory = "~"

c.content.default_encoding = "utf-8"
c.content.pdfjs = False
c.content.user_stylesheets = [ "~/.config/qutebrowser/stylesheet.css" ]
c.content.javascript.enabled = False

A .config/qutebrowser/stylesheet.css => .config/qutebrowser/stylesheet.css +3 -0
@@ 0,0 1,3 @@
.js-consent-banner {
	display: none !important;
}

A .config/tmux/tmux.conf => .config/tmux/tmux.conf +31 -0
@@ 0,0 1,31 @@
# Environment

# Do not run as login shell
set -g default-command "${SHELL}"

# Remove ESC delay
set -s escape-time 0

# Bindings

# Map leader
unbind C-b
set-option -g prefix M-w
bind-key M-w send-prefix

bind -n M-n new-session
bind n new-window

# Pane switching
bind -n M-h select-pane -L
bind -n M-j select-pane -D
bind -n M-k select-pane -U
bind -n M-l select-pane -R

# Pane splitting
unbind s # previously bound to :choose-tree -Zs which could be useful

unbind '"'
unbind %
bind s split-window -h
bind v split-window -v

A .config/wget/wgetrc => .config/wget/wgetrc +1 -0
@@ 0,0 1,1 @@
hsts-file=~/.cache/wget-hsts

A .config/x11/xinitrc => .config/x11/xinitrc +29 -0
@@ 0,0 1,29 @@
#!/bin/sh
# TODO continue looking through xinitrc.example
setxkbmap -layout "gb" -option "caps:escape"

xset -b # Disable bell.

while true; do
	DATETIME=$(date +%d-%m-%Y\ %H:%M)

	# TODO Check we are actually on battery first.
	BATCAPACITY="$(cat $BAT/capacity)%"

	BATSTATUS=$(cat $BAT/status)
	if [ $BATSTATUS = "Charging" ]; then
		BATSTATUS="^"
	elif [ $BATSTATUS = "Discharging" ]; then
		BATSTATUS="v"
	else
		BATSTATUS="*"
	fi

	TEMP="$(($(cat /sys/class/thermal/thermal_zone0/temp) / 1000))C"
	export BATSTATUS

	xsetroot -name "$DATETIME ${BATCAPACITY}${BATSTATUS} $TEMP"
	sleep 30s
done &

exec dwm