update config
This commit is contained in:
@@ -18,29 +18,24 @@
|
||||
autocmd BufRead,BufNewFile *.ms,*.me,*.mom,*.man set filetype=groff
|
||||
autocmd BufRead,BufNewFile *.tex set filetype=tex
|
||||
|
||||
" Save file as sudo on files that require root permission
|
||||
cabbrev w!! execute 'silent! write !sudo tee % >/dev/null' <bar> edit!
|
||||
" Save file as doas on files that require root permission
|
||||
cabbrev w!! execute 'silent! write !doas tee % >/dev/null' <bar> edit!
|
||||
|
||||
" Automatically deletes all trailing whitespace and newlines at end of file on save. & reset cursor position
|
||||
autocmd BufWritePre * let currPos = getpos(".")
|
||||
autocmd BufWritePre * %s/\s\+$//e
|
||||
autocmd BufWritePre * %s/\n\+\%$//e
|
||||
autocmd BufWritePre *.[ch] %s/\%$/\r/e " add trailing newline for ANSI C standard
|
||||
autocmd BufWritePre *neomutt* %s/^--$/-- /e " dash-dash-space signature delimiter in emails
|
||||
autocmd BufWritePre * cal cursor(currPos[1], currPos[2])
|
||||
autocmd BufWritePre * let currPos = getpos(".")
|
||||
autocmd BufWritePre * %s/\s\+$//e
|
||||
autocmd BufWritePre * %s/\n\+\%$//e
|
||||
autocmd BufWritePre *.[ch] %s/\%$/\r/e " add trailing newline for ANSI C standard
|
||||
autocmd BufWritePre * cal cursor(currPos[1], currPos[2])
|
||||
|
||||
" When shortcut files are updated, renew bash and ranger configs with new material:
|
||||
autocmd BufWritePost bm-files,bm-dirs !shortcuts
|
||||
" Run xrdb whenever Xdefaults or Xresources are updated.
|
||||
autocmd BufRead,BufNewFile Xresources,Xdefaults,xresources,xdefaults set filetype=xdefaults
|
||||
autocmd BufWritePost Xresources,Xdefaults,xresources,xdefaults !xrdb %
|
||||
" Recompile dwmblocks on config edit.
|
||||
autocmd BufWritePost ~/.local/src/dwmblocks/config.h !cd ~/.local/src/dwmblocks/; sudo make install && { killall -q dwmblocks;setsid -f dwmblocks }
|
||||
|
||||
" Turns off highlighting on the bits of code that are changed, so the line that is changed is highlighted but the actual text that has changed stands out on the line and is readable.
|
||||
if &diff
|
||||
highlight! link DiffText MatchParen
|
||||
endif
|
||||
" Recompile i3/i3blocks on config edit.
|
||||
autocmd BufWritePost ~/.config/i3/config !i3 restart
|
||||
autocmd BufWritePost ~/.config/i3blocks/config !i3 restart
|
||||
|
||||
" Function for toggling the bottom statusbar:
|
||||
let s:hidden_all = 0
|
||||
|
||||
Reference in New Issue
Block a user