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, ... }: { { pkgs, ... }: {
stylix.fonts = { stylix.fonts = {
monospace = { # monospace = { name = "Iosevka"; package = pkgs.iosevka; };
name = "Iosevka"; monospace = { name = "Cascadia Code"; package = pkgs.cascadia-code; };
package = pkgs.iosevka; sansSerif = { name = "CMUSansSerif"; package = pkgs.cm_unicode; };
}; serif = { name = "CMUSerif-Roman"; package = pkgs.cm_unicode; };
# monospace = {
# name = "Cascadia Code";
# package = pkgs.cascadia-code;
# };
sansSerif = {
name = "CMUSansSerif";
package = pkgs.cm_unicode;
};
serif = {
name = "CMUSerif-Roman";
package = pkgs.cm_unicode;
};
sizes = { sizes = {
desktop = 13; desktop = 13;

View file

@ -2045,11 +2045,11 @@
}, },
"nixpkgs-unstable": { "nixpkgs-unstable": {
"locked": { "locked": {
"lastModified": 1701718080, "lastModified": 1708475490,
"narHash": "sha256-6ovz0pG76dE0P170pmmZex1wWcQoeiomUZGggfH9XPs=", "narHash": "sha256-g1v0TsWBQPX97ziznfJdWhgMyMGtoBFs102xSYO4syU=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "2c7f3c0fb7c08a0814627611d9d7d45ab6d75335", "rev": "0e74ca98a74bc7270d28838369593635a5db3260",
"type": "github" "type": "github"
}, },
"original": { "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() require("my.abbreviations.fp").setup()

View file

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

View file

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

View file

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

View file

@ -1,6 +1,6 @@
local runtime = require("my.tempest") local runtime = require("my.tempest")
local lspconfig = { local M = {
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
event = "VeryLazy", event = "VeryLazy",
dependencies = { dependencies = {
@ -13,7 +13,21 @@ local lspconfig = {
cond = runtime.blacklist("vscode"), cond = runtime.blacklist("vscode"),
} }
local M = lspconfig -- {{{ Capabilities
M.capabilities = function()
local c = require("cmp_nvim_lsp").default_capabilities()
-- Add folding capabilities
c.textDocument.foldingRange = {
dynamicRegistration = false,
lineFoldingOnly = true,
}
return c
end
-- }}}
-- {{{ Main config function
function M.config()
local lspconfig = require("lspconfig")
-- {{{ General server config -- {{{ General server config
---@type lspconfig.options ---@type lspconfig.options
@ -22,19 +36,23 @@ local servers = {
-- {{{ Typescript -- {{{ Typescript
---@diagnostic disable-next-line: missing-fields ---@diagnostic disable-next-line: missing-fields
tsserver = { tsserver = {
on_attach = function(client, bufnr) on_attach = function(client)
-- We handle formatting using null-ls and prettierd -- We handle formatting using null-ls and prettierd
client.server_capabilities.documentFormattingProvider = false client.server_capabilities.documentFormattingProvider = false
M.on_attach(client, bufnr)
end, end,
}, },
-- }}} -- }}}
-- {{{ Purescript -- {{{ Purescript
purescriptls = { purescriptls = {
root_dir = lspconfig.util.root_pattern("spago.yaml"),
settings = { settings = {
---@diagnostic disable-next-line: missing-fields ---@diagnostic disable-next-line: missing-fields
purescript = { purescript = {
censorWarnings = { "UnusedName", "ShadowedName", "UserDefinedWarning" }, censorWarnings = {
"UnusedName",
"ShadowedName",
"UserDefinedWarning",
},
formatter = "purs-tidy", formatter = "purs-tidy",
}, },
}, },
@ -106,30 +124,16 @@ local servers = {
-- }}} -- }}}
} }
-- }}} -- }}}
-- {{{ Capabilities
M.capabilities = function()
local c = require("cmp_nvim_lsp").default_capabilities()
-- Add folding capabilities
c.textDocument.foldingRange = {
dynamicRegistration = false,
lineFoldingOnly = true,
}
return c
end
-- }}}
-- {{{ Main config function
function lspconfig.config()
vim.lsp.handlers["textDocument/hover"] = vim.lsp.handlers["textDocument/hover"] =
vim.lsp.with(vim.lsp.handlers.hover, { border = "single" }) vim.lsp.with(vim.lsp.handlers.hover, { border = "single" })
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.handlers["textDocument/signatureHelp"] =
vim.lsp.with(vim.lsp.handlers.signature_help, { border = "single" }) vim.lsp.with(vim.lsp.handlers.signature_help, { border = "single" })
-- }}}
local capabilities = M.capabilities() local capabilities = M.capabilities()
for lsp, details in pairs(servers) do for lsp, details in pairs(servers) do
details.capabilities = capabilities details.capabilities = capabilities
require("lspconfig")[lsp].setup(details) lspconfig[lsp].setup(details)
end end
end end
--}}} --}}}

View file

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

View file

@ -1,5 +1,7 @@
{ ... }: { ... }:
let mkConfig = { blueTrigger, redTrigger, chordDelay }: '' let
stickTap = action: "tap-hold-press 0 200 (one-shot-press-pcancel 1000 (${action})) (${action})";
mkConfig = { blueTrigger, redTrigger, chordDelay }: ''
;; {{{ Source layout ;; {{{ Source layout
(defsrc (defsrc
grv 1 2 3 4 5 6 7 8 9 0 - = bspc grv 1 2 3 4 5 6 7 8 9 0 - = bspc
@ -11,15 +13,11 @@ let mkConfig = { blueTrigger, redTrigger, chordDelay }: ''
;; }}} ;; }}}
;; {{{ Layer & utility aliases ;; {{{ Layer & utility aliases
(defalias (defalias
red (layer-while-held red) red (${stickTap "layer-while-held red"})
blue (layer-while-held blue) blue (${stickTap "layer-while-held blue"})
purple (layer-while-held purple) purple (layer-while-held purple)
em (unicode ) em (unicode )
udo (arbitrary-code 131)
cpy (arbitrary-code 133)
pst (arbitrary-code 135)
cut (arbitrary-code 137)
) )
;; }}} ;; }}}
;; {{{ Chord aliases ;; {{{ Chord aliases
@ -135,8 +133,8 @@ let mkConfig = { blueTrigger, redTrigger, chordDelay }: ''
(deflayer blue (deflayer blue
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ S-1 S-2 S-3 S-4 S-5 S-6 S-7 S-8 grv S-grv _ _ _ _ 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-[ [ S-9 S-/ S-\ - / = S-; _ _
_ S-. S-0 ] S-] @em _ S-\ \ S-= S-' _ _ S-. S-] ] S-0 _ @em S-- \ S-= S-' _
_ _ @purple _ _ _ _ @purple _ _
) )
;; }}} ;; }}}
@ -150,11 +148,19 @@ let mkConfig = { blueTrigger, redTrigger, chordDelay }: ''
) )
;; }}} ;; }}}
;; {{{ 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 (deflayer purple
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ @cpy _ _ _ _ _ _ _ _ _ @cps @cpy next volu brup _ _ _
_ _ _ _ _ _ _ _ _ _ @pst _ _ _ _ _ _ _ _ @udo @pst pp vold brdn _ _
_ _ _ _ _ _ _ _ @udo _ @cut _ _ _ _ _ _ _ _ @cut prev mute _ _
_ _ _ _ _ _ _ _ _ _
) )
;; }}} ;; }}}

View file

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