vimrc: add augroup for filetype autocmds
This commit is contained in:
parent
9bea067fbe
commit
a85ccd7318
95
.vim/vimrc
95
.vim/vimrc
@ -610,67 +610,70 @@ augroup save_load_views
|
|||||||
au BufWinEnter *.* loadview
|
au BufWinEnter *.* loadview
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
au FileType xml setlocal shiftwidth=4 tabstop=4
|
augroup filetypes
|
||||||
au FileType html setlocal shiftwidth=4 tabstop=4
|
autocmd!
|
||||||
|
au FileType xml setlocal shiftwidth=4 tabstop=4
|
||||||
|
au FileType html setlocal shiftwidth=4 tabstop=4
|
||||||
|
|
||||||
au BufNewFile,BufRead *.js
|
au BufNewFile,BufRead *.js
|
||||||
\ setlocal shiftwidth=4 tabstop=4 softtabstop=4 expandtab autoindent
|
\ setlocal shiftwidth=4 tabstop=4 softtabstop=4 expandtab autoindent
|
||||||
\ fileformat=unix filetype=js
|
\ fileformat=unix filetype=js
|
||||||
|
|
||||||
au BufNewFile,BufRead,BufEnter *.md
|
au BufNewFile,BufRead,BufEnter *.md
|
||||||
\ setlocal textwidth=79 foldmethod=manual filetype=markdown
|
\ setlocal textwidth=79 foldmethod=manual filetype=markdown
|
||||||
\ fileformat=unix expandtab
|
\ fileformat=unix expandtab
|
||||||
|
|
||||||
au FileType sway setl textwidth=99
|
au FileType sway setl textwidth=99
|
||||||
\ tabstop=4 shiftwidth=4 softtabstop=4 noexpandtab autoindent
|
\ tabstop=4 shiftwidth=4 softtabstop=4 noexpandtab autoindent
|
||||||
|
|
||||||
au FileType rust setl
|
au FileType rust setl
|
||||||
\ tabstop=8 shiftwidth=8 softtabstop=8 noexpandtab autoindent ff=unix
|
\ tabstop=8 shiftwidth=8 softtabstop=8 noexpandtab autoindent ff=unix
|
||||||
|
|
||||||
au BufNewFile,BufRead *.py,*.pyw,*.pyx,?akefil*
|
au BufNewFile,BufRead *.py,*.pyw,*.pyx,?akefil*
|
||||||
\ setlocal tabstop=4 shiftwidth=4 noexpandtab autoindent
|
\ setlocal tabstop=4 shiftwidth=4 noexpandtab autoindent
|
||||||
\ fileformat=unix
|
\ fileformat=unix
|
||||||
|
|
||||||
" Linux kernel style tabs - not for cpp
|
" Linux kernel style tabs - not for cpp
|
||||||
" au BufNewFile,BufRead,BufEnter *.c,*.h,*.cpp
|
" au BufNewFile,BufRead,BufEnter *.c,*.h,*.cpp
|
||||||
au BufNewFile,BufRead,BufEnter *.c,*.h
|
au BufNewFile,BufRead,BufEnter *.c,*.h
|
||||||
\ set tabstop=8 shiftwidth=8 softtabstop=8 noexpandtab autoindent
|
\ set tabstop=8 shiftwidth=8 softtabstop=8 noexpandtab autoindent
|
||||||
\ textwidth=79 fileformat=unix omnifunc=lsp#complete
|
\ textwidth=79 fileformat=unix omnifunc=lsp#complete
|
||||||
|
|
||||||
au BufNewFile,BufRead,BufEnter *.cpp,*.h,*.hpp
|
au BufNewFile,BufRead,BufEnter *.cpp,*.h,*.hpp
|
||||||
\ set tabstop=4 shiftwidth=4 softtabstop=4 noexpandtab autoindent
|
\ set tabstop=4 shiftwidth=4 softtabstop=4 noexpandtab autoindent
|
||||||
\ textwidth=79 fileformat=unix omnifunc=lsp#complete ft=cpp
|
\ textwidth=79 fileformat=unix omnifunc=lsp#complete ft=cpp
|
||||||
" \ textwidth=79 fileformat=unix
|
" \ textwidth=79 fileformat=unix
|
||||||
au FileType cpp
|
au FileType cpp
|
||||||
\ set tabstop=4 shiftwidth=4 softtabstop=4 noexpandtab autoindent
|
\ set tabstop=4 shiftwidth=4 softtabstop=4 noexpandtab autoindent
|
||||||
\ textwidth=79 fileformat=unix omnifunc=lsp#complete
|
\ textwidth=79 fileformat=unix omnifunc=lsp#complete
|
||||||
" \ textwidth=79 fileformat=unix
|
" \ textwidth=79 fileformat=unix
|
||||||
|
|
||||||
|
|
||||||
au FileType tex setlocal tabstop=2
|
au FileType tex setlocal tabstop=2
|
||||||
|
|
||||||
au BufNewFile,BufRead,BufEnter *.tex
|
au BufNewFile,BufRead,BufEnter *.tex
|
||||||
\ setlocal tabstop=2 shiftwidth=2 softtabstop=2 expandtab autoindent
|
\ setlocal tabstop=2 shiftwidth=2 softtabstop=2 expandtab autoindent
|
||||||
\ textwidth=79 fileformat=unix conceallevel=0
|
\ textwidth=79 fileformat=unix conceallevel=0
|
||||||
|
|
||||||
au BufNewFile,BufRead,BufEnter *.bib
|
au BufNewFile,BufRead,BufEnter *.bib
|
||||||
\ setlocal ft=bib tabstop=2 shiftwidth=2 softtabstop=2 noexpandtab autoindent
|
\ setlocal ft=bib tabstop=2 shiftwidth=2 softtabstop=2 noexpandtab autoindent
|
||||||
\ fileformat=unix conceallevel=0
|
\ fileformat=unix conceallevel=0
|
||||||
|
|
||||||
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab indentkeys-=0#
|
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab indentkeys-=0#
|
||||||
\ indentkeys-=<:> foldmethod=indent nofoldenable
|
\ indentkeys-=<:> foldmethod=indent nofoldenable
|
||||||
|
|
||||||
au BufNewFile,BufRead,BufEnter *.cs
|
au BufNewFile,BufRead,BufEnter *.cs
|
||||||
\ setlocal ft=cs tabstop=4 shiftwidth=4 softtabstop=4 noexpandtab autoindent
|
\ setlocal ft=cs tabstop=4 shiftwidth=4 softtabstop=4 noexpandtab autoindent
|
||||||
\ textwidth=79 fileformat=unix conceallevel=0
|
\ textwidth=79 fileformat=unix conceallevel=0
|
||||||
|
|
||||||
au BufNewFile,BufRead *.cshtml
|
au BufNewFile,BufRead *.cshtml
|
||||||
\ setlocal ft=csh tabstop=4 shiftwidth=4 softtabstop=4 noexpandtab autoindent
|
\ setlocal ft=csh tabstop=4 shiftwidth=4 softtabstop=4 noexpandtab autoindent
|
||||||
\ textwidth=79 fileformat=unix conceallevel=0
|
\ textwidth=79 fileformat=unix conceallevel=0
|
||||||
|
|
||||||
" no autocomments, for example when entering insert mode above or below a
|
" no autocomments, for example when entering insert mode above or below a
|
||||||
" commented line
|
" commented line
|
||||||
autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
|
autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
|
||||||
|
augroup END
|
||||||
|
|
||||||
|
|
||||||
augroup line_too_long
|
augroup line_too_long
|
||||||
|
Loading…
Reference in New Issue
Block a user