From 6e04314a99afd7d7962d0b207199a14e87cc805b Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Sun, 11 Aug 2013 10:01:19 -0500 Subject: [PATCH 1/2] Remove over-eager ftplugin indent settings It's not really appropriate for filetype plugins to set indent-related options. In this case, the appropriate options (autoindent, expandtab, and sw=2) are already being set in indent/slim.vim. smartindent is meant for C-like languages where the normal C indentation doesn't work. There's no reason to use it here (autoindent is what you want, but that's already set in indent/slim.vim). There's no reason to set all of tabstop, softtabstop, and shiftwidth; and when using smarttab, only shiftwidth is required. However, smarttab is a global option with no buffer-local value, so setting it (even with setlocal) changes the option for all buffers. Thus it should be left up to the user. --- ftdetect/slim.vim | 1 - ftplugin/slim.vim | 6 ------ 2 files changed, 7 deletions(-) delete mode 100755 ftplugin/slim.vim diff --git a/ftdetect/slim.vim b/ftdetect/slim.vim index 4c56435..4f0f524 100644 --- a/ftdetect/slim.vim +++ b/ftdetect/slim.vim @@ -1,2 +1 @@ autocmd BufNewFile,BufRead *.slim set syntax=slim|set ft=slim -autocmd FileType slim set tabstop=2|set shiftwidth=2|set expandtab diff --git a/ftplugin/slim.vim b/ftplugin/slim.vim deleted file mode 100755 index 206bea0..0000000 --- a/ftplugin/slim.vim +++ /dev/null @@ -1,6 +0,0 @@ -setlocal tabstop=2 -setlocal softtabstop=2 -setlocal shiftwidth=2 -setlocal smarttab -setlocal expandtab -setlocal smartindent From 1e4e48866b1fc3ad1794ff2fb46c75aefe9264d1 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Sun, 11 Aug 2013 10:48:32 -0500 Subject: [PATCH 2/2] Use setfiletype This is the standard way to set the filetype, and allows syntax.vim to set the correct syntax highlighting automatically. --- ftdetect/slim.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ftdetect/slim.vim b/ftdetect/slim.vim index 4f0f524..b3415ce 100644 --- a/ftdetect/slim.vim +++ b/ftdetect/slim.vim @@ -1 +1 @@ -autocmd BufNewFile,BufRead *.slim set syntax=slim|set ft=slim +autocmd BufNewFile,BufRead *.slim setf slim