Questions tagged [ftdetect]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
32 views

Setting ftdetect a given directory

I'm looking for a way to set filetype on load, a loading phase via ftdetect. Right now I can open the files inside a given directory via some utility function that I wrote, and during the opening ...
3
votes
1answer
151 views

How to do file type detection based on file contents (e.g. a certain shebang line)?

I have created a few scripts in .vim/ftdetct to e.g. detect the filetype of sshconfig files based on their filename: autocmd BufRead,BufNewFile ~/.ssh/host-* setfiletype sshconfig Now, how can I make ...
4
votes
2answers
266 views

Is it possible to override the filetype of a text file based on the first line?

I have some specifically formatted text files that I'd like to detect when I start vim. When I load these files now, the filetype is automatically set to text. I only want to override that if the ...
0
votes
1answer
69 views

Why are files in after/ftplugin/ run on every save, and can I work around it?

I have a variety of vimscripts for different filetypes in ~/.vim/after/ftplugin, e.g. text.vim, vim.vim, etc. These contain a variety of settings, mappings, etc. Only recently, I've noticed (not sure ...