1
Fork 0

Change a lot of neovim stuff

and remove some outdated firefox profiles
This commit is contained in:
Matei Adriel 2024-01-04 05:24:55 +01:00
parent c36f93d9c9
commit a39544b93d
No known key found for this signature in database
18 changed files with 119 additions and 145 deletions

View file

@ -31,6 +31,10 @@ function fish_user_key_bindings
bind -M default \cx "clear && commandline -f repaint" bind -M default \cx "clear && commandline -f repaint"
bind -M insert \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 # {{{ C-enter to run command through less
bind -M default \e\[13\;2u "commandline -a ' | less' && commandline -f execute" bind -M default \e\[13\;2u "commandline -a ' | less' && commandline -f execute"
bind -M insert \e\[13\;2u "commandline -a ' | less' && commandline -f execute" bind -M insert \e\[13\;2u "commandline -a ' | less' && commandline -f execute"

View file

@ -23,7 +23,7 @@ in
home.packages = [ discocss ]; home.packages = [ discocss ];
xdg.configFile."discocss/custom.css".source = config.satellite.theming.get themeMap; xdg.configFile."discocss/custom.css".source = config.satellite.theming.get themeMap;
# {{{ Storage # {{{ Storage
# Clean cache older than 10 days # Clean cache older than 10 days
systemd.user.tmpfiles.rules = [ systemd.user.tmpfiles.rules = [
"d ${config.xdg.configHome}/discord/Cache/Cache_Data - - - 10d" "d ${config.xdg.configHome}/discord/Cache/Cache_Data - - - 10d"

View file

@ -266,38 +266,13 @@ in
# {{{ Standalone "apps" which actually run inside a browser. # {{{ Standalone "apps" which actually run inside a browser.
apps.extensions = extensions; apps.extensions = extensions;
apps.app = { apps.app = {
# {{{ Job stuff # TODO: auto increment ids
# {{{ 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;
};
# }}}
# {{{ Desmos # {{{ Desmos
desmos = { desmos = {
url = "https://www.desmos.com/calculator"; url = "https://www.desmos.com/calculator";
icon = ./icons/desmos.png; icon = ./icons/desmos.png;
displayName = "Desmos"; displayName = "Desmos";
id = 4; id = 1;
}; };
# }}} # }}}
# {{{ Monkey type # {{{ Monkey type
@ -305,7 +280,7 @@ in
url = "https://monkeytype.com/"; url = "https://monkeytype.com/";
icon = ./icons/monkeytype.png; icon = ./icons/monkeytype.png;
displayName = "Monkeytype"; displayName = "Monkeytype";
id = 5; id = 2;
}; };
# }}} # }}}
# {{{ Syncthing # {{{ Syncthing
@ -313,13 +288,19 @@ in
url = "http://localhost:8384/"; url = "http://localhost:8384/";
icon = ./icons/syncthing.png; icon = ./icons/syncthing.png;
displayName = "Syncthing"; 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 # {{{ Make firefox the default
# Use firefox as the default browser to open stuff. # Use firefox as the default browser to open stuff.
xdg.mimeApps.defaultApplications = { xdg.mimeApps.defaultApplications = {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 423 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

View file

@ -15,6 +15,7 @@
"crates": { "branch": "main", "commit": "b8ea20fda2e1029fbbb1bae7a9eab35c84037ca0" }, "crates": { "branch": "main", "commit": "b8ea20fda2e1029fbbb1bae7a9eab35c84037ca0" },
"discord-rich-presence": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" }, "discord-rich-presence": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" },
"dressing": { "branch": "master", "commit": "94b0d24483d56f3777ee0c8dc51675f21709318c" }, "dressing": { "branch": "master", "commit": "94b0d24483d56f3777ee0c8dc51675f21709318c" },
"dressing.nvim": { "branch": "master", "commit": "94b0d24483d56f3777ee0c8dc51675f21709318c" },
"edit-code-block": { "branch": "main", "commit": "5e4e31012eafa113216cb5894f696682833f8e7f" }, "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" },
@ -27,6 +28,7 @@
"hydra.nvim": { "branch": "master", "commit": "3ced42c0b6a6c85583ff0f221635a7f4c1ab0dd0" }, "hydra.nvim": { "branch": "master", "commit": "3ced42c0b6a6c85583ff0f221635a7f4c1ab0dd0" },
"hyprland": { "branch": "main", "commit": "be665459a21730a6acdfaa9c6352cda5e4763af6" }, "hyprland": { "branch": "main", "commit": "be665459a21730a6acdfaa9c6352cda5e4763af6" },
"idris": { "branch": "main", "commit": "8bff02984a33264437e70fd9fff4359679d910da" }, "idris": { "branch": "main", "commit": "8bff02984a33264437e70fd9fff4359679d910da" },
"inc-rename": { "branch": "main", "commit": "6f9b5f9cb237e12935144cdc535322b8c93c1b25" },
"inc-rename.nvim": { "branch": "main", "commit": "a48c7cec5c4f00d7438dce5fadb55f4d715ef9f2" }, "inc-rename.nvim": { "branch": "main", "commit": "a48c7cec5c4f00d7438dce5fadb55f4d715ef9f2" },
"indent-blankline": { "branch": "master", "commit": "7206c77cb931f79885fc47f88ae18f99148392eb" }, "indent-blankline": { "branch": "master", "commit": "7206c77cb931f79885fc47f88ae18f99148392eb" },
"lastplace": { "branch": "main", "commit": "0bb6103c506315044872e0f84b1f736c4172bb20" }, "lastplace": { "branch": "main", "commit": "0bb6103c506315044872e0f84b1f736c4172bb20" },
@ -42,7 +44,6 @@
"mini.statusline": { "branch": "main", "commit": "950d9029c7ed901b67c839e74478f784b7432665" }, "mini.statusline": { "branch": "main", "commit": "950d9029c7ed901b67c839e74478f784b7432665" },
"mini.surround": { "branch": "main", "commit": "af8129efcabe95fc08a233e9f91569829bed031f" }, "mini.surround": { "branch": "main", "commit": "af8129efcabe95fc08a233e9f91569829bed031f" },
"neoconf": { "branch": "main", "commit": "64437787dba70fce50dad7bfbb97d184c5bc340f" }, "neoconf": { "branch": "main", "commit": "64437787dba70fce50dad7bfbb97d184c5bc340f" },
"neoconf.nvim": { "branch": "main", "commit": "64437787dba70fce50dad7bfbb97d184c5bc340f" },
"neodev.nvim": { "branch": "main", "commit": "c4ce017bd4bacf60bf59330cec9e93c5d5e104a6" }, "neodev.nvim": { "branch": "main", "commit": "c4ce017bd4bacf60bf59330cec9e93c5d5e104a6" },
"neogit": { "branch": "master", "commit": "761e9be2aa7cc4c8ca87f10c8c37108a687b928e" }, "neogit": { "branch": "master", "commit": "761e9be2aa7cc4c8ca87f10c8c37108a687b928e" },
"nui": { "branch": "main", "commit": "c9b4de623d19a85b353ff70d2ae9c77143abe69c" }, "nui": { "branch": "main", "commit": "c9b4de623d19a85b353ff70d2ae9c77143abe69c" },

View file

@ -13,6 +13,7 @@ M.types = {
{ "tlis", "List" }, { "tlis", "List" },
{ "tmay", "Maybe" }, { "tmay", "Maybe" },
{ "teff", "Effect" }, { "teff", "Effect" },
{ "tio", "IO" },
{ "taff", "Aff" }, { "taff", "Aff" },
{ "tnea", "NonEmptyArray" }, { "tnea", "NonEmptyArray" },
} }

View file

@ -3,7 +3,6 @@ local M = {}
M.no_capitalization = { capitalized = false } M.no_capitalization = { capitalized = false }
function M.localAbbr(lhs, rhs) function M.localAbbr(lhs, rhs)
-- Create abbreviation
vim.cmd(":iabbrev <buffer> " .. lhs .. " " .. rhs) vim.cmd(":iabbrev <buffer> " .. lhs .. " " .. rhs)
end end

View file

@ -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

View file

@ -9,38 +9,11 @@ local lspconfig = {
"folke/neodev.nvim", "folke/neodev.nvim",
config = true, config = true,
}, },
"simrat39/rust-tools.nvim",
}, },
cond = runtime.blacklist("vscode"), cond = runtime.blacklist("vscode"),
} }
local M = { local M = lspconfig
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", "<leader>rn", function()
return ":IncRename " .. vim.fn.expand("<cword>")
end, expropts)
-- }}}
end
-- {{{ General server config -- {{{ General server config
---@type lspconfig.options ---@type lspconfig.options
@ -147,32 +120,17 @@ end
-- }}} -- }}}
-- {{{ Main config function -- {{{ Main config function
function lspconfig.config() function lspconfig.config()
-- diagnostics_icons()
-- -- {{{ Change on-hover borders
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()
-- Setup basic language servers
for lsp, details in pairs(servers) do for lsp, details in pairs(servers) do
require("lspconfig")[lsp].setup({ details.capabilities = capabilities
on_attach = details.on_attach, require("lspconfig")[lsp].setup(details)
settings = details.settings, -- Specific per-language settings
cmd = details.cmd,
capabilities = capabilities,
})
end 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 end
--}}} --}}}

View file

@ -1,4 +1,4 @@
local H = require("my.helpers.theme") local H = require("my.tempest")
local M = { local M = {
"uloco/bluloco.nvim", "uloco/bluloco.nvim",
@ -12,7 +12,7 @@ function M.config()
bluloco.setup({ bluloco.setup({
transparent = H.theme.opacity.terminal < 1.0, transparent = H.theme.opacity.terminal < 1.0,
style = H.variant("Bluloco"), style = H.theme_variant("Bluloco"),
}) })
vim.cmd("colorscheme bluloco") vim.cmd("colorscheme bluloco")

View file

@ -1,4 +1,4 @@
local H = require("my.helpers.theme") local H = require("my.tempest")
local M = { local M = {
"catppuccin/nvim", "catppuccin/nvim",
@ -9,7 +9,7 @@ local M = {
function M.config() function M.config()
local catppuccin = require("catppuccin") local catppuccin = require("catppuccin")
vim.g.catppuccin_flavour = H.variant("Catppuccin") vim.g.catppuccin_flavour = H.theme_variant("Catppuccin")
catppuccin.setup({ catppuccin.setup({
transparent_background = H.theme.transparent.terminal, transparent_background = H.theme.transparent.terminal,

View file

@ -1,4 +1,4 @@
local H = require("my.helpers.theme") local H = require("my.tempest")
local M = { local M = {
"rose-pine/neovim", "rose-pine/neovim",
@ -8,7 +8,7 @@ local M = {
} }
function M.config() function M.config()
local variant = H.variant("Rosé Pine") local variant = H.theme_variant("Rosé Pine")
if variant == "dawn" then if variant == "dawn" then
vim.o.background = "light" vim.o.background = "light"

View file

@ -306,5 +306,19 @@ function M.prepareLazySpec(spec)
end end
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 return M

View file

@ -14,8 +14,8 @@ let
# {{{ Pre-plugin config # {{{ Pre-plugin config
pre = { pre = {
# {{{ General options # {{{ General options
"0:general-options".vim = { "0:general-options" = {
g = { vim.g = {
# Disable filetype.vim # Disable filetype.vim
do_filetype_lua = true; do_filetype_lua = true;
did_load_filetypes = false; did_load_filetypes = false;
@ -24,7 +24,7 @@ let
mapleader = " "; mapleader = " ";
}; };
opt = { vim.opt = {
# Basic options # Basic options
joinspaces = false; # No double spaces with join (mapped to qj in my config) joinspaces = false; # No double spaces with join (mapped to qj in my config)
list = true; # Show some invisible characters list = true; # Show some invisible characters
@ -67,12 +67,13 @@ let
# }}} # }}}
}; };
# Disable pseudo-transparency; # {{{Disable pseudo-transparency;
autocmds = { autocmds = {
event = "FileType"; event = "FileType";
group = "WinblendSettings"; group = "WinblendSettings";
action.vim.opt.winblend = 0; action.vim.opt.winblend = 0;
}; };
# }}}
}; };
# }}} # }}}
# {{{ Misc keybinds # {{{ Misc keybinds
@ -135,7 +136,7 @@ let
(nmap "Q" ":wqa<cr>" "Save all files and [q]uit") (nmap "Q" ":wqa<cr>" "Save all files and [q]uit")
(nmap "<leader>rw" ":%s/<C-r><C-w>/" "[R]eplace [w]ord in file") (nmap "<leader>rw" ":%s/<C-r><C-w>/" "[R]eplace [w]ord in file")
(nmap "<leader>sw" (nmap "<leader>sw"
(lua ''require("my.helpers.wrapMovement").toggle'') (lua ''require("my.helpers.wrap").toggle'')
"toggle word [w]rap") "toggle word [w]rap")
# }}} # }}}
]; ];
@ -156,7 +157,7 @@ let
event = "FileType"; event = "FileType";
pattern = [ "markdown" "typst" "tex" ]; pattern = [ "markdown" "typst" "tex" ];
group = "EnableWrapMovement"; group = "EnableWrapMovement";
action = lua ''require("my.helpers.wrapMovement").enable''; action = lua ''require("my.helpers.wrap").enable'';
} }
# }}} # }}}
]; ];
@ -177,51 +178,61 @@ let
} }
]; ];
# }}} # }}}
# {{{ Lsp on-attach # {{{ Lsp settings
"3:lsp-on-attach".autocmds = { "3:lsp-settings" = {
event = "LspAttach"; # {{{ Change lsp on-hover borders
group = "UserLspConfig"; vim.lsp.handlers."textDocument/hover" = lua
action = ''vim.lsp.with(vim.lsp.handlers.hover, { border = "single" })'';
let nmap = mapping: action: desc: vim.lsp.handlers."textDocument/signatureHelp" = lua
nlib.nmap mapping ''vim.lsp.with(vim.lsp.handlers.signature_help, { border = "single" })'';
(lua "vim.lsp.buf.${action}") # }}}
desc; # {{{ Create on-attach keybinds
in autocmds = {
{ event = "LspAttach";
mkContext = event: { group = "UserLspConfig";
bufnr = lua "${event}.buf"; action =
client = lua /* lua */ let nmap = mapping: action: desc:
"vim.lsp.get_client_by_id(${event}.data.client_id)"; 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 "<leader>li" "<cmd>LspInfo<cr>" "[L]sp [i]nfo")
(nmap "gd" "definition" "[G]o to [d]efinition")
(nmap "<leader>gi" "implementation" "[G]o to [i]mplementation")
(nmap "<leader>gr" "references" "[G]o to [r]eferences")
(nmap "L" "signature_help" "Signature help")
(nmap "<leader>c" "code_action" "[C]ode actions")
(keymap "v" "<leader>c" ":'<,'> lua vim.lsp.buf.range_code_action()" "[C]ode actions")
(nmap "<leader>wa" "add_workspace_folder" "[W]orkspace [A]dd Folder")
(nmap "<leader>wr" "remove_workspace_folder" "[W]orkspace [R]emove Folder")
(nlib.nmap "<leader>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 "<leader>li" "<cmd>LspInfo<cr>" "[L]sp [i]nfo") # }}}
(nmap "gd" "definition" "[G]o to [d]efinition")
(nmap "<leader>gi" "implementation" "[G]o to [i]mplementation")
(nmap "<leader>gr" "references" "[G]o to [r]eferences")
(nmap "L" "signature_help" "Signature help")
(nmap "<leader>c" "code_action" "[C]ode actions")
(keymap "v" "<leader>c" ":'<,'> lua vim.lsp.buf.range_code_action()" "[C]ode actions")
(nmap "<leader>wa" "add_workspace_folder" "[W]orkspace [A]dd Folder")
(nmap "<leader>wr" "remove_workspace_folder" "[W]orkspace [R]emove Folder")
(nlib.nmap "<leader>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 # {{{ Neovide config
"4:configure-neovide" = { "4:configure-neovide" = {
cond = whitelist "neovide"; cond = whitelist "neovide";
vim.g = { 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_animation_length = 0.04;
neovide_cursor_animate_in_insert_mode = false; neovide_cursor_animate_in_insert_mode = false;
}; };
@ -231,7 +242,7 @@ let
"5:language-specific-settings".autocmds = [{ "5:language-specific-settings".autocmds = [{
event = "FileType"; event = "FileType";
group = "UserNixSettings"; group = "UserNixSettings";
pattern = "*.nix"; pattern = "nix";
action = { action = {
vim.opt.commentstring = "# %s"; vim.opt.commentstring = "# %s";
keys = { keys = {
@ -1038,6 +1049,26 @@ let
config = importFrom ./plugins/cmp.lua "config"; 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 = "<leader>rn";
action = ":IncRename <c-r><c-w>";
desc = "Incremenetal [r]e[n]ame";
};
};
};
# }}}
# }}} # }}}
# {{{ language support # {{{ language support
# {{{ haskell support # {{{ haskell support

View file

@ -86,7 +86,7 @@ let
mkAttrName = s: mkAttrName = s:
let let
# These list *are* incomplete # These list *are* incomplete
forbiddenChars = lib.stringToCharacters "<>[]{}()'\".,:;"; forbiddenChars = lib.stringToCharacters "<>[]{}()'\".,:;\\/";
keywords = [ "if" "then" "else" "do" "for" "local" "" ]; keywords = [ "if" "then" "else" "do" "for" "local" "" ];
in in
if lib.any (c: lib.hasInfix c s) forbiddenChars || lib.elem s keywords then if lib.any (c: lib.hasInfix c s) forbiddenChars || lib.elem s keywords then