Closed ttys3 closed 2 years ago
Also happens to me when I open .bash_profile.
Update: sourcing dist#ft breaks the plugin. Do this instead:
local function bash_literal()
vim.bo.filetype = 'sh'
vim.b.is_bash = true
end
require('filetype').setup {
overrides = {
function_literal = {
['.bashrc'] = bash_literal,
['.bash_profile'] = bash_literal,
['.bash_history'] = bash_literal,
['.bash_logout'] = bash_literal,
... -- more overrides
},
... -- even more overrides
}
}
Here's a bandaid for packer.nvim users:
use {
'nathom/filetype.nvim',
setup = [[vim.cmd('runtime! autoload/dist/ft.vim')]],
... -- config and whatever else
}
This command should probably be included in the plugin. (related to #9)
I'm also experiencing this with any .bash*
file. The band-aid above works with a single complex rule as a workaround:
require('filetype').setup {
overrides = {
complex = {
['.*/.bash.*'] = bash_literal,
},
},
}
I am seeing this now in the nighly neovim builds.
I suspect because of this bullet
filetype.vim is removed in favor of lua-filetype (Note that filetype logic and tests still align with Vim, so additions or changes need to be contributed there first.) See https://github.com/neovim/neovim/pull/20674.
I believe what I'm seeing is the same as https://github.com/nathom/filetype.nvim/issues/91