summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Luevano Alvarado <55825613+luevano@users.noreply.github.com>2021-01-06 21:50:52 -0700
committerDavid Luevano Alvarado <55825613+luevano@users.noreply.github.com>2021-01-06 21:50:52 -0700
commit28a52138c566ee92cb2568a139e6a292ba420d8d (patch)
treed704a1c857726e33475bb3cd29c1be6a4333dd6d
parent8da0a7927b2c218b3f09117a01aff274ecaa993c (diff)
Fix indentation on different files while opened at the same time
-rw-r--r--.config/nvim/init.vim12
1 files changed, 10 insertions, 2 deletions
diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim
index e92740e..5b3c98f 100644
--- a/.config/nvim/init.vim
+++ b/.config/nvim/init.vim
@@ -132,10 +132,18 @@ set showcmd
\ set expandtab |
\ set textwidth=79 |
\ set fileformat=unix
- au BufRead,BufNewFile *.py,*.pyw,*.c,*.h match BadWhitespace /\s\+$/
+ au BufAdd,BufEnter,BufRead,BufNewFile *.py,*.pyw,*.c,*.h match BadWhitespace /\s\+$/
+
+ " Some filetypes that require 4 spaces for tabs.
+ au BufAdd,BufEnter,BufNewFile,BufRead *.java
+ \ set tabstop=4 |
+ \ set softtabstop=0 |
+ \ set shiftwidth=4 |
+ \ set noexpandtab |
+ \ set fileformat=unix
" Some filetypes that require 2 spaces for tabs.
- au BufNewFile,BufRead *.xml,*.html
+ au BufAdd,BufEnter,BufNewFile,BufRead *.xml,*.html,*.jsp
\ set tabstop=2 |
\ set softtabstop=2 |
\ set shiftwidth=2 |