add swith to default gg=G
This commit is contained in:
parent
b01c85e8f7
commit
37a6b7f979
@ -1,5 +1,10 @@
|
|||||||
" Function for finding the formatters for this filetype
|
" Function for finding the formatters for this filetype
|
||||||
" Result is stored in b:formatters
|
" Result is stored in b:formatters
|
||||||
|
|
||||||
|
if !exists('g:autoformat_autoindent')
|
||||||
|
let g:autoformat_autoindent = 1
|
||||||
|
endif
|
||||||
|
|
||||||
function! s:find_formatters(...)
|
function! s:find_formatters(...)
|
||||||
" Detect verbosity
|
" Detect verbosity
|
||||||
let verbose = &verbose || exists("g:autoformat_verbosemode")
|
let verbose = &verbose || exists("g:autoformat_verbosemode")
|
||||||
@ -62,7 +67,13 @@ function! s:TryAllFormatters(...) range
|
|||||||
if !call('<SID>find_formatters', a:000)
|
if !call('<SID>find_formatters', a:000)
|
||||||
" No formatters defined, so autoindent code
|
" No formatters defined, so autoindent code
|
||||||
" exe "normal gg=G"
|
" exe "normal gg=G"
|
||||||
return 0
|
if g:autoformat_autoindent == 1
|
||||||
|
" No formatters defined, so autoindent code
|
||||||
|
exe "normal gg=G"
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Make sure index exist and is valid
|
" Make sure index exist and is valid
|
||||||
@ -108,8 +119,13 @@ function! s:TryAllFormatters(...) range
|
|||||||
|
|
||||||
if s:index == b:current_formatter_index
|
if s:index == b:current_formatter_index
|
||||||
" Tried all formatters, none worked so autoindent code
|
" Tried all formatters, none worked so autoindent code
|
||||||
exe "normal gg=G"
|
if g:autoformat_autoindent == 1
|
||||||
return 0
|
" No formatters defined, so autoindent code
|
||||||
|
exe "normal gg=G"
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
endwhile
|
endwhile
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user