diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2017-10-30 14:24:51 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2017-10-30 14:24:51 +1300 |
commit | 93b9d6c0188b075f06ec2b55221f12057eadd17b (patch) | |
tree | 2e4d56bbbf0a10c125d691fe220bbadf0cdbbfc3 /vim | |
parent | Configure indent dynamically based on filetype (diff) | |
download | dotfiles-93b9d6c0188b075f06ec2b55221f12057eadd17b.tar.gz dotfiles-93b9d6c0188b075f06ec2b55221f12057eadd17b.zip |
Revert dynamic filetype indent configuration
This requires more careful thought to avoid stale local options
(:setlocal) for appropriate filetypes.
This reverts commit d3d998c68c335b35525172c700ff958d5a016399.
Diffstat (limited to 'vim')
-rw-r--r-- | vim/config/indent.vim | 31 |
1 files changed, 11 insertions, 20 deletions
diff --git a/vim/config/indent.vim b/vim/config/indent.vim index 1ae8a909..f6dfd416 100644 --- a/vim/config/indent.vim +++ b/vim/config/indent.vim @@ -1,7 +1,14 @@ -" Indent with four literal spaces when 'expandtab' is on +" Adopt the indent of the last line on new lines; interestingly, plugins that +" do clever things with indenting will often assume this is set +set autoindent + +" Use spaces instead of tabs +set expandtab + +" Indent with four spaces when an indent operation is used set shiftwidth=4 -" Insert four spaces when Tab is pressed and 'expandtab' is on +" Insert four spaces when Tab is pressed set softtabstop=4 " How many spaces to show for a literal tab when 'list' is unset @@ -12,22 +19,6 @@ set tabstop=4 set smarttab " When indenting lines with < or >, round the indent to a multiple of -" 'shiftwidth', so even if the line is indented by one space it will indent up -" to 4 and down to 0, for example; all this when 'expandtab' is on +" 'shiftwidth', so even if the line is indented by one space it will indent +" up to 4 and down to 0, for example set shiftround - -" Tabs vs spaces and automatic indentation behaviour depends on there being an -" actual filetype that's more than just plain text (or a Vim help buffer). -function! FileTypeIndentConfig(ft) - if a:ft == '' || a:ft == 'csv' || a:ft == 'help' || a:ft == 'text' - setlocal noautoindent noexpandtab - else - setlocal autoindent expandtab - endif -endfunction - -" Call the function that we just declared each time the filetype is set -augroup dfindent - autocmd! - autocmd FileType * call FileTypeIndentConfig(&filetype) -augroup END |