fix: errors when autocmd AutoSaveFolds
This commit is contained in:
parent
8eb1efae5e
commit
a41c581174
30
vimrc
30
vimrc
|
@ -724,7 +724,7 @@ function! s:RunShellCommand(cmdline) abort"{{{
|
||||||
" Shell command
|
" Shell command
|
||||||
" http://vim.wikia.com/wiki/VimTip1599
|
" http://vim.wikia.com/wiki/VimTip1599
|
||||||
|
|
||||||
let l:expanded_cmdline = a:cmdline
|
let l:expanded_cmdline = a:cmdline
|
||||||
for l:part in split(a:cmdline, ' ')
|
for l:part in split(a:cmdline, ' ')
|
||||||
if l:part[0] =~ '\v[%#<]'
|
if l:part[0] =~ '\v[%#<]'
|
||||||
let l:expanded_part = fnameescape(expand(l:part))
|
let l:expanded_part = fnameescape(expand(l:part))
|
||||||
|
@ -749,7 +749,7 @@ function! s:RunShellCommand(cmdline) abort"{{{
|
||||||
endif
|
endif
|
||||||
|
|
||||||
setlocal buftype=nofile bufhidden=wipe nobuflisted noswapfile nowrap
|
setlocal buftype=nofile bufhidden=wipe nobuflisted noswapfile nowrap
|
||||||
nnoremap <buffer> q :bdelete<CR>
|
nnoremap <buffer> q :bdelete<CR>
|
||||||
augroup ResetShellBufferNr
|
augroup ResetShellBufferNr
|
||||||
autocmd! * <buffer>
|
autocmd! * <buffer>
|
||||||
autocmd BufUnload <buffer> let g:shell_scratch_buffer_nr = -1
|
autocmd BufUnload <buffer> let g:shell_scratch_buffer_nr = -1
|
||||||
|
@ -980,7 +980,7 @@ set showmode
|
||||||
|
|
||||||
set autoindent
|
set autoindent
|
||||||
set breakindent
|
set breakindent
|
||||||
set showbreak=\ \ ↳\
|
set showbreak=\ \ ↳\
|
||||||
|
|
||||||
set mouse=a
|
set mouse=a
|
||||||
|
|
||||||
|
@ -1148,15 +1148,15 @@ augroup AutoSaveFolds
|
||||||
" autocmd BufWinLeave ?* mkview
|
" autocmd BufWinLeave ?* mkview
|
||||||
autocmd BufWrite ?* mkview
|
autocmd BufWrite ?* mkview
|
||||||
" autocmd BufWinEnter ?* silent loadview
|
" autocmd BufWinEnter ?* silent loadview
|
||||||
autocmd BufRead ?* silent loadview
|
autocmd BufRead ?* silent! loadview
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
"}}}
|
"}}}
|
||||||
" Show trailing whitepace and spaces before a tab: {{{
|
" Show trailing whitepace and spaces before a tab: {{{
|
||||||
augroup whitespaceerrors
|
augroup whitespaceerrors
|
||||||
autocmd!
|
autocmd!
|
||||||
autocmd Syntax * syn match ExtraWhitespace /\s\+$\| \+\ze\t/ containedin=ALL
|
autocmd Syntax * syn match ExtraWhitespace /\s\+$\| \+\ze\t/ containedin=ALL
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
"}}}
|
"}}}
|
||||||
" automatically reload if color scheme file written {{{
|
" automatically reload if color scheme file written {{{
|
||||||
|
@ -1254,7 +1254,7 @@ function! GetStatus(isactive) abort "{{{
|
||||||
endif"}}}
|
endif"}}}
|
||||||
|
|
||||||
" non-empty buftype (help, quickfix, etc) {{{
|
" non-empty buftype (help, quickfix, etc) {{{
|
||||||
if a:isactive
|
if a:isactive
|
||||||
let l:statusline .= l:active . "%{&buftype == '' ? '' : ' '}%q%h%w%#StatusLineActiveNoText#"
|
let l:statusline .= l:active . "%{&buftype == '' ? '' : ' '}%q%h%w%#StatusLineActiveNoText#"
|
||||||
else
|
else
|
||||||
let l:statusline .= l:normal . "%{&buftype == '' ? '' : ' '}%q%h%w%#StatusLineNormalNoText#"
|
let l:statusline .= l:normal . "%{&buftype == '' ? '' : ' '}%q%h%w%#StatusLineNormalNoText#"
|
||||||
|
@ -1263,15 +1263,15 @@ function! GetStatus(isactive) abort "{{{
|
||||||
"}}}
|
"}}}
|
||||||
|
|
||||||
" right/left divider {{{
|
" right/left divider {{{
|
||||||
let l:statusline.=l:separator
|
let l:statusline.=l:separator
|
||||||
" modified version
|
" modified version
|
||||||
let l:color = 'StatusLineDivMod' . (a:isactive?'Active':'')
|
let l:color = 'StatusLineDivMod' . (a:isactive?'Active':'')
|
||||||
let l:statusline .= GetStatusFrag("&modified && mode() != 'i'", l:color, '%<', l:divider)
|
let l:statusline .= GetStatusFrag("&modified && mode() != 'i'", l:color, '%<', l:divider)
|
||||||
|
|
||||||
" unmodified version
|
" unmodified version
|
||||||
let l:color = 'StatusLineDiv' . (a:isactive?'Active':'')
|
let l:color = 'StatusLineDiv' . (a:isactive?'Active':'')
|
||||||
let l:statusline .= GetStatusFrag("!&modified && mode() != 'i'", l:color, '%<', l:divider)
|
let l:statusline .= GetStatusFrag("!&modified && mode() != 'i'", l:color, '%<', l:divider)
|
||||||
|
|
||||||
" input mode version
|
" input mode version
|
||||||
if a:isactive
|
if a:isactive
|
||||||
let l:statusline .= GetStatusFrag("mode() == 'i'", 'StatusLineDivInput', '%<', l:divider)
|
let l:statusline .= GetStatusFrag("mode() == 'i'", 'StatusLineDivInput', '%<', l:divider)
|
||||||
|
@ -1281,7 +1281,7 @@ function! GetStatus(isactive) abort "{{{
|
||||||
"}}}
|
"}}}
|
||||||
|
|
||||||
" file info{{{
|
" file info{{{
|
||||||
if a:isactive == 1
|
if a:isactive == 1
|
||||||
" let l:statusline.=l:active
|
" let l:statusline.=l:active
|
||||||
let l:statusline.='%#StatusLineFileInfo#'
|
let l:statusline.='%#StatusLineFileInfo#'
|
||||||
" let l:statusline.=" %{strlen(&ft)?&ft:'none'} "
|
" let l:statusline.=" %{strlen(&ft)?&ft:'none'} "
|
||||||
|
@ -1297,7 +1297,7 @@ function! GetStatus(isactive) abort "{{{
|
||||||
"}}}
|
"}}}
|
||||||
|
|
||||||
" path/filename.extension {{{
|
" path/filename.extension {{{
|
||||||
if a:isactive
|
if a:isactive
|
||||||
if &readonly
|
if &readonly
|
||||||
let l:statusline .= '%#StatusLineWarningActive# %r '
|
let l:statusline .= '%#StatusLineWarningActive# %r '
|
||||||
let l:statusline .= '%#StatusLineFileReadOnlyActive#'
|
let l:statusline .= '%#StatusLineFileReadOnlyActive#'
|
||||||
|
@ -1341,7 +1341,7 @@ function! GetStatus(isactive) abort "{{{
|
||||||
let l:statusline.='%*' . l:separator
|
let l:statusline.='%*' . l:separator
|
||||||
|
|
||||||
" linter status {{{
|
" linter status {{{
|
||||||
if a:isactive
|
if a:isactive
|
||||||
" errors
|
" errors
|
||||||
let l:statusline .= "%#LinterDashActive#%{(GetLinterStatus('error') == 0?'-':'')}"
|
let l:statusline .= "%#LinterDashActive#%{(GetLinterStatus('error') == 0?'-':'')}"
|
||||||
let l:statusline .= "%#LinterErrorActive#%{(GetLinterStatus('error') == 0?'':GetLinterStatus('error'))}"
|
let l:statusline .= "%#LinterErrorActive#%{(GetLinterStatus('error') == 0?'':GetLinterStatus('error'))}"
|
||||||
|
@ -1387,7 +1387,7 @@ function! GetStatus(isactive) abort "{{{
|
||||||
|
|
||||||
return l:statusline
|
return l:statusline
|
||||||
|
|
||||||
endfunction
|
endfunction
|
||||||
"}}}
|
"}}}
|
||||||
|
|
||||||
" highlight groups {{{
|
" highlight groups {{{
|
||||||
|
|
Loading…
Reference in New Issue