" Autocmd hooks augroup vimrc au! " Hide line numbers in terminal windows au FileType floaterm setl nonumber norelativenumber " Spellcheck commit messages and markdown files au FileType gitcommit,markdown :setl spell " Reload sway when related config change au BufWritePost ~/.config/sway/*,~/.config/waybar/* :silent !swaymsg reload & " Filetype detection au BufRead,BufNewFile ~/.config/sway/* :setl ft=i3config au BufRead,BufNewFile tsconfig.json :setl ft=jsonc au BufRead,BufNewFile *.service :setl ft=cfg au BufRead,BufNewFile *.scd :setl ft=scdoc " Vim detects *.h files as C++ ¯\_(ツ)_/¯ au BufRead,BufNewFile *.h :setl ft=c " Whitespace preferences au FileType c :setl ts=4 sts=4 au FileType go :setl ts=4 sts=4 au FileType sh,zsh :setl ts=4 sts=4 au FileType scdoc :setl ts=4 sts=4 au FileType html,css :setl et ts=2 sts=2 au FileType markdown :setl et ts=2 sts=2 au FileType vim :setl et au FileType gitcommit :setl et au BufRead,BufNewFile *.devlog :setl et ts=2 sts=2 tw=80 spell " Gemini things au FileType gemini :setl wrap tw=0 au FileType gemini :nnoremap j gj au FileType gemini :nnoremap k gk " Plain text-ish au FileType plain,scdoc,markdown :setl tw=80 " Qutebrowser editor and tut: " - Disable auto text wrapping, wrap view instead " - Enable spellcheck to prevent dumb mistakes " - And also filetype is plain text au BufRead,BufNewFile qutebrowser-editor-* :setl ft=plain tw=0 spell wrap " Mail stuff " Quotes are handled as comments for allowing to (un-)quote someone " with Commentary and remove > when joining lines au FileType mail :setl commentstring=>\ %s " Update Sourcehut patchset status. This complicated magic just finds " first paragraph (headers) of the mail and adds " X-Sourcehut-Patchset-Update: (cursor here) after it. au FileType mail :nmap p gg}OX-Sourcehut-Patchset-Update: augroup END