Skip to content

Commit

Permalink
use treesitter language injection
Browse files Browse the repository at this point in the history
  • Loading branch information
ners committed Jan 9, 2024
1 parent 2477485 commit accb305
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 14 deletions.
4 changes: 2 additions & 2 deletions modules/home/neovim/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ with lib;
vimdiffAlias = true;
withNodeJs = true;
withPython3 = true;
extraConfig = mkBefore ''
extraConfig = mkBefore /*vim*/ ''
syntax on
command W w
'';
extraLuaConfig = mkBefore ''
extraLuaConfig = mkBefore /*lua*/ ''
-- bytecompile lua modules
vim.loader.enable()
Expand Down
2 changes: 1 addition & 1 deletion modules/home/neovim/plugins/autopairs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
plugin = pkgs.vimPlugins.nvim-autopairs;
type = "lua";
config = ''
config = /*lua*/ ''
require('nvim-autopairs').setup({})
'';
}
Expand Down
2 changes: 1 addition & 1 deletion modules/home/neovim/plugins/base16.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
plugin = pkgs.vimPlugins.nvim-base16;
type = "viml";
config = ''
config = /*vim*/ ''
colorscheme base16-default-dark
'';
}
Expand Down
2 changes: 1 addition & 1 deletion modules/home/neovim/plugins/gitsigns.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
plugin = pkgs.vimPlugins.gitsigns-nvim;
type = "lua";
config = ''
config = /*lua*/ ''
require('gitsigns').setup({})
'';
}
Expand Down
2 changes: 1 addition & 1 deletion modules/home/neovim/plugins/hlslens.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
plugin = nvim-hlslens;
type = "lua";
config = ''
config = /*lua*/ ''
require("hlslens").setup()
'';
}
Expand Down
2 changes: 1 addition & 1 deletion modules/home/neovim/plugins/illuminate.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
plugin = vim-illuminate;
type = "lua";
config = ''
config = /*lua*/ ''
require('illuminate').configure({})
'';
}
Expand Down
2 changes: 1 addition & 1 deletion modules/home/neovim/plugins/lsp.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{
plugin = lsp_lines-nvim;
type = "lua";
config = ''
config = /*lua*/ ''
-- Disable virtual_text since it's redundant due to lsp_lines.
vim.diagnostic.config({
virtual_text = false,
Expand Down
4 changes: 2 additions & 2 deletions modules/home/neovim/plugins/nix.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
{
home.packages = with pkgs; [ nil nixpkgs-fmt ];

programs.neovim.extraLuaConfig = ''
programs.neovim.extraLuaConfig = /*lua*/ ''
require('lspconfig').nil_ls.setup({})
'';

xdg.configFile."nvim/ftplugin/nix.lua".text = ''
xdg.configFile."nvim/ftplugin/nix.lua".text = /*lua*/ ''
vim.bo.expandtab = true
vim.bo.shiftwidth = 2
vim.bo.softtabstop = 2
Expand Down
2 changes: 1 addition & 1 deletion modules/home/neovim/plugins/scrollbar.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
plugin = nvim-scrollbar;
type = "lua";
config = ''
config = /*lua*/ ''
require("scrollbar").setup()
require("scrollbar.handlers.search").setup()
'';
Expand Down
4 changes: 3 additions & 1 deletion modules/home/neovim/plugins/treesitter/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
{
plugin = nvim-treesitter-context;
type = "lua";
config = "require('treesitter-context').setup({})";
config = /*lua*/ ''
require('treesitter-context').setup({})
'';
}
];
}
2 changes: 1 addition & 1 deletion modules/home/zsh/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

programs.zsh = {
enable = true;
initExtra = ''
initExtra = /*bash*/ ''
source "${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
source "${pkgs.zsh-history-substring-search}/share/zsh-history-substring-search/zsh-history-substring-search.zsh"
source "${pkgs.zsh-autosuggestions}/share/zsh-autosuggestions/zsh-autosuggestions.zsh"
Expand Down
2 changes: 1 addition & 1 deletion modules/profiles/fonts.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ in
emoji = [ "Noto Color Emoji" ];
};

fontconfig.localConf = ''
fontconfig.localConf = /*xml*/ ''
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
Expand Down

0 comments on commit accb305

Please sign in to comment.