zaiste / vimified

Yet another Vim configuration
http://zaiste.github.com/vimified/
686 stars 130 forks source link

Seems that I can’t load filetype #130

Closed AleksNovak closed 7 years ago

AleksNovak commented 7 years ago

Hi, I’m trying to add filetype parameter in my shebang but it seems it doesn’t load :(

As describe here:

I added # vim:ft=ansible: at the top of my file Unfortunatly when I do SyntasticInfo it doesn’t detect it.

Syntastic version: 3.8.0-52 (Vim 800, Linux)
Info for filetype: yaml
Global mode: active
Passive filetypes: css html slim
Filetype yaml is active
The current file will be checked automatically
Available checkers: -
Currently enabled checkers: -

Some output:

$ grep -Ri filetype ~/.vimified/*vimrc
.vimified/local.vimrc:filetype on
.vimified/vimrc:filetype on
.vimified/vimrc:    au! BufNewFile,BufRead /tmp/bash-fc* setfiletype sh
.vimified/vimrc:    let g:syntastic_mode_map = { 'mode': 'active', 'active_filetypes': ['ruby', 'python', ], 'passive_filetypes': ['html', 'css', 'slim'] }
.vimified/vimrc:    autocmd FileType gitcommit set tw=68 spell
.vimified/vimrc:    autocmd FileType gitcommit setlocal foldmethod=manual
.vimified/vimrc:    autocmd FileType ruby,eruby,yaml set tw=80 ai sw=2 sts=2 et
.vimified/vimrc:    autocmd FileType ruby,eruby,yaml setlocal foldmethod=manual
.vimified/vimrc:    au BufNewFile,BufReadPost *.md set filetype=markdown
.vimified/vimrc:filetype plugin indent on
.vimified/vimrc:    au FileType vim setlocal foldmethod=marker
.vimified/vimrc:    au FileType help setlocal textwidth=78
.vimified/vimrc:" Send visual selection to gist.github.com as a private, filetyped Gist
$ grep -Ri filetype ~/.vimified/bundle/vim-ansible-yaml/
.vimified/bundle/vim-ansible-yaml/ftplugin/ansible.vim:" Ansible/YAML filetype plugin
.vimified/bundle/vim-ansible-yaml/README.md:A file is recognized as an Ansible YAML file, and its filetype is set to `ansible`, if
.vimified/bundle/vim-ansible-yaml/ftdetect/ansible.vim:fun! s:SelectAnsible(fileType)
.vimified/bundle/vim-ansible-yaml/ftdetect/ansible.vim:  " Bail out if 'filetype' is already set to "ansible".
.vimified/bundle/vim-ansible-yaml/ftdetect/ansible.vim:    execute "set filetype=" . a:fileType . '.yaml'
.vimified/bundle/vim-ansible-yaml/ftdetect/ansible.vim:      execute "set filetype=" . a:fileType

If I do it manually, it's working. For now, I add my path into after.vimrc to autocmd ~/*ansible*/*.yml set filetype=ansible

I'm sure I’m just missing something.

Anyway, thank you for that vimplugin, it'’s really a great tool :1st_place_medal:

AleksNovak commented 7 years ago

I’m back, Found how to finally work with it. I was looking for the wrong pattern, it's called modeline So, that’s how I fixed it: ~/.vimified/after.vimrc

" Activate mode lines
set nocompatible
filetype plugin on
set modeline
set modelines=5
zaiste commented 7 years ago

@AleksNovak great, you figured it out and thanks for the kind words!