-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: opiniated syntax hilighting plugins
- Loading branch information
Zoey de Souza Pessanha
committed
May 27, 2023
1 parent
14efe00
commit d542e41
Showing
6 changed files
with
229 additions
and
53 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
./surround.nix | ||
./telescope.nix | ||
./theme.nix | ||
./treesitter.nix | ||
./visuals.nix | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
{ pkgs, lib, config, ... }: | ||
|
||
let | ||
inherit (pkgs) neovimPlugins; | ||
inherit (lib) mkEnableOption mkIf withPlugins writeIf; | ||
cfg = config.lvim.treesitter; | ||
in | ||
{ | ||
options.lvim.treesitter = { | ||
enable = mkEnableOption "Enables tree-sitter [nvim-treesitter]"; | ||
autotag.enable = mkEnableOption "Enables auto tagging"; | ||
context.enable = mkEnableOption "Enables block context"; | ||
rainbow.enable = mkEnableOption "Enables rainbow colored pairs"; | ||
}; | ||
|
||
config.lvim = mkIf cfg.enable { | ||
startPlugins = with neovimPlugins; ( | ||
(withPlugins cfg.autotag.enable [ nvim-ts-autotag ]) ++ | ||
(withPlugins cfg.autotag.enable [ nvim-ts-context ]) ++ | ||
(withPlugins cfg.autotag.enable [ nvim-ts-rainbow ]) ++ | ||
[ nvim-ts ] | ||
); | ||
globals = { | ||
"foldmethod" = "expr"; | ||
"foldexpr" = "nvim_treesitter#foldexpr()"; | ||
"nofoldenable" = 1; | ||
}; | ||
rawConfig = '' | ||
-- TRESSITTER | ||
require('nvim-treesitter.configs').setup({ | ||
highlight = { | ||
enable = true, | ||
use_languagetree = true, | ||
}, | ||
${writeIf cfg.rainbow.enable '' | ||
rainbow = { | ||
enable = true, | ||
query = 'rainbow-parens', | ||
strategy = require('ts-rainbow').strategy.global, | ||
}, | ||
''} | ||
${writeIf cfg.autotag.enable '' | ||
autotag = { | ||
enable = true, | ||
}, | ||
''} | ||
}) | ||
${writeIf cfg.context.enable '' | ||
require'treesitter-context'.setup { | ||
enable = true, | ||
throttle = true, | ||
max_lines = 0 | ||
} | ||
''} | ||
-- END TRESSITTER | ||
''; | ||
}; | ||
} |