Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Broken file type resolution in .chezmoitemplates directory on Windows/Android/macOS #85

@gtbuchanan

Description

@gtbuchanan

File type resolution for files in the .chezmoitemplates directory does not appear to be working correctly. The file type is resolved as chezmoitmpl without the true file type:

vim .chezmoitemplates/vscode_settings.json
:echo &ft
# Output: chezmoitmpl

Expected Output: json.chezmoitmpl

Opening files that end in .tmpl appears to always result in the correct file type (e.g., dot_vimrc.tmpl is vim.chezmoitmpl). This is only occurring for files without the .tmpl extension in the .chezmoitemplates directory (.tmpl is not required here).

I see that the docs say this should be working, so perhaps there is something wrong with my setup

Image

Environment:

  • Windows 11 25H2 (also occurs in Termux on Android 16)
  • Vim v9.1
  • vim-plug latest
  • chezmoi.vim latest

dot_vimrc.tmpl:

" Install vim-plug if not found
let data_dir = '~/.vim'
if empty(glob(data_dir . '/autoload/plug.vim'))
{{- if eq .chezmoi.os "windows" }}
  silent execute '!pwsh -Command "& { Invoke-WebRequest -useb https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim | New-Item ' . data_dir . '/autoload/plug.vim -Force }"'
{{- else }}
  silent execute '!curl -fLo ' . data_dir . '/autoload/plug.vim --create-dirs  https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
{{- end }}
  autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif

" I've tried with and without this
" let g:chezmoi#use_tmp_buffer = 1

call plug#begin(data_dir . '/bundle')

Plug 'alker0/chezmoi.vim'

call plug#end()

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions