nvim-config

Log | Files | Refs | Submodules | README

commit efbcb7cf1868201de63f6fc5b8413af3238ae2f4
parent 9727229a7b50fd3183610ec4fa3ab4655e0f5681
Author: Thomas Vigouroux <thomas.vigouroux@protonmail.com>
Date:   Wed, 20 Jul 2022 13:40:18 +0200

feat(c): use uncrustify when possible

Diffstat:
Mafter/ftplugin/c.vim | 7+++----
1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/after/ftplugin/c.vim b/after/ftplugin/c.vim @@ -1,4 +1,4 @@ -" Last Change: 2022 Apr 14 +" Last Change: 2022 Jul 20 setlocal expandtab setlocal textwidth=80 " Nvim uses this @@ -6,12 +6,11 @@ setlocal tabstop=2 setlocal foldmethod=expr setlocal foldexpr=nvim_treesitter#foldexpr() setlocal foldlevel=0 -setlocal omnifunc=v:lua.vim.lsp.omnifunc setlocal comments^=:/// setlocal commentstring=//%s -if !empty(findfile('.clang-format', ';')) - setlocal formatprg=clang-format\ -style=file +if !empty(findfile('src/uncrustify.cfg', ';')) && executable("uncrustify") + setlocal formatprg=uncrustify\ -q\ -l\ C\ -c\ src/uncrustify.cfg\ --no-backup endif nnoremap <buffer> <Leader><Leader> <cmd>ClangdSwitchSourceHeader<CR>