From cecb4cef0f7475522e4bc9721a600240459f54f8 Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Mon, 13 Mar 2023 14:45:59 +0100 Subject: [PATCH] config/nvim: clean up firenvim --- .config/nvim/init/firenvim.vim | 61 ++++++++++++++++++++++++++++++ .config/nvim/init/pluginConfig.vim | 59 +---------------------------- 2 files changed, 62 insertions(+), 58 deletions(-) create mode 100644 .config/nvim/init/firenvim.vim diff --git a/.config/nvim/init/firenvim.vim b/.config/nvim/init/firenvim.vim new file mode 100644 index 0000000..d6edfd0 --- /dev/null +++ b/.config/nvim/init/firenvim.vim @@ -0,0 +1,61 @@ +" textarea.inputbox is for phpBB +let g:firenvim_config = { + \ '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"]), div[class="CodeMirror"]', + \ 'takeover': 'always', + \ }, + \ '.*com.*': { + \ 'priority': 1, + \ 'selector': 'textarea.inputbox', + \ 'takeover': 'once', + \ }, + \ + \ '.*wiki.*\.org.*': { 'priority': 9, 'takeover': 'never', }, + \ '.*openstreetmap\.org.*': { 'priority': 9, 'takeover': 'once', }, + \ '.*openstreetmap\.de.*': { 'priority': 9, 'takeover': 'once', }, + \ + \ '.*church\.tools.*': { 'priority': 9, 'takeover': 'empty', }, + \ '.*element\.io.*': { 'priority': 9, 'takeover': 'never', }, + \ + \ '.*discord\.com.*': { 'priority': 9, 'takeover': 'never', }, + \ '://chat\..*': { 'priority': 9, 'takeover': 'never', }, + \ '.*twitter\.com.*': { 'priority': 9, 'takeover': 'never', }, + \ + \ '://pve.*': { 'priority': 9, 'takeover': 'never', }, + \ '.*:8006/.*': { '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', }, + \ } +\ } +if exists('g:started_by_firenvim') + nnoremap :call firenvim#focus_page() + + 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 +endif diff --git a/.config/nvim/init/pluginConfig.vim b/.config/nvim/init/pluginConfig.vim index 43205c5..0352d3c 100644 --- a/.config/nvim/init/pluginConfig.vim +++ b/.config/nvim/init/pluginConfig.vim @@ -24,61 +24,4 @@ xmap ib CamelCaseMotion_ib omap ie CamelCaseMotion_ie xmap ie CamelCaseMotion_ie -" FIRENVIM {{{1 - -" textarea.inputbox is for phpBB -let g:firenvim_config = { - \ '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"]), div[class="CodeMirror"]', - \ 'takeover': 'always', - \ }, - \ '.*com.*': { - \ 'priority': 1, - \ 'selector': 'textarea.inputbox', - \ 'takeover': 'once', - \ }, - \ '.*church\.tools.*': { 'priority': 9, 'takeover': 'empty', }, - \ '.*element\.io.*': { 'priority': 9, 'takeover': 'never', }, - \ '.*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', }, - \ '://pve.*': { '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', }, - \ } -\ } -if exists('g:started_by_firenvim') - nnoremap :call firenvim#focus_page() - - 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 -endif +source $INITDIR/init/firenvim.vim