From 93324696369be5ece04ce0797754646f74185bc1 Mon Sep 17 00:00:00 2001 From: th3r00t Date: Sat, 30 Aug 2025 13:39:27 -0400 Subject: [PATCH] Updated server settings, pulling nvim from repo --- flake.lock | 33 +++- flake.nix | 25 ++- home-xps13.nix | 62 +++++- home/.config/nvim/init.lua | 156 --------------- home/.config/nvim/lazy-lock.json | 3 - home/.config/nvim/lua/autocmds.lua | 9 - home/.config/nvim/lua/completion.lua | 112 ----------- home/.config/nvim/lua/diagnostics.lua | 60 ------ home/.config/nvim/lua/functions.lua | 166 ---------------- home/.config/nvim/lua/keymaps.lua | 112 ----------- home/.config/nvim/lua/lsp.lua | 57 ------ home/.config/nvim/lua/options.lua | 55 ------ home/.config/nvim/lua/plugins.lua | 138 ------------- .../nvim/lua/telescope_configuration.lua | 32 --- home/.config/nvim/lua/terminal.lua | 11 -- home/.config/nvim/lua/treesitter.lua | 11 -- home/.config/nvim/lua/utils/reload.lua | 11 -- home/.config/nvim/lua/utils/t3_functions.lua | 187 ------------------ home/.config/nvim/lua/utils/t3_overrides.lua | 5 - home/.config/nvim/lua/vimwiki.lua | 109 ---------- modules/configuration-server.nix | 145 ++++++-------- modules/configuration-xps13.nix | 72 +++---- modules/home-manager-common.nix | 4 +- modules/hyprland.nix | 11 +- 24 files changed, 206 insertions(+), 1380 deletions(-) delete mode 100644 home/.config/nvim/init.lua delete mode 100644 home/.config/nvim/lazy-lock.json delete mode 100644 home/.config/nvim/lua/autocmds.lua delete mode 100644 home/.config/nvim/lua/completion.lua delete mode 100644 home/.config/nvim/lua/diagnostics.lua delete mode 100644 home/.config/nvim/lua/functions.lua delete mode 100644 home/.config/nvim/lua/keymaps.lua delete mode 100644 home/.config/nvim/lua/lsp.lua delete mode 100644 home/.config/nvim/lua/options.lua delete mode 100644 home/.config/nvim/lua/plugins.lua delete mode 100644 home/.config/nvim/lua/telescope_configuration.lua delete mode 100644 home/.config/nvim/lua/terminal.lua delete mode 100644 home/.config/nvim/lua/treesitter.lua delete mode 100644 home/.config/nvim/lua/utils/reload.lua delete mode 100644 home/.config/nvim/lua/utils/t3_functions.lua delete mode 100644 home/.config/nvim/lua/utils/t3_overrides.lua delete mode 100644 home/.config/nvim/lua/vimwiki.lua diff --git a/flake.lock b/flake.lock index ba21627..028bfc9 100644 --- a/flake.lock +++ b/flake.lock @@ -166,20 +166,36 @@ ] }, "locked": { - "lastModified": 1753592768, - "narHash": "sha256-oV695RvbAE4+R9pcsT9shmp6zE/+IZe6evHWX63f2Qg=", + "lastModified": 1756022458, + "narHash": "sha256-J1i35r4HfNDdPpwL0vOBaZopQudAUVtartEerc1Jryc=", "owner": "nix-community", "repo": "home-manager", - "rev": "fc3add429f21450359369af74c2375cb34a2d204", + "rev": "9e3a33c0bcbc25619e540b9dfea372282f8a9740", "type": "github" }, "original": { "owner": "nix-community", - "ref": "release-25.05", "repo": "home-manager", "type": "github" } }, + "neovim-config": { + "flake": false, + "locked": { + "lastModified": 1756442459, + "narHash": "sha256-YfZ9KdGGnhG1t+7TKw3kbH6oUhvbchhpUxACasP87f8=", + "ref": "master", + "rev": "ee941c351daa870d4a40b933fe93ffb8459884f7", + "revCount": 2, + "type": "git", + "url": "https://git.th3r00t.net/th3r00t/nvim-config.git" + }, + "original": { + "ref": "master", + "type": "git", + "url": "https://git.th3r00t.net/th3r00t/nvim-config.git" + } + }, "neovim-nightly-overlay": { "inputs": { "flake-compat": "flake-compat", @@ -290,16 +306,16 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1755078291, - "narHash": "sha256-Hu/gTDoi4uy6TAKISPHQusSMy8U6xUbLSDjKBYdhDIY=", + "lastModified": 1756125398, + "narHash": "sha256-XexyKZpf46cMiO5Vbj+dWSAXOnr285GHsMch8FBoHbc=", "owner": "NixOs", "repo": "nixpkgs", - "rev": "3385ca0cd7e14c1a1eb80401fe011705ff012323", + "rev": "3b9f00d7a7bf68acd4c4abb9d43695afb04e03a5", "type": "github" }, "original": { "owner": "NixOs", - "ref": "nixos-25.05", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } @@ -308,6 +324,7 @@ "inputs": { "disko": "disko", "home-manager": "home-manager", + "neovim-config": "neovim-config", "neovim-nightly-overlay": "neovim-nightly-overlay", "nix-index-database": "nix-index-database", "nixos-hardware": "nixos-hardware", diff --git a/flake.nix b/flake.nix index 23feb7d..e0c5a96 100644 --- a/flake.nix +++ b/flake.nix @@ -2,9 +2,9 @@ description = "System Flake"; inputs = { - nixpkgs.url = "github:NixOs/nixpkgs/nixos-25.05"; + nixpkgs.url = "github:NixOs/nixpkgs/nixos-unstable"; home-manager = { - url = "github:nix-community/home-manager/release-25.05"; + url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; nix-index-database.url = "github:nix-community/nix-index-database"; @@ -14,6 +14,17 @@ sops-nix.url = "github:Mic92/sops-nix"; sops-nix.inputs.nixpkgs.follows = "nixpkgs"; nixos-hardware.url = "github:NixOS/nixos-hardware/master"; + neovim-config = { + # pick ONE of these URLs: + + # Public over HTTPS: + url = "git+https://git.th3r00t.net/th3r00t/nvim-config.git?ref=master"; + + # OR private over SSH (recommended if the repo is private): + # url = "git+ssh://git@git.th3r00t.net/th3r00t/nvim-config.git?ref=main"; + + flake = false; + }; }; outputs = { @@ -52,6 +63,11 @@ ./home-xps13.nix nix-index-database.homeModules.nix-index ]; + home.file.".config/nvim" = { + source = inputs.neovim-config; + recursive = true; + executable = true; + }; }; # Optionally, use home-manager.extraSpecialArgs to pass arguments to home.nix } @@ -75,6 +91,11 @@ ./home-server.nix nix-index-database.homeModules.nix-index ]; + home.file.".config/nvim" = { + source = inputs.neovim-config; + recursive = true; + executable = true; + }; }; # home-manager.users.th3r00t = import ./home.nix; # Optionally, use home-manager.extraSpecialArgs to pass arguments to home.nix diff --git a/home-xps13.nix b/home-xps13.nix index 2728329..011c885 100644 --- a/home-xps13.nix +++ b/home-xps13.nix @@ -12,11 +12,11 @@ recursive = true; executable = true; }; - home.file.".config/nvim" = { - source = ./home/.config/nvim; - recursive = true; - executable = true; - }; + # home.file.".config/nvim" = { + # source = ./home/.config/nvim; + # recursive = true; + # executable = true; + # }; home.file.".irssi" = { source = ./home/.irssi; recursive = true; @@ -73,6 +73,7 @@ BROWSER = "qutebrowser"; PLATFORMTHEME = "kde"; }; + nixpkgs.config.allowUnfree = true; home.packages = with pkgs; [ mesa-demos bluez @@ -97,6 +98,13 @@ xdg-desktop-portal-wlr exfatprogs neovide + ghostty + # wineWowPackages.staging + wineWowPackages.waylandFull + winetricks + logmein-hamachi + openmw + virt-viewer ]; services.udiskie = { enable = false; @@ -106,6 +114,46 @@ }; }; }; + programs.ghostty = { + enable = true; + settings = { + theme = "tokyonight"; + font-family = "FiraCode Nerd Font Mono"; + font-size = 10; + keybind = [ + ]; + }; + installVimSyntax = true; + enableZshIntegration = true; + installBatSyntax = true; + themes = { + catppuccin-mocha = { + background = "1e1e2e"; + cursor-color = "f5e0dc"; + foreground = "cdd6f4"; + palette = [ + "0=#45475a" + "1=#f38ba8" + "2=#a6e3a1" + "3=#f9e2af" + "4=#89b4fa" + "5=#f5c2e7" + "6=#94e2d5" + "7=#bac2de" + "8=#585b70" + "9=#f38ba8" + "10=#a6e3a1" + "11=#f9e2af" + "12=#89b4fa" + "13=#f5c2e7" + "14=#94e2d5" + "15=#a6adc8" + ]; + selection-background = "353749"; + selection-foreground = "cdd6f4"; + }; + }; + }; programs.neovide = { enable = true; settings = { @@ -123,7 +171,7 @@ font = { normal = "SauceCodePro Nerd Font Mono"; - size = 8; + size = 11; }; }; }; @@ -191,7 +239,7 @@ settings = { main = { term = "foot"; - font = "SauceCodePro Nerd Font Mono:size=6"; + font = "FiraCode Nerd Font Mono:size=6"; dpi-aware = "yes"; shell = "${pkgs.zsh}/bin/zsh"; }; diff --git a/home/.config/nvim/init.lua b/home/.config/nvim/init.lua deleted file mode 100644 index 49640f9..0000000 --- a/home/.config/nvim/init.lua +++ /dev/null @@ -1,156 +0,0 @@ -local vim = vim -local host = vim.loop.os_gethostname() -require("options") -- /etc/nixos/home/.config/nvim/lua/options.lua -require("plugins") -- /etc/nixos/home/.config/nvim/lua/plugins.lua -require("utils.t3_functions") -- /etc/nixos/home/.config/nvim/lua/utils/t3_functions.lua -require("utils.t3_overrides") -- /etc/nixos/home/.config/nvim/lua/utils/t3_overrides.lua -require("utils.reload") -- /etc/nixos/home/.config/nvim/lua/utils/reload.lua -require("vimwiki") -- /etc/nixos/home/.config/nvim/lua/vimwiki.lua -require("keymaps") -- /etc/nixos/home/.config/nvim/lua/keymaps.lua -require("lsp") -- /etc/nixos/home/.config/nvim/lua/lsp.lua -require("completion") -- /etc/nixos/home/.config/nvim/lua/completion.lua -require("treesitter") -- /etc/nixos/home/.config/nvim/lua/treesitter.lua -require("autocmds") -- /etc/nixos/home/.config/nvim/lua/autocmds.lua -require("diagnostics") -- /etc/nixos/home/.config/nvim/lua/diagnostics.lua -require('telescope_configuration') -- /etc/nixos/home/.config/nvim/lua/telescope_configuration.lua - -if host == "xps13" then - require('tokyonight').setup({ - style = "moon", -- "storm", "moon", "day", "night" - transparent = true, -- Enable transparent background - terminal_colors = true, -- Enable terminal colors - styles = { - comments = { italic = true }, -- Italic comments - keywords = { italic = true }, -- Italic keywords - functions = { bold = true }, -- Bold functions - variables = {}, -- No special style for variables - sidebars = "dark", -- Dark sidebars - floats = "dark", -- Dark floating windows - }, - }) -elseif host == "Titan" then - require('tokyonight').setup({ - style = "storm", -- "storm", "moon", "day", "night" - transparent = false, -- Enable transparent background - terminal_colors = true, -- Enable terminal colors - styles = { - comments = { italic = true }, -- Italic comments - keywords = { italic = true }, -- Italic keywords - functions = { bold = true }, -- Bold functions - variables = {}, -- No special style for variables - sidebars = "dark", -- Dark sidebars - floats = "dark", -- Dark floating windows - }, - }) -end - -local function is_linux_console() - return vim.env.TERM == "linux" -end - -local function want_truecolor() - if is_linux_console() then return false end - return vim.fn.has("termguicolors") == 1 - or ((vim.env.COLORTERM or ""):lower():find("truecolor") ~= nil) -end - -local function set_colorscheme() - if want_truecolor() then - vim.o.termguicolors = true - if not pcall(vim.cmd.colorscheme, "tokyonight") then - pcall(vim.cmd.colorscheme, "habamax") - end - else - vim.o.termguicolors = false - if not pcall(vim.cmd.colorscheme, "industry") then - pcall(vim.cmd.colorscheme, "default") - end - end -end - -vim.api.nvim_create_autocmd("VimEnter", { - callback = function() - set_colorscheme() - - local tty = is_linux_console() - - -- LUALINE: no icons, simple separators, TTY theme - pcall(function() - local ok, lualine = pcall(require, "lualine") - if not ok then return end - if tty then - lualine.setup({ - options = { - theme = "16color", -- built-in, safe for TTY - icons_enabled = false, - component_separators = "", - section_separators = "", - globalstatus = true, - }, - sections = { - lualine_a = { "mode" }, - lualine_b = { "branch" }, - lualine_c = { { "filename", file_status = true, path = 1 } }, - lualine_x = { "encoding", "fileformat", "filetype" }, - lualine_y = { "progress" }, - lualine_z = { "location" }, - }, - }) - else - lualine.setup({ - options = { - theme = "tokyonight", - icons_enabled = true, - globalstatus = true, - }, - }) - end - end) - - -- BARBAR: kill icons in TTY, simplify separators - pcall(function() - vim.g.barbar_auto_setup = false - local ok, barbar = pcall(require, "barbar") - if not ok then return end - if tty then - barbar.setup({ - animation = false, - auto_hide = false, - sidebar_filetypes = { NvimTree = true, undotree = { text = "Undotree" } }, - icons = { - -- aggressively disable anything icon-like - buffer_index = false, - buffer_number = false, - button = "", -- close button - diagnostics = { - [vim.diagnostic.severity.ERROR] = { enabled = false }, - [vim.diagnostic.severity.WARN] = { enabled = false }, - [vim.diagnostic.severity.INFO] = { enabled = false }, - [vim.diagnostic.severity.HINT] = { enabled = false }, - }, - gitsigns = { added = {enabled=false}, changed = {enabled=false}, deleted = {enabled=false} }, - filetype = { enabled = false }, - pinned = { button = "", filename = true }, - modified = { button = "*" }, -- simple ASCII marker - separator = { left = "|", right = "|" }, - inactive = { separator = { left = "", right = "" } }, - }, - }) - else - barbar.setup({}) -- your normal config, or keep defaults - end - end) - - -- If you use web-devicons, disable it in TTY to avoid glyphs - if is_linux_console() then - -- If using lazy.nvim, better to conditionally load the plugin (see spec below). - if package.loaded["nvim-web-devicons"] then - local ok, devicons = pcall(require, "nvim-web-devicons") - if ok and devicons.has_loaded() then - -- there's no runtime "disable", but not using it in barbar/lualine is enough. - end - end - end - end, -}) - diff --git a/home/.config/nvim/lazy-lock.json b/home/.config/nvim/lazy-lock.json deleted file mode 100644 index 0db3279..0000000 --- a/home/.config/nvim/lazy-lock.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - -} diff --git a/home/.config/nvim/lua/autocmds.lua b/home/.config/nvim/lua/autocmds.lua deleted file mode 100644 index bc71e2e..0000000 --- a/home/.config/nvim/lua/autocmds.lua +++ /dev/null @@ -1,9 +0,0 @@ -local vim = vim - -vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost" }, { - group = vim.api.nvim_create_augroup("TWTask", { clear = true }), - pattern = "*.wiki", -- Pattern to match Markdown files - callback = function() - vim.cmd('TWSyncTasks') - end, -}) diff --git a/home/.config/nvim/lua/completion.lua b/home/.config/nvim/lua/completion.lua deleted file mode 100644 index b9a5df0..0000000 --- a/home/.config/nvim/lua/completion.lua +++ /dev/null @@ -1,112 +0,0 @@ -local cmp = require("cmp") - -cmp.setup({ - snippet = { - expand = function(args) - require('luasnip').lsp_expand(args.body) -- For `luasnip` users. - end, - }, - window = { - completion = cmp.config.window.bordered(), - documentation = cmp.config.window.bordered(), - }, - mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.complete(), - [""] = cmp.mapping.abort(), - [""] = cmp.mapping.confirm({ select = false }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - else - fallback() - end - end, { "i", "s" }), - - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - else - fallback() - end - end, { "i", "s" }), - }), - sources = cmp.config.sources({ - { name = "nvim_lua" }, - { name = "copilot", group_index = 3 }, - { name = "nvim_lsp", group_index = 1 }, - { name = "path", group_index = 3 }, - { name = "luasnip", group_index = 2 }, - { name = "buffer" }, - { name = "calc" }, - { name = 'orgmode' }, - -- { name = 'vsnip' }, -- For vsnip users. - -- { name = 'luasnip' }, -- For luasnip users. - -- { name = 'ultisnips' }, -- For ultisnips users. - -- { name = 'snippy' }, -- For snippy users. - { name = "crates" }, - -- { name = 'cmdline' }, - -- { name = 'neorg' }, - }), -}) - --- Set configuration for specific filetype. -cmp.setup.filetype("gitcommit", { - sources = cmp.config.sources({ - { name = "cmp_git" }, -- You can specify the `cmp_git` source if you were installed it. - }, { - { name = "buffer" }, - }), -}) - --- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). -cmp.setup.cmdline({ "/", "?" }, { - mapping = cmp.mapping.preset.cmdline(), - sources = { - { name = "buffer" }, - { name = "cmdline" }, - }, -}) - --- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). -cmp.setup.cmdline(":", { - mapping = cmp.mapping.preset.cmdline(), - sources = cmp.config.sources({ - { name = "path" }, - }, { - { name = "cmdline" }, - }), -}) - --- Set up lspconfig. --- require("cmp_nvim_lsp").default_capabilities() -local capabilities = require("cmp_nvim_lsp").default_capabilities() --- Replace with each lsp server you've enabled. --- require('lspconfig')[''].setup { --- capabilities = capabilities --- } -require("lspconfig").clangd.setup({ - capabilities = capabilities, -}) -require("lspconfig").taplo.setup({ - capabilities = capabilities, -}) -require("lspconfig").marksman.setup({ - capabilities = capabilities, -}) -require("lspconfig").lua_ls.setup({ - capabilities = capabilities, -}) -require("lspconfig").rust_analyzer.setup({ - capabilities = capabilities, -}) -require("lspconfig").zls.setup({ - capabilities = capabilities, -}) -require("lspconfig").pyright.setup({ - capabilities = capabilities, -}) --- require'lspconfig'.jedi_language_server.setup { --- capabilities = capabilities, --- } diff --git a/home/.config/nvim/lua/diagnostics.lua b/home/.config/nvim/lua/diagnostics.lua deleted file mode 100644 index 5310947..0000000 --- a/home/.config/nvim/lua/diagnostics.lua +++ /dev/null @@ -1,60 +0,0 @@ -require("tiny-inline-diagnostic").setup({ - -- Style preset for diagnostic messages - -- Available options: - -- "modern", "classic", "minimal", "powerline", - -- "ghost", "simple", "nonerdfont", "amongus" - preset = "modern", - transparent_bg = false, -- Set the background of the diagnostic to transparent - transparent_cursorline = false, -- Set the background of the cursorline to transparent (only one the first diagnostic) - hi = { - error = "DiagnosticError", -- Highlight group for error messages - warn = "DiagnosticWarn", -- Highlight group for warning messages - info = "DiagnosticInfo", -- Highlight group for informational messages - hint = "DiagnosticHint", -- Highlight group for hint or suggestion messages - arrow = "NonText", -- Highlight group for diagnostic arrows - background = "CursorLine", - mixing_color = "None", - }, - - options = { - show_source = { - enabled = false, - if_many = false, - }, - use_icons_from_diagnostic = false, - set_arrow_to_diag_color = false, - add_messages = true, - throttle = 20, - softwrap = 30, - multilines = { - enabled = false, - always_show = false, - trim_whitespaces = false, - tabstop = 4, - }, - show_all_diags_on_cursorline = false, - enable_on_insert = false, - enable_on_select = false, - - overflow = { - mode = "wrap", - padding = 0, - }, - break_line = { - enabled = false, - after = 30, - }, - format = nil, - virt_texts = { - priority = 2048, - }, - severity = { - vim.diagnostic.severity.ERROR, - vim.diagnostic.severity.WARN, - vim.diagnostic.severity.INFO, - vim.diagnostic.severity.HINT, - }, - overwrite_events = nil, - }, - disabled_ft = {} -- List of filetypes to disable the plugin -}) diff --git a/home/.config/nvim/lua/functions.lua b/home/.config/nvim/lua/functions.lua deleted file mode 100644 index 00c2dd8..0000000 --- a/home/.config/nvim/lua/functions.lua +++ /dev/null @@ -1,166 +0,0 @@ -local vim = vim -local fzflua = require("fzf-lua") -local Job = require'plenary.job' - -function t3_find_file() - -- local file_name = vim.fn.input("Find File: ", "", "file") - fzflua.files() -end - -function t3_recent_files() - fzflua.oldfiles() -end - -function t3_org_files() - fzflua.files({ cwd = '~/org/'}) -end - -function t3_project_files() - fzflua.files({ cwd = '~/Projects/'}) -end - -function t3_dot_files() - fzflua.files({ cwd = '~/.dotfiles/'}) -end - -function t3_config_files() - fzflua.files({ cwd = '~/.dotfiles/'}) -end - -function t3_snip_capture(name) - if type(name) ~= "string" or name == "" then - print("Error: Invalid snippet name") - return - end - -- local timestamp = os.date("%Y%m%d%H%M%S") - local snippet_path = "~/.config/nvim/snippets/" - local filename = snippet_path .. name:gsub("%s+", "_") .. ".lua" - local file = io.open(vim.fn.expand(filename), "w") - if file == nil then - print("Error: Could not open file for editing.") - return - end - local previous_buffer = vim.api.nvim_get_current_buf() - file:write("local ls = require('luasnip')\n\nls.add_snippets(\"{}\", {\n\tls.parser.parse_snippet(\n\t\t'{}',\n\t\t'{}'),\n})") - file:close() - vim.cmd("e " .. filename) - vim.bo.filetype = 'lua' - -- vim.cmd("Neorg inject-metadata") - -- Set an autocmd to return to the previous buffer when the note buffer is closed - vim.api.nvim_create_autocmd("BufLeave", { - buffer = 0, -- Current buffer (the note buffer) - callback = function() - load_snippets_from_directory(snippet_path) - vim.cmd("buffer " .. previous_buffer) - end, - }) - print("Captured snippet: " .. filename) -end - -function t3_org_capture(name) - if type(name) ~= "string" or name == "" then - print("Error: Invalid note name") - return - end - local timestamp = os.date("%Y%m%d%H%M%S") - local org_path = "~/org/.org-roam/" - local filename = org_path .. timestamp .. "-" .. name:gsub("%s+", "_") .. ".norg" - local file = io.open(vim.fn.expand(filename), "w") - if file == nil then - print("Error: Could not open file for editing.") - return - end - local previous_buffer = vim.api.nvim_get_current_buf() - file:write("* " .. name .. "\n\n") - file:close() - vim.cmd("e " .. filename) - vim.bo.filetype = 'norg' - vim.cmd("Neorg inject-metadata") - -- Set an autocmd to return to the previous buffer when the note buffer is closed - vim.api.nvim_create_autocmd("BufLeave", { - buffer = 0, -- Current buffer (the note buffer) - callback = function() - vim.cmd("buffer " .. previous_buffer) - end, - }) - print("Captured note: " .. filename) -end - -vim.api.nvim_create_user_command( - 'NeorgCapture', - function() - -- local title = vim.fn.input("Title: ") - local current_workspace = vim.g.neorg_workspace_name - if not current_workspace then - vim.cmd("Neorg workspace default") - end - vim.ui.input({ prompt = "Enter note name: "}, function(note_name) - if not note_name or note_name == "" then - print("Error: Note name required!") - return - end - t3_org_capture(note_name) - end - ) - end, - { nargs = 0, desc = "Capture a Neorg note" } -) - -vim.api.nvim_create_user_command( - 'CaptureSnip', - function() - -- local title = vim.fn.input("Title: ") - -- local current_workspace = vim.g.neorg_workspace_name - -- if not current_workspace then - -- vim.cmd("Neorg workspace default") - -- end - vim.ui.input({ prompt = "Enter snippet name: "}, function(snip_name) - if not snip_name or snip_name == "" then - print("Error: Snippet name required!") - return - end - t3_snip_capture(snip_name) - end - ) - end, - { nargs = 0, desc = "Capture a Neorg note" } -) -function t3_buffers() - fzflua.buffers() -end - -function t3_tabs() - fzflua.tabs() -end - -function t3_live_grep(state) - state = state or 0 - if state == 0 then - fzflua.live_grep() - else - fzflua.live_grep_resume() - end -end - -function t3_grep(state) - state = state or 0 - if state == 0 then - fzflua.grep_project() - else - fzflua.grep() - end -end -function t3_make_ctags() - Job:new({ - command = 'ctags', - args = { '-R .' }, - }) -end - -vim.api.nvim_create_autocmd("FileType", { - pattern = { "markdown", "norg", "md", "wiki" }, -- Set for markdown file type - callback = function() - vim.api.nvim_buf_set_keymap(0, "n", "", "o* [ ] ", { noremap = true, silent = true }) - vim.api.nvim_buf_set_keymap(0, "i", "", "0wi* [ ] ", { noremap = true, silent = true }) - end, -}) diff --git a/home/.config/nvim/lua/keymaps.lua b/home/.config/nvim/lua/keymaps.lua deleted file mode 100644 index 5491e5e..0000000 --- a/home/.config/nvim/lua/keymaps.lua +++ /dev/null @@ -1,112 +0,0 @@ -local vim = vim - -vim.keymap.set("n", "s", function() - vim.cmd("split") - vim.cmd("wincmd j") -end, { noremap = true }) - -vim.keymap.set("n", "v", function() - vim.cmd("vsplit") - vim.cmd("wincmd l") -end, { noremap = true }) - --- Leader Maps -vim.keymap.set("n", "f", "", { desc = "Files"}) -vim.keymap.set("n", "ff", ":FzfLua files", { desc = "File Finder"}) --- vim.keymap.set("n", "fe", ":Pick files", { desc = "File Picker"}) -vim.keymap.set("n", "ft", t3_toggle_netrw, { desc = "File Tree"}) - -vim.keymap.set("n", "b", "", { desc = "Buffers"}) -vim.keymap.set("n", "bb", ":Pick buffers", { desc = "Buffer Picker"}) -vim.keymap.set("n", "bp", ":bp", { desc = "Previous"}) -vim.keymap.set("n", "bn", ":bn", { desc = "Next"}) -vim.keymap.set("n", "bd", ":bd", { desc = "Delete"}) - -vim.keymap.set("n", "g", "", { desc = "Grep"}) -vim.keymap.set("n", "gg", ":FzfLua grep", { desc = "Grep"}) -vim.keymap.set("n", "gr", ":FzfLua grep resume=true", { desc = "Resume Grep"}) - -vim.keymap.set("n", "G", "", { desc = "Git"}) -vim.keymap.set("n", "Gg", ":LazyGit", { desc = "LazyGit"}) -vim.keymap.set("n", "GC", ":LazyGitConfig", { desc = "LazyGit Config"}) -vim.keymap.set("n", "Gc", ":LazyGitFilter", { desc = "Commits"}) -vim.keymap.set("n", "Gl", ":LazyGitLog", { desc = "Log"}) - -vim.keymap.set("n", "", "", { desc = "Tabs"}) -vim.keymap.set("n", "", ":tabnew", { desc = "New Tab"}) -vim.keymap.set("n", "p", ":tabprevious", { desc = "Previous Tab"}) -vim.keymap.set("n", "n", ":tabnext", { desc = "Next Tab"}) -vim.keymap.set("n", "d", ":tabclose", { desc = "Delete Tab"}) -vim.keymap.set("n", "l", ":tablast", { desc = "Last Tab"}) -vim.keymap.set("n", "f", ":tabfirst", { desc = "First Tab"}) -vim.keymap.set("n", "m", ":tabmove", { desc = "Move Tab"}) -vim.keymap.set("n", "r", ":tabrenumber", { desc = "Renumber Tabs"}) -vim.keymap.set("n", "c", ":tabclose!", { desc = "Force Close Tab"}) - -vim.keymap.set("n", "gR", "Glance references", { desc = "Glance References" }) -vim.keymap.set("n", "gD", "Glance definitions", { desc = "Glance Definitions" }) -vim.keymap.set("n", "gY", "Glance type_definitions", { desc = "Glance Type Definitions" }) -vim.keymap.set("n", "gM", "Glance implementations", { desc = "Glance Implementations" }) - -vim.keymap.set("n", "", ":b#", { desc = "Switch to Last Buffer" }) -vim.keymap.set("n", "", ":bprevious", { desc = "Previous Buffer" }) -vim.keymap.set("n", "", ":bnext", { desc = "Next Buffer" }) -vim.keymap.set("n", "", ":tabprevious", { desc = "Previous Tab" }) -vim.keymap.set("n", "", ":tabnext", { desc = "Next Tab" }) -vim.keymap.set("n", "", "BufferGoto 1", { desc = "Go to Buffer 1" }) -vim.keymap.set("n", "", "BufferGoto 2", { desc = "Go to Buffer 2" }) -vim.keymap.set("n", "", "BufferGoto 3", { desc = "Go to Buffer 3" }) -vim.keymap.set("n", "", "BufferGoto 4", { desc = "Go to Buffer 4" }) -vim.keymap.set("n", "", "BufferGoto 5", { desc = "Go to Buffer 5" }) -vim.keymap.set("n", "", "BufferGoto 6", { desc = "Go to Buffer 6" }) -vim.keymap.set("n", "", "BufferGoto 7", { desc = "Go to Buffer 7" }) -vim.keymap.set("n", "", "BufferGoto 8", { desc = "Go to Buffer 8" }) -vim.keymap.set("n", "", "BufferGoto 9", { desc = "Go to Buffer 9" }) -vim.keymap.set("n", "", "BufferLast", { desc = "Go to Last Buffer" }) - --- Meta X Maps -vim.keymap.set("n", "", ":Telescope commands", { desc = "Commands"}) -vim.keymap.set("n", "b", ":Telescope buffers", { desc = "Buffers"}) -vim.keymap.set("n", "f", ":Telescope find_files", { desc = "Find Files"}) -vim.keymap.set("n", "g", ":Telescope live_grep", { desc = "Live Grep"}) -vim.keymap.set("n", "h", ":Telescope help_tags", { desc = "Help Tags"}) -vim.keymap.set("n", "p", ":Telescope project", { desc = "Projects"}) -vim.keymap.set("n", "l", ":Telescope resume", { desc = "Resume Last Search"}) -vim.keymap.set("n", "c", ":Telescope colorscheme", { desc = "Colorschemes"}) -vim.keymap.set("n", "n", ":enew", { desc = "New File"}) -vim.keymap.set("n", "s", ":w", { desc = "Save File"}) -vim.keymap.set("n", "q", ":q", { desc = "Quit"}) -vim.keymap.set("n", "w", ":bd", { desc = "Close Buffer"}) -vim.keymap.set("n", "a", "ggVG", { desc = "Select All"}) -vim.keymap.set("n", "z", "u", { desc = "Undo"}) -vim.keymap.set("n", "y", "", { desc = "Redo"}) -vim.keymap.set("n", "/", ":nohlsearch", { desc = "Clear Search Highlight"}) -vim.keymap.set("n", "=", ":vertical resize +5", { desc = "Increase Window Width"}) -vim.keymap.set("n", "-"," :vertical resize -5", { desc = "Decrease Window Width"}) -vim.keymap.set("n", "+", ":resize +5", { desc = "Increase Window Height"}) -vim.keymap.set("n", "_", ":resize -5", { desc = "Decrease Window Height"}) -vim.keymap.set("n", "Left", ":vertical resize -5", { desc = "Decrease Window Width"}) -vim.keymap.set("n", "Right"," :vertical resize +5", { desc = "Increase Window Width"}) -vim.keymap.set("n", "Up", ":resize +5", { desc = "Increase Window Height"}) -vim.keymap.set("n", "Down", ":resize -5", { desc = "Decrease Window Height"}) -vim.keymap.set("n", "Enter", ":ToggleTerm", { desc = "Toggle Terminal"}) - - --- CTRL X Maps -vim.keymap.set("n", "", ":Pick buffers", { desc = "Buffer Picker"}) -vim.keymap.set("n", "", ":Pick files", { desc = "File Picker"}) -vim.keymap.set("n", "", ":Pick help", { desc = "Help Picker"}) -vim.keymap.set("n", "", "", { desc = "Grep"}) -vim.keymap.set("n", "g", ":Pick grep", { desc = "Grep"}) -vim.keymap.set("n", "l", ":Pick grep_live", { desc = "Live Grep"}) -vim.keymap.set("n", "", "", { desc = "Notes"}) -vim.keymap.set("n", "e", "TWEditTask", { desc = "TaskWarrior Edit", noremap = true, silent = true }) -vim.keymap.set("n", "v", "TWView", { desc = "View Tasks", noremap = true, silent = true }) -vim.keymap.set("n", "u", "TWUpdateCurrent", { desc="Update Tasks", noremap = true, silent = true }) -vim.keymap.set("n", "s", "TWSyncTasks", { desc = "Sync Tasks", noremap = true, silent = true }) -vim.keymap.set("n", "", "TWToggle", { desc = "Toggle Taskwarrior", silent = true }) - -vim.keymap.set("v", "", ":'<,'>SnipRun", { silent = true, desc = "Run Selection" }) -vim.keymap.set("n", "", ":SnipRun", { desc = "Run Current Line" }) -vim.keymap.set("n", "", ":%SnipRun", { desc = "Run Buffer" }) -vim.keymap.set("n", "", "SnipReset", { desc = "Run Buffer" }) diff --git a/home/.config/nvim/lua/lsp.lua b/home/.config/nvim/lua/lsp.lua deleted file mode 100644 index 943f4c5..0000000 --- a/home/.config/nvim/lua/lsp.lua +++ /dev/null @@ -1,57 +0,0 @@ -local vim = vim --- vim.cmd [[ --- augroup LspCompletion --- autocmd! --- autocmd InsertEnter * setlocal omnifunc=v:lua.vim.lsp.omnifunc --- autocmd TextChangedI * if pumvisible() == 0 | silent! lua vim.fn.complete(vim.fn.col('.'), vim.fn["vim.lsp.omnifunc"]()) | endif --- augroup END --- ]] -vim.lsp.enable('lua_ls') -vim.lsp.enable('gopls', { - settings = { - gopls = { - analyses = { - unusedparams = true, - unusedwrite = true, - shadow = true, - }, - staticcheck = true, - usePlaceholders = true, - hints = { - assignVariableTypes = true, - compositeLiteralFields = true, - compositeLiteralTypes = true, - functionTypeParameters = true, - parameterNames = true, - rangeVariableTypes = true, - }, - }, - }, -}) -require("lsp_signature").setup({ - debug = false, - bind = true, -- registers signature handler - doc_lines = 10, - max_height = 12, - max_width = function() return math.floor(vim.api.nvim_win_get_width(0) * 0.8) end, - wrap = true, - floating_window = true, -- show the popup - floating_window_above_cur_line = true, - floating_window_off_x = 1, - floating_window_off_y = 0, - - -- IMPORTANT: don’t inline (you can change later if you want) - hint_enable = true, - hint_inline = function() return false end, - - hint_prefix = "🐼 ", - hint_scheme = "String", - hi_parameter = "LspSignatureActiveParameter", - handler_opts = { border = "rounded" }, - - always_trigger = false, - extra_trigger_chars = { "(", "," }, -- good default - zindex = 200, - padding = "", - timer_interval = 200, -}) diff --git a/home/.config/nvim/lua/options.lua b/home/.config/nvim/lua/options.lua deleted file mode 100644 index 3f92afa..0000000 --- a/home/.config/nvim/lua/options.lua +++ /dev/null @@ -1,55 +0,0 @@ -local vim = vim - -vim.o.number = true -vim.o.relativenumber = true -vim.o.tabstop = 2 -vim.o.shiftwidth = 2 -vim.o.wrap = false -vim.o.scrolloff = 5 -vim.o.colorcolumn = "80" -vim.o.wildmenu = true -vim.o.wildmode = "longest:full,full" -vim.o.wildoptions = "pum" -vim.g.mapleader = " " -vim.o.termguicolors = true -vim.o.winborder = "shadow" -vim.o.clipboard = "unnamedplus" -vim.o.completeopt = "menuone" --- vim.o.completeopt = "menuone,noinsert,noselect" -vim.o.cursorline = true -vim.o.sessionoptions="blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions" -vim.g.netrw_keepdir = 1 -vim.g.netrw_winsize = 20 -vim.g.netrw_banner = 0 -vim.g.netrw_localcopydircmd = 'cp -avr' -vim.g.netrw_liststyle = 3 -vim.g.netrw_browse_split = 4 - -vim.o.foldmethod = "expr" -vim.o.foldexpr = "nvim_treesitter#foldexpr()" -vim.o.foldlevel = 1 -vim.o.foldenable = true - -vim.o.undofile = true -vim.o.undodir = vim.fn.stdpath("data") .. "/undo" - -vim.api.nvim_create_autocmd("FileType", { - pattern = "help", - callback = function() - vim.opt_local.wrap = true - end, -}) - -vim.api.nvim_create_autocmd("FileType", { - pattern = "markdown", - callback = function() - vim.opt_local.wrap = true - end, -}) - -vim.api.nvim_create_autocmd("BufWritePost", { - pattern = ".wiki", - callback = function() - vim.cmd("VimwikiGenerateLinks") - end, -}) diff --git a/home/.config/nvim/lua/plugins.lua b/home/.config/nvim/lua/plugins.lua deleted file mode 100644 index 95c7646..0000000 --- a/home/.config/nvim/lua/plugins.lua +++ /dev/null @@ -1,138 +0,0 @@ -local vim = vim -local host = vim.loop.os_gethostname() - -vim.pack.add({ - { src = "https://github.com/folke/tokyonight.nvim" }, - { src = "https://github.com/nvim-tree/nvim-web-devicons" }, - { src = "https://github.com/ibhagwan/fzf-lua" }, - { src = "https://github.com/echasnovski/mini.pick" }, - { src = "https://github.com/echasnovski/mini.icons" }, - { src = "https://github.com/echasnovski/mini.files" }, - { src = "https://github.com/echasnovski/mini.pairs" }, - { src = "https://github.com/echasnovski/mini.notify" }, - { src = "https://github.com/echasnovski/mini.surround" }, - { src = "https://github.com/echasnovski/mini.indentscope" }, - { src = "https://github.com/echasnovski/mini.fuzzy" }, - { src = "https://github.com/echasnovski/mini.tabline" }, - { src = "https://github.com/nvim-lualine/lualine.nvim" }, - { src = "https://github.com/folke/which-key.nvim" }, - { src = "https://github.com/L3MON4D3/LuaSnip" }, - { src = "https://github.com/neovim/nvim-lspconfig" }, - { src = "https://github.com/hrsh7th/nvim-cmp" }, - { src = "https://github.com/hrsh7th/cmp-nvim-lsp" }, - { src = "https://github.com/hrsh7th/cmp-buffer" }, - { src = "https://github.com/hrsh7th/cmp-path" }, - { src = "https://github.com/hrsh7th/cmp-cmdline" }, - { src = "https://github.com/hrsh7th/cmp-nvim-lua" }, - { src = "https://github.com/saadparwaiz1/cmp_luasnip" }, - { src = "https://github.com/github/copilot.vim" }, - { src = "https://github.com/pysan3/pathlib.nvim" }, - { src = "https://github.com/nvim-orgmode/org-bullets.nvim" }, - { src = "https://github.com/lukas-reineke/headlines.nvim" }, - { src = "https://github.com/michaelb/sniprun", run = "bash install.sh 1" }, - { src = "https://github.com/akinsho/toggleterm.nvim" }, - { src = "https://github.com/kdheepak/lazygit.nvim" }, - { src = "https://github.com/saecki/crates.nvim" }, - { src = "https://github.com/nvim-treesitter/nvim-treesitter" }, - { src = "https://github.com/folke/trouble.nvim" }, - { src = "https://github.com/folke/todo-comments.nvim" }, - { src = "https://github.com/MunifTanjim/nui.nvim" }, - { src = "https://github.com/huantrinh1802/m_taskwarrior_d.nvim" }, - { src = "https://github.com/rmagatti/auto-session" }, - { src = "https://github.com/romgrk/barbar.nvim" }, - { src = "https://github.com/christoomey/vim-tmux-navigator" }, - { src = "https://github.com/rachartier/tiny-inline-diagnostic.nvim" }, - { src = "https://github.com/zeioth/garbage-day.nvim" }, - { src = "https://github.com/ray-x/lsp_signature.nvim" }, - { src = "https://github.com/DNLHC/glance.nvim" }, - { src = "https://github.com/rmagatti/logger.nvim" }, - { src = "https://github.com/rmagatti/goto-preview" }, - { src = "https://github.com/norcalli/nvim-colorizer.lua" }, - { src = "https://github.com/nvim-lua/plenary.nvim" }, - { src = "https://github.com/nvim-telescope/telescope.nvim" }, - { src = "https://github.com/nvim-telescope/telescope-project.nvim"}, - { src = "https://github.com/nvim-telescope/telescope-ui-select.nvim" }, - { src = "https://github.com/luckasRanarison/nvim-devdocs" }, - { src = "https://github.com/folke/noice.nvim" }, - { src = "https://github.com/mbbill/undotree.git" }, -}) - -if host == "xps13" then -end - -require('mini.icons').setup({}) -require('mini.pick').setup({}) -require('mini.pairs').setup({}) -require('mini.notify').setup({}) -require('mini.surround').setup({}) -require('mini.indentscope').setup({}) -require('mini.tabline').setup({}) -require('mini.fuzzy').setup({}) -require('lualine').setup({ options = { theme = 'tokyonight' } }) -require('which-key').setup({}) -require('fzf-lua').setup({}) -require('crates').setup({}) -require('todo-comments').setup({ - options = { - keywords = { - FIX = { - icon = " ", -- icon used for the sign, and in search results - color = "error", -- can be a hex color, or a named color (see below) - alt = { "FIXME", "BUG", "FIXIT", "ISSUE" }, -- a set of other keywords that all map to this FIX keywords - -- signs = false, -- configure signs for some keywords individually - }, - TODO = { icon = " ", color = "info" }, - HACK = { icon = " ", color = "warning" }, - WARN = { icon = " ", color = "warning", alt = { "WARNING", "XXX" } }, - PERF = { icon = " ", alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } }, - NOTE = { icon = " ", color = "hint", alt = { "INFO" } }, - TEST = { icon = "⏲ ", color = "test", alt = { "TESTING", "PASSED", "FAILED" } }, - }, - } -}) -require('trouble').setup({}) -require('org-bullets').setup({}) -require('headlines').setup({}) -require('sniprun').setup({ - binary_path = '/home/th3r00t/.local/share/nvim/site/pack/core/opt/sniprun/\ - target/release/sniprun' -}) -require('toggleterm').setup({ - size = 20, - open_mapping = [[]], - hide_numbers = true, - shade_filetypes = {}, - shading_factor = 2, - start_in_insert = true, - insert_mappings = true, - persist_size = true, - direction = 'horizontal', - close_on_exit = true, - shell = vim.o.shell, -}) -require('m_taskwarrior_d').setup({}) -require("auto-session").setup({ - suppressed_dirs = { "~/Downloads", "~/Documents", "~/Projects", "~/" }, -}) -require('barbar').setup({}) -require('goto-preview').setup({ default_mappings = true }) -require('colorizer').setup({}) -require('telescope').setup({}) -require('nvim-devdocs').setup({}) -require('noice').setup({ - lsp = { - override = { - ["vim.lsp.util.convert_input_to_markdown_lines"] = true, - ["vim.lsp.util.stylize_markdown"] = true, - ["cmp.entry.get_documentation"] = true, -- requires hrsh7th/nvim-cmp - }, - }, - presets = { - bottom_search = true, -- use a classic bottom cmdline for search - command_palette = true, -- position the cmdline and popupmenu together - long_message_to_split = true, -- long messages will be sent to a split - inc_rename = false, -- enables an input dialog for inc-rename.nvim - lsp_doc_border = false, -- add a border to hover docs and signature help - }, -}) - diff --git a/home/.config/nvim/lua/telescope_configuration.lua b/home/.config/nvim/lua/telescope_configuration.lua deleted file mode 100644 index 309e139..0000000 --- a/home/.config/nvim/lua/telescope_configuration.lua +++ /dev/null @@ -1,32 +0,0 @@ -local vim = vim -local host = vim.loop.os_gethostname() - -require('telescope').load_extension('project') -require('telescope').load_extension('ui-select') - -require('telescope').setup{ - defaults = { - mappings = { - i = { - [""] = false, - [""] = false, - }, - }, - }, - pickers = { - -- Default configuration for builtin pickers goes here: - -- picker_name = { - -- picker_config_key = value, - -- ... - -- } - -- Now the picker_config_key will be applied every time you call this - -- builtin picker - }, - extensions = { - ["ui-select"] = { - require("telescope.themes").get_dropdown { - -- even more opts - } - }, - } -} diff --git a/home/.config/nvim/lua/terminal.lua b/home/.config/nvim/lua/terminal.lua deleted file mode 100644 index 1dd5cfb..0000000 --- a/home/.config/nvim/lua/terminal.lua +++ /dev/null @@ -1,11 +0,0 @@ -function _G.set_terminal_keymaps() - local opts = { buffer = 0 } - vim.keymap.set('t', '', [[]], opts) - vim.keymap.set('t', 'jk', [[]], opts) - vim.keymap.set('t', '', [[wincmd h]], opts) - vim.keymap.set('t', '', [[wincmd j]], opts) - vim.keymap.set('t', '', [[wincmd k]], opts) - vim.keymap.set('t', '', [[wincmd l]], opts) -end - -vim.cmd('autocmd! TermOpen term://* lua set_terminal_keymaps()') diff --git a/home/.config/nvim/lua/treesitter.lua b/home/.config/nvim/lua/treesitter.lua deleted file mode 100644 index 938e1e0..0000000 --- a/home/.config/nvim/lua/treesitter.lua +++ /dev/null @@ -1,11 +0,0 @@ -local configs = require('nvim-treesitter.configs') -configs.setup({ - -- ensure_installed = { - -- "ini", "bash", "c", "lua", "vim", "vimdoc", "query", "python", - -- "rust", "zig", "typescript", "svelte", "css", "html", "nix" - -- }, - sync_install = false, - highlight = { enable = true }, - indent = { enable = true, disable = { "norg" }, }, - incremental_selection = { enable = true }, -}) diff --git a/home/.config/nvim/lua/utils/reload.lua b/home/.config/nvim/lua/utils/reload.lua deleted file mode 100644 index db23d5f..0000000 --- a/home/.config/nvim/lua/utils/reload.lua +++ /dev/null @@ -1,11 +0,0 @@ -for name,_ in pairs(package.loaded) do - if name:match("^t3") - or name:match("^options") - or name:match("^overrides") - or name:match("^plugins") - or name:match("keymaps") - or name:match("^reload") - then - package.loaded[name] = nil - end -end diff --git a/home/.config/nvim/lua/utils/t3_functions.lua b/home/.config/nvim/lua/utils/t3_functions.lua deleted file mode 100644 index fcb3181..0000000 --- a/home/.config/nvim/lua/utils/t3_functions.lua +++ /dev/null @@ -1,187 +0,0 @@ -local vim = vim -local fzflua = require("fzf-lua") - -function t3_find_file() - -- local file_name = vim.fn.input("Find File: ", "", "file") - fzflua.files() -end - -function t3_recent_files() - fzflua.oldfiles() -end - -function t3_org_files() - fzflua.files({ cwd = '~/org/'}) -end - -function t3_project_files() - fzflua.files({ cwd = '~/Projects/'}) -end - -function t3_dot_files() - fzflua.files({ cwd = '~/.dotfiles/'}) -end - -function t3_config_files() - fzflua.files({ cwd = '~/.dotfiles/'}) -end - -function t3_snip_capture(name) - if type(name) ~= "string" or name == "" then - print("Error: Invalid snippet name") - return - end - -- local timestamp = os.date("%Y%m%d%H%M%S") - local snippet_path = "~/.config/nvim/snippets/" - local filename = snippet_path .. name:gsub("%s+", "_") .. ".lua" - local file = io.open(vim.fn.expand(filename), "w") - if file == nil then - print("Error: Could not open file for editing.") - return - end - local previous_buffer = vim.api.nvim_get_current_buf() - file:write("local ls = require('luasnip')\n\nls.add_snippets(\"{}\", {\n\tls.parser.parse_snippet(\n\t\t'{}',\n\t\t'{}'),\n})") - file:close() - vim.cmd("e " .. filename) - vim.bo.filetype = 'lua' - -- vim.cmd("Neorg inject-metadata") - -- Set an autocmd to return to the previous buffer when the note buffer is closed - vim.api.nvim_create_autocmd("BufLeave", { - buffer = 0, -- Current buffer (the note buffer) - callback = function() - load_snippets_from_directory(snippet_path) - vim.cmd("buffer " .. previous_buffer) - end, - }) - print("Captured snippet: " .. filename) -end - -function t3_org_capture(name) - if type(name) ~= "string" or name == "" then - print("Error: Invalid note name") - return - end - local timestamp = os.date("%Y%m%d%H%M%S") - local org_path = "~/org/.org-roam/" - local filename = org_path .. timestamp .. "-" .. name:gsub("%s+", "_") .. ".norg" - local file = io.open(vim.fn.expand(filename), "w") - if file == nil then - print("Error: Could not open file for editing.") - return - end - local previous_buffer = vim.api.nvim_get_current_buf() - file:write("* " .. name .. "\n\n") - file:close() - vim.cmd("e " .. filename) - vim.bo.filetype = 'norg' - vim.cmd("Neorg inject-metadata") - -- Set an autocmd to return to the previous buffer when the note buffer is closed - vim.api.nvim_create_autocmd("BufLeave", { - buffer = 0, -- Current buffer (the note buffer) - callback = function() - vim.cmd("buffer " .. previous_buffer) - end, - }) - print("Captured note: " .. filename) -end - -vim.api.nvim_create_user_command( - 'NeorgCapture', - function() - -- local title = vim.fn.input("Title: ") - local current_workspace = vim.g.neorg_workspace_name - if not current_workspace then - vim.cmd("Neorg workspace default") - end - vim.ui.input({ prompt = "Enter note name: "}, function(note_name) - if not note_name or note_name == "" then - print("Error: Note name required!") - return - end - t3_org_capture(note_name) - end - ) - end, - { nargs = 0, desc = "Capture a Neorg note" } -) - -vim.api.nvim_create_user_command( - 'CaptureSnip', - function() - -- local title = vim.fn.input("Title: ") - -- local current_workspace = vim.g.neorg_workspace_name - -- if not current_workspace then - -- vim.cmd("Neorg workspace default") - -- end - vim.ui.input({ prompt = "Enter snippet name: "}, function(snip_name) - if not snip_name or snip_name == "" then - print("Error: Snippet name required!") - return - end - t3_snip_capture(snip_name) - end - ) - end, - { nargs = 0, desc = "Capture a Neorg note" } -) -function t3_buffers() - fzflua.buffers() -end - -function t3_tabs() - fzflua.tabs() -end - -function t3_live_grep(state) - state = state or 0 - if state == 0 then - fzflua.live_grep() - else - fzflua.live_grep_resume() - end -end - -function t3_grep(state) - state = state or 0 - if state == 0 then - fzflua.grep_project() - else - fzflua.grep() - end -end - -local function is_netrw_open() - for _, win in ipairs(vim.api.nvim_tabpage_list_wins(0)) do - local buf = vim.api.nvim_win_get_buf(win) - if vim.bo[buf].filetype == "netrw" then - return true, win - end - end - return false, nil -end - -function t3_toggle_netrw() - local is_open, win = is_netrw_open() - if is_open then - vim.api.nvim_win_close(win, true) - else - vim.cmd("Lexplore") - end -end - -vim.api.nvim_create_autocmd("FileType", { - pattern = { "markdown", "norg", "md", "wiki" }, -- Set for markdown file type - callback = function() - vim.api.nvim_buf_set_keymap(0, "n", "", "o* [ ] ", { noremap = true, silent = true }) - vim.api.nvim_buf_set_keymap(0, "i", "", "0wi* [ ] ", { noremap = true, silent = true }) - end, -}) -vim.api.nvim_create_user_command("Split", function() - vim.cmd("split") - vim.cmd("wincmd j") -end, {}) - -vim.api.nvim_create_user_command("Vsplit", function() - vim.cmd("vsplit") - vim.cmd("wincmd l") -end, {}) diff --git a/home/.config/nvim/lua/utils/t3_overrides.lua b/home/.config/nvim/lua/utils/t3_overrides.lua deleted file mode 100644 index 0dc4cdc..0000000 --- a/home/.config/nvim/lua/utils/t3_overrides.lua +++ /dev/null @@ -1,5 +0,0 @@ --- vim.api.nvim_create_autocmd("winNew", { --- callback = function() --- vim.cmd("wincmd w") --- end, --- }) diff --git a/home/.config/nvim/lua/vimwiki.lua b/home/.config/nvim/lua/vimwiki.lua deleted file mode 100644 index 334c135..0000000 --- a/home/.config/nvim/lua/vimwiki.lua +++ /dev/null @@ -1,109 +0,0 @@ -local vim = vim -local opt = vim.opt - --- opt.wildmenu = true --- vim.g.netrw_keepdir = 0 --- vim.treesitter.language.register("markdown", "vimwiki") --- vim.g.vimwiki_folding = 'expr' --- vim.g.vimwiki_header_type = "=" - --- vim.api.nvim_create_autocmd({ "BufWritePost" }, { --- pattern = "*.wiki", -- Adjust this pattern if your Vimwiki files have a different extension --- callback = function() --- vim.cmd("TWSyncTasks") --- end, --- }) - --- Autocommand to trigger LuaSnip snippet expansion for new diary files -vim.api.nvim_create_autocmd("BufNewFile", { - pattern = "diary/*.wiki", -- Adjust this path to match your diary directory - callback = function() - -- Expand the 'diary_template' snippet automatically - ls.snip_expand(ls.snippets.diary_template[1]) - end, -}) -vim.g.vimwiki_automatic_nested_syntaxes = 1 -vim.g.vimwiki_list = { - { - name = "Personal Wiki", - path = '/home/th3r00t/wiki/', - path_html = '/home/th3r00t/wiki/html/', - syntax = 'default', - ext = '.wiki', - diary_rel_path = 'diary/', - diary_index = "diary_index", - auto_tags = 1, - auto_toc = 1, - auto_export = 1, - template_path = "/home/th3r00t/wiki/templates/", - template_default = "def_template", - template_ext = "html", - css_name = "main.css", - maxhi = 1, -- BUG: Can be a source of lag. - diary_caption_level = 1, - bullet_types = { "-", "*", "#", "→" }, - cycle_bullets = 1, - generated_links_caption = 1, - listsyms = '✗○◐●✓', - -- listsym_rejected = '✗', - auto_diary_index = 1, - auto_generate_links = 1, - auto_generate_tags = 1, - exclude_files = { "**/README.md" }, - rss_name = "feed.rss", - base_url = "https://th3r00t.net", - } -} -vim.g.vimwiki_syntax_plugins = { - codeblock = { - ["```lua"] = { parser = "lua" }, - ["```python"] = { parser = "python" }, - ["```javascript"] = { parser = "javascript" }, - ["```bash"] = { parser = "bash" }, - ["```html"] = { parser = "html" }, - ["```css"] = { parser = "css" }, - ["```c"] = { parser = "c" }, - ["```zig"] = { parser = "zig" }, - }, -} -vim.g.vimwiki_toc_header = "Navigation" -vim.g.vimwiki_toc_header_level = 2 -vim.g.vimwiki_hl_cb_checked = 1 -vim.g.vimwiki_global_ext = 1 -vim.g.vimwiki_auto_chdir = 1 -vim.g.wimwiki_markdown_link_ext = 1 --- vim.g.vimwiki_folding = 'list' -vim.g.vimwiki_folding = 'expr' -vim.g.vimwiki_use_calendar = 1 -vim.api.nvim_set_keymap('n', 'ww', 'VimwikiIndex', { noremap = true, silent = true }) -vim.api.nvim_set_keymap('n', 'wt', 'VimwikiTabIndex', { noremap = true, silent = true }) -vim.api.nvim_set_keymap('n', 'ws', 'VimwikiUISelect', { noremap = true, silent = true }) -local function setup_vimwiki_highlights() - -- Define color scheme mappings - local colors = { - header1 = "#81a1c1", -- Tokyo Night blue - header2 = "#88c0d0", -- Tokyo Night light blue - header3 = "#8fbcbb", -- Tokyo Night greenish blue - bold = "#eceff4", -- Tokyo Night bright white - italic = "#5e81ac", -- Tokyo Night dark blue - link = "#b48ead", -- Tokyo Night purple - list = "#d08770", -- Tokyo Night orange - } - - -- Apply highlights for vimwiki syntax elements - vim.api.nvim_set_hl(0, "VimwikiHeader1", { fg = colors.header1, bold = true }) - vim.api.nvim_set_hl(0, "VimwikiHeader2", { fg = colors.header2, bold = true }) - vim.api.nvim_set_hl(0, "VimwikiHeader3", { fg = colors.header3, bold = true }) - vim.api.nvim_set_hl(0, "VimwikiBold", { fg = colors.bold, bold = true }) - vim.api.nvim_set_hl(0, "VimwikiItalic", { fg = colors.italic, italic = true }) - vim.api.nvim_set_hl(0, "VimwikiLink", { fg = colors.link, underline = true }) - vim.api.nvim_set_hl(0, "VimwikiList", { fg = colors.list }) -end -setup_vimwiki_highlights() --- Define the Lua function for generating the diary template --- -vim.pack.add({ - { src = "https://github.com/vimwiki/vimwiki", opt = true }, -}) - -vim.cmd.packadd("vimwiki") diff --git a/modules/configuration-server.nix b/modules/configuration-server.nix index 4469404..862eba6 100644 --- a/modules/configuration-server.nix +++ b/modules/configuration-server.nix @@ -5,16 +5,18 @@ { config, pkgs, ... }: { - imports = - [ - ./hardware-configuration.nix - ./server-partitioning.nix - ./configuration-common.nix - ]; - nix.settings.experimental-features = [ "nix-command" "flakes" ]; - nix.settings.trusted-users = [ "root" "th3r00t" ]; - networking.hostName = "Titan"; # Define your hostname. - # Bootloader. + imports = [ + ./hardware-configuration.nix + ./server-partitioning.nix + ./configuration-common.nix + ]; + nixpkgs.config.allowUnfree = true; + nix = { + settings = { + experimental-features = [ "nix-command" "flakes" ]; + trusted-users = [ "root" "th3r00t" ]; + }; + }; boot = { kernelPackages = pkgs.linuxPackages_latest; initrd.availableKernelModules = [ @@ -29,46 +31,28 @@ extraModprobeConfig = '' ''; }; - # Set your time zone. + networking = { + hostName = "Titan"; # Define your hostname. + firewall.enable = true; + firewall.allowedTCPPorts = [ 21 22 80 443 5900 8080 8384]; + firewall.allowedUDPPorts = [ 21 22 80 443 5900 8080 8384]; + }; time.timeZone = "America/New_York"; - - # Select internationalisation properties. - i18n.defaultLocale = "en_US.UTF-8"; - - i18n.extraLocaleSettings = { - LC_ADDRESS = "en_US.UTF-8"; - LC_IDENTIFICATION = "en_US.UTF-8"; - LC_MEASUREMENT = "en_US.UTF-8"; - LC_MONETARY = "en_US.UTF-8"; - LC_NAME = "en_US.UTF-8"; - LC_NUMERIC = "en_US.UTF-8"; - LC_PAPER = "en_US.UTF-8"; - LC_TELEPHONE = "en_US.UTF-8"; - LC_TIME = "en_US.UTF-8"; + i18 = { + defaultLocale = "en_US.UTF-8"; + extraLocaleSettings = { + LC_ADDRESS = "en_US.UTF-8"; + LC_IDENTIFICATION = "en_US.UTF-8"; + LC_MEASUREMENT = "en_US.UTF-8"; + LC_MONETARY = "en_US.UTF-8"; + LC_NAME = "en_US.UTF-8"; + LC_NUMERIC = "en_US.UTF-8"; + LC_PAPER = "en_US.UTF-8"; + LC_TELEPHONE = "en_US.UTF-8"; + LC_TIME = "en_US.UTF-8"; + }; }; - # Enable the X11 windowing system. - # You can disable this if you're only using the Wayland session. - # services.xserver.enable = true; - - # Enable the KDE Plasma Desktop Environment. - # services.displayManager.sddm.enable = true; - # services.desktopManager.plasma6.enable = true; - - # Configure keymap in X11 - # services.xserver.xkb = { - # layout = "us"; - # variant = ""; - # }; - - # Enable CUPS to print documents. - services.printing.enable = true; - - # Enable sound with pipewire. - services.pulseaudio.enable = false; - security.rtkit.enable = true; - - # Enable touchpad support (enabled default in most desktopManager). fonts = { enableDefaultPackages = true; fontDir.enable = true; @@ -76,62 +60,45 @@ ]; }; - # Define a user account. Don't forget to set a password with ‘passwd’. users.users.th3r00t = { isNormalUser = true; description = "Mike 'th3r00t' Young"; extraGroups = [ "networkmanager" "wheel" "input" ]; packages = with pkgs; [ - # kdePackages.kate - # thunderbird + ]; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIH8P/3yzsruekSaZ9b+yk429VTcfCtI1j8jnkNbPAgnr th3r00t@nixos" ]; }; - # Enable automatic login for the user. - - nixpkgs.config.allowUnfree = true; - - # List packages installed in system profile. To search, run: - # $ nix search wget - environment.variables.EDITOR = "nvim"; - environment.systemPackages = with pkgs; [ - # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. - # wget - git - vim - curl - age - ]; - - # Some programs need SUID wrappers, can be configured further or are - # started in user sessions. - programs.mtr.enable = true; - programs.gnupg.agent = { - enable = true; - enableSSHSupport = true; + environment = { + variables.EDITOR = "nvim"; + systemPackages = with pkgs; [ + git + vim + curl + age + ]; }; - # List services that you want to enable: + programs = { + mtr.enable = true; + gnupg.agent = { + enable = true; + enableSSHSupport = true; + }; + }; + + services = { + pulseaudio.enable = false; + rtkit.enable = true; + printing.enable = false; + openssh.enable = true; + }; - # Enable the OpenSSH daemon. - services.openssh.enable = true; users.users.root.openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIH8P/3yzsruekSaZ9b+yk429VTcfCtI1j8jnkNbPAgnr th3r00t@nixos" ]; - - # Open ports in the firewall. - networking.firewall.allowedTCPPorts = [ 21 22 80 443 5900 8080 8384]; - networking.firewall.allowedUDPPorts = [ 21 22 80 443 5900 8080 8384]; - # Or disable the firewall altogether. - # networking.firewall.enable = false; - - # This value determines the NixOS release from which the default - # settings for stateful data, like file locations and database versions - # on your system were taken. It‘s perfectly fine and recommended to leave - # this value at the release version of the first install of this system. - # Before changing this value read the documentation for this option - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). system.stateVersion = "25.05"; # Did you read the comment? - } diff --git a/modules/configuration-xps13.nix b/modules/configuration-xps13.nix index 1dd7f02..cbf27a5 100644 --- a/modules/configuration-xps13.nix +++ b/modules/configuration-xps13.nix @@ -27,24 +27,8 @@ options ath10k_core rawmode=1 ''; }; - services.udisks2.enable = false; - # Enable CUPS to print documents. - services.printing.enable = true; - programs.uwsm.enable = true; - programs.hyprland.withUWSM = true; - # Enable sound with pipewire. - services.pulseaudio.enable = false; security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - jack.enable = true; - #media-session.enable = true; - }; # Enable touchpad support (enabled default in most desktopManager). - services.libinput.enable = true; fonts = { enableDefaultPackages = true; fontDir.enable = true; @@ -58,6 +42,7 @@ ]++ builtins.filter lib.attrsets.isDerivation (builtins.attrValues pkgs.nerd-fonts); }; + # Define a user account. Don't forget to set a password with ‘passwd’. users.users.th3r00t = { isNormalUser = true; @@ -69,38 +54,53 @@ ]; }; - # Enable automatic login for the user. - services.displayManager.autoLogin.enable = true; - services.displayManager.autoLogin.user = "th3r00t"; - - programs.firefox.enable = true; - programs.hyprland.enable = true; - - # List packages installed in system profile. To search, run: # $ nix search wget environment.systemPackages = with pkgs; [ - # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. - # wget git vim curl age ]; + #media-session.enable = true; - # Some programs need SUID wrappers, can be configured further or are - # started in user sessions. - programs.mtr.enable = true; + programs = { + mtr.enable = true; + firefox.enable = true; + hyprland = { + enable = true; + withUWSM = true; + }; + steam = { + enable = true; + remotePlay.openFirewall = true; + dedicatedServer.openFirewall = true; + localNetworkGameTransfers.openFirewall = true; + }; + # uwsm.enable = true; + }; - # List services that you want to enable: - - # Enable the OpenSSH daemon. - services.openssh.enable = true; + services = { + openssh.enable = true; + displayManager.autoLogin.enable = true; + displayManager.autoLogin.user = "th3r00t"; + pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + jack.enable = true; + }; + udisks2.enable = false; + printing.enable = true; + pulseaudio.enable = false; + libinput.enable = true; + logmein-hamachi.enable = true; + }; # Open ports in the firewall. - networking.firewall.allowedTCPPorts = [ 21 22 80 443 5900 8080 ]; - networking.firewall.allowedUDPPorts = [ 21 22 80 443 5900 8080 ]; - # Or disable the firewall altogether. + networking.firewall.allowedTCPPorts = [ 21 22 80 443 5900 8080 12121 12122 ]; + networking.firewall.allowedUDPPorts = [ 21 22 80 443 5900 8080 12121 12122 ]; # networking.firewall.enable = false; # This value determines the NixOS release from which the default diff --git a/modules/home-manager-common.nix b/modules/home-manager-common.nix index 3f332be..cda3ca4 100644 --- a/modules/home-manager-common.nix +++ b/modules/home-manager-common.nix @@ -167,10 +167,10 @@ set -g @tokyo-night-tmux_show_path 1 set -g @tokyo-night-tmux_path_format relative # 'relative' or 'full' if-shell "[[ $(hostname) = 'xps13' ]]" { - set -g @tokyo-night-tmux_show_netspeed 1 + # set -g @tokyo-night-tmux_show_netspeed 1 set -g @tokyo-night-tmux_netspeed_iface 'wlp2s0' set -g @tokyo-night-tmux_netspeed_showip 1 - set -g @tokyo-night-tmux_netspeed_refresh 1 + # set -g @tokyo-night-tmux_netspeed_refresh 1 set -g @tokyo-night-tmux_show_battery_widget 1 set -g @tokyo-night-tmux_battery_name "BAT0" set -g @tokyo-night-tmux_battery_low_threshold 21 diff --git a/modules/hyprland.nix b/modules/hyprland.nix index 03dd349..94c0e7b 100644 --- a/modules/hyprland.nix +++ b/modules/hyprland.nix @@ -66,16 +66,22 @@ monitor = eDP-1, preferred,0x0,2 # monitor = Virtual-1, 2800x1752@120, 1920x0, 1 - $terminal = footclient -e tmux new-session zsh -c '~/.local/usr/bin/tmuxstartup.sh' - $fileManager = footclient -T vifm -e vifm + # $terminal = ghostty + $terminal = footclient + # $terminal = footclient -e tmux new-session zsh -c '~/.local/usr/bin/tmuxstartup.sh' + $fileManager = footclient -T ranger -e ranger + $fileManager = footclient -T ranger -e ranger $systeminfo = hyprsysteminfo $menu = wofi --show drun $browser = qutebrowser $notes = footclient -T capture -e pytui -n + $manpages = footclient -T capture -e pytui -m $sysmon = footclient -T system-monitor -e bashtop + $editor = neovide bind = $mainMod SHIFT, M, exec, hyprvirtmon.py bind = $mainMod SHIFT, Return, exec, $terminal + bind = $mainMod, D, exec, $editor bind = $mainMod, E, exec, $fileManager bind = $mainMod SHIFT, C, killactive bind = $mainMod SHIFT, Q, exit @@ -84,6 +90,7 @@ bind = $mainMod, B, exec, $browser bind = $mainMod, M, exec, $sysmon bind = $mainMod CTRL, N, exec, $notes + bind = $mainMod CTRL, M, exec, $manpages # bind = $mainMod, P, exec, $menu bind = $mainMod, V, togglefloating bind = $mainMod, P, pseudo, # dwindle