Friday, December 4, 2020

Re: Autocommand bug when reloading file

On Wed, Dec 02, 2020 at 03:56:17AM -0600, Felipe Contreras wrote:
>For a while I've configured the indentation preferences for many
>languages and different projects, similar to:
>
> au! FileType sh setl et ts=2
> au! BufRead,BufNewFile */project/*.sh setl noet ts=8

Filetype settings should really go under ~/.vim/after/ftplugin. Try putting this into ~/.after/ftplugin/sh.vim:

if expand('%:p') =~# '/project/[^/]*'
setlocal noexpandtab tabstop=8
else
setlocal expandtab tabstop=2
endif

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20201204121300.GA19235%40rainslide.net.

No comments: