2020-06-26 21:23:12 +00:00
|
|
|
" Don't show current mode because airline already does and it inhibits echo in visual mode
|
|
|
|
set noshowmode
|
|
|
|
|
|
|
|
command! PU PlugUpdate | PlugUpgrade
|
|
|
|
|
|
|
|
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
|
|
|
let g:blamer_enabled = 1
|
|
|
|
let g:blamer_template = '<committer>: <summary> • <commit-short> <committer-time>'
|
|
|
|
let g:blamer_relative_time = 1
|
|
|
|
let g:blamer_delay = 300
|
|
|
|
" let g:blamer_show_in_visual_modes = 0
|
|
|
|
|
|
|
|
" 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
|
|
|
|
|
|
|
|
" open-browser
|
|
|
|
let g:openbrowser_default_search="duckduckgo"
|
|
|
|
let g:netrw_nogx = 1 " disable netrw's gx mapping.
|
|
|
|
nmap gs <Plug>(openbrowser-smart-search)
|
|
|
|
vmap gs <Plug>(openbrowser-smart-search)
|
|
|
|
nmap gx yi':OpenGithubProject <C-R>"<CR>
|
|
|
|
command! S OpenBrowserSmartSearch <C-R>"<CR>
|
|
|
|
command! GH OpenGithubProject <C-R>"<CR>
|
|
|
|
|
|
|
|
" firenvim
|
|
|
|
let g:firenvim_config = {
|
|
|
|
\ 'globalSettings': {
|
|
|
|
\ 'alt': 'all',
|
|
|
|
\ },
|
|
|
|
\ 'localSettings': {
|
|
|
|
\ '.*': {
|
2020-09-04 10:02:34 +00:00
|
|
|
\ 'cmdline': 'firenvim',
|
2020-06-26 21:23:12 +00:00
|
|
|
\ 'priority': 0,
|
2020-09-04 10:02:34 +00:00
|
|
|
\ 'selector': 'textarea:not([readonly]):not([class="handsontableInput"]), div[role="textbox"]:not([aria-label="Search"])',
|
2020-06-26 21:23:12 +00:00
|
|
|
\ 'takeover': 'always',
|
|
|
|
\ },
|
2020-09-04 10:02:34 +00:00
|
|
|
\ '.*notion\.so.*': { 'priority': 9, 'takeover': 'never', },
|
|
|
|
\ '.*docs\.google\.com.*': { 'priority': 9, 'takeover': 'never', },
|
|
|
|
\ '.*mail\.protonmail\.com.*': { 'priority': 9, 'takeover': 'never', },
|
2020-09-19 07:33:31 +00:00
|
|
|
\ '.*cloud.atomtoast.xyz.*': { 'priority': 9, 'takeover': 'never', },
|
|
|
|
\ 'https://bigbluebutton.*': { 'priority': 9, 'takeover': 'never', },
|
|
|
|
\ 'https://dhall-lang.org.*': { 'priority': 9, 'takeover': 'never', },
|
2020-06-26 21:23:12 +00:00
|
|
|
\ }
|
|
|
|
\ }
|
|
|
|
if exists('g:started_by_firenvim')
|
2020-09-04 10:02:34 +00:00
|
|
|
let g:smoothie_no_default_mappings=1 "extremely slow, see https://github.com/psliwka/vim-smoothie/issues/17
|
|
|
|
|
|
|
|
nnoremap <Esc><Esc> :call firenvim#focus_page()<CR>
|
|
|
|
|
2020-06-26 21:23:12 +00:00
|
|
|
autocmd FocusLost,InsertLeave,BufLeave * ++nested call WriteSilent()
|
|
|
|
function WriteSilent()
|
2020-09-04 10:02:34 +00:00
|
|
|
let was_enabled=b:strip_whitespace_on_save
|
|
|
|
DisableStripWhitespaceOnSave
|
2020-06-26 21:23:12 +00:00
|
|
|
write
|
2020-09-04 10:02:34 +00:00
|
|
|
if was_enabled
|
|
|
|
EnableStripWhitespaceOnSave
|
|
|
|
endif
|
2020-06-26 21:23:12 +00:00
|
|
|
endfunction
|
|
|
|
endif
|