pearofducks / ansible-vim

A vim plugin for syntax highlighting Ansible's common filetypes
MIT License
796 stars 98 forks source link

Fix autodetection #56

Closed hurricanehrndz closed 6 years ago

hurricanehrndz commented 6 years ago

Auto-detection is too aggressive, other well know yaml files get picked up.

pearofducks commented 6 years ago

Could you clarify "too aggressive" and what other files are being picked up that shouldn't be?

That function hasn't been touched in over 2 years and no one has had an issue with it amongst quite a lot of users. :)

hurricanehrndz commented 6 years ago

Picks up kitchen and Travis files within role directories. This request allows disabling of the function and also adds check for Travis and kitchen

On Fri, Mar 30, 2018, 7:58 AM Dave Honneffer notifications@github.com wrote:

Could you clarify "too aggressive" and what other files are being picked up that shouldn't be?

That function hasn't been touched in over 2 years and no one has had an issue with it amongst quite a lot of users. :)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pearofducks/ansible-vim/pull/56#issuecomment-377529700, or mute the thread https://github.com/notifications/unsubscribe-auth/AFiQzdGJB5v0SgqG8OCsJHjDSEfOF6Ahks5tjjnWgaJpZM4TBszP .

pearofducks commented 6 years ago

I agree this is less than ideal, but I don't agree with solving this by trying to place exceptions for every *.yaml that isn't an Ansible file. This can very easily be solved in your own vimrc through autocommands and since each individual will have 0-n *.yaml they want excepted I think this is the best approach.

hurricanehrndz commented 6 years ago

Okay, understood and agreed, can we at least have the option to disable the included Auto detection. I can not have kitchen and Travis and yaml files toggling back and forth from file types yaml to yaml.ansible and back to yaml, it really messes with language servers and trying to get auto complete working with ansible and so on. Also, I think it is just good practice to have the Auto commands in Auto group. I can modify it accordingly if you agree the changes are acceptable.

On Fri, Mar 30, 2018, 9:18 AM Dave Honneffer notifications@github.com wrote:

I agree this is less than ideal, but I don't agree with solving this by trying to place exceptions for every .yaml that isn't an Ansible file. This can very easily be solved in your own vimrc through autocommands and since each individual will have 0-n .yaml they want excepted I think this is the best approach.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pearofducks/ansible-vim/pull/56#issuecomment-377547607, or mute the thread https://github.com/notifications/unsubscribe-auth/AFiQzW_upEzQI63fyw-XCwRdHgNNy35Iks5tjkzDgaJpZM4TBszP .

hurricanehrndz commented 6 years ago

While we are chatting I do have another question unrelated. It is in regards to stephpy/vim-yaml plugin, when used I lose the orange highlighting like in your example image.

On Fri, Mar 30, 2018, 9:28 AM Carlos Hernandez carlos@techbyte.ca wrote:

Okay, understood and agreed, can we at least have the option to disable the included Auto detection. I can not have kitchen and Travis and yaml files toggling back and forth from file types yaml to yaml.ansible and back to yaml, it really messes with language servers and trying to get auto complete working with ansible and so on. Also, I think it is just good practice to have the Auto commands in Auto group. I can modify it accordingly if you agree the changes are acceptable.

On Fri, Mar 30, 2018, 9:18 AM Dave Honneffer notifications@github.com wrote:

I agree this is less than ideal, but I don't agree with solving this by trying to place exceptions for every .yaml that isn't an Ansible file. This can very easily be solved in your own vimrc through autocommands and since each individual will have 0-n .yaml they want excepted I think this is the best approach.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pearofducks/ansible-vim/pull/56#issuecomment-377547607, or mute the thread https://github.com/notifications/unsubscribe-auth/AFiQzW_upEzQI63fyw-XCwRdHgNNy35Iks5tjkzDgaJpZM4TBszP .

pearofducks commented 6 years ago

If it is causing problems with other plugins then sure, we can provide an option to disable ftdetect for Ansible files!

hurricanehrndz commented 6 years ago

Thank you, I think adding the au commands to a group for ftdetect will suffice. I can then use an after plugin to erase the group and develop my own detection. I really appreciate your help. Keep an eye out on LanguageClient-neovim, I will be updating the wiki to document code completion and general yaml linting for ansible.

On Fri, Mar 30, 2018, 10:04 AM Dave Honneffer notifications@github.com wrote:

If it is causing problems with other plugins then sure, we can provide an option to disable ftdetect for Ansible files!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pearofducks/ansible-vim/pull/56#issuecomment-377557953, or mute the thread https://github.com/notifications/unsubscribe-auth/AFiQzR_yOyn0voUEd2cWGeOlryCMc17rks5tjlekgaJpZM4TBszP .