1
Fork 0

Make purescript work inside neovim

This commit is contained in:
prescientmoon 2024-02-24 01:53:32 +01:00
parent fd3af8a1f6
commit eb9d1d2814
Signed by: prescientmoon
SSH key fingerprint: SHA256:UUF9JT2s8Xfyv76b8ZuVL7XrmimH4o49p4b+iexbVH4
10 changed files with 405 additions and 409 deletions

View file

@ -1,24 +1,9 @@
{ pkgs, ... }: {
stylix.fonts = {
monospace = {
name = "Iosevka";
package = pkgs.iosevka;
};
# monospace = {
# name = "Cascadia Code";
# package = pkgs.cascadia-code;
# };
sansSerif = {
name = "CMUSansSerif";
package = pkgs.cm_unicode;
};
serif = {
name = "CMUSerif-Roman";
package = pkgs.cm_unicode;
};
# monospace = { name = "Iosevka"; package = pkgs.iosevka; };
monospace = { name = "Cascadia Code"; package = pkgs.cascadia-code; };
sansSerif = { name = "CMUSansSerif"; package = pkgs.cm_unicode; };
serif = { name = "CMUSerif-Roman"; package = pkgs.cm_unicode; };
sizes = {
desktop = 13;

View file

@ -2045,11 +2045,11 @@
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1701718080,
"narHash": "sha256-6ovz0pG76dE0P170pmmZex1wWcQoeiomUZGggfH9XPs=",
"lastModified": 1708475490,
"narHash": "sha256-g1v0TsWBQPX97ziznfJdWhgMyMGtoBFs102xSYO4syU=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "2c7f3c0fb7c08a0814627611d9d7d45ab6d75335",
"rev": "0e74ca98a74bc7270d28838369593635a5db3260",
"type": "github"
},
"original": {

View file

@ -1,19 +1 @@
-- Use vt to test
vim.keymap.set(
"n",
"<leader>vt",
':VimuxRunCommand "clear && spago test"<CR>',
{ desc = "[V]imtex run [t]ests", buffer = true }
)
-- Use vb to build
vim.keymap.set(
"n",
"<leader>vb",
':VimuxRunCommand "clear && spago build"<CR>',
{ desc = "[V]imtex [b]uild", buffer = true }
)
vim.opt.expandtab = true -- Use spaces for the tab char
require("my.abbreviations.fp").setup()

View file

@ -1,74 +1,69 @@
{
"LuaSnip": { "branch": "master", "commit": "118263867197a111717b5f13d954cd1ab8124387" },
"alpha-nvim": { "branch": "main", "commit": "29074eeb869a6cbac9ce1fbbd04f5f5940311b32" },
"catppuccin": { "branch": "main", "commit": "079500a625f3ae5aa6efb758f1a17fe4c7a57e52" },
"alpha-nvim": { "branch": "main", "commit": "1356b9ef31b985d541d94314f2cf73c61124bf1d" },
"catppuccin": { "branch": "main", "commit": "9703f227bfab20d04bcee62d2f08f1795723b4ae" },
"clipboard-image": { "branch": "main", "commit": "485de5493d196154db30f85665f8ac480ce116a2" },
"cmp": { "branch": "main", "commit": "538e37ba87284942c1d76ed38dd497e54e65b891" },
"cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" },
"cmp-digraphs": { "branch": "master", "commit": "5efc1f0078d7c5f3ea1c8e3aad04da3fd6e081a9" },
"cmp-emoji": { "branch": "main", "commit": "19075c36d5820253d32e2478b6aaf3734aeaafa0" },
"cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" },
"cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
"conform": { "branch": "master", "commit": "48bc9996ebfe90e7766f46338360f75fd6ecb174" },
"crates": { "branch": "main", "commit": "b8ea20fda2e1029fbbb1bae7a9eab35c84037ca0" },
"conform": { "branch": "master", "commit": "192a6d2ddace343f1840a8f72efe2315bd392243" },
"crates": { "branch": "main", "commit": "ec2b04a380c9f3a8e6ca38c230e4990d71978143" },
"discord-rich-presence": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" },
"dressing": { "branch": "master", "commit": "94b0d24483d56f3777ee0c8dc51675f21709318c" },
"dressing.nvim": { "branch": "master", "commit": "94b0d24483d56f3777ee0c8dc51675f21709318c" },
"edit-code-block": { "branch": "main", "commit": "5e4e31012eafa113216cb5894f696682833f8e7f" },
"dressing": { "branch": "master", "commit": "6f212262061a2120e42da0d1e87326e8a41c0478" },
"fidget": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" },
"flash": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" },
"ftft": { "branch": "master", "commit": "09a72f9adf8ee7c824c517ef8408c9e687453039" },
"ftft": { "branch": "master", "commit": "f3e43c9584e14b27f04c27a95a9d9f0e58dfec02" },
"github-actions": { "branch": "master", "commit": "f2f16243447cea174daa6b4a9ffd3ff9213814ef" },
"gitlinker": { "branch": "master", "commit": "cc59f732f3d043b626c8702cb725c82e54d35c25" },
"gitsigns": { "branch": "main", "commit": "d195f0c35ced5174d3ecce1c4c8ebb3b5bc23fa9" },
"harpoon": { "branch": "master", "commit": "867e212ac153e793f95b316d1731f3ca1894625e" },
"gitsigns": { "branch": "main", "commit": "2c2463dbd82eddd7dbab881c3a62cfbfbe3c67ae" },
"harpoon": { "branch": "master", "commit": "ccae1b9bec717ae284906b0bf83d720e59d12b91" },
"haskell-tools": { "branch": "master", "commit": "92e097c6832405fb64e4c44a7ce8bebe7836cae6" },
"hydra.nvim": { "branch": "master", "commit": "3ced42c0b6a6c85583ff0f221635a7f4c1ab0dd0" },
"hyprland": { "branch": "main", "commit": "be665459a21730a6acdfaa9c6352cda5e4763af6" },
"hyprland": { "branch": "main", "commit": "71760fe0cad972070657b0528f48456f7e0027b2" },
"idris": { "branch": "main", "commit": "8bff02984a33264437e70fd9fff4359679d910da" },
"inc-rename": { "branch": "main", "commit": "6f9b5f9cb237e12935144cdc535322b8c93c1b25" },
"indent-blankline": { "branch": "master", "commit": "7206c77cb931f79885fc47f88ae18f99148392eb" },
"indent-blankline": { "branch": "master", "commit": "821a7acd88587d966f7e464b0b3031dfe7f5680c" },
"lastplace": { "branch": "main", "commit": "0bb6103c506315044872e0f84b1f736c4172bb20" },
"lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" },
"lean": { "branch": "main", "commit": "a5daac8ebccb93af25ace2a2041b503f18ff3dcb" },
"lazy.nvim": { "branch": "main", "commit": "aedcd79811d491b60d0a6577a9c1701063c2a609" },
"lean": { "branch": "main", "commit": "1a2a2dfbc7e6775e9ec8b84e5eadaf31fde1894e" },
"live-command": { "branch": "main", "commit": "d460067d47948725a6f25b20f31ea8bbfdfe4622" },
"lspkind.nvim": { "branch": "master", "commit": "57610d5ab560c073c465d6faf0c19f200cb67e6e" },
"luasnip": { "branch": "master", "commit": "118263867197a111717b5f13d954cd1ab8124387" },
"mini.base16": { "branch": "main", "commit": "867265505d5147af45d38ca120bbfddaa43e61aa" },
"mini.colors": { "branch": "main", "commit": "a6b594b7cc07a55fd9e9698be2ff5d2194fd4ac6" },
"mini.comment": { "branch": "main", "commit": "3d9c8009615857e982f09bc5357fc95f2a2175f3" },
"mini.files": { "branch": "main", "commit": "173d73f5d0b2a9abbb2d6533a3770fdbbd0c4dcc" },
"mini.operators": { "branch": "main", "commit": "7a97e2528a4c274e9da8953d3ba22f493c360a9f" },
"mini.pairs": { "branch": "main", "commit": "552062017ff207e1f35f7028bfb3f27c7421d22d" },
"mini.statusline": { "branch": "main", "commit": "950d9029c7ed901b67c839e74478f784b7432665" },
"mini.surround": { "branch": "main", "commit": "af8129efcabe95fc08a233e9f91569829bed031f" },
"neoconf": { "branch": "main", "commit": "64437787dba70fce50dad7bfbb97d184c5bc340f" },
"neodev.nvim": { "branch": "main", "commit": "c4ce017bd4bacf60bf59330cec9e93c5d5e104a6" },
"neogit": { "branch": "master", "commit": "761e9be2aa7cc4c8ca87f10c8c37108a687b928e" },
"nui": { "branch": "main", "commit": "c9b4de623d19a85b353ff70d2ae9c77143abe69c" },
"nui.nvim": { "branch": "main", "commit": "c9b4de623d19a85b353ff70d2ae9c77143abe69c" },
"lspkind.nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" },
"luasnip": { "branch": "master", "commit": "8ae1dedd988eb56441b7858bd1e8554dfadaa46d" },
"mini.base16": { "branch": "main", "commit": "f770a9cecf91bc690ba7943818caff0b5770f0f1" },
"mini.colors": { "branch": "main", "commit": "f64963332f7fcb45c8dfcc243f682a9a0fb9935d" },
"mini.comment": { "branch": "main", "commit": "a4b7e46deb9ad2feb8902cc5dbf087eced112ee5" },
"mini.files": { "branch": "main", "commit": "eab771c69b787a3f042dc6505d15613c282aa786" },
"mini.operators": { "branch": "main", "commit": "0765e4818086e96b8fb55d280e47af781a5bc56a" },
"mini.pairs": { "branch": "main", "commit": "04f58f2545ed80ac3b52dd4826e93f33e15b2af6" },
"mini.statusline": { "branch": "main", "commit": "dfd3d2ba295473930f78f143852b9b53eb54ae2a" },
"mini.surround": { "branch": "main", "commit": "a1b590cc3b676512de507328d6bbab5e43794720" },
"neoconf": { "branch": "main", "commit": "4ef6c6c5882e7e16209173fb8c47414202843384" },
"neodev.nvim": { "branch": "main", "commit": "b0ccf605c952eb0d1efe3692d5b241c52ceee187" },
"neogit": { "branch": "master", "commit": "4075ca97222e0a1ab517dcb8fd4542fd8df4ca91" },
"nui": { "branch": "main", "commit": "c3c7fd618dcb5a89e443a2e1033e7d11fdb0596b" },
"null-ls": { "branch": "main", "commit": "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7" },
"nvim-lspconfig": { "branch": "master", "commit": "511609ae0311abfcfaed3c398429a147e895ce2c" },
"nvim-tree": { "branch": "master", "commit": "7d1760f892951dd6a118dae1d7a1d8df5f029edf" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "ec1c5bdb3d87ac971749fa6c7dbc2b14884f1f6a" },
"nvim-web-devicons": { "branch": "master", "commit": "5efb8bd06841f91f97c90e16de85e96d57e9c862" },
"nvim-lspconfig": { "branch": "master", "commit": "6b9f4bbe0aa1f351fd4845dc5fd4f3450b010f88" },
"nvim-tree": { "branch": "master", "commit": "030defdb6522f5f716d8201d20ca1a2baa57ca66" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "7f00d94543f1fd37cab2afa2e9a6cd54e1c6b9ef" },
"nvim-web-devicons": { "branch": "master", "commit": "14ac5887110b06b89a96881d534230dac3ed134d" },
"paperlanes": { "branch": "master", "commit": "bd52c54c36ad2e9ac563ae1c6a4f6ed1f5faacd2" },
"plenary": { "branch": "master", "commit": "55d9fe89e33efd26f532ef20223e5f9430c8b0c0" },
"plenary.nvim": { "branch": "master", "commit": "55d9fe89e33efd26f532ef20223e5f9430c8b0c0" },
"rust-tools": { "branch": "master", "commit": "0cc8adab23117783a0292a0c8a2fbed1005dc645" },
"scrap": { "branch": "main", "commit": "0f833d8dccaabe49c1ed7a2b24cfd887d9d5003f" },
"smart-splits.nvim": { "branch": "master", "commit": "c970c7a3cc7ba635fd73d43c81b40f04c00f5058" },
"plenary": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" },
"rust-tools": { "branch": "master", "commit": "676187908a1ce35ffcd727c654ed68d851299d3e" },
"scrap": { "branch": "main", "commit": "cc8453ed613932c744c3d1ec42f379b78bd8b92c" },
"smart-splits.nvim": { "branch": "master", "commit": "e1e1e6ca3754bd8ef971fb69673cc17965eb9e37" },
"ssr": { "branch": "main", "commit": "bb323ba621ac647b4ac5638b47666e3ef3c279e1" },
"telescope": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" },
"treesitter-top-context": { "branch": "master", "commit": "c9f2b429a1d63023f7a33b5404616f4cd2a109c5" },
"treesitter-virtual-context": { "branch": "master", "commit": "a14f9292b4bd68ceed433fc513f287641816dc6d" },
"typst": { "branch": "main", "commit": "308e7737d09de8c1100320ddc6bc270615ae791a" },
"undotree": { "branch": "master", "commit": "36ff7abb6b60980338344982ad4cdf03f7961ecd" },
"treesitter": { "branch": "master", "commit": "19bf991be2403c10fa379fa0fb11b7de2560ac31" },
"treesitter-virtual-context": { "branch": "master", "commit": "8f7b6b46292e0819290b0d368abc3366b8a163fc" },
"typst": { "branch": "main", "commit": "e28d440c7ba4df2516d7d7f908c4fb664a8cf86c" },
"undotree": { "branch": "master", "commit": "9dbbf3b7d19dda0d22ceca461818e4739ad8154d" },
"venn.nvim": { "branch": "main", "commit": "e4d68341a73dd56c64955058821a58295fb337b1" },
"wakatime": { "branch": "master", "commit": "8c8856327815a077cbebeba8c7456312a3d2c39c" },
"web-devicons": { "branch": "master", "commit": "5efb8bd06841f91f97c90e16de85e96d57e9c862" },
"wakatime": { "branch": "master", "commit": "285c2e4e48fb0c63ced233c00fb10a2edb3b6c94" },
"web-devicons": { "branch": "master", "commit": "14ac5887110b06b89a96881d534230dac3ed134d" },
"which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" },
"winbar": { "branch": "main", "commit": "13739fdb31be51a1000486189662596f07a59a31" }
}

View file

@ -4,7 +4,7 @@ local M = {}
M.symols = {
{ "mto", ">>=" }, -- [M]onadic [t]o
{ "oalt", "<\\|>" }, -- [O]peration [A]lternative
{ "oalt", "<|>" }, -- [O]peration [A]lternative
{ "omono", "<>" }, -- [O]peration [M]onoid
}
@ -24,17 +24,9 @@ M.functions = {
}
function M.setup()
scrap.many_local_abbreviations(
scrap.expand_many(M.types, A.no_capitalization)
)
scrap.many_local_abbreviations(
scrap.expand_many(M.symols, A.no_capitalization)
)
scrap.many_local_abbreviations(
scrap.expand_many(M.functions, A.no_capitalization)
)
A.manyLocalAbbr(scrap.expand_many(M.types, A.no_capitalization))
A.manyLocalAbbr(scrap.expand_many(M.symols, A.no_capitalization))
A.manyLocalAbbr(scrap.expand_many(M.functions, A.no_capitalization))
end
return M

View file

@ -150,7 +150,7 @@ M.unicode = {
-- }}}
function M.setup()
A.manyGlobalAbbr(scrap.expand_many(M.unicode, { capitalized = false }))
A.manyLocalAbbr(scrap.expand_many(M.unicode, { capitalized = false }))
end
return M

View file

@ -1,6 +1,6 @@
local runtime = require("my.tempest")
local lspconfig = {
local M = {
"neovim/nvim-lspconfig",
event = "VeryLazy",
dependencies = {
@ -13,99 +13,6 @@ local lspconfig = {
cond = runtime.blacklist("vscode"),
}
local M = lspconfig
-- {{{ General server config
---@type lspconfig.options
---@diagnostic disable-next-line: missing-fields
local servers = {
-- {{{ Typescript
---@diagnostic disable-next-line: missing-fields
tsserver = {
on_attach = function(client, bufnr)
-- We handle formatting using null-ls and prettierd
client.server_capabilities.documentFormattingProvider = false
M.on_attach(client, bufnr)
end,
},
-- }}}
-- {{{ Purescript
purescriptls = {
settings = {
---@diagnostic disable-next-line: missing-fields
purescript = {
censorWarnings = { "UnusedName", "ShadowedName", "UserDefinedWarning" },
formatter = "purs-tidy",
},
},
},
-- }}}
-- {{{ Lua
lua_ls = {
cmd = {
"lua-language-server",
"--logpath=/home/adrielus/.local/share/lua-language-server/log",
},
settings = {
---@diagnostic disable-next-line: missing-fields
Lua = {
---@diagnostic disable-next-line: missing-fields
format = {
enable = true,
},
-- Do not send telemetry data containing a randomized but unique identifier
telemetry = {
enable = false,
},
},
},
},
-- }}}
-- {{{ Latex
texlab = {
settings = {
texlab = {
build = {
args = {
-- Here by default:
"-pdf",
"-interaction=nonstopmode",
"-synctex=1",
"%f",
-- Required for syntax highlighting inside the generated pdf aparently
"-shell-escape",
},
executable = "latexmk",
forwardSearchAfter = true,
onSave = true,
},
chktex = {
onOpenAndSave = true,
onEdit = true,
},
},
},
},
-- }}}
-- {{{ Nix
rnix = {},
-- nil_ls = {},
nixd = {},
-- }}}
---@diagnostic disable-next-line: missing-fields
cssls = {},
---@diagnostic disable-next-line: missing-fields
jsonls = {},
dhall_lsp_server = {},
typst_lsp = {},
---@diagnostic disable-next-line: missing-fields
elmls = {},
-- {{{ Inactive
-- pylsp = {},
-- pyright = {},
-- }}}
}
-- }}}
-- {{{ Capabilities
M.capabilities = function()
local c = require("cmp_nvim_lsp").default_capabilities()
@ -119,17 +26,114 @@ M.capabilities = function()
end
-- }}}
-- {{{ Main config function
function lspconfig.config()
function M.config()
local lspconfig = require("lspconfig")
-- {{{ General server config
---@type lspconfig.options
---@diagnostic disable-next-line: missing-fields
local servers = {
-- {{{ Typescript
---@diagnostic disable-next-line: missing-fields
tsserver = {
on_attach = function(client)
-- We handle formatting using null-ls and prettierd
client.server_capabilities.documentFormattingProvider = false
end,
},
-- }}}
-- {{{ Purescript
purescriptls = {
root_dir = lspconfig.util.root_pattern("spago.yaml"),
settings = {
---@diagnostic disable-next-line: missing-fields
purescript = {
censorWarnings = {
"UnusedName",
"ShadowedName",
"UserDefinedWarning",
},
formatter = "purs-tidy",
},
},
},
-- }}}
-- {{{ Lua
lua_ls = {
cmd = {
"lua-language-server",
"--logpath=/home/adrielus/.local/share/lua-language-server/log",
},
settings = {
---@diagnostic disable-next-line: missing-fields
Lua = {
---@diagnostic disable-next-line: missing-fields
format = {
enable = true,
},
-- Do not send telemetry data containing a randomized but unique identifier
telemetry = {
enable = false,
},
},
},
},
-- }}}
-- {{{ Latex
texlab = {
settings = {
texlab = {
build = {
args = {
-- Here by default:
"-pdf",
"-interaction=nonstopmode",
"-synctex=1",
"%f",
-- Required for syntax highlighting inside the generated pdf aparently
"-shell-escape",
},
executable = "latexmk",
forwardSearchAfter = true,
onSave = true,
},
chktex = {
onOpenAndSave = true,
onEdit = true,
},
},
},
},
-- }}}
-- {{{ Nix
rnix = {},
-- nil_ls = {},
nixd = {},
-- }}}
---@diagnostic disable-next-line: missing-fields
cssls = {},
---@diagnostic disable-next-line: missing-fields
jsonls = {},
dhall_lsp_server = {},
typst_lsp = {},
---@diagnostic disable-next-line: missing-fields
elmls = {},
-- {{{ Inactive
-- pylsp = {},
-- pyright = {},
-- }}}
}
-- }}}
vim.lsp.handlers["textDocument/hover"] =
vim.lsp.with(vim.lsp.handlers.hover, { border = "single" })
vim.lsp.handlers["textDocument/signatureHelp"] =
vim.lsp.with(vim.lsp.handlers.signature_help, { border = "single" })
-- }}}
local capabilities = M.capabilities()
for lsp, details in pairs(servers) do
details.capabilities = capabilities
require("lspconfig")[lsp].setup(details)
lspconfig[lsp].setup(details)
end
end
--}}}

View file

@ -250,23 +250,39 @@ let
};
# }}}
# {{{ Language specific settings
"5:language-specific-settings".autocmds = [{
event = "FileType";
group = "UserNixSettings";
pattern = "nix";
action = {
vim.opt.commentstring = "# %s";
keys = {
mapping = "<leader>lg";
action = thunk /* lua */ ''
D.tempest.withSavedCursor(function()
vim.cmd(":%!${lib.getExe pkgs.update-nix-fetchgit}")
end)
'';
desc = "Update all fetchgit calls";
};
};
}];
"5:language-specific-settings" = {
autocmds = [
{
event = "FileType";
group = "UserNixSettings";
pattern = "nix";
action = {
vim.opt.commentstring = "# %s";
keys = {
mapping = "<leader>lg";
action = thunk /* lua */ ''
D.tempest.withSavedCursor(function()
vim.cmd(":%!${lib.getExe pkgs.update-nix-fetchgit}")
end)
'';
desc = "Update all fetchgit calls";
};
};
}
{
event = "FileType";
group = "UserPurescriptSettings";
pattern = "purs";
action.vim.opt = {
expandtab = true; # Use spaces for the tab char
commentstring = "-- %s";
};
}
];
# Make neovim aware about the existence of the purescript datatype.
callback = lua ''vim.filetype.add({ extension = { purs = "purescript" } })'';
};
# }}}
};
# }}}
@ -310,7 +326,7 @@ let
mini-statusline = {
package = "echasnovski/mini.statusline";
name = "mini.statusline";
dependencies.lua = [ self.lazy.web-devicons.package ];
dependencies.lua = [ "web-devicons" ];
cond = blacklist [ "vscode" "firenvim" ];
lazy = false;
@ -342,7 +358,7 @@ let
mini-files = {
package = "echasnovski/mini.files";
name = "mini.files";
dependencies.lua = [ self.lazy.web-devicons.package ];
dependencies.lua = [ "web-devicons" ];
cond = blacklist [ "vscode" "firenvim" ];
keys = {
@ -411,7 +427,7 @@ let
# {{{ neogit
neogit = {
package = "TimUntersberger/neogit";
dependencies.lua = [ self.lazy.plenary.package ];
dependencies.lua = [ "plenary" ];
cond = blacklist [ "vscode" "firenvim" ];
cmd = "Neogit"; # We sometimes spawn this directly from fish using a keybind
@ -436,7 +452,7 @@ let
dependencies = {
nix = [ pkgs.ripgrep ];
lua = [
self.lazy.plenary.package
"plenary"
{
# We want a prebuilt version of this plugin
dir = pkgs.vimPlugins.telescope-fzf-native-nvim;
@ -562,12 +578,15 @@ let
# {{{ treesitter
treesitter = {
# REASON: more grammars
dir = upkgs.vimPlugins.nvim-treesitter.withAllGrammars;
# dir = upkgs.vimPlugins.nvim-treesitter.withAllGrammars;
package = "nvim-treesitter/nvim-treesitter";
main = "nvim-treesitter.configs";
dependencies.lua = [ "nvim-treesitter/nvim-treesitter-textobjects" ];
dependencies.nix = [ pkgs.tree-sitter ];
cond = blacklist "vscode";
event = "BufReadPost";
event = "VeryLazy";
#{{{ Highlighting
opts.highlight = {
@ -628,15 +647,16 @@ let
event = "VeryLazy";
};
# REASON: broken
# show context at top of file
treesitter-top-context = {
package = "nvim-treesitter/nvim-treesitter-context";
dependencies.lua = [ "treesitter" ];
cond = blacklist "vscode";
event = "VeryLazy";
opts.enable = true;
};
# treesitter-top-context = {
# package = "nvim-treesitter/nvim-treesitter-context";
# dependencies.lua = [ "treesitter" ];
#
# cond = blacklist "vscode";
# event = "VeryLazy";
# opts.enable = true;
# };
# }}}
# }}}
# {{{ editing
@ -735,21 +755,22 @@ let
opts.keymaps.replace_all = "<s-cr>";
};
# }}}
# {{{ edit-code-block (edit injections in separate buffers)
edit-code-block = {
package = "dawsers/edit-code-block.nvim";
dependencies.lua = [ "treesitter" ];
main = "ecb";
cond = blacklist "vscode";
config = true;
keys = {
mapping = "<leader>e";
action = "<cmd>EditCodeBlock<cr>";
desc = "[e]dit injection";
};
};
# }}}
# # {{{ edit-code-block (edit injections in separate buffers)
# REASON: broken
# edit-code-block = {
# package = "dawsers/edit-code-block.nvim";
# dependencies.lua = [ "treesitter" ];
# main = "ecb";
#
# cond = blacklist "vscode";
# config = true;
# keys = {
# mapping = "<leader>e";
# action = "<cmd>EditCodeBlock<cr>";
# desc = "[e]dit injection";
# };
# };
# # }}}
# {{{ mini.comment
mini-comment = {
package = "echasnovski/mini.comment";
@ -890,6 +911,7 @@ let
# {{{ ide
# {{{ conform
conform = {
dependencies.lua = [ "neovim/nvim-lspconfig" ];
package = "stevearc/conform.nvim";
cond = blacklist "vscode";
@ -1052,7 +1074,7 @@ let
"dmitmel/cmp-digraphs"
# }}}
"onsails/lspkind.nvim" # show icons in lsp completion menus
self.lazy.luasnip.package
"luasnip"
];
cond = blacklist "vscode";
@ -1063,7 +1085,7 @@ let
# {{{ inc-rename
inc-rename = {
package = "smjonas/inc-rename.nvim";
dependencies.lua = [ self.lazy.dressing.package ];
dependencies.lua = [ "dressing" ];
cond = blacklist "vscode";
event = "VeryLazy";
@ -1085,7 +1107,7 @@ let
# {{{ haskell support
haskell-tools = {
package = "mrcjkb/haskell-tools.nvim";
dependencies.lua = [ self.lazy.plenary.package ];
dependencies.lua = [ "plenary" ];
version = "^2";
cond = blacklist "vscode";
@ -1126,7 +1148,7 @@ let
# {{{ crates
crates = {
package = "saecki/crates.nvim";
dependencies.lua = [ self.lazy.plenary.package ];
dependencies.lua = [ "plenary" ];
cond = blacklist "vscode";
event = "BufReadPost Cargo.toml";
@ -1203,7 +1225,7 @@ let
package = "Julian/lean.nvim";
name = "lean";
dependencies.lua = [
self.lazy.plenary.package
"plenary"
"neovim/nvim-lspconfig"
];
@ -1229,7 +1251,7 @@ let
package = "ShinKage/idris2-nvim";
name = "idris";
dependencies.lua = [
self.lazy.nui.package
"nui"
"neovim/nvim-lspconfig"
];
@ -1278,6 +1300,14 @@ let
ft = "typst";
};
# }}}
# {{{ purescript support
# purescript = {
# package = "purescript-contrib/purescript-vim";
#
# cond = blacklist "vscode";
# ft = "purescript";
# };
# }}}
# {{{ hyprland
hyprland = {
package = "theRealCarneiro/hyprland-vim-syntax";
@ -1322,7 +1352,7 @@ let
in
{
package = "ruifm/gitlinker.nvim";
dependencies.lua = [ self.lazy.plenary.package ];
dependencies.lua = [ "plenary" ];
cond = blacklist [ "vscode" "firenvim" ];
opts.mappings = mapping;
@ -1345,7 +1375,7 @@ let
in
{
package = "epwalsh/obsidian.nvim";
dependencies.lua = [ self.lazy.plenary.package ];
dependencies.lua = [ "plenary" ];
cond = [
(blacklist [ "vscode" "firenvim" ])
@ -1393,7 +1423,7 @@ let
extraPackages = with pkgs; [
# Language servers
nodePackages.typescript-language-server # typescript
nodePackages_latest.purescript-language-server # purescript
# nodePackages_latest.purescript-language-server # purescript
lua-language-server # lua
rnix-lsp # nix
nil # nix
@ -1404,7 +1434,7 @@ let
# Formatters
stylua # Lua
nodePackages_latest.purs-tidy # Purescript
# nodePackages_latest.purs-tidy # Purescript
nodePackages_latest.prettier # Js & friends
nodePackages_latest.prettier_d_slim # Js & friends
@ -1483,7 +1513,7 @@ let
base =
if config.satellite.toggles.neovim-nightly.enable
then pkgs.neovim-nightly
else pkgs.neovim;
else upkgs.neovim;
name = "nvim";
};

View file

@ -1,164 +1,170 @@
{ ... }:
let mkConfig = { blueTrigger, redTrigger, chordDelay }: ''
;; {{{ Source layout
(defsrc
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w e r t y u i o p [ ] \
caps a s d f g h j k l ; ' ret
lsft z x c v b n m , . / rsft
lctl lmet ${redTrigger} spc ${blueTrigger}
)
;; }}}
;; {{{ Layer & utility aliases
(defalias
red (layer-while-held red)
blue (layer-while-held blue)
purple (layer-while-held purple)
em (unicode )
udo (arbitrary-code 131)
cpy (arbitrary-code 133)
pst (arbitrary-code 135)
cut (arbitrary-code 137)
)
;; }}}
;; {{{ Chord aliases
(defalias
chq (chord mainchords q)
chw (chord mainchords w)
che (chord mainchords e)
chr (chord mainchords r)
cha (chord mainchords a)
chs (chord mainchords s)
chd (chord mainchords d)
chf (chord mainchords f)
chz (chord mainchords z)
chx (chord mainchords x)
chc (chord mainchords c)
chg (chord mainchords g)
chh (chord mainchords h)
chi (chord mainchords i)
chp (chord mainchords p)
chj (chord mainchords j)
chk (chord mainchords k)
chl (chord mainchords l)
ch: (chord mainchords :)
chn (chord mainchords n)
)
;; }}}
(defchords mainchords ${toString chordDelay}
;; {{{ Single keys
(q) q
(w) w
(e) e
(r) r
(a) a
(s) s
(d) d
(f) f
(z) z
(x) x
(c) c
(g) g
(h) h
(i) i
(p) p
(j) j
(k) k
(l) l
(:) ;
(n) n
;; }}}
;; {{{ Left modifiers
(a s ) lalt
( s d ) lsft
( s f) lctl
( s d f) C-lsft
(a s d ) S-lalt
(a s d f) C-S-lalt
let
stickTap = action: "tap-hold-press 0 200 (one-shot-press-pcancel 1000 (${action})) (${action})";
mkConfig = { blueTrigger, redTrigger, chordDelay }: ''
;; {{{ Source layout
(defsrc
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w e r t y u i o p [ ] \
caps a s d f g h j k l ; ' ret
lsft z x c v b n m , . / rsft
lctl lmet ${redTrigger} spc ${blueTrigger}
)
;; }}}
;; {{{ Right modifiers
( l :) ralt
( k l ) rsft
(j l ) rctl
(j k l ) C-rsft
( k l :) S-ralt
(j k l :) C-S-ralt
;; }}}
;; {{{ Special keys
(d f) tab
(e f) ret
(q w) esc
;; {{{ Layer & utility aliases
(defalias
red (${stickTap "layer-while-held red"})
blue (${stickTap "layer-while-held blue"})
purple (layer-while-held purple)
(g h) bspc
(n l) rmet
(j k) f10
(c p) f11
(j i) f12
em (unicode )
)
;; }}}
;; {{{ Wm keybinds
(n l k) M-p
(n l q) M-1
(n l w) M-2
(n l e) M-3
(n l r) M-4
(n l a) M-5
(n l s) M-6
(n l d) M-7
(n l f) M-8
(n l z) M-9
(n l x) M-0
;; {{{ Chord aliases
(defalias
chq (chord mainchords q)
chw (chord mainchords w)
che (chord mainchords e)
chr (chord mainchords r)
cha (chord mainchords a)
chs (chord mainchords s)
chd (chord mainchords d)
chf (chord mainchords f)
chz (chord mainchords z)
chx (chord mainchords x)
chc (chord mainchords c)
chg (chord mainchords g)
chh (chord mainchords h)
chi (chord mainchords i)
chp (chord mainchords p)
chj (chord mainchords j)
chk (chord mainchords k)
chl (chord mainchords l)
ch: (chord mainchords :)
chn (chord mainchords n)
)
;; }}}
)
;; {{{ Qwerty
(deflayer qwerty
XX XX XX XX XX XX XX XX XX XX XX XX XX XX
XX @chq @chw @che @chr t y u @chi o @chp XX XX XX
XX @cha @chs @chd @chf @chg @chh @chj @chk @chl @ch: XX XX
lsft @chz @chx @chc v b @chn m , . ' XX
XX lmet @red spc @blue
)
;; }}}
;; {{{ Transparent template
(deflayer template
_ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _
)
;; }}}
;; {{{ Blue
(deflayer blue
_ _ _ _ _ _ _ _ _ _ _ _ _ _
_ S-1 S-2 S-3 S-4 S-5 S-6 S-7 S-8 grv S-grv _ _ _
_ S-, S-9 [ S-[ - S-/ S-- / = S-; _ _
_ S-. S-0 ] S-] @em _ S-\ \ S-= S-' _
_ _ @purple _ _
)
;; }}}
;; {{{ Red
(deflayer red
_ _ _ _ _ _ _ _ _ _ _ _ _ _
_ 1 2 3 4 _ _ _ _ _ _ _ _ _
_ 5 6 7 8 _ left down up rght _ _ _
_ 9 0 _ _ _ _ _ _ _ _ _
_ _ _ _ @purple
)
;; }}}
;; {{{ Purple
(deflayer purple
_ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ @cpy _ _ _
_ _ _ _ _ _ _ _ _ _ @pst _ _
_ _ _ _ _ _ _ _ @udo _ @cut _
_ _ _ _ _
)
;; }}}
'';
(defchords mainchords ${toString chordDelay}
;; {{{ Single keys
(q) q
(w) w
(e) e
(r) r
(a) a
(s) s
(d) d
(f) f
(z) z
(x) x
(c) c
(g) g
(h) h
(i) i
(p) p
(j) j
(k) k
(l) l
(:) ;
(n) n
;; }}}
;; {{{ Left modifiers
(a s ) lalt
( s d ) lsft
( s f) lctl
( s d f) C-lsft
(a s d ) S-lalt
(a s d f) C-S-lalt
;; }}}
;; {{{ Right modifiers
( l :) ralt
( k l ) rsft
(j l ) rctl
(j k l ) C-rsft
( k l :) S-ralt
(j k l :) C-S-ralt
;; }}}
;; {{{ Special keys
(d f) tab
(e f) ret
(q w) esc
(g h) bspc
(n l) rmet
(j k) f10
(c p) f11
(j i) f12
;; }}}
;; {{{ Wm keybinds
(n l k) M-p
(n l q) M-1
(n l w) M-2
(n l e) M-3
(n l r) M-4
(n l a) M-5
(n l s) M-6
(n l d) M-7
(n l f) M-8
(n l z) M-9
(n l x) M-0
;; }}}
)
;; {{{ Qwerty
(deflayer qwerty
XX XX XX XX XX XX XX XX XX XX XX XX XX XX
XX @chq @chw @che @chr t y u @chi o @chp XX XX XX
XX @cha @chs @chd @chf @chg @chh @chj @chk @chl @ch: XX XX
lsft @chz @chx @chc v b @chn m , . ' XX
XX lmet @red spc @blue
)
;; }}}
;; {{{ Transparent template
(deflayer template
_ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _
)
;; }}}
;; {{{ Blue
(deflayer blue
_ _ _ _ _ _ _ _ _ _ _ _ _ _
_ S-1 S-2 S-3 S-4 S-5 S-6 S-7 S-8 grv S-grv _ _ _
_ S-, S-[ [ S-9 S-/ S-\ - / = S-; _ _
_ S-. S-] ] S-0 _ @em S-- \ S-= S-' _
_ _ @purple _ _
)
;; }}}
;; {{{ Red
(deflayer red
_ _ _ _ _ _ _ _ _ _ _ _ _ _
_ 1 2 3 4 _ _ _ _ _ _ _ _ _
_ 5 6 7 8 _ left down up rght _ _ _
_ 9 0 _ _ _ _ _ _ _ _ _
_ _ _ _ @purple
)
;; }}}
;; {{{ Purple
(defalias
cps (caps-word 2000) ;; revert after being idle for 2s
udo (arbitrary-code 131) ;; undo
cpy (arbitrary-code 133) ;; copy
pst (arbitrary-code 135) ;; paste
cut (arbitrary-code 137) ;; cut
)
(deflayer purple
_ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ @cps @cpy next volu brup _ _ _
_ _ _ _ _ _ @udo @pst pp vold brdn _ _
_ _ _ _ _ _ _ @cut prev mute _ _
_ _ _ _ _
)
;; }}}
'';
in
{
services.kanata = {

View file

@ -21,6 +21,8 @@
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
system.stateVersion = "22.11";
services.mullvad-vpn.enable = true;
# {{{ Machine ids
networking.hostName = "tethys";
environment.etc.machine-id.text = "08357db3540c4cd2b76d4bb7f825ec88";