1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 07:00:04 +08:00

fix(format): format code in visual mode

close https://github.com/SpaceVim/SpaceVim/issues/4864
This commit is contained in:
Eric Wong 2024-07-03 10:48:25 +08:00
parent c501057f6f
commit e2250a99f7

View File

@ -68,11 +68,11 @@ endfunction
function! SpaceVim#layers#format#config() abort
if s:format_method ==# 'neoformat'
call SpaceVim#mapping#space#def('nnoremap', ['b', 'f'], 'Neoformat', 'format-code', 1)
call SpaceVim#mapping#space#def('nnoremap', ['b', 'f'], ":Neoformat\<Cr>", 'format-code', 0, 1)
elseif s:format_method ==# 'codefmt'
call SpaceVim#mapping#space#def('nnoremap', ['b', 'f'], 'FormatCode', 'format-code', 1)
elseif s:format_method ==# 'format.nvim'
call SpaceVim#mapping#space#def('nnoremap', ['b', 'f'], 'Format', 'format-code', 1)
call SpaceVim#mapping#space#def('nnoremap', ['b', 'f'], ":Format\<Cr>", 'format-code', 0, 1)
endif
augroup spacevim_layer_format
autocmd!