chezmoi.vim icon indicating copy to clipboard operation
chezmoi.vim copied to clipboard

Is it possible to autodetect ~/.config/conky/conky.conf as a lua file?

Open vbrand1984 opened this issue 1 year ago • 1 comments

As the title says. I have a templated conky.conf.tmpl, the plugin makes a reasonable suggestion that this is a chezmoi template file, but the truth is, conky config is written in lua, and this should be lua.chezmoitmpl, as far as I get it.

After enabling this plugin, my own makeshift autocmd rules in vimrc cease to work, alas.

vbrand1984 avatar Jun 25 '24 15:06 vbrand1984

Making your autocmd rules that detects file type belong in the filetypedetect group could make it work for you because this plugin runs all autocmds only belonging in the filetypedetect group as that should include all autocmds that detects file type.

For example, editing your .vimrc or .vim/vimrc as follows should fix it:

"autocmd BufRead,BufNewFile *conky.conf setlocal filetype=lua
augroup filetypedetect
  autocmd! BufRead,BufNewFile *conky.conf setfiletype lua
augroup END

Or making .vim/filetype.vim with these contents this should also work:

if exists('did_load_filetypes')
  finish
endif

augroup filetypedetect
  autocmd! BufRead,BufNewFile *conky.conf setfiletype lua
augroup END

You can see more details at vimhelp.org.

alker0 avatar Jul 01 '24 01:07 alker0

Hi, has this issue been resolved in your environment? I've decided to close this issue as an old, but since this topic remains important to other users, I'll keep it pinned.

alker0 avatar Oct 04 '25 10:10 alker0