+ vim-clang-format plugin
This commit is contained in:
parent
fe1588978c
commit
525874c9de
1
pack/vim-clang-format/opt/vim-clang-format
Submodule
1
pack/vim-clang-format/opt/vim-clang-format
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit 6b791825ff478061ad1c57b21bb1ed5a5fd0eb29
|
@ -33,11 +33,6 @@ if (g:os == 'linux')
|
|||||||
endif
|
endif
|
||||||
setlocal suffixesadd=.h
|
setlocal suffixesadd=.h
|
||||||
|
|
||||||
" set clang-format for gq, if exists
|
|
||||||
if exists('*ClangFormat()')
|
|
||||||
setlocal formatexpr=ClangFormat()
|
|
||||||
endif
|
|
||||||
|
|
||||||
" commenting
|
" commenting
|
||||||
" ----------
|
" ----------
|
||||||
let b:commentstring = "\/\/"
|
let b:commentstring = "\/\/"
|
||||||
|
@ -210,19 +210,6 @@ endfunction
|
|||||||
" Formatting Functions
|
" Formatting Functions
|
||||||
" --------------------
|
" --------------------
|
||||||
|
|
||||||
" hint: formatexpr=ClangFormat() is set in ft/c.vim
|
|
||||||
command! ClangFormat call ClangFormat()
|
|
||||||
function ClangFormat()
|
|
||||||
if (v:count > 0)
|
|
||||||
let startline = v:lnum
|
|
||||||
let endline = v:lnum + v:count
|
|
||||||
let l:lines = startline.':'.endline
|
|
||||||
else
|
|
||||||
let l:lines='all'
|
|
||||||
endif
|
|
||||||
py3file /usr/share/vim/addons/syntax/clang-format.py
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" delete all multiple empty lines
|
" delete all multiple empty lines
|
||||||
command -range=% DelAllMultipleEmptyLines call DelAllMultipleEmptyLines(<line1>,<line2>)
|
command -range=% DelAllMultipleEmptyLines call DelAllMultipleEmptyLines(<line1>,<line2>)
|
||||||
function DelAllMultipleEmptyLines(fromline, toline)
|
function DelAllMultipleEmptyLines(fromline, toline)
|
||||||
|
@ -61,6 +61,7 @@ packadd! tcomment
|
|||||||
packadd! termdebug
|
packadd! termdebug
|
||||||
packadd! vc
|
packadd! vc
|
||||||
packadd! vimagit
|
packadd! vimagit
|
||||||
|
packadd! vim-clang-format
|
||||||
packadd! VisIncr
|
packadd! VisIncr
|
||||||
packadd! xml
|
packadd! xml
|
||||||
packadd! yapf
|
packadd! yapf
|
||||||
@ -288,6 +289,15 @@ command PyFlake Flake8
|
|||||||
" -----
|
" -----
|
||||||
command PyIsort Isort
|
command PyIsort Isort
|
||||||
|
|
||||||
|
" -----------
|
||||||
|
" ClangFormat
|
||||||
|
" -----------
|
||||||
|
let g:clang_format#command = 'clang-format-15'
|
||||||
|
let g:clang_format#detect_style_file = 1
|
||||||
|
let g:clang_format#auto_format = 1
|
||||||
|
let g:clang_format#auto_format_on_insert_leave = 1
|
||||||
|
let g:clang_format#auto_formatexpr = 1
|
||||||
|
|
||||||
" -------------
|
" -------------
|
||||||
" YouCompleteMe
|
" YouCompleteMe
|
||||||
" -------------
|
" -------------
|
||||||
|
Loading…
x
Reference in New Issue
Block a user