mirror of
https://github.com/nmasur/dotfiles
synced 2024-12-24 02:34:52 +00:00
inject bash highlighting in nix shell scripts
This commit is contained in:
parent
02fc29c482
commit
2c663347ee
@ -144,6 +144,7 @@
|
||||
(import ./overlays/neovim-plugins.nix inputs)
|
||||
(import ./overlays/calibre-web.nix)
|
||||
(import ./overlays/disko.nix inputs)
|
||||
(import ./overlays/tree-sitter-bash.nix)
|
||||
];
|
||||
|
||||
# System types to support.
|
||||
|
@ -3,19 +3,28 @@
|
||||
plugins = [
|
||||
(pkgs.vimPlugins.nvim-treesitter.withPlugins (_plugins:
|
||||
with pkgs.tree-sitter-grammars; [
|
||||
tree-sitter-hcl
|
||||
tree-sitter-python
|
||||
tree-sitter-lua
|
||||
tree-sitter-nix
|
||||
tree-sitter-bash
|
||||
tree-sitter-fish
|
||||
tree-sitter-hcl
|
||||
tree-sitter-json
|
||||
tree-sitter-lua
|
||||
tree-sitter-markdown
|
||||
tree-sitter-markdown-inline
|
||||
tree-sitter-nix
|
||||
tree-sitter-python
|
||||
tree-sitter-toml
|
||||
tree-sitter-yaml
|
||||
tree-sitter-json
|
||||
]))
|
||||
pkgs.vimPlugins.vim-matchup # Better % jumping in languages
|
||||
pkgs.vimPlugins.playground # Tree-sitter experimenting
|
||||
pkgs.vimPlugins.nginx-vim
|
||||
pkgs.vimPlugins.vim-helm
|
||||
pkgs.vimPlugins.vim-puppet
|
||||
(pkgs.vimUtils.buildVimPluginFrom2Nix {
|
||||
pname = "nmasur";
|
||||
version = "0.1";
|
||||
src = ../plugin;
|
||||
})
|
||||
];
|
||||
|
||||
setup."nvim-treesitter.configs" = {
|
||||
|
@ -0,0 +1,8 @@
|
||||
expression: (apply_expression
|
||||
function: (apply_expression
|
||||
function: (select_expression
|
||||
attrpath: (attrpath) @writeshell (#match? @writeshell "^writeShell.*$")
|
||||
)
|
||||
)
|
||||
(indented_string_expression) @bash
|
||||
)
|
16
overlays/tree-sitter-bash.nix
Normal file
16
overlays/tree-sitter-bash.nix
Normal file
@ -0,0 +1,16 @@
|
||||
# Fix: bash highlighting doesn't work as of this commit:
|
||||
# https://github.com/NixOS/nixpkgs/commit/49cce41b7c5f6b88570a482355d9655ca19c1029
|
||||
|
||||
_final: prev: {
|
||||
tree-sitter-grammars = prev.tree-sitter-grammars // {
|
||||
tree-sitter-bash = prev.tree-sitter-grammars.tree-sitter-bash.overrideAttrs
|
||||
(old: {
|
||||
src = prev.fetchFromGitHub {
|
||||
owner = "tree-sitter";
|
||||
repo = "tree-sitter-bash";
|
||||
rev = "493646764e7ad61ce63ce3b8c59ebeb37f71b841";
|
||||
sha256 = "sha256-gl5F3IeZa2VqyH/qFj8ey2pRbGq4X8DL5wiyvRrH56U=";
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user