+
+"" syntax
+autocmd Syntax php syn clear phpHereDoc phpNowDoc
+
+"" mappings
+" use more accessible escapes, as C-n and C-o are shadowed by some terminals
+if has('nvim')
+ tnoremap <C-\>n <C-\><C-N>
+ tnoremap <C-\>o <C-\><C-O>
+endif
+
+" move windows any time
+if has('nvim')
+ " terminal
+ tnoremap <A-h> <C-\><C-N><C-w>h
+ tnoremap <A-j> <C-\><C-N><C-w>j
+ tnoremap <A-k> <C-\><C-N><C-w>k
+ tnoremap <A-l> <C-\><C-N><C-w>l
+endif
+" insert
+inoremap <A-h> <C-\><C-N><C-w>h
+inoremap <A-j> <C-\><C-N><C-w>j
+inoremap <A-k> <C-\><C-N><C-w>k
+inoremap <A-l> <C-\><C-N><C-w>l
+" normal
+nnoremap <A-h> <C-w>h
+nnoremap <A-j> <C-w>j
+nnoremap <A-k> <C-w>k
+nnoremap <A-l> <C-w>l
+
+"" CTRL-L to clear highlighting and also update diff
+" NOTE: sensible.vim and nvim already do this, so copy sensible.vim
+" functionality if it hasn't been set or we aren't nvim. taken from
+" sensible.vim by Tim Pope, under Vim license; see :help license
+" https://github.com/tpope/vim-sensible/blob/0ce2d843d6f588bb0c8c7eec6449171615dc56d9/plugin/sensible.vim#L57
+if !has('nvim') && maparg('<C-L>', 'n') ==# ''
+ nnoremap <silent> <C-L> :nohlsearch<C-R>=has('diff')?'<Bar>diffupdate':''<CR><CR><C-L>
+endif
+
+
+""" package config
+"" suda
+" https://github.com/lambdalisue/vim-suda/issues/32#issuecomment-829608925
+if ! &diff
+ let g:suda_smart_edit = 1
+endif
+" re-enable backup, swap, undo for suda buffers that we can read
+" https://github.com/lambdalisue/vim-suda/issues/25
+function s:SudaSettingsSave()
+ let b:sev_suda_backup = &backup
+ let b:sev_suda_swapfile = &swapfile
+ let b:sev_suda_undofile = &undofile
+endfunction
+function s:SudaSettingsRestore()
+ if filereadable(expand('<afile>')[7:])
+ if exists('b:sev_suda_backup') && b:sev_suda_backup
+ " XXX: suda.vim uses setlocal for this, even though it's global...
+ " https://github.com/lambdalisue/vim-suda/issues/85
+ setlocal backup
+ endif
+ if exists('b:sev_suda_swapfile') && b:sev_suda_swapfile
+ setlocal swapfile
+ endif
+ if exists('b:sev_suda_undofile') && b:sev_suda_undofile
+ setlocal undofile
+ endif
+ endif
+endfunction
+autocmd BufReadPre suda://* call s:SudaSettingsSave()
+autocmd BufReadPost suda://* call s:SudaSettingsRestore()