small changes

This commit is contained in:
TheGeneralist 2025-10-12 16:44:42 +02:00
parent d8a9db867c
commit f7168c0b29
Signed by: thegeneralist01
SSH key fingerprint: SHA256:pp9qddbCNmVNoSjevdvQvM5z0DHN7LTa8qBMbcMq/R4
6 changed files with 351 additions and 310 deletions

View file

@ -11,7 +11,7 @@
clearDefaultKeybinds = false; clearDefaultKeybinds = false;
settings = { settings = {
# theme = "tokyonight"; # theme = "tokyonight";
theme = "GruvboxDarkHard"; theme = "Gruvbox Dark Hard";
font-family = "Berkeley Mono"; font-family = "Berkeley Mono";
font-size = 16; font-size = 16;

View file

@ -26,6 +26,9 @@
nixfmt-rfc-style nixfmt-rfc-style
libiconv libiconv
clang
clang-analyzer
]; ];
}; };
} }

View file

@ -1,18 +1,31 @@
let let
numbers = [ numbers = [
"1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1"
"2"
"3"
"4"
"5"
"6"
"7"
"8"
"9"
"0"
]; ];
number_to_symbol = num: { number_to_symbol = num: {
type = "basic"; type = "basic";
from = { from = {
key_code = num; key_code = num;
modifiers = { optional = [ "caps_lock" ]; }; modifiers = {
optional = [ "caps_lock" ];
};
}; };
to = [{ to = [
key_code = num; {
modifiers = ["left_shift"]; key_code = num;
}]; modifiers = [ "left_shift" ];
}
];
}; };
symbol_to_number = num: { symbol_to_number = num: {
@ -24,55 +37,80 @@ let
optional = [ "caps_lock" ]; optional = [ "caps_lock" ];
}; };
}; };
to = [{ to = [
key_code = num; {
}]; key_code = num;
}
];
}; };
manipulators = builtins.concatLists (map (n: [ manipulators = builtins.concatLists (
(number_to_symbol n) map (n: [
(symbol_to_number n) (number_to_symbol n)
]) numbers); (symbol_to_number n)
]) numbers
);
simple_modifications = [ simple_modifications = [
{ {
from.apple_vendor_top_case_key_code = "keyboard_fn"; from.apple_vendor_top_case_key_code = "keyboard_fn";
to = [{ key_code = "left_control"; }]; to = [ { key_code = "left_control"; } ];
} }
{ {
from.key_code = "left_control"; from.key_code = "left_control";
to = [{ apple_vendor_top_case_key_code = "keyboard_fn"; }]; to = [ { apple_vendor_top_case_key_code = "keyboard_fn"; } ];
} }
]; ];
complex_modifications = { complex_modifications = {
name = "Complex Modifications"; name = "Complex Modifications";
rules = [{ rules = [
description = "Change numbers to symbols and vice versa"; # {
manipulators = manipulators; # description = "Change numbers to symbols and vice versa";
}]; # manipulators = manipulators;
# }
{
description = "Toggle Focus Mode with F6";
manipulators = [
{
from = {
"key_code" = "f6";
};
to = [ { "shell_command" = "shortcuts run 'Reduced Interruptions'"; } ];
type = "basic";
}
];
}
];
}; };
config = builtins.toJSON { config = builtins.toJSON {
global.show_in_menu_bar = false; global.show_in_menu_bar = false;
profiles = [{ profiles = [
name = "default"; {
selected = true; name = "default";
virtual_hid_keyboard.keyboard_type_v2 = "ansi"; selected = true;
inherit simple_modifications; virtual_hid_keyboard.keyboard_type_v2 = "ansi";
inherit complex_modifications; inherit simple_modifications;
inherit complex_modifications;
devices = [{ devices = [
identifiers.is_keyboard = true; {
}]; identifiers.is_keyboard = true;
}]; }
];
}
];
}; };
in { in
home-manager.sharedModules = [{ {
home.file.".config/karabiner/karabiner.json" = { home-manager.sharedModules = [
force = true; {
text = config; home.file.".config/karabiner/karabiner.json" = {
}; force = true;
}]; text = config;
};
}
];
} }

View file

@ -1,5 +1,5 @@
{ pkgs, ... }: { { pkgs, ... }: {
homebrew.enable = true; homebrew.enable = true;
homebrew.casks = [ "ungoogled-chromium" ]; homebrew.casks = [ "google-chrome" ];
environment.systemPackages = [ pkgs.iina ]; environment.systemPackages = [ pkgs.iina ];
} }

View file

@ -18,8 +18,6 @@ return {
-- See :h blink-cmp-config-keymap for defining your own keymap -- See :h blink-cmp-config-keymap for defining your own keymap
keymap = { keymap = {
preset = "default", preset = "default",
["<Tab>"] = { "select_and_accept" },
["<S-Tab>"] = { "select_next", "fallback_to_mappings" },
}, },
appearance = { appearance = {

View file

@ -1,285 +1,287 @@
return { return {
{ {
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
dependencies = { dependencies = {
"saghen/blink.cmp", "saghen/blink.cmp",
-- "folke/neodev.nvim", -- "folke/neodev.nvim",
"williamboman/mason.nvim", "williamboman/mason.nvim",
"mason-org/mason-registry", "mason-org/mason-registry",
"williamboman/mason-lspconfig.nvim", "williamboman/mason-lspconfig.nvim",
"hrsh7th/cmp-nvim-lsp", "hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer", "hrsh7th/cmp-buffer",
"hrsh7th/cmp-path", "hrsh7th/cmp-path",
"hrsh7th/cmp-cmdline", "hrsh7th/cmp-cmdline",
-- "hrsh7th/nvim-cmp", -- "hrsh7th/nvim-cmp",
"L3MON4D3/LuaSnip", "L3MON4D3/LuaSnip",
"saadparwaiz1/cmp_luasnip", "saadparwaiz1/cmp_luasnip",
"j-hui/fidget.nvim", "j-hui/fidget.nvim",
}, },
config = function() config = function()
local lspkind = require("lspkind") local lspkind = require("lspkind")
-- local cmp = require("cmp") -- local cmp = require("cmp")
-- local cmp_lsp = require("cmp_nvim_lsp") -- local cmp_lsp = require("cmp_nvim_lsp")
-- local capabilities = vim.tbl_deep_extend( -- local capabilities = vim.tbl_deep_extend(
-- "force", -- "force",
-- {}, -- {},
-- vim.lsp.protocol.make_client_capabilities(), -- vim.lsp.protocol.make_client_capabilities(),
-- cmp_lsp.default_capabilities() -- cmp_lsp.default_capabilities()
-- ) -- )
require("fidget").setup({}) require("fidget").setup({})
require("mason").setup() require("mason").setup()
-- local vue_typescript_plugin = require("mason-registry") -- local vue_typescript_plugin = require("mason-registry")
-- .get_package("vue-language-server") -- .get_package("vue-language-server")
-- :get_install_path() .. "/node_modules/@vue/language-server" .. "/node_modules/@vue/typescript-plugin" -- :get_install_path() .. "/node_modules/@vue/language-server" .. "/node_modules/@vue/typescript-plugin"
local capabilities = require("blink.cmp").get_lsp_capabilities() local capabilities = require("blink.cmp").get_lsp_capabilities()
vim.lsp.enable("nixd") vim.lsp.enable("nixd")
require("mason-lspconfig").setup({ vim.lsp.enable("clangd")
automatic_enable = true, vim.lsp.enable("basedpyright")
ensure_installed = { require("mason-lspconfig").setup({
"lua_ls", automatic_enable = true,
"ts_ls", ensure_installed = {
"cssls", "lua_ls",
"tailwindcss", "ts_ls",
}, "cssls",
handlers = { "tailwindcss",
function(server_name) -- default handler (optional) },
-- if server_name == "rust_analyzer" then handlers = {
-- return function(server_name) -- default handler (optional)
-- end -- if server_name == "rust_analyzer" then
require("lspconfig")[server_name].setup({ -- return
capabilities = capabilities, -- end
}) require("lspconfig")[server_name].setup({
end, capabilities = capabilities,
})
end,
["lua_ls"] = function() ["lua_ls"] = function()
local lspconfig = require("lspconfig") local lspconfig = require("lspconfig")
lspconfig.lua_ls.setup({ lspconfig.lua_ls.setup({
capabilities = capabilities, capabilities = capabilities,
settings = { settings = {
Lua = { Lua = {
diagnostics = { diagnostics = {
globals = { "vim", "it", "describe", "before_each", "after_each" }, globals = { "vim", "it", "describe", "before_each", "after_each" },
}, },
}, },
}, },
}) })
end, end,
["ts_ls"] = function() ["ts_ls"] = function()
local lspconfig = require("lspconfig") local lspconfig = require("lspconfig")
lspconfig.ts_ls.setup({ lspconfig.ts_ls.setup({
capabilities = capabilities, capabilities = capabilities,
-- settings = { -- settings = {
-- }, -- },
-- init_options = { -- init_options = {
-- plugins = { -- plugins = {
-- { -- {
-- name = "@vue/typescript-plugin", -- name = "@vue/typescript-plugin",
-- location = vue_typescript_plugin, -- location = vue_typescript_plugin,
-- languages = { "vue" }, -- languages = { "vue" },
-- }, -- },
-- }, -- },
-- }, -- },
filetypes = { filetypes = {
"javascript", "javascript",
"javascriptreact", "javascriptreact",
"javascript.jsx", "javascript.jsx",
"typescript", "typescript",
"typescriptreact", "typescriptreact",
"typescript.tsx", "typescript.tsx",
-- "vue", -- "vue",
}, },
}) })
end, end,
}, },
}) })
vim.api.nvim_create_autocmd("LspAttach", { vim.api.nvim_create_autocmd("LspAttach", {
callback = function(args) callback = function(args)
local c = vim.lsp.get_client_by_id(args.data.client_id) local c = vim.lsp.get_client_by_id(args.data.client_id)
if not c then if not c then
return return
end end
if vim.bo.filetype == "lua" then if vim.bo.filetype == "lua" then
-- Format the current buffer on save -- Format the current buffer on save
vim.api.nvim_create_autocmd("BufWritePre", { vim.api.nvim_create_autocmd("BufWritePre", {
buffer = args.buf, buffer = args.buf,
callback = function() callback = function()
vim.lsp.buf.format({ bufnr = args.buf, id = c.id }) vim.lsp.buf.format({ bufnr = args.buf, id = c.id })
end, end,
}) })
end end
end, end,
}) })
-- local cmp_select = { behavior = cmp.SelectBehavior.Select } -- local cmp_select = { behavior = cmp.SelectBehavior.Select }
--- Select item next/prev, taking into account whether the cmp window is --- Select item next/prev, taking into account whether the cmp window is
--- top-down or bottoom-up so that the movement is always in the same direction. --- top-down or bottoom-up so that the movement is always in the same direction.
-- local select_item_smart = function(dir, opts) -- local select_item_smart = function(dir, opts)
-- return function(fallback) -- return function(fallback)
-- if cmp.visible() then -- if cmp.visible() then
-- opts = opts or { behavior = cmp.SelectBehavior.Select } -- opts = opts or { behavior = cmp.SelectBehavior.Select }
-- if cmp.core.view.custom_entries_view:is_direction_top_down() then -- if cmp.core.view.custom_entries_view:is_direction_top_down() then
-- ({ next = cmp.select_next_item, prev = cmp.select_prev_item })[dir](opts) -- ({ next = cmp.select_next_item, prev = cmp.select_prev_item })[dir](opts)
-- else -- else
-- ({ prev = cmp.select_next_item, next = cmp.select_prev_item })[dir](opts) -- ({ prev = cmp.select_next_item, next = cmp.select_prev_item })[dir](opts)
-- end -- end
-- else -- else
-- fallback() -- fallback()
-- end -- end
-- end -- end
-- end -- end
-- cmp.setup({ -- cmp.setup({
-- snippet = { -- snippet = {
-- expand = function(args) -- expand = function(args)
-- require("luasnip").lsp_expand(args.body) -- For `luasnip` users. -- require("luasnip").lsp_expand(args.body) -- For `luasnip` users.
-- end, -- end,
-- }, -- },
-- completion = { -- completion = {
-- completeopt = "menu,menuone,noinsert", -- completeopt = "menu,menuone,noinsert",
-- }, -- },
-- -- No idea what this is -- -- No idea what this is
-- matching = { -- matching = {
-- disallow_fuzzy_matching = false, -- disallow_fuzzy_matching = false,
-- disallow_fullfuzzy_matching = false, -- disallow_fullfuzzy_matching = false,
-- disallow_partial_fuzzy_matching = false, -- disallow_partial_fuzzy_matching = false,
-- }, -- },
-- performance = { -- performance = {
-- -- debounce = 50, -- -- debounce = 50,
-- debounce = 25, -- debounce = 25,
-- -- max_view_entries = 20, -- -- max_view_entries = 20,
-- }, -- },
-- That crazy window -- That crazy window
-- window = { -- window = {
-- completion = cmp.config.window.bordered({ -- completion = cmp.config.window.bordered({
-- border = "single", -- border = "single",
-- side_padding = 2, -- side_padding = 2,
-- col_offset = -3, -- col_offset = -3,
-- max_width = 80, -- max_width = 80,
-- }), -- }),
-- documentation = cmp.config.window.bordered({ -- documentation = cmp.config.window.bordered({
-- max_width = 50, -- max_width = 50,
-- }), -- }),
-- }, -- },
-- mapping = cmp.mapping.preset.insert({ -- mapping = cmp.mapping.preset.insert({
-- ["<C-p>"] = select_item_smart("prev", cmp_select), -- ["<C-p>"] = select_item_smart("prev", cmp_select),
-- ["<C-n>"] = select_item_smart("next", cmp_select), -- ["<C-n>"] = select_item_smart("next", cmp_select),
-- ["<C-e>"] = cmp.mapping.close(), -- ["<C-e>"] = cmp.mapping.close(),
-- ["<C-y>"] = cmp.mapping.confirm({ select = true }), -- ["<C-y>"] = cmp.mapping.confirm({ select = true }),
-- ["<Tab>"] = cmp.mapping.confirm({ select = true }), -- ["<Tab>"] = cmp.mapping.confirm({ select = true }),
-- ["<C-B>"] = cmp.mapping.complete(), -- ["<C-B>"] = cmp.mapping.complete(),
-- ["<C-u>"] = cmp.mapping.scroll_docs(-3), -- ["<C-u>"] = cmp.mapping.scroll_docs(-3),
-- ["<C-d>"] = cmp.mapping.scroll_docs(3), -- ["<C-d>"] = cmp.mapping.scroll_docs(3),
-- ["<C-g>"] = cmp.mapping.abort(), -- ["<C-g>"] = cmp.mapping.abort(),
-- }), -- }),
-- sorting = { -- sorting = {
-- comparators = { -- comparators = {
-- cmp.config.compare.locality, -- cmp.config.compare.locality,
-- cmp.config.compare.offset, -- cmp.config.compare.offset,
-- cmp.config.compare.recently_used, -- cmp.config.compare.recently_used,
-- cmp.config.compare.exact, -- cmp.config.compare.exact,
-- cmp.config.compare.order, -- cmp.config.compare.order,
-- cmp.config.compare.length, -- cmp.config.compare.length,
-- function(entry1, entry2) -- function(entry1, entry2)
-- local _, entry1_under = entry1.completion_item.label:find("^_+") -- local _, entry1_under = entry1.completion_item.label:find("^_+")
-- local _, entry2_under = entry2.completion_item.label:find("^_+") -- local _, entry2_under = entry2.completion_item.label:find("^_+")
-- entry1_under = entry1_under or 0 -- entry1_under = entry1_under or 0
-- entry2_under = entry2_under or 0 -- entry2_under = entry2_under or 0
-- if entry1_under > entry2_under then -- if entry1_under > entry2_under then
-- return false -- return false
-- elseif entry1_under < entry2_under then -- elseif entry1_under < entry2_under then
-- return true -- return true
-- end -- end
-- end, -- end,
-- cmp.config.compare.kind, -- cmp.config.compare.kind,
-- cmp.config.compare.sort_text, -- cmp.config.compare.sort_text,
-- }, -- },
-- }, -- },
-- sources = cmp.config.sources({ -- sources = cmp.config.sources({
-- { name = "neopyter" }, -- { name = "neopyter" },
-- { name = "nvim_lsp" }, -- { name = "nvim_lsp" },
-- { name = "codeium" }, -- { name = "codeium" },
-- { name = "luasnip" }, -- For luasnip users. -- { name = "luasnip" }, -- For luasnip users.
-- }, { -- }, {
-- { name = "buffer" }, -- { name = "buffer" },
-- }), -- }),
-- formatting = { -- formatting = {
-- fields = { -- fields = {
-- "abbr", -- "abbr",
-- "kind", -- "kind",
-- "menu", -- "menu",
-- }, -- },
-- expandable_indicator = true, -- expandable_indicator = true,
-- format = lspkind.cmp_format({ -- format = lspkind.cmp_format({
-- mode = "symbol_text", -- mode = "symbol_text",
-- maxwidth = 50, -- maxwidth = 50,
-- ellipsis_char = "...", -- ellipsis_char = "...",
-- menu = { -- menu = {
-- neopyter = "[Neopyter]", -- neopyter = "[Neopyter]",
-- }, -- },
-- symbol_map = { -- symbol_map = {
-- -- specific complete item kind icon -- -- specific complete item kind icon
-- ["Magic"] = "🪄", -- ["Magic"] = "🪄",
-- ["Path"] = "📁", -- ["Path"] = "📁",
-- ["Dict key"] = "🔑", -- ["Dict key"] = "🔑",
-- ["Instance"] = "󱃻", -- ["Instance"] = "󱃻",
-- ["Statement"] = "󱇯", -- ["Statement"] = "󱇯",
-- }, -- },
-- }), -- }),
-- }, -- },
-- }) -- })
-- -- menu item highlight -- -- menu item highlight
-- vim.api.nvim_set_hl(0, "CmpItemKindMagic", { bg = "NONE", fg = "#D4D434" }) -- vim.api.nvim_set_hl(0, "CmpItemKindMagic", { bg = "NONE", fg = "#D4D434" })
-- vim.api.nvim_set_hl(0, "CmpItemKindPath", { link = "CmpItemKindFolder" }) -- vim.api.nvim_set_hl(0, "CmpItemKindPath", { link = "CmpItemKindFolder" })
-- vim.api.nvim_set_hl(0, "CmpItemKindDictkey", { link = "CmpItemKindKeyword" }) -- vim.api.nvim_set_hl(0, "CmpItemKindDictkey", { link = "CmpItemKindKeyword" })
-- vim.api.nvim_set_hl(0, "CmpItemKindInstance", { link = "CmpItemKindVariable" }) -- vim.api.nvim_set_hl(0, "CmpItemKindInstance", { link = "CmpItemKindVariable" })
-- vim.api.nvim_set_hl(0, "CmpItemKindStatement", { link = "CmpItemKindVariable" }) -- vim.api.nvim_set_hl(0, "CmpItemKindStatement", { link = "CmpItemKindVariable" })
-- vim.diagnostic.config({ -- vim.diagnostic.config({
-- -- update_in_insert = true, -- Update diagnostics in Insert mode -- -- update_in_insert = true, -- Update diagnostics in Insert mode
-- -- ^ (if false, diagnostics are updated on InsertLeave) -- -- ^ (if false, diagnostics are updated on InsertLeave)
-- --
-- underline = true, -- underline = true,
-- --
-- virtual_text = true, -- virtual_text = true,
-- --
-- severity_sort = true, -- high -> low -- severity_sort = true, -- high -> low
-- --
-- -- float = { -- -- float = {
-- -- focusable = false, -- -- focusable = false,
-- -- style = "minimal", -- -- style = "minimal",
-- -- border = "rounded", -- -- border = "rounded",
-- -- source = true, -- -- source = true,
-- -- header = { "  Diagnostics", "String" }, -- -- header = { "  Diagnostics", "String" },
-- -- prefix = function(_, _, _) -- -- prefix = function(_, _, _)
-- -- return "  ", "String" -- -- return "  ", "String"
-- -- end, -- -- end,
-- -- }, -- -- },
-- }) -- })
-- treesitter jupyter notebook stuff -- treesitter jupyter notebook stuff
-- require("nvim-treesitter.configs").setup({ -- require("nvim-treesitter.configs").setup({
-- textobjects = { -- textobjects = {
-- move = { -- move = {
-- enable = true, -- enable = true,
-- goto_next_start = { -- goto_next_start = {
-- ["]j"] = "@cellseparator", -- ["]j"] = "@cellseparator",
-- ["]c"] = "@cellcontent", -- ["]c"] = "@cellcontent",
-- }, -- },
-- goto_previous_start = { -- goto_previous_start = {
-- ["[j"] = "@cellseparator", -- ["[j"] = "@cellseparator",
-- ["[c"] = "@cellcontent", -- ["[c"] = "@cellcontent",
-- }, -- },
-- }, -- },
-- }, -- },
-- }) -- })
end, end,
}, },
} }