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

View file

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

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" },
"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" },

View file

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

View file

@ -3,7 +3,6 @@ local M = {}
M.no_capitalization = { capitalized = false }
function M.localAbbr(lhs, rhs)
-- Create abbreviation
vim.cmd(":iabbrev <buffer> " .. lhs .. " " .. rhs)
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",
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", "<leader>rn", function()
return ":IncRename " .. vim.fn.expand("<cword>")
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
--}}}

View file

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

View file

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

View file

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

View file

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

View file

@ -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<cr>" "Save all files and [q]uit")
(nmap "<leader>rw" ":%s/<C-r><C-w>/" "[R]eplace [w]ord in file")
(nmap "<leader>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,8 +178,16 @@ let
}
];
# }}}
# {{{ Lsp on-attach
"3:lsp-on-attach".autocmds = {
# {{{ 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 =
@ -217,11 +226,13 @@ let
};
};
# }}}
};
# }}}
# {{{ 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 = "<leader>rn";
action = ":IncRename <c-r><c-w>";
desc = "Incremenetal [r]e[n]ame";
};
};
};
# }}}
# }}}
# {{{ language support
# {{{ haskell support

View file

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