Skip to content

Commit

Permalink
nix: Add syntax highlighting to strings
Browse files Browse the repository at this point in the history
Note that alejandra currently does not handle these comments properly.

See: kamadorueda/alejandra#366
  • Loading branch information
donovanglover committed Jun 11, 2023
1 parent e42bfc0 commit 31ad806
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 36 deletions.
70 changes: 35 additions & 35 deletions modules/neovim/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ in {
{
programs.neovim = {
enable = true;
extraConfig = ''
extraConfig = /* vim */ ''
filetype plugin indent on
set undofile
set spell
Expand Down Expand Up @@ -74,7 +74,7 @@ in {
{
plugin = nvim-tree-lua;
type = "lua";
config = ''
config = /* lua */ ''
require("nvim-tree").setup()
vim.api.nvim_create_autocmd({"QuitPre"}, {
Expand Down Expand Up @@ -121,36 +121,36 @@ in {
{
plugin = nvim-lspconfig;
type = "lua";
config = "
local lspconfig = require('lspconfig')
lspconfig.nil_ls.setup {}
lspconfig.rust_analyzer.setup {}
lspconfig.marksman.setup {}
lspconfig.gopls.setup {}
lspconfig.lua_ls.setup {}
lspconfig.clangd.setup {}
lspconfig.texlab.setup {}
lspconfig.crystalline.setup {}
vim.keymap.set('n', '<space>e', vim.diagnostic.open_float)
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev)
vim.keymap.set('n', ']d', vim.diagnostic.goto_next)
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist)
vim.api.nvim_create_autocmd('LspAttach', {
group = vim.api.nvim_create_augroup('UserLspConfig', {}),
callback = function(ev)
local opts = { buffer = ev.buf }
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts)
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts)
vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts)
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts)
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, opts)
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, opts)
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, opts)
vim.keymap.set({ 'n', 'v' }, '<space>ca', vim.lsp.buf.code_action, opts)
vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts)
end,
})
";
config = /* lua */ ''
local lspconfig = require('lspconfig')
lspconfig.nil_ls.setup {}
lspconfig.rust_analyzer.setup {}
lspconfig.marksman.setup {}
lspconfig.gopls.setup {}
lspconfig.lua_ls.setup {}
lspconfig.clangd.setup {}
lspconfig.texlab.setup {}
lspconfig.crystalline.setup {}
vim.keymap.set('n', '<space>e', vim.diagnostic.open_float)
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev)
vim.keymap.set('n', ']d', vim.diagnostic.goto_next)
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist)
vim.api.nvim_create_autocmd('LspAttach', {
group = vim.api.nvim_create_augroup('UserLspConfig', {}),
callback = function(ev)
local opts = { buffer = ev.buf }
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts)
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts)
vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts)
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts)
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, opts)
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, opts)
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, opts)
vim.keymap.set({ 'n', 'v' }, '<space>ca', vim.lsp.buf.code_action, opts)
vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts)
end,
})
'';
}
{
plugin = nvim-base16;
Expand All @@ -160,7 +160,7 @@ in {
{
plugin = lualine-nvim;
type = "lua";
config = ''
config = /* lua */ ''
local theme = require("lualine.themes.base16")
theme.normal.b.bg = nil
theme.normal.c.bg = nil
Expand Down Expand Up @@ -206,7 +206,7 @@ in {
}
{
plugin = vimtex;
config = ''
config = /* vim */ ''
" Disable all keybinds so we can define our own
let g:vimtex_mappings_enabled = 0
let g:vimtex_imaps_enabled = 0
Expand All @@ -222,7 +222,7 @@ in {
}
{
plugin = vim-startify;
config = ''
config = /* vim */ ''
let g:startify_custom_header = startify#pad(split(system("${pkgs.fish}/bin/fish -c 'cat (random choice (${pkgs.fd}/bin/fd . ${pkgs.ponysay}/share/ponysay/quotes --ignore-file ~/.config/fd/ponyignore))'"), '\n'))
let g:startify_change_to_dir = 0
Expand Down
2 changes: 1 addition & 1 deletion modules/waycorner/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

home-manager.sharedModules = [
{
xdg.configFile."waycorner/config.toml".text = ''
xdg.configFile."waycorner/config.toml".text = /* toml */ ''
[application_launcher]
enter_command = [ "hyprctl", "dispatch", "workspace", "empty" ]
exit_command = [ "${pkgs.lnch}/bin/lnch", "${pkgs.rofi}/bin/rofi", "-show", "drun" ]
Expand Down

0 comments on commit 31ad806

Please sign in to comment.