Skip to content

Commit

Permalink
vimrc: tabstop=8 when opening system header
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangyinzuo committed Feb 22, 2024
1 parent 515e54c commit 06c9e6b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ if has('autocmd') " vim-tiny does not have autocmd
" autocmd FileType c,cpp setlocal equalprg=uncrustify\ -c\ .uncrustify.cfg\ --replace\ --no-backup
autocmd FileType sql setlocal equalprg=sqlformat\ -k\ upper\ -r\ --indent_columns\ -
augroup end
autocmd FileType c,cpp,cuda,vim,tex,html,sh,zsh,json,lua setlocal tabstop=2 shiftwidth=2 softtabstop=2
autocmd FileType c,cpp if expand('%:p') =~ '^/usr/include/\(\(c++\)\|\(\w\+\.h$\)\)' | setlocal tabstop=8 shiftwidth=8 softtabstop=8 | else | setlocal tabstop=2 shiftwidth=2 softtabstop=2 | endif
autocmd FileType cuda,vim,tex,html,sh,zsh,json,lua setlocal tabstop=2 shiftwidth=2 softtabstop=2
" tex使用空格缩进
autocmd FileType tex setlocal expandtab
if v:version >= 901
Expand Down
3 changes: 2 additions & 1 deletion root/.vim/vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ if has('autocmd') " vim-tiny does not have autocmd
autocmd FileType sql setlocal equalprg=sqlformat\ -k\ upper\ -r\ --indent_columns\ -
augroup end

autocmd FileType c,cpp,cuda,vim,tex,html,sh,zsh,json,lua setlocal tabstop=2 shiftwidth=2 softtabstop=2
autocmd FileType c,cpp if expand('%:p') =~ '^/usr/include/\(\(c++\)\|\(\w\+\.h$\)\)' | setlocal tabstop=8 shiftwidth=8 softtabstop=8 | else | setlocal tabstop=2 shiftwidth=2 softtabstop=2 | endif
autocmd FileType cuda,vim,tex,html,sh,zsh,json,lua setlocal tabstop=2 shiftwidth=2 softtabstop=2
" tex使用空格缩进
autocmd FileType tex setlocal expandtab

Expand Down

0 comments on commit 06c9e6b

Please sign in to comment.