diff --git a/home/features/cli/fish/config.fish b/home/features/cli/fish/config.fish index 091e12c..803aa91 100644 --- a/home/features/cli/fish/config.fish +++ b/home/features/cli/fish/config.fish @@ -31,6 +31,10 @@ function fish_user_key_bindings bind -M default \cx "clear && commandline -f repaint" bind -M insert \cx "clear && commandline -f repaint" # }}} + # {{{ C-z to run `fg` + bind -M default \cz "fg && commandline -f repaint" + bind -M insert \cz "fg && commandline -f repaint" + # }}} # {{{ C-enter to run command through less bind -M default \e\[13\;2u "commandline -a ' | less' && commandline -f execute" bind -M insert \e\[13\;2u "commandline -a ' | less' && commandline -f execute" diff --git a/home/features/desktop/discord/default.nix b/home/features/desktop/discord/default.nix index f3e240a..04212f2 100644 --- a/home/features/desktop/discord/default.nix +++ b/home/features/desktop/discord/default.nix @@ -23,7 +23,7 @@ in home.packages = [ discocss ]; xdg.configFile."discocss/custom.css".source = config.satellite.theming.get themeMap; - # {{{ Storage + # {{{ Storage # Clean cache older than 10 days systemd.user.tmpfiles.rules = [ "d ${config.xdg.configHome}/discord/Cache/Cache_Data - - - 10d" diff --git a/home/features/desktop/firefox/default.nix b/home/features/desktop/firefox/default.nix index cba446a..9c0ebc6 100644 --- a/home/features/desktop/firefox/default.nix +++ b/home/features/desktop/firefox/default.nix @@ -266,38 +266,13 @@ in # {{{ Standalone "apps" which actually run inside a browser. apps.extensions = extensions; apps.app = { - # {{{ Job stuff - # {{{ Asana - asana = { - url = "https://app.asana.com/"; - icon = ./icons/asana.png; - displayName = "Asana"; - id = 1; - }; - # }}} - # {{{ Clockodo - clockodo = { - url = "https://my.clockodo.com/en/"; - icon = ./icons/clockodo.png; - displayName = "Clockodo"; - id = 2; - }; - # }}} - # }}} - # {{{ Gitlab - gitlab = { - url = "https://gitlab.com"; - icon = ./icons/gitlab.png; - displayName = "Gitlab"; - id = 3; - }; - # }}} + # TODO: auto increment ids # {{{ Desmos desmos = { url = "https://www.desmos.com/calculator"; icon = ./icons/desmos.png; displayName = "Desmos"; - id = 4; + id = 1; }; # }}} # {{{ Monkey type @@ -305,7 +280,7 @@ in url = "https://monkeytype.com/"; icon = ./icons/monkeytype.png; displayName = "Monkeytype"; - id = 5; + id = 2; }; # }}} # {{{ Syncthing @@ -313,13 +288,19 @@ in url = "http://localhost:8384/"; icon = ./icons/syncthing.png; displayName = "Syncthing"; - id = 6; + id = 3; }; # }}} }; # }}} }; + # TODO: uncomment when using newer version + # stylix.targets.firefox = { + # enable = true; + # profileNames = [ "adrielus" "desmos" "monkey-type" "syncthing" ]; + # }; + # {{{ Make firefox the default # Use firefox as the default browser to open stuff. xdg.mimeApps.defaultApplications = { diff --git a/home/features/desktop/firefox/icons/asana.png b/home/features/desktop/firefox/icons/asana.png deleted file mode 100644 index e47a612..0000000 Binary files a/home/features/desktop/firefox/icons/asana.png and /dev/null differ diff --git a/home/features/desktop/firefox/icons/clockodo.png b/home/features/desktop/firefox/icons/clockodo.png deleted file mode 100644 index 7b710c4..0000000 Binary files a/home/features/desktop/firefox/icons/clockodo.png and /dev/null differ diff --git a/home/features/desktop/firefox/icons/gitlab.png b/home/features/desktop/firefox/icons/gitlab.png deleted file mode 100644 index d17fce3..0000000 Binary files a/home/features/desktop/firefox/icons/gitlab.png and /dev/null differ diff --git a/home/features/neovim/config/lazy-lock.json b/home/features/neovim/config/lazy-lock.json index b3a9cc5..e0cae5c 100644 --- a/home/features/neovim/config/lazy-lock.json +++ b/home/features/neovim/config/lazy-lock.json @@ -15,6 +15,7 @@ "crates": { "branch": "main", "commit": "b8ea20fda2e1029fbbb1bae7a9eab35c84037ca0" }, "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" }, "fidget": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" }, "flash": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" }, @@ -27,6 +28,7 @@ "hydra.nvim": { "branch": "master", "commit": "3ced42c0b6a6c85583ff0f221635a7f4c1ab0dd0" }, "hyprland": { "branch": "main", "commit": "be665459a21730a6acdfaa9c6352cda5e4763af6" }, "idris": { "branch": "main", "commit": "8bff02984a33264437e70fd9fff4359679d910da" }, + "inc-rename": { "branch": "main", "commit": "6f9b5f9cb237e12935144cdc535322b8c93c1b25" }, "inc-rename.nvim": { "branch": "main", "commit": "a48c7cec5c4f00d7438dce5fadb55f4d715ef9f2" }, "indent-blankline": { "branch": "master", "commit": "7206c77cb931f79885fc47f88ae18f99148392eb" }, "lastplace": { "branch": "main", "commit": "0bb6103c506315044872e0f84b1f736c4172bb20" }, @@ -42,7 +44,6 @@ "mini.statusline": { "branch": "main", "commit": "950d9029c7ed901b67c839e74478f784b7432665" }, "mini.surround": { "branch": "main", "commit": "af8129efcabe95fc08a233e9f91569829bed031f" }, "neoconf": { "branch": "main", "commit": "64437787dba70fce50dad7bfbb97d184c5bc340f" }, - "neoconf.nvim": { "branch": "main", "commit": "64437787dba70fce50dad7bfbb97d184c5bc340f" }, "neodev.nvim": { "branch": "main", "commit": "c4ce017bd4bacf60bf59330cec9e93c5d5e104a6" }, "neogit": { "branch": "master", "commit": "761e9be2aa7cc4c8ca87f10c8c37108a687b928e" }, "nui": { "branch": "main", "commit": "c9b4de623d19a85b353ff70d2ae9c77143abe69c" }, diff --git a/home/features/neovim/config/lua/my/abbreviations/fp.lua b/home/features/neovim/config/lua/my/abbreviations/fp.lua index 782cfaf..6e8d622 100644 --- a/home/features/neovim/config/lua/my/abbreviations/fp.lua +++ b/home/features/neovim/config/lua/my/abbreviations/fp.lua @@ -13,6 +13,7 @@ M.types = { { "tlis", "List" }, { "tmay", "Maybe" }, { "teff", "Effect" }, + { "tio", "IO" }, { "taff", "Aff" }, { "tnea", "NonEmptyArray" }, } diff --git a/home/features/neovim/config/lua/my/abbreviations/init.lua b/home/features/neovim/config/lua/my/abbreviations/init.lua index 9950881..eccb5aa 100644 --- a/home/features/neovim/config/lua/my/abbreviations/init.lua +++ b/home/features/neovim/config/lua/my/abbreviations/init.lua @@ -3,7 +3,6 @@ local M = {} M.no_capitalization = { capitalized = false } function M.localAbbr(lhs, rhs) - -- Create abbreviation vim.cmd(":iabbrev " .. lhs .. " " .. rhs) end diff --git a/home/features/neovim/config/lua/my/helpers/theme.lua b/home/features/neovim/config/lua/my/helpers/theme.lua deleted file mode 100644 index 39c595f..0000000 --- a/home/features/neovim/config/lua/my/helpers/theme.lua +++ /dev/null @@ -1,15 +0,0 @@ -local theme = vim.g.nix_theme - -local M = {} -M.theme = theme - -function M.theme_contains(name) - return string.find(theme.name, name) ~= nil -end - -function M.variant(name) - -- +1 for 1-indexed strings and +1 for the space between name and variant - return string.lower(string.sub(theme.name, string.len(name) + 2)) -end - -return M diff --git a/home/features/neovim/config/lua/my/helpers/wrapMovement.lua b/home/features/neovim/config/lua/my/helpers/wrap.lua similarity index 100% rename from home/features/neovim/config/lua/my/helpers/wrapMovement.lua rename to home/features/neovim/config/lua/my/helpers/wrap.lua diff --git a/home/features/neovim/config/lua/my/plugins/lspconfig.lua b/home/features/neovim/config/lua/my/plugins/lspconfig.lua index fff0125..88b088a 100644 --- a/home/features/neovim/config/lua/my/plugins/lspconfig.lua +++ b/home/features/neovim/config/lua/my/plugins/lspconfig.lua @@ -9,38 +9,11 @@ local lspconfig = { "folke/neodev.nvim", config = true, }, - "simrat39/rust-tools.nvim", }, cond = runtime.blacklist("vscode"), } -local M = { - lspconfig, - { - "smjonas/inc-rename.nvim", - cmd = "IncRename", - opts = { - input_buffer_type = "dressing", - }, - cond = runtime.blacklist("vscode"), - }, -} - -function M.on_attach(_, _) end -function M.legacy_on_attach(_, bufnr) - -- {{{ Keymap helpers - local opts = function(desc) - return { silent = true, desc = desc, buffer = bufnr } - end - -- }}} - -- {{{ Code actions - local expropts = opts("[R]e[n]ame") - expropts.expr = true - vim.keymap.set("n", "rn", function() - return ":IncRename " .. vim.fn.expand("") - end, expropts) - -- }}} -end +local M = lspconfig -- {{{ General server config ---@type lspconfig.options @@ -147,32 +120,17 @@ end -- }}} -- {{{ Main config function function lspconfig.config() - -- diagnostics_icons() - -- -- {{{ Change on-hover borders 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() - -- Setup basic language servers for lsp, details in pairs(servers) do - require("lspconfig")[lsp].setup({ - on_attach = details.on_attach, - settings = details.settings, -- Specific per-language settings - cmd = details.cmd, - capabilities = capabilities, - }) + details.capabilities = capabilities + require("lspconfig")[lsp].setup(details) end - - vim.api.nvim_create_autocmd("LspAttach", { - group = vim.api.nvim_create_augroup("UserLspConfig", {}), - callback = function(ev) - local client = vim.lsp.get_client_by_id(ev.data.client_id) - M.legacy_on_attach(client, ev.buf) - end, - }) end --}}} diff --git a/home/features/neovim/config/lua/my/plugins/themes/bluloco.lua b/home/features/neovim/config/lua/my/plugins/themes/bluloco.lua index b6b942d..4469094 100644 --- a/home/features/neovim/config/lua/my/plugins/themes/bluloco.lua +++ b/home/features/neovim/config/lua/my/plugins/themes/bluloco.lua @@ -1,4 +1,4 @@ -local H = require("my.helpers.theme") +local H = require("my.tempest") local M = { "uloco/bluloco.nvim", @@ -12,7 +12,7 @@ function M.config() bluloco.setup({ transparent = H.theme.opacity.terminal < 1.0, - style = H.variant("Bluloco"), + style = H.theme_variant("Bluloco"), }) vim.cmd("colorscheme bluloco") diff --git a/home/features/neovim/config/lua/my/plugins/themes/catppuccin.lua b/home/features/neovim/config/lua/my/plugins/themes/catppuccin.lua index fcacbf3..73e60e9 100644 --- a/home/features/neovim/config/lua/my/plugins/themes/catppuccin.lua +++ b/home/features/neovim/config/lua/my/plugins/themes/catppuccin.lua @@ -1,4 +1,4 @@ -local H = require("my.helpers.theme") +local H = require("my.tempest") local M = { "catppuccin/nvim", @@ -9,7 +9,7 @@ local M = { function M.config() local catppuccin = require("catppuccin") - vim.g.catppuccin_flavour = H.variant("Catppuccin") + vim.g.catppuccin_flavour = H.theme_variant("Catppuccin") catppuccin.setup({ transparent_background = H.theme.transparent.terminal, diff --git a/home/features/neovim/config/lua/my/plugins/themes/rosepine.lua b/home/features/neovim/config/lua/my/plugins/themes/rosepine.lua index 407ac1f..f053597 100644 --- a/home/features/neovim/config/lua/my/plugins/themes/rosepine.lua +++ b/home/features/neovim/config/lua/my/plugins/themes/rosepine.lua @@ -1,4 +1,4 @@ -local H = require("my.helpers.theme") +local H = require("my.tempest") local M = { "rose-pine/neovim", @@ -8,7 +8,7 @@ local M = { } function M.config() - local variant = H.variant("Rosé Pine") + local variant = H.theme_variant("Rosé Pine") if variant == "dawn" then vim.o.background = "light" diff --git a/home/features/neovim/config/lua/my/tempest.lua b/home/features/neovim/config/lua/my/tempest.lua index 5b64789..52536b8 100644 --- a/home/features/neovim/config/lua/my/tempest.lua +++ b/home/features/neovim/config/lua/my/tempest.lua @@ -306,5 +306,19 @@ function M.prepareLazySpec(spec) end end -- }}} +-- {{{ Theming +local theme = vim.g.nix_theme + +M.theme = theme + +function M.theme_contains(name) + return string.find(theme.name, name) ~= nil +end + +function M.theme_variant(name) + -- +1 for 1-indexed strings and +1 for the space between name and variant + return string.lower(string.sub(theme.name, string.len(name) + 2)) +end +-- }}} return M diff --git a/home/features/neovim/default.nix b/home/features/neovim/default.nix index 0621b2a..a2bd2a3 100644 --- a/home/features/neovim/default.nix +++ b/home/features/neovim/default.nix @@ -14,8 +14,8 @@ let # {{{ Pre-plugin config pre = { # {{{ General options - "0:general-options".vim = { - g = { + "0:general-options" = { + vim.g = { # Disable filetype.vim do_filetype_lua = true; did_load_filetypes = false; @@ -24,7 +24,7 @@ let mapleader = " "; }; - opt = { + vim.opt = { # Basic options joinspaces = false; # No double spaces with join (mapped to qj in my config) list = true; # Show some invisible characters @@ -67,12 +67,13 @@ let # }}} }; - # Disable pseudo-transparency; + # {{{Disable pseudo-transparency; autocmds = { event = "FileType"; group = "WinblendSettings"; action.vim.opt.winblend = 0; }; + # }}} }; # }}} # {{{ Misc keybinds @@ -135,7 +136,7 @@ let (nmap "Q" ":wqa" "Save all files and [q]uit") (nmap "rw" ":%s//" "[R]eplace [w]ord in file") (nmap "sw" - (lua ''require("my.helpers.wrapMovement").toggle'') + (lua ''require("my.helpers.wrap").toggle'') "toggle word [w]rap") # }}} ]; @@ -156,7 +157,7 @@ let event = "FileType"; pattern = [ "markdown" "typst" "tex" ]; group = "EnableWrapMovement"; - action = lua ''require("my.helpers.wrapMovement").enable''; + action = lua ''require("my.helpers.wrap").enable''; } # }}} ]; @@ -177,51 +178,61 @@ let } ]; # }}} - # {{{ Lsp on-attach - "3:lsp-on-attach".autocmds = { - event = "LspAttach"; - group = "UserLspConfig"; - action = - let nmap = mapping: action: desc: - nlib.nmap mapping - (lua "vim.lsp.buf.${action}") - desc; - in - { - mkContext = event: { - bufnr = lua "${event}.buf"; - client = lua /* lua */ - "vim.lsp.get_client_by_id(${event}.data.client_id)"; + # {{{ Lsp settings + "3:lsp-settings" = { + # {{{ Change lsp on-hover borders + vim.lsp.handlers."textDocument/hover" = lua + ''vim.lsp.with(vim.lsp.handlers.hover, { border = "single" })''; + vim.lsp.handlers."textDocument/signatureHelp" = lua + ''vim.lsp.with(vim.lsp.handlers.signature_help, { border = "single" })''; + # }}} + # {{{ Create on-attach keybinds + autocmds = { + event = "LspAttach"; + group = "UserLspConfig"; + action = + let nmap = mapping: action: desc: + nlib.nmap mapping + (lua "vim.lsp.buf.${action}") + desc; + in + { + mkContext = event: { + bufnr = lua "${event}.buf"; + client = lua /* lua */ + "vim.lsp.get_client_by_id(${event}.data.client_id)"; + }; + keys = [ + (nlib.nmap "li" "LspInfo" "[L]sp [i]nfo") + (nmap "gd" "definition" "[G]o to [d]efinition") + (nmap "gi" "implementation" "[G]o to [i]mplementation") + (nmap "gr" "references" "[G]o to [r]eferences") + (nmap "L" "signature_help" "Signature help") + (nmap "c" "code_action" "[C]ode actions") + (keymap "v" "c" ":'<,'> lua vim.lsp.buf.range_code_action()" "[C]ode actions") + (nmap "wa" "add_workspace_folder" "[W]orkspace [A]dd Folder") + (nmap "wr" "remove_workspace_folder" "[W]orkspace [R]emove Folder") + (nlib.nmap "wl" + (thunk /* lua */ '' + print(vim.inspect(vim.lsp.buf.list_workspace_folders())) + '') "[W]orkspace [L]ist Folders") + ]; + callback = { + cond = ctx: lua '' + return ${ctx}.client.supports_method("textDocument/hover") + ''; + keys = nmap "K" "hover" "Hover"; + }; }; - keys = [ - (nlib.nmap "li" "LspInfo" "[L]sp [i]nfo") - (nmap "gd" "definition" "[G]o to [d]efinition") - (nmap "gi" "implementation" "[G]o to [i]mplementation") - (nmap "gr" "references" "[G]o to [r]eferences") - (nmap "L" "signature_help" "Signature help") - (nmap "c" "code_action" "[C]ode actions") - (keymap "v" "c" ":'<,'> lua vim.lsp.buf.range_code_action()" "[C]ode actions") - (nmap "wa" "add_workspace_folder" "[W]orkspace [A]dd Folder") - (nmap "wr" "remove_workspace_folder" "[W]orkspace [R]emove Folder") - (nlib.nmap "wl" - (thunk /* lua */ '' - print(vim.inspect(vim.lsp.buf.list_workspace_folders())) - '') "[W]orkspace [L]ist Folders") - ]; - callback = { - cond = ctx: lua '' - return ${ctx}.client.supports_method("textDocument/hover") - ''; - keys = nmap "K" "hover" "Hover"; - }; - }; + }; + # }}} }; # }}} # {{{ Neovide config "4:configure-neovide" = { cond = whitelist "neovide"; vim.g = { - neovide_transparency = lua ''require("my.helpers.theme").theme.opacity.applications''; + neovide_transparency = lua ''D.tempest.theme.opacity.applications''; neovide_cursor_animation_length = 0.04; neovide_cursor_animate_in_insert_mode = false; }; @@ -231,7 +242,7 @@ let "5:language-specific-settings".autocmds = [{ event = "FileType"; group = "UserNixSettings"; - pattern = "*.nix"; + pattern = "nix"; action = { vim.opt.commentstring = "# %s"; keys = { @@ -1038,6 +1049,26 @@ let config = importFrom ./plugins/cmp.lua "config"; }; # }}} + # {{{ inc-rename + inc-rename = { + package = "smjonas/inc-rename.nvim"; + dependencies.lua = [ self.lazy.dressing.package ]; + + cond = blacklist "vscode"; + event = "BufReadPost"; + + opts.input_buffer_type = "dressing"; + config.autocmds = { + event = "LspAttach"; + group = "CreateIncRenameKeybinds"; + action.keys = { + mapping = "rn"; + action = ":IncRename "; + desc = "Incremenetal [r]e[n]ame"; + }; + }; + }; + # }}} # }}} # {{{ language support # {{{ haskell support diff --git a/modules/common/korora-lua.nix b/modules/common/korora-lua.nix index 6cc4b65..8a95dd8 100644 --- a/modules/common/korora-lua.nix +++ b/modules/common/korora-lua.nix @@ -86,7 +86,7 @@ let mkAttrName = s: let # These list *are* incomplete - forbiddenChars = lib.stringToCharacters "<>[]{}()'\".,:;"; + forbiddenChars = lib.stringToCharacters "<>[]{}()'\".,:;\\/"; keywords = [ "if" "then" "else" "do" "for" "local" "" ]; in if lib.any (c: lib.hasInfix c s) forbiddenChars || lib.elem s keywords then