Initial commit
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
;; Emacs configuration for clang-format integration
|
||||
(load "/path/to/clang-format.el")
|
||||
(global-set-key [C-M-tab] 'clang-format-region)
|
||||
4
skills/clang-format/assets/integrations/pre-commit
Executable file
4
skills/clang-format/assets/integrations/pre-commit
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
# Pre-commit hook for clang-format
|
||||
# Format staged changes before commit
|
||||
git clang-format --staged --quiet
|
||||
@@ -0,0 +1,21 @@
|
||||
" Vim configuration for clang-format integration
|
||||
" Format on save for C++ files
|
||||
|
||||
" Python 3 support
|
||||
if has('python3')
|
||||
map <C-K> :py3f /path/to/clang-format.py<cr>
|
||||
imap <C-K> <c-o>:py3f /path/to/clang-format.py<cr>
|
||||
endif
|
||||
|
||||
" Python 2 support
|
||||
if has('python')
|
||||
map <C-K> :pyf /path/to/clang-format.py<cr>
|
||||
imap <C-K> <c-o>:pyf /path/to/clang-format.py<cr>
|
||||
endif
|
||||
|
||||
" Format on save
|
||||
function! Formatonsave()
|
||||
let l:formatdiff = 1
|
||||
py3f /path/to/clang-format.py
|
||||
endfunction
|
||||
autocmd BufWritePre *.h,*.cc,*.cpp call Formatonsave()
|
||||
Reference in New Issue
Block a user