vim-autoformat icon indicating copy to clipboard operation
vim-autoformat copied to clipboard

Won't use symlink'd .clang-format

Open mjedmonds opened this issue 9 years ago • 4 comments

I have a symlink'd .clang-format file on the volume I'm editing on, and :echo g:ClangFormatConfigFileExists() returns 0 and :Autoformat is using the default.

Is there a way for vim-autoformat to recognize symlinks?

Thanks

mjedmonds avatar Apr 08 '16 18:04 mjedmonds

The function that checks for that file can be found in defaults.vim:

function! g:ClangFormatConfigFileExists()
    return len(findfile(".clang-format", expand("%:p:h").";")) || len(findfile("_clang-format", expand("%:p:h").";"))
endfunction

You could fiddle around with this a bit, and provide a pull request if you got it working.

chtenb avatar Apr 13 '16 08:04 chtenb

FWIW, I think this is resolved with Vim 8.0 (potentially even less recently, but that's what I'm running). I use symlinks for all my config files, and findfile doesn't have a problem picking them up.

chpatton013 avatar Apr 03 '18 00:04 chpatton013

@mjedmonds can you confirm?

chtenb avatar Apr 03 '18 08:04 chtenb

@Chiel92 I still use this plugin but without symlink'd files. I also have migrated to Neovim.

mjedmonds avatar Apr 03 '18 15:04 mjedmonds