2022-02-07 10:12:20 +00:00
|
|
|
command! PU PlugClean! | PlugUpdate | PlugUpgrade
|
2022-01-21 18:57:10 +00:00
|
|
|
" TODO Automatically do this in topgrade
|
2020-06-26 21:23:12 +00:00
|
|
|
|
2022-01-16 13:14:17 +00:00
|
|
|
" TODO auto-update on start/error
|
|
|
|
|
2020-06-26 21:23:12 +00:00
|
|
|
lua require 'colorizer'.setup({ '*'; markdown = { names = false; }; })
|
|
|
|
|
|
|
|
let g:strip_whitespace_on_save=1
|
2020-09-04 10:02:34 +00:00
|
|
|
autocmd FileType taskedit,crontab,markdown DisableStripWhitespaceOnSave
|
2020-06-26 21:23:12 +00:00
|
|
|
let g:show_spaces_that_precede_tabs=1
|
|
|
|
let g:better_whitespace_skip_empty_lines=1
|
|
|
|
let g:better_whitespace_guicolor=$THEME == 'light' ? 'LightGrey' : 'DarkGrey'
|
|
|
|
" see https://github.com/ntpeters/vim-better-whitespace/issues/134 - autocmd OptionSet background let g:better_whitespace_guicolor=&background == 'light' ? 'LightYellow' : 'Brown'
|
|
|
|
|
2020-09-04 10:02:34 +00:00
|
|
|
" remap movement commands to respect CamelCase
|
2020-06-26 21:23:12 +00:00
|
|
|
map <silent> w <Plug>CamelCaseMotion_w
|
|
|
|
map <silent> b <Plug>CamelCaseMotion_b
|
|
|
|
map <silent> e <Plug>CamelCaseMotion_e
|
|
|
|
map <silent> ge <Plug>CamelCaseMotion_ge
|
|
|
|
omap <silent> iw <Plug>CamelCaseMotion_iw
|
|
|
|
xmap <silent> iw <Plug>CamelCaseMotion_iw
|
|
|
|
omap <silent> ib <Plug>CamelCaseMotion_ib
|
|
|
|
xmap <silent> ib <Plug>CamelCaseMotion_ib
|
|
|
|
omap <silent> ie <Plug>CamelCaseMotion_ie
|
|
|
|
xmap <silent> ie <Plug>CamelCaseMotion_ie
|
|
|
|
|
2022-01-17 19:53:52 +00:00
|
|
|
" FIRENVIM {{{1
|
|
|
|
|
|
|
|
" textarea.inputbox is for phpBB
|
2020-06-26 21:23:12 +00:00
|
|
|
let g:firenvim_config = {
|
2022-01-17 19:53:52 +00:00
|
|
|
\ 'globalSettings': {
|
|
|
|
\ 'alt': 'all',
|
|
|
|
\ },
|
|
|
|
\ 'localSettings': {
|
|
|
|
\ '.*': {
|
|
|
|
\ 'cmdline': 'firenvim',
|
|
|
|
\ 'priority': 0,
|
|
|
|
\ 'selector': 'textarea:not([readonly]):not([class="handsontableInput"]):not([wrap="off"]):not([rows="1"]):not([title="Replace"]):not([title="Search"]):not([name="message"]),
|
|
|
|
\ div[role="textbox"]:not([aria-label="Search"])',
|
|
|
|
\ 'takeover': 'always',
|
|
|
|
\ },
|
|
|
|
\ '.*com.*': {
|
|
|
|
\ 'priority': 1,
|
|
|
|
\ 'selector': 'textarea.inputbox',
|
|
|
|
\ 'takeover': 'once',
|
|
|
|
\ },
|
|
|
|
\ '.*church\.tools.*': { 'priority': 9, 'takeover': 'empty', },
|
|
|
|
\ '.*element\.io.*': { 'priority': 9, 'takeover': 'empty', },
|
|
|
|
\ '.*openstreetmap\.org.*': { 'priority': 9, 'takeover': 'once', },
|
|
|
|
\ '.*openstreetmap\.de.*': { 'priority': 9, 'takeover': 'once', },
|
|
|
|
\
|
|
|
|
\ '.*discord\.com.*': { 'priority': 9, 'takeover': 'never', },
|
|
|
|
\ '.*twitter\.com.*': { 'priority': 9, 'takeover': 'never', },
|
|
|
|
\ '.*wiki.*\.org.*': { 'priority': 9, 'takeover': 'never', },
|
|
|
|
\
|
|
|
|
\ '.*calendar\.google\.com.*': { 'priority': 9, 'takeover': 'empty', },
|
|
|
|
\ '.*docs\.google\.com.*': { 'priority': 9, 'takeover': 'never', },
|
|
|
|
\ '.*contacts\.google\.com.*': { 'priority': 9, 'takeover': 'never', },
|
|
|
|
\ '.*notion\.so.*': { 'priority': 9, 'takeover': 'never', },
|
|
|
|
\ '.*cloud\.atomtoast\.xyz.*': { 'priority': 9, 'takeover': 'never', },
|
|
|
|
\ 'https://bigbluebutton.*': { 'priority': 9, 'takeover': 'never', },
|
|
|
|
\ 'https://dhall-lang.org.*': { 'priority': 9, 'takeover': 'never', },
|
|
|
|
\ 'https://aur.archlinux.org/account.*': { 'priority': 9, 'takeover': 'never', },
|
|
|
|
\
|
|
|
|
\ '.*stackexchange\.com.*': { 'priority': 9, 'takeover': 'never', },
|
|
|
|
\ '.*stackoverflow\.com.*': { 'priority': 9, 'takeover': 'never', },
|
|
|
|
\ '.*com/questions/[0-9]+/.*': { 'priority': 9, 'takeover': 'never', },
|
|
|
|
\ '.*com/posts/[0-9]+/.*': { 'priority': 9, 'takeover': 'never', },
|
|
|
|
\ }
|
2020-06-26 21:23:12 +00:00
|
|
|
\ }
|
|
|
|
if exists('g:started_by_firenvim')
|
2022-01-17 19:53:52 +00:00
|
|
|
nnoremap <Esc><Esc> :call firenvim#focus_page()<CR>
|
2020-09-04 10:02:34 +00:00
|
|
|
|
2022-01-17 19:53:52 +00:00
|
|
|
autocmd FocusLost,InsertLeave,BufLeave * ++nested call WriteSilent()
|
|
|
|
function WriteSilent()
|
|
|
|
let was_enabled=b:strip_whitespace_on_save
|
|
|
|
DisableStripWhitespaceOnSave
|
|
|
|
write
|
|
|
|
if was_enabled
|
|
|
|
EnableStripWhitespaceOnSave
|
|
|
|
endif
|
|
|
|
endfunction
|
2020-06-26 21:23:12 +00:00
|
|
|
endif
|