# Mardown files always have vimwiki filetype (vimwiki plugin)

Here is the relevant content of my .vimrc

let g:vimwiki_global_ext=0
let g:vimwiki_list = [{'path': 'C:\Users\<USER>\vimwiki',
\ 'syntax': 'markdown', 'ext': '.md'}]


The plugin mapping <leader>ww creates a new file called index.md in C:\Users\<USER>\vimwiki as expected. So I suppose path is correct.

My problem is that :set ft? of the index.md file is always set to vimwiki (filetype=vimwiki). I don't know what settings are wrong here?

Note that vimwiki is in /opt instead of /start.

This is the expected behavior of the plugin when you create a file in your vimwiki the filetype is set to vimwiki.
If you don't want files created outside of the wiki directory to have this filetype you can follow this issue and add the following line to your .vimrc:
let g:vimwiki_global_ext = 0

• How to set .md file in wiki directory has filetype mardown?. Because of highlights depend on filetype, if a buffer use markdown syntax but has filetype vimwiki, the highlight is totally incorrect. – Tuyen Pham Jun 20 '18 at 8:12
• @TuyenPham To force the markdown filetype you could use an autocommand like autocmd BufNewFile,BufReadPost /path/to/vimwiki/* set filetype=markdown but I think that might break the plugin. You should try asking your question to the maintainer directly on the plugin's issue tracker – statox Jun 20 '18 at 8:55
• Didn't work: autocmd BufNewFile,BufReadPost C:\Users\<USER>\vimwiki\* set filetype=markdown in vimrc, restart gvim and it's still vimwiki from :set ft?. I already asked in issue tracker but haven't got reply yet. – Tuyen Pham Jun 20 '18 at 9:45