languages/bash: add filetype mappings for ash, dash and zsh

This commit is contained in:
Snoweuph 2026-04-23 22:52:51 +02:00 committed by Ching Pei Yang
commit 2592c16878
3 changed files with 9 additions and 5 deletions

View file

@ -287,6 +287,8 @@
<https://github.com/nvim-treesitter/nvim-treesitter/blob/main/plugin/filetypes.lua>.
This is mostly use full for Markdown code block injections.
- Added some Tree-sitter filetype mappings for `ash`, `dash` and `zsh`.
- Added `vim.lsp.presets.<name>` to contain LSP configurations. This allows for
more flexibility in nvf and reuse of LSPs across languages. Dropped
`deprecatedSingleOrListOf` in favor of `listOf` for the affected LSP options.

View file

@ -95,15 +95,19 @@ in {
config = mkIf cfg.enable (mkMerge [
(mkIf cfg.treesitter.enable {
vim.treesitter.enable = true;
vim.treesitter.grammars = [cfg.treesitter.package];
vim.treesitter = {
enable = true;
grammars = [cfg.treesitter.package];
# not perfect mappings, but better than none
filetypeMappings.bash = ["ash" "dash" "zsh"];
};
})
(mkIf cfg.lsp.enable {
vim.lsp = {
presets = genAttrs cfg.lsp.servers (_: {enable = true;});
servers = genAttrs cfg.lsp.servers (_: {
filetypes = ["bash" "sh" "zsh"];
filetypes = ["bash" "sh" "ash" "dash" "zsh"];
});
};
})

View file

@ -158,8 +158,6 @@ in {
};
config = mkIf cfg.enable (mkMerge [
{vim.globals.markdown_fenced_languages = ["ts=typescript"];}
(mkIf cfg.treesitter.enable {
vim.treesitter.enable = true;
vim.treesitter.grammars = [