From ea4de175b3d643aabdf50b80af46b222968657d2 Mon Sep 17 00:00:00 2001 From: sgoudham Date: Thu, 29 Jun 2023 01:21:33 +0100 Subject: [PATCH] refactor!: we nix now --- .chezmoi.yaml.tmpl | 21 - .chezmoiignore | 6 - README.md | 5 +- dot_config/lvim/config.lua | 1 - dot_config/lvim/lua/hammy/formatter.lua | 8 - dot_config/lvim/lua/hammy/init.lua | 21 - dot_config/lvim/lua/hammy/linter.lua | 18 - dot_config/lvim/lua/hammy/lsp/haskell.lua | 5 - dot_config/lvim/lua/hammy/lsp/init.lua | 60 -- dot_config/lvim/lua/hammy/lsp/rust.lua | 102 --- dot_config/lvim/lua/hammy/packer.lua | 94 --- dot_config/lvim/lua/hammy/plugin/cmp.lua | 10 - .../lvim/lua/hammy/plugin/dashboard.lua | 11 - dot_config/lvim/lua/hammy/plugin/init.lua | 14 - dot_config/lvim/lua/hammy/plugin/nvimtree.lua | 2 - .../lvim/lua/hammy/plugin/telescope.lua | 38 - .../lvim/lua/hammy/plugin/treesitter.lua | 47 -- dot_config/lvim/lua/hammy/remap.lua | 32 - dot_config/lvim/lua/hammy/set.lua | 14 - dot_config/nvim/ftplugin/java.lua | 12 - dot_config/nvim/init.lua | 97 --- dot_config/nvim/lazy-lock.json | 71 -- dot_config/nvim/lua/binds.lua | 63 -- dot_config/nvim/lua/extra/feline.lua | 529 ------------- dot_config/nvim/lua/lsp/init.lua | 43 -- dot_config/nvim/lua/lsp/java.lua | 184 ----- dot_config/nvim/lua/options.lua | 88 --- dot_config/nvim/lua/plugins/actually.lua | 3 - dot_config/nvim/lua/plugins/alpha.lua | 73 -- dot_config/nvim/lua/plugins/asciiblocks.lua | 3 - dot_config/nvim/lua/plugins/asciitree.lua | 3 - dot_config/nvim/lua/plugins/autopairs.lua | 13 - dot_config/nvim/lua/plugins/catppuccin.lua | 74 -- dot_config/nvim/lua/plugins/ccc.lua | 8 - dot_config/nvim/lua/plugins/cmp.lua | 113 --- dot_config/nvim/lua/plugins/coverage.lua | 7 - dot_config/nvim/lua/plugins/dap.lua | 136 ---- dot_config/nvim/lua/plugins/delaytrain.lua | 9 - dot_config/nvim/lua/plugins/dressing.lua | 10 - dot_config/nvim/lua/plugins/feline.lua | 23 - dot_config/nvim/lua/plugins/gitsigns.lua | 57 -- dot_config/nvim/lua/plugins/lsp.lua | 193 ----- .../nvim/lua/plugins/markdown-preview.lua | 6 - dot_config/nvim/lua/plugins/mini.lua | 21 - dot_config/nvim/lua/plugins/neogit.lua | 7 - dot_config/nvim/lua/plugins/nvim-navic.lua | 13 - dot_config/nvim/lua/plugins/nvim-tree.lua | 30 - dot_config/nvim/lua/plugins/overseer.lua | 11 - dot_config/nvim/lua/plugins/presence.lua | 8 - dot_config/nvim/lua/plugins/project.lua | 19 - dot_config/nvim/lua/plugins/quickscope.lua | 8 - dot_config/nvim/lua/plugins/statuscol.lua | 9 - dot_config/nvim/lua/plugins/surround.lua | 6 - dot_config/nvim/lua/plugins/telescope.lua | 51 -- dot_config/nvim/lua/plugins/treesitter.lua | 38 - dot_config/nvim/lua/plugins/which-key.lua | 25 - dot_config/nvim/lua/plugins/zenmode.lua | 20 - dot_config/nvim/stylua.toml | 7 - dot_config/wezterm/stylua.toml | 7 - dot_gitconfig | 13 - dot_zshenv | 48 -- dot_zshrc | 142 ---- flake.lock | 236 ++++++ flake.nix | 77 ++ home/apps/deno.nix | 5 + home/apps/fish.nix | 323 ++++++++ home/apps/fish/functions/bj.fish | 3 + home/apps/fonts.nix | 8 + home/apps/git.nix | 46 ++ home/apps/go.nix | 9 + {dot_config => home/apps}/ideavim/ideavimrc | 0 home/apps/k8s.nix | 22 + home/apps/nap.nix | 14 + home/apps/rust.nix | 13 + .../apps/scripts/checkout-pr | 2 +- .../apps/scripts/disable-static-workspaces | 2 +- .../apps/scripts/enable-static-workspaces | 2 +- home/apps/scripts/icat | 70 ++ home/apps/scripts/pomo | 31 + .../apps/scripts/toggle-keyboard-backlights | 2 +- .../apps/starship/config.toml | 30 +- home/apps/wezterm.nix | 19 + home/apps/wezterm/.gitignore | 1 + .../lvim => home/apps/wezterm}/stylua.toml | 0 {dot_config => home/apps}/wezterm/wezterm.lua | 88 ++- home/apps/wezterm/wezterm.sh | 463 ++++++++++++ home/apps/wezterm/wezterm_terminfo | 89 +++ home/apps/zsh.nix | 72 ++ home/default.nix | 58 ++ .../eclipse/eclipse-java-google-style.xml | 714 ------------------ 90 files changed, 1644 insertions(+), 3565 deletions(-) delete mode 100644 .chezmoi.yaml.tmpl delete mode 100644 .chezmoiignore delete mode 100644 dot_config/lvim/config.lua delete mode 100644 dot_config/lvim/lua/hammy/formatter.lua delete mode 100644 dot_config/lvim/lua/hammy/init.lua delete mode 100644 dot_config/lvim/lua/hammy/linter.lua delete mode 100644 dot_config/lvim/lua/hammy/lsp/haskell.lua delete mode 100644 dot_config/lvim/lua/hammy/lsp/init.lua delete mode 100644 dot_config/lvim/lua/hammy/lsp/rust.lua delete mode 100644 dot_config/lvim/lua/hammy/packer.lua delete mode 100644 dot_config/lvim/lua/hammy/plugin/cmp.lua delete mode 100644 dot_config/lvim/lua/hammy/plugin/dashboard.lua delete mode 100644 dot_config/lvim/lua/hammy/plugin/init.lua delete mode 100644 dot_config/lvim/lua/hammy/plugin/nvimtree.lua delete mode 100644 dot_config/lvim/lua/hammy/plugin/telescope.lua delete mode 100644 dot_config/lvim/lua/hammy/plugin/treesitter.lua delete mode 100644 dot_config/lvim/lua/hammy/remap.lua delete mode 100644 dot_config/lvim/lua/hammy/set.lua delete mode 100644 dot_config/nvim/ftplugin/java.lua delete mode 100644 dot_config/nvim/init.lua delete mode 100644 dot_config/nvim/lazy-lock.json delete mode 100644 dot_config/nvim/lua/binds.lua delete mode 100644 dot_config/nvim/lua/extra/feline.lua delete mode 100644 dot_config/nvim/lua/lsp/init.lua delete mode 100644 dot_config/nvim/lua/lsp/java.lua delete mode 100644 dot_config/nvim/lua/options.lua delete mode 100644 dot_config/nvim/lua/plugins/actually.lua delete mode 100644 dot_config/nvim/lua/plugins/alpha.lua delete mode 100644 dot_config/nvim/lua/plugins/asciiblocks.lua delete mode 100644 dot_config/nvim/lua/plugins/asciitree.lua delete mode 100644 dot_config/nvim/lua/plugins/autopairs.lua delete mode 100644 dot_config/nvim/lua/plugins/catppuccin.lua delete mode 100644 dot_config/nvim/lua/plugins/ccc.lua delete mode 100644 dot_config/nvim/lua/plugins/cmp.lua delete mode 100644 dot_config/nvim/lua/plugins/coverage.lua delete mode 100644 dot_config/nvim/lua/plugins/dap.lua delete mode 100644 dot_config/nvim/lua/plugins/delaytrain.lua delete mode 100644 dot_config/nvim/lua/plugins/dressing.lua delete mode 100644 dot_config/nvim/lua/plugins/feline.lua delete mode 100644 dot_config/nvim/lua/plugins/gitsigns.lua delete mode 100644 dot_config/nvim/lua/plugins/lsp.lua delete mode 100644 dot_config/nvim/lua/plugins/markdown-preview.lua delete mode 100644 dot_config/nvim/lua/plugins/mini.lua delete mode 100644 dot_config/nvim/lua/plugins/neogit.lua delete mode 100644 dot_config/nvim/lua/plugins/nvim-navic.lua delete mode 100644 dot_config/nvim/lua/plugins/nvim-tree.lua delete mode 100644 dot_config/nvim/lua/plugins/overseer.lua delete mode 100644 dot_config/nvim/lua/plugins/presence.lua delete mode 100644 dot_config/nvim/lua/plugins/project.lua delete mode 100644 dot_config/nvim/lua/plugins/quickscope.lua delete mode 100644 dot_config/nvim/lua/plugins/statuscol.lua delete mode 100644 dot_config/nvim/lua/plugins/surround.lua delete mode 100644 dot_config/nvim/lua/plugins/telescope.lua delete mode 100644 dot_config/nvim/lua/plugins/treesitter.lua delete mode 100644 dot_config/nvim/lua/plugins/which-key.lua delete mode 100644 dot_config/nvim/lua/plugins/zenmode.lua delete mode 100644 dot_config/nvim/stylua.toml delete mode 100644 dot_config/wezterm/stylua.toml delete mode 100644 dot_gitconfig delete mode 100644 dot_zshenv delete mode 100644 dot_zshrc create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 home/apps/deno.nix create mode 100644 home/apps/fish.nix create mode 100644 home/apps/fish/functions/bj.fish create mode 100644 home/apps/fonts.nix create mode 100644 home/apps/git.nix create mode 100644 home/apps/go.nix rename {dot_config => home/apps}/ideavim/ideavimrc (100%) create mode 100644 home/apps/k8s.nix create mode 100644 home/apps/nap.nix create mode 100644 home/apps/rust.nix rename private_dot_local/scripts/executable_checkout-pr.sh => home/apps/scripts/checkout-pr (78%) mode change 100644 => 100755 rename private_dot_local/scripts/executable_disable-static-workspaces.sh => home/apps/scripts/disable-static-workspaces (93%) mode change 100644 => 100755 rename private_dot_local/scripts/executable_enable-static-workspaces.sh => home/apps/scripts/enable-static-workspaces (94%) mode change 100644 => 100755 create mode 100755 home/apps/scripts/icat create mode 100755 home/apps/scripts/pomo rename private_dot_local/scripts/executable_toggle-keyboard-backlights.sh => home/apps/scripts/toggle-keyboard-backlights (96%) mode change 100644 => 100755 rename dot_config/starship.toml => home/apps/starship/config.toml (88%) create mode 100644 home/apps/wezterm.nix create mode 100644 home/apps/wezterm/.gitignore rename {dot_config/lvim => home/apps/wezterm}/stylua.toml (100%) rename {dot_config => home/apps}/wezterm/wezterm.lua (65%) create mode 100644 home/apps/wezterm/wezterm.sh create mode 100644 home/apps/wezterm/wezterm_terminfo create mode 100644 home/apps/zsh.nix create mode 100644 home/default.nix delete mode 100644 private_dot_local/private_share/eclipse/eclipse-java-google-style.xml diff --git a/.chezmoi.yaml.tmpl b/.chezmoi.yaml.tmpl deleted file mode 100644 index fcc9b97..0000000 --- a/.chezmoi.yaml.tmpl +++ /dev/null @@ -1,21 +0,0 @@ -# vim:ft=yaml:fenc=utf-8:fdm=marker -encryption: gpg - -gpg: - recipient: sgoudham@gmail.com - -edit: - command: lvim -diff: - command: lvim - args: - - "-d" - - "{{`{{ .Destination }}`}}" - - "{{`{{ .Target }}`}}" -merge: - command: nvim - args: - - "-d" - - "{{`{{ .Destination }}`}}" - - "{{`{{ .Source }}" - - "{{ .Target }}`}}" diff --git a/.chezmoiignore b/.chezmoiignore deleted file mode 100644 index 7e3a0a5..0000000 --- a/.chezmoiignore +++ /dev/null @@ -1,6 +0,0 @@ -README.md - -{{- if eq .chezmoi.os "windows" }} -.zshrc -.config/ -{{- end }} diff --git a/README.md b/README.md index d164ae6..ceefb8d 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,5 @@ # dotfiles -My blazingly fast, memory safe, and borrow-checked dotfiles + +My blazingly reproducible, declarative, and reliable dotfiles + +![](https://i.redd.it/4nriibmskn771.png) \ No newline at end of file diff --git a/dot_config/lvim/config.lua b/dot_config/lvim/config.lua deleted file mode 100644 index 1f16ffb..0000000 --- a/dot_config/lvim/config.lua +++ /dev/null @@ -1 +0,0 @@ -reload("hammy") diff --git a/dot_config/lvim/lua/hammy/formatter.lua b/dot_config/lvim/lua/hammy/formatter.lua deleted file mode 100644 index 725211d..0000000 --- a/dot_config/lvim/lua/hammy/formatter.lua +++ /dev/null @@ -1,8 +0,0 @@ -local formatters = require("lvim.lsp.null-ls.formatters") - -formatters.setup({ - { - command = "stylua", - filetypes = { "lua" }, - }, -}) diff --git a/dot_config/lvim/lua/hammy/init.lua b/dot_config/lvim/lua/hammy/init.lua deleted file mode 100644 index 3135e8e..0000000 --- a/dot_config/lvim/lua/hammy/init.lua +++ /dev/null @@ -1,21 +0,0 @@ -reload("hammy.set") -reload("hammy.remap") -reload("hammy.formatter") --- reload("hammy.linter") -reload("hammy.packer") -reload("hammy.lsp") -reload("hammy.plugin") - --- Some "Proper" Custom Configuration -- -vim.api.nvim_create_autocmd("BufWritePost", { - group = vim.api.nvim_create_augroup("editorconfig", { clear = true }), - pattern = "*.editorconfig", - desc = "Refresh open buffers configuration on .editorconfig save", - callback = function() - for _, buf in pairs(vim.api.nvim_list_bufs()) do - if vim.api.nvim_buf_is_valid(buf) then - require("editorconfig").config(buf) - end - end - end, -}) diff --git a/dot_config/lvim/lua/hammy/linter.lua b/dot_config/lvim/lua/hammy/linter.lua deleted file mode 100644 index f56b1d9..0000000 --- a/dot_config/lvim/lua/hammy/linter.lua +++ /dev/null @@ -1,18 +0,0 @@ --- -- set additional linters --- local linters = require "lvim.lsp.null-ls.linters" --- linters.setup { --- { command = "flake8", filetypes = { "python" } }, --- { --- -- each linter accepts a list of options identical to https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md#Configuration --- command = "shellcheck", --- ---@usage arguments to pass to the formatter --- -- these cannot contain whitespaces, options such as `--line-width 80` become either `{'--line-width', '80'}` or `{'--line-width=80'}` --- extra_args = { "--severity", "warning" }, --- }, --- { --- command = "codespell", --- ---@usage specify which filetypes to enable. By default a providers will attach to all the filetypes it supports. --- filetypes = { "javascript", "python" }, --- }, --- } - diff --git a/dot_config/lvim/lua/hammy/lsp/haskell.lua b/dot_config/lvim/lua/hammy/lsp/haskell.lua deleted file mode 100644 index fd956e9..0000000 --- a/dot_config/lvim/lua/hammy/lsp/haskell.lua +++ /dev/null @@ -1,5 +0,0 @@ -local opts = { - cmd = { "haskell-language-server-9.2.4", "--lsp" }, -} - -require("lvim.lsp.manager").setup("hls", opts) diff --git a/dot_config/lvim/lua/hammy/lsp/init.lua b/dot_config/lvim/lua/hammy/lsp/init.lua deleted file mode 100644 index 99b735f..0000000 --- a/dot_config/lvim/lua/hammy/lsp/init.lua +++ /dev/null @@ -1,60 +0,0 @@ -reload("hammy.lsp.haskell") -reload("hammy.lsp.rust") - -require("lspconfig.ui.windows").default_options.border = "rounded" - -local lsp_diagnostics = { - update_in_insert = true, - float = { border = "rounded" }, -} -local buffer_mappings = { - normal_mode = { - ["ge"] = { - function() - require("telescope.builtin").diagnostics() - end, - "Display Workplace Diagnostics", - }, - ["gr"] = { - function() - require("telescope.builtin").lsp_references() - end, - "Goto References", - }, - ["gd"] = { - function() - require("telescope.builtin").lsp_definitions() - end, - "Goto Definitions", - }, - ["gI"] = { - function() - require("telescope.builtin").lsp_implementations() - end, - "Goto Implementations", - }, - }, -} - -lvim.lsp.diagnostics = vim.tbl_deep_extend("keep", lsp_diagnostics, lvim.lsp.diagnostics) -lvim.lsp.buffer_mappings = vim.tbl_deep_extend("keep", buffer_mappings, lvim.lsp.buffer_mappings) - --- Requires `:LvimCacheReset` to take effect -vim.list_extend(lvim.lsp.automatic_configuration.skipped_servers, { "hls", "rust_analyzer" }) - --- ---remove a server from the skipped list, e.g. eslint, or emmet_ls. !!Requires `:LvimCacheReset` to take effect!! ----see the full default list `:lua print(vim.inspect(lvim.lsp.automatic_configuration.skipped_servers))` --- ---`:LvimInfo` lists which server(s) are skipped for the current filetype --- lvim.lsp.automatic_configuration.skipped_servers = vim.tbl_filter(function(server) --- return server ~= "hls" --- end, lvim.lsp.automatic_configuration.skipped_servers) - --- -- you can set a custom on_attach function that will be used for all the language servers --- -- See --- lvim.lsp.on_attach_callback = function(client, bufnr) --- local function buf_set_option(...) --- vim.api.nvim_buf_set_option(bufnr, ...) --- end --- --Enable completion triggered by --- buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc") --- end diff --git a/dot_config/lvim/lua/hammy/lsp/rust.lua b/dot_config/lvim/lua/hammy/lsp/rust.lua deleted file mode 100644 index 70c1692..0000000 --- a/dot_config/lvim/lua/hammy/lsp/rust.lua +++ /dev/null @@ -1,102 +0,0 @@ -local mason_path = vim.fn.glob(vim.fn.stdpath("data") .. "/mason/") -local codelldb_adapter = { - type = "server", - port = "${port}", - executable = { - command = mason_path .. "bin/codelldb", - args = { "--port", "${port}" }, - }, -} - -pcall(function() - require("rust-tools").setup({ - tools = { - reload_workspace_from_cargo_toml = true, - runnables = { - use_telescope = true, - }, - inlay_hints = { - auto = true, - only_current_line = false, - show_parameter_hints = false, - parameter_hints_prefix = "<-", - other_hints_prefix = "=> ", - highlight = "Comment", - }, - hover_actions = { - border = "rounded", - }, - on_initialized = function() - vim.api.nvim_create_autocmd({ "BufWritePost", "BufEnter", "CursorHold", "InsertLeave" }, { - pattern = { "*.rs" }, - callback = function() - local _, _ = pcall(vim.lsp.codelens.refresh) - end, - }) - end, - }, - dap = { - adapter = codelldb_adapter, - }, - server = { - on_attach = function(client, bufnr) - require("lvim.lsp").common_on_attach(client, bufnr) - local rt = require("rust-tools") - vim.keymap.set("n", "K", rt.hover_actions.hover_actions, { buffer = bufnr }) - end, - - capabilities = require("lvim.lsp").common_capabilities(), - settings = { - ["rust-analyzer"] = { - lens = { - enable = true, - }, - checkOnSave = { - enable = true, - command = "clippy", - }, - }, - }, - }, - }) -end) - -lvim.builtin.dap.on_config_done = function(dap) - dap.adapters.codelldb = codelldb_adapter - dap.configurations.rust = { - { - name = "Launch file", - type = "codelldb", - request = "launch", - program = function() - vim.fn.jobstart("cargo test --no-run") - return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/target/debug/", "file") - end, - cwd = "${workspaceFolder}", - stopOnEntry = false, - }, - } -end - --- vim.api.nvim_set_keymap("n", "", "RustOpenExternalDocs", { noremap = true, silent = true }) - --- lvim.builtin.which_key.mappings["C"] = { --- name = "Rust", --- r = { "RustRunnables", "Runnables" }, --- t = { "lua _CARGO_TEST()", "Cargo Test" }, --- m = { "RustExpandMacro", "Expand Macro" }, --- c = { "RustOpenCargo", "Open Cargo" }, --- p = { "RustParentModule", "Parent Module" }, --- d = { "RustDebuggables", "Debuggables" }, --- v = { "RustViewCrateGraph", "View Crate Graph" }, --- R = { --- "lua require('rust-tools/workspace_refresh')._reload_workspace_from_cargo_toml()", --- "Reload Workspace", --- }, --- o = { "RustOpenExternalDocs", "Open External Docs" }, --- y = { "lua require'crates'.open_repository()", "[crates] open repository" }, --- P = { "lua require'crates'.show_popup()", "[crates] show popup" }, --- i = { "lua require'crates'.show_crate_popup()", "[crates] show info" }, --- f = { "lua require'crates'.show_features_popup()", "[crates] show features" }, --- D = { "lua require'crates'.show_dependencies_popup()", "[crates] show dependencies" }, --- } diff --git a/dot_config/lvim/lua/hammy/packer.lua b/dot_config/lvim/lua/hammy/packer.lua deleted file mode 100644 index 47577ea..0000000 --- a/dot_config/lvim/lua/hammy/packer.lua +++ /dev/null @@ -1,94 +0,0 @@ -lvim.plugins = { - { "andweeb/presence.nvim" }, - { "hrsh7th/cmp-cmdline" }, - { "gpanders/editorconfig.nvim" }, - { "p00f/nvim-ts-rainbow" }, - { "nvim-treesitter/playground" }, - { "nvim-treesitter/nvim-treesitter-textobjects"}, - { "simrat39/rust-tools.nvim" }, - { - "saecki/crates.nvim", - tag = "v0.3.0", - requires = { "nvim-lua/plenary.nvim" }, - config = function() - require("crates").setup({ - null_ls = { - enabled = true, - name = "crates.nvim", - }, - popup = { - border = "rounded", - }, - }) - end, - }, - { - "axkirillov/easypick.nvim", - config = function() - local easypick = require("easypick") - easypick.setup({ - pickers = { - { - name = "chezmoi", - command = [[chezmoi managed -x encrypted -i files | awk '{ printf("%s/%s\n", "~", $0) }']], - opts = require("telescope.themes").get_dropdown({}), - }, - }, - }) - end, - }, - { - "stevearc/dressing.nvim", - config = function() - require("dressing").setup({ input = { insert_only = false } }) - end, - }, - { - "kylechui/nvim-surround", - tag = "*", -- Use for stability; omit to use `main` branch for the latest features - config = function() - require("nvim-surround").setup() - end, - }, - { - "catppuccin/nvim", - as = "catppuccin", - config = function() - local cp = require("catppuccin.palettes").get_palette() - - require("catppuccin").setup({ - flavour = "mocha", - compile_path = vim.fn.stdpath("cache") .. "/catppuccin", - transparent_background = true, - term_colors = true, - no_italic = true, - integrations = { - ts_rainbow = true, - which_key = true, - dap = { enabled = true, enable_ui = true }, - navic = { enabled = true, custom_bg = "NONE" }, - }, - color_overrides = { - mocha = { - base = "#000000", - mantle = "#000000", - surface2 = cp.subtext0, - overlay0 = cp.subtext0, - }, - }, - custom_highlights = { - ErrorMsg = { fg = cp.red, style = { "bold" } }, - LspInfoBorder = { link = "FloatBorder" }, - PmenuSel = { bg = cp.surface0 }, - FloatBorder = { fg = cp.overlay0, bg = "NONE" }, - TelescopeBorder = { link = "FloatBorder" }, - TelescopeMatching = { link = "TelescopeNormal" }, - TelescopeSelection = { fg = "NONE", bg = cp.surface0 }, - TelescopeTitle = { fg = cp.subtext0 }, - }, - }) - - vim.api.nvim_command("colorscheme catppuccin") - end, - }, -} diff --git a/dot_config/lvim/lua/hammy/plugin/cmp.lua b/dot_config/lvim/lua/hammy/plugin/cmp.lua deleted file mode 100644 index a0501eb..0000000 --- a/dot_config/lvim/lua/hammy/plugin/cmp.lua +++ /dev/null @@ -1,10 +0,0 @@ -local cmp = require("cmp") -local mappings = { - [""] = cmp.mapping(cmp.mapping.select_prev_item(), { "i", "c" }), - [""] = cmp.mapping(cmp.mapping.select_next_item(), { "i", "c" }), - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), -} - -lvim.builtin.cmp.cmdline.enable = true -lvim.builtin.cmp.mapping = vim.tbl_deep_extend("keep", mappings, lvim.builtin.cmp.mapping) diff --git a/dot_config/lvim/lua/hammy/plugin/dashboard.lua b/dot_config/lvim/lua/hammy/plugin/dashboard.lua deleted file mode 100644 index 4863b15..0000000 --- a/dot_config/lvim/lua/hammy/plugin/dashboard.lua +++ /dev/null @@ -1,11 +0,0 @@ -lvim.builtin.alpha.active = true -lvim.builtin.alpha.mode = "dashboard" - -lvim.builtin.alpha.dashboard.section.header.val = { - [[ __ ]], - [[ ___ ___ ___ __ __ /\_\ ___ ___ ]], - [[ / _ `\ / __`\ / __`\/\ \/\ \\/\ \ / __` __`\ ]], - [[/\ \/\ \/\ __//\ \_\ \ \ \_/ |\ \ \/\ \/\ \/\ \ ]], - [[\ \_\ \_\ \____\ \____/\ \___/ \ \_\ \_\ \_\ \_\]], - [[ \/_/\/_/\/____/\/___/ \/__/ \/_/\/_/\/_/\/_/]], -} diff --git a/dot_config/lvim/lua/hammy/plugin/init.lua b/dot_config/lvim/lua/hammy/plugin/init.lua deleted file mode 100644 index 090b6ea..0000000 --- a/dot_config/lvim/lua/hammy/plugin/init.lua +++ /dev/null @@ -1,14 +0,0 @@ -reload("hammy.plugin.cmp") -reload("hammy.plugin.treesitter") -reload("hammy.plugin.telescope") -reload("hammy.plugin.dashboard") -reload("hammy.plugin.nvimtree") - --- Enable/Disable Lvim Plugins -lvim.builtin.project.active = true -lvim.builtin.bufferline.active = false -lvim.builtin.breadcrumbs.active = true -lvim.builtin.terminal.active = false -lvim.builtin.indentlines.active = false -lvim.builtin.illuminate.active = false - diff --git a/dot_config/lvim/lua/hammy/plugin/nvimtree.lua b/dot_config/lvim/lua/hammy/plugin/nvimtree.lua deleted file mode 100644 index ba5fcbc..0000000 --- a/dot_config/lvim/lua/hammy/plugin/nvimtree.lua +++ /dev/null @@ -1,2 +0,0 @@ -lvim.builtin.nvimtree.setup.view.side = "left" -lvim.builtin.nvimtree.setup.renderer.icons.show.git = true diff --git a/dot_config/lvim/lua/hammy/plugin/telescope.lua b/dot_config/lvim/lua/hammy/plugin/telescope.lua deleted file mode 100644 index 283cf6e..0000000 --- a/dot_config/lvim/lua/hammy/plugin/telescope.lua +++ /dev/null @@ -1,38 +0,0 @@ -lvim.builtin.telescope.defaults.prompt_prefix = "🔍 " -lvim.builtin.telescope.defaults.selection_caret = "> " -lvim.builtin.telescope.defaults.file_ignore_patterns = { ".git/" } - -lvim.builtin.which_key.mappings["f"] = { - name = "Find", - b = { "Telescope buffers", "Open Buffers" }, - f = { "Telescope find_files", "Find File" }, - h = { "Telescope help_tags", "Find Help" }, - H = { "Telescope highlights", "Find Highlights" }, - g = { "Telescope live_grep", "Find Text" }, - R = { "Telescope registers", "Find Registers" }, - k = { "Telescope keymaps", "Find Keymaps" }, - c = { - "Telescope current_buffer_fuzzy_find", - "Find Text In Current Buffer", - }, - C = { "Telescope commands", "Find Commands" }, - r = { "Telescope oldfiles", "Open Recent File" }, - p = { "Telescope projects", "Open Projects" }, - d = { "Easypick chezmoi", "Open Dotfiles" }, -} - -local _, actions = pcall(require, "telescope.actions") -lvim.builtin.telescope.defaults.mappings = { - i = { - [""] = actions.move_selection_next, - [""] = actions.move_selection_previous, - [""] = actions.cycle_history_next, - [""] = actions.cycle_history_prev, - }, - n = { - [""] = actions.move_selection_next, - [""] = actions.move_selection_previous, - [""] = actions.preview_scrolling_down, - [""] = actions.preview_scrolling_up, - }, -} diff --git a/dot_config/lvim/lua/hammy/plugin/treesitter.lua b/dot_config/lvim/lua/hammy/plugin/treesitter.lua deleted file mode 100644 index 4ad6e97..0000000 --- a/dot_config/lvim/lua/hammy/plugin/treesitter.lua +++ /dev/null @@ -1,47 +0,0 @@ -lvim.builtin.treesitter.rainbow.enable = true -lvim.builtin.treesitter.highlight.enable = true -lvim.builtin.treesitter.ensure_installed = "all" -lvim.builtin.treesitter.textobjects = { - select = { - enable = true, - lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim - keymaps = { - -- You can use the capture groups defined in textobjects.scm - ["aa"] = "@parameter.outer", - ["ia"] = "@parameter.inner", - ["af"] = "@function.outer", - ["if"] = "@function.inner", - ["ac"] = "@class.outer", - ["ic"] = "@class.inner", - }, - }, - move = { - enable = true, - set_jumps = true, -- whether to set jumps in the jumplist - goto_next_start = { - ["]m"] = "@function.outer", - ["]]"] = "@class.outer", - }, - goto_next_end = { - ["]M"] = "@function.outer", - ["]["] = "@class.outer", - }, - goto_previous_start = { - ["[m"] = "@function.outer", - ["[["] = "@class.outer", - }, - goto_previous_end = { - ["[M"] = "@function.outer", - ["[]"] = "@class.outer", - }, - }, - swap = { - enable = true, - swap_next = { - ["a"] = "@parameter.inner", - }, - swap_previous = { - ["A"] = "@parameter.inner", - }, - }, -} diff --git a/dot_config/lvim/lua/hammy/remap.lua b/dot_config/lvim/lua/hammy/remap.lua deleted file mode 100644 index 3fc6051..0000000 --- a/dot_config/lvim/lua/hammy/remap.lua +++ /dev/null @@ -1,32 +0,0 @@ --- unmapping defaults -lvim.keys.normal_mode[""] = false -lvim.keys.normal_mode[""] = false -lvim.keys.normal_mode[""] = false -lvim.keys.insert_mode[""] = false -lvim.keys.insert_mode[""] = false -lvim.builtin.which_key.mappings["s"] = nil - --- navigation -lvim.keys.normal_mode[""] = "j" -lvim.keys.normal_mode[""] = "k" -lvim.keys.normal_mode[""] = "l" -lvim.keys.normal_mode[""] = "h" - --- useful -lvim.keys.normal_mode[""] = "zz" -lvim.keys.normal_mode[""] = "zz" -lvim.keys.normal_mode["J"] = "mzJ`z" -lvim.keys.normal_mode["n"] = "nzzzv" -lvim.keys.normal_mode["N"] = "Nzzzv" -lvim.keys.normal_mode[""] = "o" -lvim.keys.normal_mode["0"] = "^" -lvim.keys.normal_mode["[d"] = ":lua vim.diagnostic.goto_prev()" -lvim.keys.normal_mode["]d"] = ":lua vim.diagnostic.goto_next()" -lvim.keys.normal_mode["[c"] = ":lua require('gitsigns').prev_hunk()" -lvim.keys.normal_mode["]c"] = ":lua require('gitsigns').next_hunk()" - --- clipboard -lvim.keys.visual_block_mode["p"] = [["_dp]] -lvim.keys.visual_mode["y"] = [["+y]] -lvim.keys.normal_mode["y"] = [["+y]] -lvim.keys.normal_mode["Y"] = [["+Y]] diff --git a/dot_config/lvim/lua/hammy/set.lua b/dot_config/lvim/lua/hammy/set.lua deleted file mode 100644 index 88b7879..0000000 --- a/dot_config/lvim/lua/hammy/set.lua +++ /dev/null @@ -1,14 +0,0 @@ -vim.opt.timeoutlen = 500 -vim.opt.relativenumber = true -vim.opt.laststatus = 3 -vim.opt.pumheight = 20 -vim.opt.clipboard = "" -vim.opt.lazyredraw = true -vim.opt.showtabline = 0 -vim.opt.completeopt = [[menuone,noinsert,noselect]] - --- Lvim Related Stuffs -lvim.log.level = "warn" -lvim.format_on_save = false -lvim.colorscheme = "catppuccin" -lvim.leader = "space" diff --git a/dot_config/nvim/ftplugin/java.lua b/dot_config/nvim/ftplugin/java.lua deleted file mode 100644 index 0ad23af..0000000 --- a/dot_config/nvim/ftplugin/java.lua +++ /dev/null @@ -1,12 +0,0 @@ --- https://sookocheff.com/post/vim/neovim-java-ide/ :bless: - -vim.opt_local.shiftwidth = 4 -vim.opt_local.tabstop = 4 -vim.opt_local.softtabstop = 4 - -local root_markers = { "gradlew", "mvnw", ".git", "pom.xml", "build.gradle" } -local root_dir = require("jdtls.setup").find_root(root_markers) -local workspace_folder = os.getenv("HOME") .. "/.local/share/eclipse/" .. vim.fn.fnamemodify(root_dir, ":p:h:t") - -local config = require("lsp.java").make_jdtls_config(root_dir, workspace_folder) -require("jdtls").start_or_attach(config) diff --git a/dot_config/nvim/init.lua b/dot_config/nvim/init.lua deleted file mode 100644 index c2acef5..0000000 --- a/dot_config/nvim/init.lua +++ /dev/null @@ -1,97 +0,0 @@ --- set this early so plugins etc can all use it -vim.g.mapleader = " " --- disable netrw at the very start of your init.lua (strongly advised) --- vim.g.loaded_netrw = 0 --- vim.g.loaded_netrwPlugin = 0 - --- bootstrap & set up lazy -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not vim.loop.fs_stat(lazypath) then - vim.fn.system({ - "git", - "clone", - "--filter=blob:none", - "https://github.com/folke/lazy.nvim.git", - "--branch=stable", -- latest stable release - lazypath, - }) -end -vim.opt.rtp:prepend(lazypath) - -require("lazy").setup("plugins", { - install = { - colorscheme = { "catppuccin" }, - missing = true, - }, - change_detection = { - enabled = true, - notify = false, - }, - ui = { - border = "rounded", - icons = { - list = { "●" }, - }, - }, -}) - --- load remaining config -require("options") -require("binds") - -vim.api.nvim_create_augroup("disable_mini", {}) -vim.api.nvim_create_autocmd({ "BufWinEnter" }, { - group = "disable_mini", - pattern = { "NvimTr*" }, - callback = function() - vim.b.miniindentscope_disable = true - vim.b.minicursorword_disable = true - end, -}) -vim.api.nvim_create_autocmd({ "User" }, { - group = "disable_mini", - pattern = "AlphaReady", - callback = function() - vim.b.miniindentscope_disable = true - vim.b.minicursorword_disable = true - end, -}) - --- highlight yank -vim.api.nvim_create_augroup("highlight_yank", {}) -vim.api.nvim_create_autocmd({ "TextYankPost" }, { - group = "highlight_yank", - pattern = { "*" }, - callback = function() - vim.highlight.on_yank({ - higroup = "Visual", - timeout = 150, - }) - end, -}) --- Disable semantic highlights -vim.api.nvim_create_autocmd("LspAttach", { - callback = function(args) - local client = vim.lsp.get_client_by_id(args.data.client_id) - client.server_capabilities.semanticTokensProvider = nil - end, -}) --- Stop comments on new lines when pressing 'o' -vim.api.nvim_create_augroup("stop_comments_on_o", {}) -vim.api.nvim_create_autocmd("BufEnter", { - group = "stop_comments_on_o", - callback = function(_) - vim.opt.formatoptions:remove("o") - end, -}) -vim.api.nvim_create_augroup("last_loc", {}) -vim.api.nvim_create_autocmd("BufReadPost", { - group = "last_loc", - callback = function() - local mark = vim.api.nvim_buf_get_mark(0, '"') - local lcount = vim.api.nvim_buf_line_count(0) - if mark[1] > 0 and mark[1] <= lcount then - pcall(vim.api.nvim_win_set_cursor, 0, mark) - end - end, -}) diff --git a/dot_config/nvim/lazy-lock.json b/dot_config/nvim/lazy-lock.json deleted file mode 100644 index ca09282..0000000 --- a/dot_config/nvim/lazy-lock.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "LuaSnip": { "branch": "master", "commit": "58fbfc627a93281a77f7d161d4ff702e639677b1" }, - "actually.nvim": { "branch": "main", "commit": "a735082694b1f06c4d9874f2a7288dba94acdb71" }, - "alpha-nvim": { "branch": "main", "commit": "1c903fd40b1d51e7740b4d90e9f18e83f2916586" }, - "ascii-blocks.nvim": { "branch": "main", "commit": "a8a7d99fc52df30d7c4e7664818542fd44839d97" }, - "asciitree.nvim": { "branch": "main", "commit": "a979a0c6987e07eaa9f405d90c086105c0a2d99c" }, - "catppuccin": { "branch": "main", "commit": "a5f3ed5d3b1d9ea21183718a8a89a6653bd6ea48" }, - "ccc.nvim": { "branch": "main", "commit": "be0a8122fd77efb7b6a0d672bab10417e68fab8b" }, - "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, - "cmp-cmdline": { "branch": "main", "commit": "23c51b2a3c00f6abc4e922dbd7c3b9aca6992063" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "0e6b2ed705ddcff9738ec4ea838141654f12eeef" }, - "cmp-nvim-lua": { "branch": "main", "commit": "f3491638d123cfd2c8048aefaf66d246ff250ca6" }, - "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, - "cmp-under-comparator": { "branch": "master", "commit": "6857f10272c3cfe930cece2afa2406e1385bfef8" }, - "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" }, - "delaytrain.nvim": { "branch": "main", "commit": "eb8d2157e6a7de1b4f024f7ca5bccc4014d88b05" }, - "dressing.nvim": { "branch": "master", "commit": "db716a0f1279f79a886c0e0b6ab3c3d5ffdb42fe" }, - "feline.nvim": { "branch": "master", "commit": "d48b6f92c6ccdd6654c956f437be49ea160b5b0c" }, - "friendly-snippets": { "branch": "main", "commit": "1645e7cd98ed99e766c84ab3cf13a1612c77dcee" }, - "gitsigns.nvim": { "branch": "main", "commit": "a5caac26768af80b7c57b919f77b3fed3d7424d0" }, - "go.nvim": { "branch": "master", "commit": "37d226ca7444a3950a133acc205aaba7a2339f69" }, - "guihua.lua": { "branch": "master", "commit": "d331b1526a87edbe13679298c3547d49f8a14ffc" }, - "haskell-tools.nvim": { "branch": "1.x.x", "commit": "66e78bb7184a992c25669c46e6b9af39623bb739" }, - "lazy.nvim": { "branch": "main", "commit": "c778b7aa04c484e1536ba219e71f2fd0f05302aa" }, - "lsp_signature.nvim": { "branch": "master", "commit": "6f6252f63b0baf0f2224c4caea33819a27f3f550" }, - "lspkind.nvim": { "branch": "master", "commit": "c68b3a003483cf382428a43035079f78474cd11e" }, - "ltex_extra.nvim": { "branch": "master", "commit": "1d2f288ceedc70d5a9c00f55c0d0cc788b5164f2" }, - "markdown-preview.nvim": { "branch": "master", "commit": "02cc3874738bc0f86e4b91f09b8a0ac88aef8e96" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "e2b82cf4c68b453eeab5833d90c042ed4b49d0e1" }, - "mason-null-ls.nvim": { "branch": "main", "commit": "9ad7503c32545ee6e8000e52d9ae4a93d49231fb" }, - "mason-nvim-dap.nvim": { "branch": "main", "commit": "28d87f3e91f9a333cc2726eea4922768a67bfc8e" }, - "mason.nvim": { "branch": "main", "commit": "bd3b9918dc317b8772000949a0229156dbb004bb" }, - "mini.nvim": { "branch": "main", "commit": "8a248b3b2cf26bf450299cd715b770668c6b5d2d" }, - "neodev.nvim": { "branch": "main", "commit": "a81e749d0fe8429cd340b2e40f274b344bef42ac" }, - "neogit": { "branch": "master", "commit": "089d388876a535032ac6a3f80e19420f09e4ddda" }, - "null-ls.nvim": { "branch": "main", "commit": "9d811bb6ed44cf766f4bda8a47fd65fdfbdcaa7d" }, - "nvim-autopairs": { "branch": "master", "commit": "45ae3122a4c7744db41298b41f9f5a3f092123e6" }, - "nvim-cmp": { "branch": "main", "commit": "aae0c3e4e778ca4be6fabc52e388cbd5b844b7a5" }, - "nvim-coverage": { "branch": "main", "commit": "5c5ab0cc575c483bf3485b9481880b5ea4160ed4" }, - "nvim-dap": { "branch": "master", "commit": "401f5f22b2d7f9bdbb9294d0235136091458816a" }, - "nvim-dap-ui": { "branch": "master", "commit": "cb623ef426ca81fc437f946f4556f556f369f74d" }, - "nvim-dap-virtual-text": { "branch": "master", "commit": "7f7f2af549e72a0b7bddc3b4f827beb027ea8ce3" }, - "nvim-jdtls": { "branch": "master", "commit": "8fe3be1c08ab0bb55f2998fbc02f1a08f87a44bc" }, - "nvim-lspconfig": { "branch": "master", "commit": "1712672e4da3003a0dd9f771d30389600b360f42" }, - "nvim-navic": { "branch": "master", "commit": "7e9d2b2b601149fecdccd11b516acb721e571fe6" }, - "nvim-surround": { "branch": "main", "commit": "90821ad682aac189cd0a38fd83fc96f0cbcc5d29" }, - "nvim-tree.lua": { "branch": "master", "commit": "8b8d457e07d279976a9baac6bbff5aa036afdc5f" }, - "nvim-treesitter": { "branch": "master", "commit": "ad9ae9e7def54fee446c3e186ed0a0d44cca7b90" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "37e3c7b32b653f24d7aa2fa087a9c5a67ef07786" }, - "nvim-web-devicons": { "branch": "master", "commit": "bb6d4fd1e010300510172b173ab5205d37af084f" }, - "overseer.nvim": { "branch": "master", "commit": "42c0d69f505314d6994a84da4e3fcbaf308c1a86" }, - "playground": { "branch": "master", "commit": "c481c660fa903a0e295902b1765ecfbd6e76a556" }, - "plenary.nvim": { "branch": "master", "commit": "9a0d3bf7b832818c042aaf30f692b081ddd58bd9" }, - "presence.nvim": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" }, - "project.nvim": { "branch": "main", "commit": "685bc8e3890d2feb07ccf919522c97f7d33b94e4" }, - "py_lsp.nvim": { "branch": "main", "commit": "6f160d0e1864b1a46c932c542a132a57abd7f1c1" }, - "quick-scope": { "branch": "master", "commit": "428e8698347f254d24b248af9f656194a80081e5" }, - "rust-tools.nvim": { "branch": "master", "commit": "bd1aa99ffb911a1cf99b3fcf3b44c0391c57e3ef" }, - "smart-open.nvim": { "branch": "main", "commit": "ebf87075af7d193c16800ce682a04eca393ac2a7" }, - "sqlite.lua": { "branch": "master", "commit": "93ff5824682ecc874200e338fd8ca9ccd08508f8" }, - "statuscol.nvim": { "branch": "main", "commit": "49a3bdab3e9cf23982724c1e888a6296fca4c8b9" }, - "telescope-catppuccin.nvim": { "branch": "main", "commit": "92e028a34d917d5b4b891f8f4406c45c8cc6497e" }, - "telescope-fzy-native.nvim": { "branch": "master", "commit": "282f069504515eec762ab6d6c89903377252bf5b" }, - "telescope.nvim": { "branch": "master", "commit": "203bf5609137600d73e8ed82703d6b0e320a5f36" }, - "twilight.nvim": { "branch": "main", "commit": "9410252bed96887ca5a86bf16435a3a51a0e6ce5" }, - "vim-textobj-entire": { "branch": "master", "commit": "64a856c9dff3425ed8a863b9ec0a21dbaee6fb3a" }, - "vim-textobj-user": { "branch": "master", "commit": "41a675ddbeefd6a93664a4dc52f302fe3086a933" }, - "vimtex": { "branch": "master", "commit": "cb1460f6e6160a855bf83d93d9a34bb944f6b540" }, - "which-key.nvim": { "branch": "main", "commit": "5224c261825263f46f6771f1b644cae33cd06995" }, - "zen-mode.nvim": { "branch": "main", "commit": "3c92f503823088862ca2a7809d1c7edc90fb92fa" } -} \ No newline at end of file diff --git a/dot_config/nvim/lua/binds.lua b/dot_config/nvim/lua/binds.lua deleted file mode 100644 index 7f74fe9..0000000 --- a/dot_config/nvim/lua/binds.lua +++ /dev/null @@ -1,63 +0,0 @@ -local wk = require("which-key") - --- what a workaround (screw you @nekowinston :sob:) --- https://github.com/wez/wezterm/discussions/2426 --- https://github.com/neovim/neovim/issues/2252 -wk.register({ - [""] = { "lua io.popen('wezterm cli split-pane --right --cwd .')", "All my homies hate OSC 7" }, - [""] = { "lua io.popen('wezterm cli split-pane --bottom --cwd .')", "All my homies hate OSC 7" }, -}, { mode = { "n", "i", "v", "t" } }) - --- normal binds -wk.register({ - ["0"] = { "0^", "Start of Line" }, - [""] = { "o", "New Line" }, - [""] = { "zz", "Half page down" }, - [""] = { "zz", "Half page up" }, - - n = { "nzzzv", "Next result (centered)" }, - N = { "Nzzzv", "Previous result (centered)" }, - J = { "mzJ`z", "Join lines (stable)" }, - ["li"] = { "LspInfo", "LSP Info" }, - ["lI"] = { "Mason", "Mason Info" }, -}) - --- visual binds -wk.register({ - J = { ":m '>+1gv=gv", "Move line down" }, - K = { ":m '<-2gv=gv", "Move line up" }, - ["<"] = { ""] = { ">gv", "Better Right Indent" } -}, { mode = "v" }) - --- terminal binds -wk.register({ - [""] = { [[]], "Normal mode" }, -}, { mode = "t" }) - --- normal + terminal binds -wk.register({ - [""] = { "wincmd h", "Go to the left window" }, - [""] = { "wincmd j", "Go to the down window" }, - [""] = { "wincmd k", "Go to the up window" }, - [""] = { "wincmd l", "Go to the right window" }, -}, { mode = { "n", "t" } }) - --- leader binds -wk.register({ - p = { [["+p]], "Put from clipboard" }, - w = { [[:w]], "Quick Save" }, - q = { [[:q]], "Quick Exit" }, - Q = { [[:qa]], "Quick Exit All Buffers" }, -}, { prefix = "" }) - --- nv leader binds -wk.register({ - -- d = { [["_d]], "Delete w/o yank" }, - y = { [["+y]], "Yank to clipboard" }, -}, { prefix = "", mode = { "n", "v" } }) - --- x leader binds -wk.register({ - p = { [["_dP"]], "Put w/o yank" }, -}, { prefix = "", mode = "x" }) diff --git a/dot_config/nvim/lua/extra/feline.lua b/dot_config/nvim/lua/extra/feline.lua deleted file mode 100644 index 58b6b78..0000000 --- a/dot_config/nvim/lua/extra/feline.lua +++ /dev/null @@ -1,529 +0,0 @@ -local M = {} - -local C = require("catppuccin.palettes").get_palette() -local lsp = require("feline.providers.lsp") -local navic = require("nvim-navic") - -local assets = { - left_separator = "", - right_separator = "", - mode_icon = "", - dir = "", - file = "", - lsp = { - server = "", - error = "", - warning = "", - info = "", - hint = "", - }, - git = { - branch = "", - added = "", - changed = "", - removed = "", - }, -} - -local sett = { - text = C.surface0, - bkg = C.surface0, - diffs = C.mauve, - extras = C.overlay1, - curr_file = C.maroon, - curr_dir = C.flamingo, - show_modified = false, -} - -if require("catppuccin").options.transparent_background then - sett.bkg = "NONE" -end - -local mode_colors = { - ["n"] = { "NORMAL", C.lavender }, - ["no"] = { "N-PENDING", C.lavender }, - ["i"] = { "INSERT", C.green }, - ["ic"] = { "INSERT", C.green }, - ["t"] = { "TERMINAL", C.green }, - ["v"] = { "VISUAL", C.flamingo }, - ["V"] = { "V-LINE", C.flamingo }, - [""] = { "V-BLOCK", C.flamingo }, - ["R"] = { "REPLACE", C.maroon }, - ["Rv"] = { "V-REPLACE", C.maroon }, - ["s"] = { "SELECT", C.maroon }, - ["S"] = { "S-LINE", C.maroon }, - [""] = { "S-BLOCK", C.maroon }, - ["c"] = { "COMMAND", C.peach }, - ["cv"] = { "COMMAND", C.peach }, - ["ce"] = { "COMMAND", C.peach }, - ["r"] = { "PROMPT", C.teal }, - ["rm"] = { "MORE", C.teal }, - ["r?"] = { "CONFIRM", C.mauve }, - ["!"] = { "SHELL", C.green }, -} - -function M.setup(opts) - if opts then - opts.assets = opts.assets or {} - opts.sett = opts.sett or {} - opts.mode_colors = opts.mode_colors or {} - else - opts = {} - end - assets = vim.tbl_deep_extend("force", assets, opts.assets) - sett = vim.tbl_deep_extend("force", sett, opts.sett) - mode_colors = vim.tbl_deep_extend("force", mode_colors, opts.mode_colors) -end - -function M.get() - local shortline = false - - local components = { - active = { {}, {}, {} }, -- left, center, right - inactive = { {} }, - } - - local function is_enabled(min_width) - if shortline then - return true - end - - return vim.api.nvim_win_get_width(0) > min_width - end - - -- global components - local invi_sep = { - str = " ", - hl = { - fg = sett.bkg, - bg = sett.bkg, - }, - } - - -- helpers - local function has_git_head() - return vim.b.gitsigns_head ~= nil - end - - local function any_git_changes() - local gst = vim.b.gitsigns_status_dict -- git stats - if gst then - if - gst["added"] and gst["added"] > 0 - or gst["removed"] and gst["removed"] > 0 - or gst["changed"] and gst["changed"] > 0 - then - return true - end - end - return false - end - - -- #################### STATUSLINE -> - - -- ######## Left - - -- Current vi mode ------> - local vi_mode_hl = function() - return { - fg = sett.text, - bg = mode_colors[vim.fn.mode()][2], - style = "bold", - } - end - - components.active[1][1] = { - provider = " " .. assets.mode_icon .. " ", - hl = function() - return { - fg = sett.text, - bg = mode_colors[vim.fn.mode()][2], - } - end, - } - - -- there is a dilema: we need to hide Diffs if ther is no git info. We can do that, but this will - -- leave the right_separator colored with purple, and since we can't change the color conditonally - -- then the solution is to create two right_separators: one with a mauve sett.bkg and the other one normal - -- sett.bkg; both have the same fg (vi mode). The mauve one appears if there is git info, else the one with - -- the normal sett.bkg appears. Fixed :) - - components.active[1][2] = { - provider = assets.right_separator, - hl = function() - return { - fg = mode_colors[vim.fn.mode()][2], - bg = sett.bkg, - } - end, - enabled = function() - return not any_git_changes() and not has_git_head() - end, - } - - components.active[1][3] = { - provider = assets.right_separator, - hl = function() - return { - fg = mode_colors[vim.fn.mode()][2], - bg = sett.diffs, - } - end, - enabled = function() - return any_git_changes() - end, - } - - components.active[1][4] = { - provider = assets.right_separator, - hl = function() - return { - fg = mode_colors[vim.fn.mode()][2], - bg = C.maroon, - } - end, - enabled = function() - return not any_git_changes() and has_git_head() - end, - } - - -- Current vi mode ------> - - -- Diffs ------> - components.active[1][5] = { - provider = "git_diff_added", - hl = { - fg = sett.text, - bg = sett.diffs, - }, - icon = " " .. assets.git.added .. " ", - } - - components.active[1][6] = { - provider = "git_diff_changed", - hl = { - fg = sett.text, - bg = sett.diffs, - }, - icon = " " .. assets.git.changed .. " ", - } - - components.active[1][7] = { - provider = "git_diff_removed", - hl = { - fg = sett.text, - bg = sett.diffs, - }, - icon = " " .. assets.git.removed .. " ", - } - - components.active[1][8] = { - provider = assets.right_separator, - hl = { - fg = sett.diffs, - bg = C.maroon, - }, - enabled = function() - return any_git_changes() - end, - } - -- Diffs ------> - - -- Git Branch & Breadcrumbs ------> - - components.active[1][9] = { - provider = " ", - hl = { - fg = C.maroon, - bg = C.maroon, - }, - enabled = function() - return has_git_head() - end, - } - - components.active[1][10] = { - provider = "git_branch", - enabled = is_enabled(70), - hl = { - fg = sett.text, - bg = C.maroon, - }, - icon = assets.git.branch .. " ", - } - - components.active[1][11] = { - provider = " ", - hl = { - fg = sett.bkg, - bg = C.maroon, - }, - enabled = function() - return has_git_head() - end, - } - - components.active[1][12] = { - provider = assets.right_separator, - hl = { - fg = C.maroon, - bg = sett.bkg, - }, - enabled = function() - return has_git_head() - end, - } - - components.active[1][13] = { - provider = function() - return " " .. navic.get_location() - end, - enabled = function() - return navic.is_available() - end, - hl = { - fg = sett.text, - bg = sett.bkg, - }, - } - - components.active[1][14] = { - provider = " ", - hl = { - fg = sett.bkg, - bg = sett.bkg, - }, - enabled = function() - return not navic.is_available() - end, - } - -- Git Branch & Breadcrumbs ------> - - -- ######## Left - - -- ######## Center - - function map(arr, func) - local new_arr = {} - for i, v in ipairs(arr) do - new_arr[i] = func(v) - end - return new_arr - end - - -- Diagnostics ------> - -- workspace loader - components.active[2][1] = { - provider = function() - local Lsp = vim.lsp.util.get_progress_messages()[1] - - if Lsp then - local msg = Lsp.message or "" - local percentage = Lsp.percentage - if not percentage then - return "" - end - local title = Lsp.title or "" - local spinners = { - "", - "", - "", - } - local success_icon = { - "", - "", - "", - } - local ms = vim.loop.hrtime() / 1000000 - local frame = math.floor(ms / 120) % #spinners - - if percentage >= 70 then - return string.format(" %%<%s %s %s (%s%%%%) ", success_icon[frame + 1], title, msg, percentage) - end - - return string.format(" %%<%s %s %s (%s%%%%) ", spinners[frame + 1], title, msg, percentage) - end - - return "" - end, - enabled = is_enabled(80), - hl = { - fg = C.rosewater, - bg = sett.bkg, - }, - } - - -- general diagnostics (errors, warnings. info and hints) - components.active[2][2] = { - provider = "diagnostic_errors", - enabled = function() - return lsp.diagnostics_exist(vim.diagnostic.severity.ERROR) - end, - - hl = { - fg = C.red, - bg = sett.bkg, - }, - icon = " " .. assets.lsp.error .. " ", - } - - components.active[2][3] = { - provider = "diagnostic_warnings", - enabled = function() - return lsp.diagnostics_exist(vim.diagnostic.severity.WARN) - end, - hl = { - fg = C.yellow, - bg = sett.bkg, - }, - icon = " " .. assets.lsp.warning .. " ", - } - - components.active[2][4] = { - provider = "diagnostic_info", - enabled = function() - return lsp.diagnostics_exist(vim.diagnostic.severity.INFO) - end, - hl = { - fg = C.sky, - bg = sett.bkg, - }, - icon = " " .. assets.lsp.info .. " ", - } - - components.active[2][5] = { - provider = "diagnostic_hints", - enabled = function() - return lsp.diagnostics_exist(vim.diagnostic.severity.HINT) - end, - hl = { - fg = C.rosewater, - bg = sett.bkg, - }, - icon = " " .. assets.lsp.hint .. " ", - } - -- Diagnostics ------> - - -- ######## Center - - -- ######## Right - - components.active[3][1] = { - provider = function() - local current_line = vim.fn.line(".") - local total_line = vim.fn.line("$") - - if current_line == 1 then - return "Top" - elseif current_line == vim.fn.line("$") then - return "Bot" - end - local result, _ = math.modf((current_line / total_line) * 100) - return result .. "%%" - end, - -- enabled = shortline or function(winid) - -- return vim.api.nvim_win_get_width(winid) > 90 - -- end, - hl = { - fg = sett.extras, - bg = sett.bkg, - }, - right_sep = invi_sep, - } - - -- position - components.active[3][2] = { - provider = "position", - -- enabled = shortline or function(winid) - -- return vim.api.nvim_win_get_width(winid) > 90 - -- end, - hl = { - fg = sett.extras, - bg = sett.bkg, - }, - right_sep = invi_sep, - } - - -- macro - components.active[3][3] = { - provider = "macro", - enabled = function() - return vim.api.nvim_get_option("cmdheight") == 0 - end, - hl = { - fg = sett.extras, - bg = sett.bkg, - }, - right_sep = invi_sep, - } - - -- search count - components.active[3][4] = { - provider = "search_count", - enabled = function() - return vim.api.nvim_get_option("cmdheight") == 0 - end, - hl = { - fg = sett.extras, - bg = sett.bkg, - }, - right_sep = invi_sep, - } - - components.active[3][5] = { - provider = function() - local filename = vim.fn.expand("%:t") - local extension = vim.fn.expand("%:e") - local present, icons = pcall(require, "nvim-web-devicons") - local icon = present and icons.get_icon(filename, extension) or assets.file - return (sett.show_modified and "%m" or "") .. " " .. icon .. " " .. filename .. " " - end, - enabled = is_enabled(70), - hl = { - fg = sett.text, - bg = sett.curr_file, - }, - left_sep = { - str = assets.left_separator, - hl = { - fg = sett.curr_file, - bg = sett.bkg, - }, - }, - } - - -- components.active[3][6] = { - -- provider = function() - -- local dir_name = vim.fn.fnamemodify(vim.fn.getcwd(), ":t") - -- return " " .. assets.dir .. " " .. dir_name .. " " - -- end, - -- enabled = is_enabled(80), - -- hl = { - -- fg = sett.text, - -- bg = sett.curr_dir, - -- }, - -- left_sep = { - -- str = assets.left_separator, - -- hl = { - -- fg = sett.curr_dir, - -- bg = sett.curr_file, - -- }, - -- }, - -- } - -- ######## Right - - -- Inanctive components - components.inactive[1][1] = { - provider = function() - return " " .. string.upper(vim.bo.ft) .. " " - end, - hl = { - fg = C.overlay2, - bg = C.mantle, - }, - } - - return components -end - -return M diff --git a/dot_config/nvim/lua/lsp/init.lua b/dot_config/nvim/lua/lsp/init.lua deleted file mode 100644 index 4440d51..0000000 --- a/dot_config/nvim/lua/lsp/init.lua +++ /dev/null @@ -1,43 +0,0 @@ -local M = {} - -local map = function(mode, lhs, rhs, opts) - vim.keymap.set(mode, lhs, rhs, { buffer = opts[1], desc = opts[2] }) -end -M.map = map - -M.default_config = { - on_attach = function(client, bufnr) - if client.server_capabilities.documentSymbolProvider then - require("nvim-navic").attach(client, bufnr) - end - - map("n", "K", vim.lsp.buf.hover, { bufnr, "Hover Information" }) - map("n", "]d", vim.diagnostic.goto_next, { bufnr, "Next Diagnostic" }) - map("n", "[d", vim.diagnostic.goto_prev, { bufnr, "Previous Diagnostic" }) - - map("n", "gs", vim.lsp.buf.signature_help, { bufnr, "Signature Help" }) - map("n", "gD", vim.lsp.buf.declaration, { bufnr, "Declarations" }) - map("n", "gd", "Telescope lsp_definitions", { bufnr, "Definitions" }) - map("n", "gT", "Telescope lsp_type_definitions", { bufnr, "Type Definitions" }) - map("n", "gr", "Telescope lsp_references", { bufnr, "References" }) - map("n", "gI", "Telescope lsp_implementations", { bufnr, "Implementations" }) - map("n", "gl", function() - vim.diagnostic.open_float(0, { scope = "line" }) - end, { bufnr, "LSP Line Diagnostics" }) - - map("n", "la", vim.lsp.buf.code_action, { bufnr, "Code Action" }) - map("n", "lr", vim.lsp.buf.rename, { bufnr, "Rename" }) - map("n", "lf", vim.lsp.buf.format, { bufnr, "Format" }) - map("n", "ld", "Telescope diagnostics", { bufnr, "Workspace Diagnostics" }) - map("n", "lD", "Telescope diagnostics bufnr=0", { bufnr, "Buffer Diagnostics" }) - map("n", "ls", "Telescope lsp_document_symbols", { bufnr, "Document Symbols" }) - map("n", "lS", "Telescope lsp_workspace_symbols", { bufnr, "Workspace Symbols" }) - map("n", "lwa", vim.lsp.buf.add_workspace_folder, { bufnr, "Add Workspace Folder" }) - map("n", "lwr", vim.lsp.buf.remove_workspace_folder, { bufnr, "Remove Workspace Folder" }) - map("n", "lwl", function() - print(vim.inspect(vim.lsp.buf.list_workspace_folders())) - end, { bufnr, "List Workspace Folders" }) - end, -} - -return M diff --git a/dot_config/nvim/lua/lsp/java.lua b/dot_config/nvim/lua/lsp/java.lua deleted file mode 100644 index 9df8445..0000000 --- a/dot_config/nvim/lua/lsp/java.lua +++ /dev/null @@ -1,184 +0,0 @@ -local M = {} - -local HOME = os.getenv("HOME") -local SDKMAN_DIR = os.getenv("SDKMAN_DIR") - -local lsp = require("lsp") -local map = lsp.map - -local jdtls = require("jdtls") - -local bundles = {} -local mason_path = vim.fn.glob(vim.fn.stdpath("data") .. "/mason/") -vim.list_extend(bundles, vim.split(vim.fn.glob(mason_path .. "packages/java-test/extension/server/*.jar"), "\n")) -vim.list_extend( - bundles, - vim.split( - vim.fn.glob(mason_path .. "packages/java-debug-adapter/extension/server/com.microsoft.java.debug.plugin-*.jar"), - "\n" - ) -) - -local capabilities = vim.lsp.protocol.make_client_capabilities() -capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities) - -local function nnoremap(rhs, lhs, bufopts, desc) - bufopts.desc = desc - vim.keymap.set("n", rhs, lhs, bufopts) -end - -local on_attach = function(client, bufnr) - lsp.default_config.on_attach(client, bufnr) - require("jdtls").setup_dap({ hotcodereplace = "auto" }) - require("jdtls.dap").setup_dap_main_class_configs() - require("jdtls.setup").add_commands() - - -- Java extensions provided by jdtls - map("n", "lo", jdtls.organize_imports, { bufnr, "Organize Imports" }) - map("n", "lle", jdtls.extract_variable, { bufnr, "Extract Variable" }) - map("n", "llc", jdtls.extract_constant, { bufnr, "Extract Constant" }) - map("v", "llm", "lua require('jdtls').extract_method(true)", { bufnr, "Extract Method" }) - map("n", "ltc", jdtls.test_class, { bufnr, "Test Class (DAP)" }) - map("n", "tm", jdtls.test_nearest_method, { bufnr, "Test Method (DAP)" }) -end - -function M.make_jdtls_config(root_dir, workspace_folder) - return { - flags = { - debounce_text_changes = 80, - allow_incremental_sync = true, - }, - on_attach = on_attach, - capabilities = capabilities, - root_dir = root_dir, - init_options = { - bundles = bundles, - }, - - -- https://github.com/eclipse/eclipse.jdt.ls/wiki/Running-the-JAVA-LS-server-from-the-command-line#initialize-request - settings = { - java = { - project = { - referencedLibraries = { - HOME .. "/University/Y3/S2/programming-languages/warm-up/antlr.jar", - }, - }, - format = { - settings = { - -- https://github.com/google/styleguide/blob/gh-pages/eclipse-java-google-style.xml - url = "/.local/share/eclipse/eclipse-java-google-style.xml", - profile = "GoogleStyle", - }, - }, - contentProvider = { preferred = "fernflower" }, -- Use fernflower to decompile library code - -- Specify any completion options - completion = { - maxResults = 30, - postfix = { enabled = true }, - favoriteStaticMembers = { - "org.hamcrest.MatcherAssert.assertThat", - "org.hamcrest.Matchers.*", - "org.hamcrest.CoreMatchers.*", - "org.junit.jupiter.api.Assertions.*", - "java.util.Objects.requireNonNull", - "java.util.Objects.requireNonNullElse", - "org.mockito.Mockito.*", - }, - filteredTypes = { - "com.sun.*", - "io.micrometer.shaded.*", - "java.awt.*", - "jdk.*", - "sun.*", - }, - }, - -- LSP Related - implementationsCodeLens = { enabled = true }, - referenceCodeLens = { enabled = true }, - signatureHelp = { enabled = true }, - inlayHints = { - parameterNames = { enabled = true }, - }, - -- Specify any options for organizing imports - sources = { - organizeImports = { - starThreshold = 9999, - staticStarThreshold = 9999, - }, - }, - maven = { - downloadSources = true, - updateSnapshots = true, - }, - -- On Save Cleanup - cleanup = { - actionsOnSave = { - "addOverride", - }, - }, - -- How code generation should act - codeGeneration = { - toString = { - template = "${object.className}{${member.name()}=${member.value}, ${otherMembers}}", - }, - hashCodeEquals = { - useJava7Objects = true, - }, - useBlocks = true, - }, - -- https://github.com/eclipse/eclipse.jdt.ls/wiki/Running-the-JAVA-LS-server-from-the-command-line#initialize-request - -- `interface RuntimeOption` - configuration = { - maven = { - userSettings = HOME .. "/.m2/settings.xml", - }, - runtimes = { - { - name = "JavaSE-17", - path = SDKMAN_DIR .. "/candidates/java/17.0.5-amzn", - }, - { - name = "JavaSE-11", - path = SDKMAN_DIR .. "/candidates/java/11.0.18-amzn", - }, - { - name = "JavaSE-1.8", - path = SDKMAN_DIR .. "/candidates/java/8.0.362-amzn", - }, - }, - }, - }, - }, - -- Note that eclipse.jdt.ls must be started with a Java version of 17 or higher - -- See: https://github.com/eclipse/eclipse.jdt.ls#running-from-the-command-line - cmd = { - SDKMAN_DIR .. "/candidates/java/17.0.5-amzn/bin/java", - "-Declipse.application=org.eclipse.jdt.ls.core.id1", - "-Dosgi.bundles.defaultStartLevel=4", - "-Declipse.product=org.eclipse.jdt.ls.core.product", - "-Dlog.protocol=true", - "-Dlog.level=ALL", - "-Xmx4g", - "--add-modules=ALL-SYSTEM", - "--add-opens", - "java.base/java.util=ALL-UNNAMED", - "--add-opens", - "java.base/java.lang=ALL-UNNAMED", - -- If you use lombok, download the lombok jar and place it in ~/.local/share/eclipse - -- "-javaagent:" - -- .. HOME - -- .. "/.local/share/eclipse/lombok.jar", - - "-jar", - vim.fn.glob(HOME .. "/.local/share/eclipse.jdt.ls/plugins/org.eclipse.equinox.launcher_*.jar"), - - "-configuration", - HOME .. "/.local/share/eclipse.jdt.ls/config_linux", - - "-data", - workspace_folder, - }, - } -end - -return M diff --git a/dot_config/nvim/lua/options.lua b/dot_config/nvim/lua/options.lua deleted file mode 100644 index 98b7d59..0000000 --- a/dot_config/nvim/lua/options.lua +++ /dev/null @@ -1,88 +0,0 @@ --- puts current line number on current line --- relative line numbers on everything else -vim.opt.number = true -vim.opt.relativenumber = true - --- highlight line number -vim.opt.cursorline = true - --- free real estate -vim.opt.cmdheight = 0 - --- don't show status -vim.opt.showmode = false - --- https://www.reddit.com/r/neovim/comments/10fpqbp/gist_statuscolumn_separate_diagnostics_and/ --- local M = {} --- _G.Status = M --- --- ---@return {name:string, text:string, texthl:string}[] --- function M.get_signs() --- local buf = vim.api.nvim_win_get_buf(vim.g.statusline_winid) --- return vim.tbl_map(function(sign) --- return vim.fn.sign_getdefined(sign.name)[1] --- end, vim.fn.sign_getplaced(buf, { group = "*", lnum = vim.v.lnum })[1].signs) --- end --- --- function M.column() --- local sign, git_sign --- for _, s in ipairs(M.get_signs()) do --- if s.name:find("GitSign") then --- git_sign = s --- else --- sign = s --- end --- end --- local components = { --- sign and ("%#" .. sign.texthl .. "#" .. sign.text .. "%*") or " ", --- [[%=]], --- [[%{&nu?(&rnu&&v:relnum?v:relnum:v:lnum):''} ]], --- git_sign and ("%#" .. git_sign.texthl .. "#" .. git_sign.text .. "%*") or " ", --- } --- return table.concat(components, "") --- end --- --- vim.opt.statuscolumn = [[%!v:lua.Status.column()]] - --- don't jump around when signs appear -vim.opt.signcolumn = "yes" - --- default to 2 spaces for indentation -vim.opt.shiftwidth = 2 -vim.opt.tabstop = 2 -vim.opt.softtabstop = 2 -vim.opt.expandtab = true - --- keep some lines at the top/bottom/left/right of the window -vim.opt.scrolloff = 8 -vim.opt.sidescrolloff = 8 - --- smarter smartindent -vim.opt.cindent = true - --- global statusline -vim.opt.laststatus = 3 - --- apparently this makes cmp work -vim.opt.completeopt = "menu,menuone,noselect" - --- live life dangerously -vim.opt.swapfile = true -vim.opt.backup = true -vim.opt.undofile = true -vim.opt.undodir = vim.fn.stdpath("data") .. "/undo/" -vim.opt.backupdir = vim.fn.stdpath("data") .. "/backup/" -vim.opt.directory = vim.fn.stdpath("data") .. "/swap/" - --- no more noh and incremental search highlighting -vim.opt.hlsearch = false -vim.opt.incsearch = true - --- make cursorhold happen faster -vim.opt.updatetime = 100 - --- make which key show up faster -vim.opt.timeoutlen = 500 - --- 24bit tui colours -vim.opt.termguicolors = true diff --git a/dot_config/nvim/lua/plugins/actually.lua b/dot_config/nvim/lua/plugins/actually.lua deleted file mode 100644 index b81d29e..0000000 --- a/dot_config/nvim/lua/plugins/actually.lua +++ /dev/null @@ -1,3 +0,0 @@ -return { - "mong8se/actually.nvim", -} diff --git a/dot_config/nvim/lua/plugins/alpha.lua b/dot_config/nvim/lua/plugins/alpha.lua deleted file mode 100644 index 6b3c7f5..0000000 --- a/dot_config/nvim/lua/plugins/alpha.lua +++ /dev/null @@ -1,73 +0,0 @@ -return { - { - "goolord/alpha-nvim", - config = function() - local alpha = require("alpha") - local dashboard = require("alpha.themes.dashboard") - dashboard.section.header.val = { - [[================= =============== =============== ======== ========]], - [[\\ . . . . . . .\\ //. . . . . . .\\ //. . . . . . .\\ \\. . .\\// . . //]], - [[||. . ._____. . .|| ||. . ._____. . .|| ||. . ._____. . .|| || . . .\/ . . .||]], - [[|| . .|| ||. . || || . .|| ||. . || || . .|| ||. . || ||. . . . . . . ||]], - [[||. . || || . .|| ||. . || || . .|| ||. . || || . .|| || . | . . . . .||]], - [[|| . .|| ||. _-|| ||-_ .|| ||. . || || . .|| ||. _-|| ||-_.|\ . . . . ||]], - [[||. . || ||-' || || `-|| || . .|| ||. . || ||-' || || `|\_ . .|. .||]], - [[|| . _|| || || || || ||_ . || || . _|| || || || |\ `-_/| . ||]], - [[||_-' || .|/ || || \|. || `-_|| ||_-' || .|/ || || | \ / |-_.||]], - [[|| ||_-' || || `-_|| || || ||_-' || || | \ / | `||]], - [[|| `' || || `' || || `' || || | \ / | ||]], - [[|| .===' `===. .==='.`===. .===' /==. | \/ | ||]], - [[|| .==' \_|-_ `===. .===' _|_ `===. .===' _-|/ `== \/ | ||]], - [[|| .==' _-' `-_ `=' _-' `-_ `=' _-' `-_ /| \/ | ||]], - [[|| .==' _-' '-__\._-' '-_./__-' `' |. /| | ||]], - [[||.==' _-' `' | /==.||]], - [[==' _-' N E O V I M \/ `==]], - [[\ _-' `-_ /]], - [[ `'' ``' ]], - } - - dashboard.section.buttons.val = { - dashboard.button("f", " Find File", ":Telescope find_files"), - dashboard.button("e", " New File", ":ene startinsert"), - dashboard.button("p", " Find Project", ":Telescope projects"), - dashboard.button("r", " Recent Files", ":Telescope oldfiles"), - dashboard.button("t", " Find Text", ":Telescope live_grep"), - dashboard.button("c", " Configuration", ":e $MYVIMRC"), - dashboard.button("q", " Quit Neovim", ":qa"), - } - local function footer() - local total_plugins = require("lazy").stats().count - local datetime = os.date("%d-%m-%Y %H:%M:%S") - local plugins_text = "  " - .. total_plugins - .. " plugins" - .. "  v" - .. vim.version().major - .. "." - .. vim.version().minor - .. "." - .. vim.version().patch - .. "  " - .. datetime - return plugins_text - end - - dashboard.section.footer.val = footer() - dashboard.section.footer.opts.hl = "Type" - dashboard.section.buttons.opts.hl = "Keyword" - - dashboard.opts.opts.noautocmd = false - - dashboard.config.layout = { - { type = "padding", val = 3 }, - dashboard.section.header, - { type = "padding", val = 2 }, - dashboard.section.buttons, - { type = "padding", val = 1 }, - dashboard.section.footer, - } - - alpha.setup(dashboard.opts) - end, - }, -} diff --git a/dot_config/nvim/lua/plugins/asciiblocks.lua b/dot_config/nvim/lua/plugins/asciiblocks.lua deleted file mode 100644 index cf547d8..0000000 --- a/dot_config/nvim/lua/plugins/asciiblocks.lua +++ /dev/null @@ -1,3 +0,0 @@ -return { - { "superhawk610/ascii-blocks.nvim", cmd = "AsciiBlockify" }, -} diff --git a/dot_config/nvim/lua/plugins/asciitree.lua b/dot_config/nvim/lua/plugins/asciitree.lua deleted file mode 100644 index 4267ab4..0000000 --- a/dot_config/nvim/lua/plugins/asciitree.lua +++ /dev/null @@ -1,3 +0,0 @@ -return { - { "cloudysake/asciitree.nvim", cmd = "AsciiTree" }, -} diff --git a/dot_config/nvim/lua/plugins/autopairs.lua b/dot_config/nvim/lua/plugins/autopairs.lua deleted file mode 100644 index cc8e169..0000000 --- a/dot_config/nvim/lua/plugins/autopairs.lua +++ /dev/null @@ -1,13 +0,0 @@ -return { - { - "windwp/nvim-autopairs", - config = function() - require("nvim-autopairs").setup({ - disable_in_macro = true, - }) - local cmp_autopairs = require("nvim-autopairs.completion.cmp") - local cmp = require("cmp") - cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) - end, - }, -} diff --git a/dot_config/nvim/lua/plugins/catppuccin.lua b/dot_config/nvim/lua/plugins/catppuccin.lua deleted file mode 100644 index 1ce4b32..0000000 --- a/dot_config/nvim/lua/plugins/catppuccin.lua +++ /dev/null @@ -1,74 +0,0 @@ -return { - { - "catppuccin/nvim", - name = "catppuccin", - lazy = false, - priority = 1000, - config = function() - local cp = require("catppuccin.palettes").get_palette() - - require("catppuccin").setup({ - flavour = "mocha", - transparent_background = true, - term_colors = true, - no_italic = true, - integrations = { - neogit = true, - mason = true, - native_lsp = { - enabled = true, - underlines = { - errors = {}, - hints = {}, - warnings = {}, - information = {}, - }, - }, - navic = { - enabled = true, - custom_bg = "NONE", - }, - dap = { - enabled = true, - enable_ui = true, - }, - cmp = true, - treesitter = true, - overseer = true, - telescope = true, - which_key = true, - }, - color_overrides = { - mocha = { - base = "#000000", - mantle = "#000000", - surface2 = cp.subtext0, - overlay0 = cp.subtext0, - }, - }, - custom_highlights = { - ErrorMsg = { fg = cp.red, style = { "bold" } }, - ["@method.call"] = { fg = cp.blue }, - ["@constant"] = { fg = cp.sapphire }, - LspInfoBorder = { link = "FloatBorder" }, - PmenuSel = { bg = cp.surface0 }, - FloatBorder = { fg = cp.overlay0, bg = "NONE" }, - TelescopeBorder = { link = "FloatBorder" }, - TelescopeMatching = { link = "TelescopeNormal" }, - TelescopeSelection = { fg = "NONE", bg = cp.surface0 }, - TelescopeTitle = { fg = cp.subtext0 }, - QuickScopePrimary = { fg = cp.red }, - QuickScopeSecondary = { fg = cp.peach }, - - DapStoppedLinehl = { bg = "#324430" }, - DapBreakpointLinehl = { bg = "#492a32" }, - - NeogitDiffContextHighlight = { bg = "NONE" }, - - NavicText = { fg = cp.teal }, - }, - }) - vim.cmd.colorscheme("catppuccin") - end, - }, -} diff --git a/dot_config/nvim/lua/plugins/ccc.lua b/dot_config/nvim/lua/plugins/ccc.lua deleted file mode 100644 index fa421ce..0000000 --- a/dot_config/nvim/lua/plugins/ccc.lua +++ /dev/null @@ -1,8 +0,0 @@ -return { - { - "uga-rosa/ccc.nvim", - opts = { - highlighter = { auto_enable = true }, - }, - }, -} diff --git a/dot_config/nvim/lua/plugins/cmp.lua b/dot_config/nvim/lua/plugins/cmp.lua deleted file mode 100644 index 50f5df6..0000000 --- a/dot_config/nvim/lua/plugins/cmp.lua +++ /dev/null @@ -1,113 +0,0 @@ -return { - { - "L3MON4D3/LuaSnip", - dependencies = { - "rafamadriz/friendly-snippets", - config = function() - require("luasnip.loaders.from_vscode").lazy_load() - end, - }, - opts = { - history = true, - delete_check_events = "TextChanged", - }, - -- stylua: ignore - keys = { - { - "", - function() - return require("luasnip").jumpable(1) and "luasnip-jump-next" or "" - end, - expr = true, silent = true, mode = "i", - }, - { "", function() require("luasnip").jump(1) end, mode = "s" }, - { "", function() require("luasnip").jump(-1) end, mode = { "i", "s" } }, - }, - }, - - { - "hrsh7th/nvim-cmp", - version = false, - event = "InsertEnter", - config = function() - local cmp = require("cmp") - local cmp_under_comparator = require("cmp-under-comparator") - local lspkind = require("lspkind") - local luasnip = require("luasnip") - - cmp.setup({ - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) - end, - }, - window = { - completion = cmp.config.window.bordered(), - documentation = cmp.config.window.bordered(), - }, - mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping(cmp.mapping.select_prev_item(), { "i", "c" }), - [""] = cmp.mapping(cmp.mapping.select_next_item(), { "i", "c" }), - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.complete({}), - [""] = cmp.mapping.abort(), - [""] = cmp.mapping.confirm({ select = true }), - }), - sources = cmp.config.sources({ - { name = "nvim_lsp" }, - { name = "nvim_lua" }, - { name = "luasnip" }, - }, { - { name = "buffer" }, - { name = "path" }, - }), - sorting = { - comparators = { - cmp.config.compare.offset, - cmp.config.compare.exact, - cmp.config.compare.score, - cmp_under_comparator.under, - cmp.config.compare.kind, - cmp.config.compare.sort_text, - cmp.config.compare.length, - cmp.config.compare.order, - }, - }, - formatting = { - format = lspkind.cmp_format({ - mode = "symbol", - maxwidth = 30, - ellipsis_char = "…", - }), - }, - }) - - cmp.setup.cmdline({ "/", "?" }, { - mapping = cmp.mapping.preset.cmdline(), - sources = { - { name = "buffer" }, - }, - }) - - cmp.setup.cmdline(":", { - mapping = cmp.mapping.preset.cmdline(), - sources = cmp.config.sources({ - { name = "path" }, - }, { - { name = "cmdline" }, - }), - }) - end, - dependencies = { - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-path", - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-nvim-lua", - "hrsh7th/cmp-cmdline", - "saadparwaiz1/cmp_luasnip", - "lukas-reineke/cmp-under-comparator", - "onsails/lspkind.nvim", - }, - }, -} diff --git a/dot_config/nvim/lua/plugins/coverage.lua b/dot_config/nvim/lua/plugins/coverage.lua deleted file mode 100644 index bc2874a..0000000 --- a/dot_config/nvim/lua/plugins/coverage.lua +++ /dev/null @@ -1,7 +0,0 @@ -return { - { - "andythigpen/nvim-coverage", - config = true, - dependencies = { "nvim-lua/plenary.nvim" }, - }, -} diff --git a/dot_config/nvim/lua/plugins/dap.lua b/dot_config/nvim/lua/plugins/dap.lua deleted file mode 100644 index 52cfd75..0000000 --- a/dot_config/nvim/lua/plugins/dap.lua +++ /dev/null @@ -1,136 +0,0 @@ -local get_python_path = function() - for _, client in pairs(vim.lsp.get_active_clients()) do - if client.name == "pyright" then - local path = client.config.settings.python.pythonPath - if path ~= nil then - return path - else - return "python" - end - end - end -end - -return { - { - "jayp0521/mason-nvim-dap.nvim", - lazy = false, - config = function() - local dap = require("dap") - local mason_dap = require("mason-nvim-dap") - - mason_dap.setup({ - ensure_installed = { "python", "codelldb", "java-debug-adapter", "java-test" }, - automatic_setup = true, - }) - mason_dap.setup_handlers({ - -- default handler - function(source) - require("mason-nvim-dap.automatic_setup")(source) - end, - - -- custom handlers - python = function(_) - dap.adapters.python = { - type = "executable", - command = "debugpy-adapter", - } - - dap.configurations.python = { - { - name = "Launch current file", - type = "python", - request = "launch", - program = "${file}", - pythonPath = get_python_path, - }, - { - name = "Launch pytest", - type = "python", - request = "launch", - module = "pytest", - pythonPath = get_python_path, - }, - } - - dap.configurations.java = { - { - type = "java", - request = "attach", - name = "Debug (Attach) - Remote", - hostName = "127.0.0.1", - port = 5005, - }, - } - end, - }) - - -- apply suggestions from catppuccin theme - local sign = vim.fn.sign_define - sign("DapBreakpoint", { text = "●", texthl = "DapBreakpoint", linehl = "DapBreakpointLinehl", numhl = "" }) - sign("DapStopped", { text = "", texthl = "Error", linehl = "DapStoppedLinehl", numhl = "" }) - sign("DapBreakpointCondition", { text = "●", texthl = "DapBreakpointCondition", linehl = "", numhl = "" }) - sign("DapLogPoint", { text = "◆", texthl = "DapLogPoint", linehl = "", numhl = "" }) - end, - -- stylua: ignore - keys = { - { "bb", vim.cmd.DapToggleBreakpoint, desc = "Toggle Breakpoint" }, - { "bf", function() require("dap").list_breakpoints() end, desc = "List Breakpoints", }, - { "bc", function() require("dap").clear_breakpoints() end, desc = "Clear Breakpoints", }, - - { "dc", vim.cmd.DapContinue, desc = "Start / Continue" }, - { "dj", function() require("dap").step_over() end, desc = "Step Over", }, - { "dk", function() require("dap").step_into() end, desc = "Step Into", }, - { "do", function() require("dap").step_out() end, desc = "Step Out", }, - { "dd", function() require("dap").disconnect() end, desc = "Disconnect", }, - { "dr", function() require("dap").restart() end, desc = "Restart", }, - - { "du", function() require("dapui").toggle({}) end, desc = "Toggle UI", }, - { "dt", function() require("dap.repl").toggle() end, desc = "Toggle REPL", }, - }, - dependencies = { - "williamboman/mason.nvim", - { - "mfussenegger/nvim-dap", - config = function() - local dap, dapui = require("dap"), require("dapui") - dap.listeners.after.event_initialized["dapui_config"] = function() - dapui.open() - end - dap.listeners.before.event_terminated["dapui_config"] = function() - dapui.close() - end - dap.listeners.before.event_exited["dapui_config"] = function() - dapui.close() - end - end, - }, - { - "rcarriga/nvim-dap-ui", - opts = { - -- stylua: ignore - layouts = { - { - elements = { - { id = "stacks", size = 0.15, }, - { id = "repl", size = 0.05, }, - { id = "scopes", size = 0.40, }, - { id = "watches", size = 0.40, }, - }, - position = "left", - size = 40, - }, - { - elements = { - { id = "console", size = 1, }, - }, - position = "bottom", - size = 10, - }, - }, - }, - }, - { "theHamsta/nvim-dap-virtual-text", config = true }, - }, - }, -} diff --git a/dot_config/nvim/lua/plugins/delaytrain.lua b/dot_config/nvim/lua/plugins/delaytrain.lua deleted file mode 100644 index a42fd10..0000000 --- a/dot_config/nvim/lua/plugins/delaytrain.lua +++ /dev/null @@ -1,9 +0,0 @@ -return { - { - "ja-ford/delaytrain.nvim", - opts = { - grace_period = 3, - ignore_filetypes = { "Neogit*", "help", "NvimTr*", "lazy", "mason" }, - }, - }, -} diff --git a/dot_config/nvim/lua/plugins/dressing.lua b/dot_config/nvim/lua/plugins/dressing.lua deleted file mode 100644 index d19a448..0000000 --- a/dot_config/nvim/lua/plugins/dressing.lua +++ /dev/null @@ -1,10 +0,0 @@ -return { - { - "stevearc/dressing.nvim", - opts = { - input = { - insert_only = false, - }, - }, - }, -} diff --git a/dot_config/nvim/lua/plugins/feline.lua b/dot_config/nvim/lua/plugins/feline.lua deleted file mode 100644 index 4b09608..0000000 --- a/dot_config/nvim/lua/plugins/feline.lua +++ /dev/null @@ -1,23 +0,0 @@ -return { - { - "feline-nvim/feline.nvim", - config = function() - local feline = require("feline") - - feline.setup({ - components = require("extra.feline").get(), - force_inactive = { - filetypes = { - "^lazy$", - "^startify$", - "^fugitive$", - "^fugitiveblame$", - "^qf$", - "^help$", - }, - }, - }) - end, - dependencies = { "nvim-tree/nvim-web-devicons" }, - }, -} diff --git a/dot_config/nvim/lua/plugins/gitsigns.lua b/dot_config/nvim/lua/plugins/gitsigns.lua deleted file mode 100644 index f2dac72..0000000 --- a/dot_config/nvim/lua/plugins/gitsigns.lua +++ /dev/null @@ -1,57 +0,0 @@ -return { - { - "lewis6991/gitsigns.nvim", - config = function() - require("gitsigns").setup({ - on_attach = function(bufnr) - local gs = package.loaded.gitsigns - - local function map(mode, l, r, opts, desc) - opts = opts or {} - opts.buffer = bufnr - opts.desc = desc - vim.keymap.set(mode, l, r, opts) - end - - -- Navigation - map("n", "]c", function() - if vim.wo.diff then - return "]c" - end - vim.schedule(function() - gs.next_hunk() - end) - return "" - end, { expr = true }, "Next Hunk") - - map("n", "[c", function() - if vim.wo.diff then - return "[c" - end - vim.schedule(function() - gs.prev_hunk() - end) - return "" - end, { expr = true }, "Previous Hunk") - - -- Actions - map({ "n", "v" }, "gg", ":Neogit", {}, "Open Git") - map({ "n", "v" }, "gs", ":Gitsigns stage_hunk", {}, "Stage Hunk") - map({ "n", "v" }, "gr", ":Gitsigns reset_hunk", {}, "Reset Hunk") - map("n", "gS", gs.stage_buffer, {}, "Stage Buffer") - map("n", "gu", gs.undo_stage_hunk, {}, "Undo Stage Hunk") - map("n", "gR", gs.reset_buffer, {}, "Reset Buffer") - map("n", "gp", gs.preview_hunk, {}, "Preview Hunk") - map("n", "gb", function() - gs.blame_line({ full = true }) - end, {}, "Show Blame") - map("n", "gb", gs.toggle_current_line_blame, {}, "Current Line Blame") - map("n", "gd", gs.toggle_deleted, {}, "Show Deleted") - - -- Text object - map({ "o", "x" }, "ih", ":Gitsigns select_hunk") - end, - }) - end, - }, -} diff --git a/dot_config/nvim/lua/plugins/lsp.lua b/dot_config/nvim/lua/plugins/lsp.lua deleted file mode 100644 index aa2bc01..0000000 --- a/dot_config/nvim/lua/plugins/lsp.lua +++ /dev/null @@ -1,193 +0,0 @@ -local lsp = require("lsp") - -local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " } -for type, icon in pairs(signs) do - local hl = "DiagnosticSign" .. type - vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" }) -end - -vim.diagnostic.config({ - underline = { - severity = { max = vim.diagnostic.severity.WARN }, - }, - virtual_text = { - severity = { min = vim.diagnostic.severity.ERROR }, - }, - float = { border = "rounded" }, - update_in_insert = true, -}) -vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = "rounded" }) -vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, { border = "rounded" }) - -local custom_config = function(config) - local merged_config = vim.deepcopy(lsp.default_config) - merged_config = vim.tbl_extend("force", merged_config, config) - return merged_config -end - -return { - { - "neovim/nvim-lspconfig", - config = function() - require("lspconfig.ui.windows").default_options.border = "rounded" - end, - dependencies = { - { - "williamboman/mason-lspconfig.nvim", - config = function() - require("mason-lspconfig").setup({ - ensure_installed = { "rust_analyzer", "pyright", "lua_ls", "marksman" }, - }) - require("mason-lspconfig").setup_handlers({ - -- default handler - function(server_name) - require("lspconfig")[server_name].setup(lsp.default_config) - end, - - ["ltex"] = function() - require("lspconfig")["ltex"].setup(lsp.default_config) - require("ltex_extra").setup({ - load_langs = { "es-AR", "en-US" }, - init_check = true, - path = vim.fn.stdpath("data") .. "/dictionary", - }) - end, - - ["rust_analyzer"] = function() - -- https://github.com/simrat39/rust-tools.nvim/issues/300 - local config = custom_config({ - settings = { - ["rust-analyzer"] = { - inlayHints = { locationLinks = false }, - }, - }, - }) - require("rust-tools").setup({ - server = config, - dap = { - adapter = { - type = "server", - port = "${port}", - host = "127.0.0.1", - executable = { - command = "codelldb", - args = { "--port", "${port}" }, - }, - }, - }, - }) - end, - - ["pyright"] = function() - require("py_lsp").setup(lsp.default_config) - end, - - ["lua_ls"] = function() - require("lspconfig")["lua_ls"].setup(custom_config({ - settings = { - Lua = { - format = { - enable = false, - }, - workspace = { - checkThirdParty = false, - }, - telemetry = { - enable = false, - }, - }, - }, - })) - end, - }) - end, - dependencies = { - { - "williamboman/mason.nvim", - opts = { - ui = { border = "rounded" }, - }, - }, - { "folke/neodev.nvim", config = true }, - }, - }, - "simrat39/rust-tools.nvim", - { - "ray-x/go.nvim", - dependencies = { -- optional packages - "ray-x/guihua.lua", - "neovim/nvim-lspconfig", - "nvim-treesitter/nvim-treesitter", - }, - config = function() - require("go").setup() - end, - event = { "CmdlineEnter" }, - ft = { "go", "gomod" }, - }, - { - "mrcjkb/haskell-tools.nvim", - branch = "1.x.x", - config = function() - local ht = require("haskell-tools") - local def_opts = { noremap = true, silent = true } - - ht.setup({ - hls = { - on_attach = function(client, bufnr) - local opts = vim.tbl_extend("keep", def_opts, { buffer = bufnr }) - -- haskell-language-server relies heavily on codeLenses, - -- so auto-refresh (see advanced configuration) is enabled by default - vim.keymap.set("n", "ca", vim.lsp.codelens.run, opts) - vim.keymap.set("n", "le", ht.lsp.buf_eval_all, opts) - end, - }, - }) - end, - }, - "HallerPatrick/py_lsp.nvim", - "mfussenegger/nvim-jdtls", - { - "ray-x/lsp_signature.nvim", - opts = { - hint_enable = false, - hint_prefix = "", - }, - }, - "barreiroleo/ltex_extra.nvim", - "lervag/vimtex", - }, - }, - { - "jose-elias-alvarez/null-ls.nvim", - config = function() - local null_ls = require("null-ls") - null_ls.setup({ - sources = { - null_ls.builtins.formatting.ruff, - null_ls.builtins.formatting.yamlfmt, - null_ls.builtins.formatting.latexindent, - null_ls.builtins.formatting.beautysh, - null_ls.builtins.formatting.stylua.with({ - extra_args = { "--indent-type", "spaces" }, - }), - null_ls.builtins.diagnostics.markdownlint, - null_ls.builtins.formatting.mdformat.with({ - extra_args = { "--wrap", "80", "--number" }, - }), - -- null_ls.builtins.formatting.black, - -- null_ls.builtins.formatting.isort.with({ - -- extra_args = { "--profile", "black" }, - -- }), - }, - }) - end, - dependencies = { "nvim-lua/plenary.nvim" }, - }, - { - "jay-babu/mason-null-ls.nvim", - opts = { - ensure_installed = { "stylua", "markdownlint", "clang-format" }, - }, - }, -} diff --git a/dot_config/nvim/lua/plugins/markdown-preview.lua b/dot_config/nvim/lua/plugins/markdown-preview.lua deleted file mode 100644 index 7cf38d2..0000000 --- a/dot_config/nvim/lua/plugins/markdown-preview.lua +++ /dev/null @@ -1,6 +0,0 @@ -return { - { - "iamcco/markdown-preview.nvim", - build = "cd app && yarn install", - }, -} diff --git a/dot_config/nvim/lua/plugins/mini.lua b/dot_config/nvim/lua/plugins/mini.lua deleted file mode 100644 index c51754d..0000000 --- a/dot_config/nvim/lua/plugins/mini.lua +++ /dev/null @@ -1,21 +0,0 @@ -return { - { - "echasnovski/mini.nvim", - config = function() - -- add gc/gcc actions, gc textobject - require("mini.comment").setup({}) - - -- highlight word under cursor - require("mini.cursorword").setup({ delay = 0 }) - - -- indent lines, `i` textobject, `]i`/`[i` motions - require("mini.indentscope").setup({ - draw = { - delay = 0, - animation = require("mini.indentscope").gen_animation.none(), - }, - symbol = "│", - }) - end, - }, -} diff --git a/dot_config/nvim/lua/plugins/neogit.lua b/dot_config/nvim/lua/plugins/neogit.lua deleted file mode 100644 index a32b25f..0000000 --- a/dot_config/nvim/lua/plugins/neogit.lua +++ /dev/null @@ -1,7 +0,0 @@ -return { - { - "TimUntersberger/neogit", - config = true, - dependencies = { "nvim-lua/plenary.nvim" }, - }, -} diff --git a/dot_config/nvim/lua/plugins/nvim-navic.lua b/dot_config/nvim/lua/plugins/nvim-navic.lua deleted file mode 100644 index d58b7fd..0000000 --- a/dot_config/nvim/lua/plugins/nvim-navic.lua +++ /dev/null @@ -1,13 +0,0 @@ -return { - { - "SmiteshP/nvim-navic", - dependencies = { - "neovim/nvim-lspconfig", - "nvim-tree/nvim-web-devicons", -- optional dependency - }, - opts = { - highlight = true - }, - }, -} - diff --git a/dot_config/nvim/lua/plugins/nvim-tree.lua b/dot_config/nvim/lua/plugins/nvim-tree.lua deleted file mode 100644 index 7cb5f0b..0000000 --- a/dot_config/nvim/lua/plugins/nvim-tree.lua +++ /dev/null @@ -1,30 +0,0 @@ -return { - { - "nvim-tree/nvim-tree.lua", - dependencies = "nvim-tree/nvim-web-devicons", - config = function() - require("nvim-tree").setup({ - hijack_cursor = true, - hijack_netrw = false, - sync_root_with_cwd = true, - respect_buf_cwd = true, - update_focused_file = { - enable = true, - update_root = false, - }, - view = { - centralize_selection = true, - width = { - max = 60 - } - }, - renderer = { - group_empty = true, - }, - }) - end, - keys = { - { "e", "NvimTreeToggle", desc = "Open Explorer" }, - }, - }, -} diff --git a/dot_config/nvim/lua/plugins/overseer.lua b/dot_config/nvim/lua/plugins/overseer.lua deleted file mode 100644 index 26f3d51..0000000 --- a/dot_config/nvim/lua/plugins/overseer.lua +++ /dev/null @@ -1,11 +0,0 @@ -return { - { - "stevearc/overseer.nvim", - config = true, - cmd = { "OverseerRun", "OverseerToggle" }, - keys = { - { "tr", vim.cmd.OverseerRun, desc = "Run Task" }, - { "tt", vim.cmd.OverseerToggle, desc = "Toggle task results" }, - }, - }, -} diff --git a/dot_config/nvim/lua/plugins/presence.lua b/dot_config/nvim/lua/plugins/presence.lua deleted file mode 100644 index 9ec3315..0000000 --- a/dot_config/nvim/lua/plugins/presence.lua +++ /dev/null @@ -1,8 +0,0 @@ -return { - { - "andweeb/presence.nvim", - opts = { - neovim_image_text = "Home Sweet Home" - }, - }, -} diff --git a/dot_config/nvim/lua/plugins/project.lua b/dot_config/nvim/lua/plugins/project.lua deleted file mode 100644 index 2bafd1b..0000000 --- a/dot_config/nvim/lua/plugins/project.lua +++ /dev/null @@ -1,19 +0,0 @@ -return { - { - "ahmedkhalf/project.nvim", - config = function() - require("project_nvim").setup({ - patterns = { - ".git", - "_darcs", - ".hg", - ".bzr", - ".svn", - "Makefile", - "package.json", - "wezterm.lua", - }, - }) - end, - }, -} diff --git a/dot_config/nvim/lua/plugins/quickscope.lua b/dot_config/nvim/lua/plugins/quickscope.lua deleted file mode 100644 index 4256b17..0000000 --- a/dot_config/nvim/lua/plugins/quickscope.lua +++ /dev/null @@ -1,8 +0,0 @@ -return { - { - "unblevable/quick-scope", - init = function() - vim.g.qs_highlight_on_keys = { "f", "F", "t", "T" } - end, - }, -} diff --git a/dot_config/nvim/lua/plugins/statuscol.lua b/dot_config/nvim/lua/plugins/statuscol.lua deleted file mode 100644 index d342757..0000000 --- a/dot_config/nvim/lua/plugins/statuscol.lua +++ /dev/null @@ -1,9 +0,0 @@ -return { - { - "luukvbaal/statuscol.nvim", - opts = { - separator = " ", - setopt = true, - }, - }, -} diff --git a/dot_config/nvim/lua/plugins/surround.lua b/dot_config/nvim/lua/plugins/surround.lua deleted file mode 100644 index b779ed0..0000000 --- a/dot_config/nvim/lua/plugins/surround.lua +++ /dev/null @@ -1,6 +0,0 @@ -return { - { - "kylechui/nvim-surround", - config = true, - }, -} diff --git a/dot_config/nvim/lua/plugins/telescope.lua b/dot_config/nvim/lua/plugins/telescope.lua deleted file mode 100644 index 8a4a541..0000000 --- a/dot_config/nvim/lua/plugins/telescope.lua +++ /dev/null @@ -1,51 +0,0 @@ -return { - { - "nvim-telescope/telescope.nvim", - config = function() - require("telescope").load_extension("projects") - require("telescope").load_extension("fzy_native") - require("telescope").load_extension("catppuccin") - require("telescope").load_extension("smart_open") - - local actions = require("telescope.actions") - require("telescope").setup({ - defaults = { - mappings = { - i = { - [""] = actions.move_selection_next, - [""] = actions.move_selection_previous, - [""] = actions.cycle_history_next, - [""] = actions.cycle_history_prev, - }, - n = { - [""] = actions.move_selection_next, - [""] = actions.move_selection_previous, - [""] = actions.preview_scrolling_down, - [""] = actions.preview_scrolling_up, - }, - }, - }, - }) - end, - keys = { - { "ff", "Telescope smart_open", "Find Files" }, - { "fp", "Telescope projects", "All Projects" }, - { "fr", "Telescope oldfiles", "Recent Files" }, - { "fg", "Telescope live_grep", "Find Text" }, - { "fh", "Telescope highlights", "Find Highlights" }, - { "fc", "Telescope current_buffer_fuzzy_find", "Find In File" }, - { "fC", "Telescope catppuccin", "Catppuccin Colours" }, - { "fj", "Telescope jumplist", "Jumplist" }, - }, - cmd = "Telescope", - dependencies = { - "backwardspy/telescope-catppuccin.nvim", - { - "nvim-telescope/telescope-fzy-native.nvim", - dependencies = { "kkharji/sqlite.lua" }, - }, - "danielfalk/smart-open.nvim", - "backwardspy/telescope-catppuccin.nvim", - }, - }, -} diff --git a/dot_config/nvim/lua/plugins/treesitter.lua b/dot_config/nvim/lua/plugins/treesitter.lua deleted file mode 100644 index 66e2122..0000000 --- a/dot_config/nvim/lua/plugins/treesitter.lua +++ /dev/null @@ -1,38 +0,0 @@ -return { - { - "nvim-treesitter/nvim-treesitter", - build = function() - local ts_update = require("nvim-treesitter.install").update({ with_sync = true }) - ts_update() - end, - config = function() - require("nvim-treesitter.configs").setup({ - ensure_installed = "all", - highlight = { enable = true }, - indent = { enable = false }, - textobjects = { - select = { - enable = true, - lookahead = true, - keymaps = { - ["af"] = "@function.outer", - ["if"] = "@function.inner", - ["ac"] = "@class.outer", - ["ic"] = "@class.inner", - ["aa"] = "@parameter.outer", - ["ia"] = "@parameter.inner", - }, - }, - }, - }) - end, - dependencies = { - "nvim-treesitter/nvim-treesitter-textobjects", - "nvim-treesitter/playground", - { - "kana/vim-textobj-entire", - dependencies = { "kana/vim-textobj-user" }, - }, - }, - }, -} diff --git a/dot_config/nvim/lua/plugins/which-key.lua b/dot_config/nvim/lua/plugins/which-key.lua deleted file mode 100644 index 483b690..0000000 --- a/dot_config/nvim/lua/plugins/which-key.lua +++ /dev/null @@ -1,25 +0,0 @@ -return { - { - "folke/which-key.nvim", - config = function() - local wk = require("which-key") - wk.setup({ - window = { - border = "rounded", - }, - }) - - wk.register({ - f = { name = "Find" }, - g = { name = "Git" }, - -- j = { name = "Jump" }, - l = { name = "LSP" }, - -- o = { name = "Open" }, - t = { name = "Tasks" }, - d = { name = "Debug" }, - b = { name = "Breakpoint" }, - z = { name = "Zen" }, - }, { prefix = "" }) - end, - }, -} diff --git a/dot_config/nvim/lua/plugins/zenmode.lua b/dot_config/nvim/lua/plugins/zenmode.lua deleted file mode 100644 index 173f58c..0000000 --- a/dot_config/nvim/lua/plugins/zenmode.lua +++ /dev/null @@ -1,20 +0,0 @@ -local extremely_zen = function() - require("zen-mode").toggle({ plugins = { twilight = { enabled = true } } }) -end - -return { - { - "folke/zen-mode.nvim", - opts = { - plugins = { - twilight = { enabled = false }, - }, - }, - cmd = { "ZenMode" }, - keys = { - { "zz", "ZenMode", desc = "Zen Mode" }, - { "Z", extremely_zen, desc = "Extremely Zen Mode" }, - }, - dependencies = { "folke/twilight.nvim" }, - }, -} diff --git a/dot_config/nvim/stylua.toml b/dot_config/nvim/stylua.toml deleted file mode 100644 index cee468f..0000000 --- a/dot_config/nvim/stylua.toml +++ /dev/null @@ -1,7 +0,0 @@ -column_width = 120 -line_endings = "Unix" -indent_type = "Spaces" -indent_width = 2 -quote_style = "AutoPreferDouble" -call_parentheses = "Always" -collapse_simple_statement = "Never" diff --git a/dot_config/wezterm/stylua.toml b/dot_config/wezterm/stylua.toml deleted file mode 100644 index cee468f..0000000 --- a/dot_config/wezterm/stylua.toml +++ /dev/null @@ -1,7 +0,0 @@ -column_width = 120 -line_endings = "Unix" -indent_type = "Spaces" -indent_width = 2 -quote_style = "AutoPreferDouble" -call_parentheses = "Always" -collapse_simple_statement = "Never" diff --git a/dot_gitconfig b/dot_gitconfig deleted file mode 100644 index d8aabd9..0000000 --- a/dot_gitconfig +++ /dev/null @@ -1,13 +0,0 @@ -[user] - name = sgoudham - email = sgoudham@gmail.com - signingkey = 44E818FD5457EEA4 -[commit] - gpgsign = true -[core] - autocrlf = input - editor = lvim -[push] - autoSetupRemote = true -[init] - defaultBranch = main diff --git a/dot_zshenv b/dot_zshenv deleted file mode 100644 index 2b530a7..0000000 --- a/dot_zshenv +++ /dev/null @@ -1,48 +0,0 @@ -# Needed for .antidote -# https://github.com/mattmc3/antidote/issues/24 -autoload -Uz compinit && compinit - -# I don't even know anymore... -# https://github.com/ohmyzsh/ohmyzsh/issues/10581 -source <(kubectl completion zsh) - -# PATH -export PATH="$PATH:$HOME/.local/bin" -export PATH="$PATH:$HOME/.local/scripts" -export PATH="$PATH:$HOME/.local/share/nvim/mason/bin" - -# Krew -export PATH="$PATH:${KREW_ROOT:-$HOME/.krew}/bin" - -# JetBrains Toolbox -export PATH="$PATH:$HOME/.local/share/JetBrains/Toolbox/scripts" - -# Go -export PATH="$PATH:$HOME/.local/share/go/bin" - -# Rust -source "$HOME/.cargo/env" - -# Haskell (ghcup-env) -[ -f "$HOME/.ghcup/env" ] && source "$HOME/.ghcup/env" - -# Deno -export DENO_INSTALL="$HOME/.deno" -export PATH="$DENO_INSTALL/bin:$PATH" - -# Config Directory -export XDG_CONFIG_HOME=$HOME/.config - -# WezTerm By Default -export TERMINAL=wezterm-gui - -# Editing -export EDITOR="nvim" -export SUDO_EDITOR=$(which nvim) - -# Go -export GOPATH="$HOME/.local/share/go" - -# Java -export JAVA_HOME="$SDKMAN_DIR/candidates/java/current" -export GRAALVM_HOME="$SDKMAN_DIR/candidates/java/22.3.r17-grl" diff --git a/dot_zshrc b/dot_zshrc deleted file mode 100644 index 338f5b1..0000000 --- a/dot_zshrc +++ /dev/null @@ -1,142 +0,0 @@ -# vim:ft=zsh:fenc=utf-8 - -# Shell Integration -source "$HOME/.config/wezterm/wezterm.sh" - -# Prompt -eval "$(starship init zsh)" - -# source antidote -source ${ZDOTDIR:-~}/.antidote/antidote.zsh - -# set omz variables -ZSH=$(antidote path ohmyzsh/ohmyzsh) -ZSH_CACHE_DIR="${XDG_CACHE_HOME:-$HOME/.cache}/oh-my-zsh" -[[ -d $ZSH_CACHE_DIR ]] || mkdir -p $ZSH_CACHE_DIR - -# initialize plugins statically with ${ZDOTDIR:-~}/.zsh_plugins.txt -antidote load - -# Make 'less' friendlier for non-text input files, see lesspipe(1) -[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" - -# Konf -# source <(konf-go shellwrapper zsh) -# Autocompletion -# source <(konf completion zsh) -# Auto load context -# export KUBECONFIG=$(konf set -) - -# Aliases -alias magit="nvim '+Neogit kind=replace'" -alias clipboard='xclip -sel clip' -alias dc="docker compose" -alias dcud="docker compose down && docker compose up -d" -alias kctx="konf set" -alias kns="konf ns" - -# Keep History -export HISTFILE="$HOME/.zhistory" -export HISTSIZE=10000 -export SAVEHIST=10000 -setopt HIST_IGNORE_ALL_DUPS -setopt HIST_IGNORE_DUPS - -# Coloured GCC warnings and errors -export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' - -# Use 'iHD' by default -export LIBVA_DRIVER_NAME="iHD" - -# Color support of 'ls' and also add aliases -if [ -x /usr/bin/dircolors ]; then - test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" - alias ls='ls --color=auto' - alias grep='grep --color=auto' -fi - -# Make directories & cd into them -function mkcd() { - mkdir -p $@ && cd ${@:$#} -} - -# Use 'wezterm ssh' if available -function ssh() { - if [[ "$TERM_PROGRAM" == "WezTerm" ]]; then - bj wezterm ssh $@ - else - echo "Falling back to normal 'ssh' as WezTerm hasn't been detected" - command ssh $@ - fi -} - -# Easily run background jobs -function bj() { - nohup $@ /dev/null & -} - - -# Display images in the terminal -function icat() { - function display() { - if [[ "$TERM_PROGRAM" == "WezTerm" ]]; then - cat - | wezterm imgcat - elif [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then - cat - | $(alias imgcat | cut -d "=" -f2-) - elif [[ "$TERM" = "xterm-kitty" ]]; then - cat - | kitty +kitten icat - else - echo "No image viewer defined for this terminal" && return 1 - fi - return 0 - } - function displaySVG() { - [[ ! -x "$(command -v convert)" ]] && echo "convert not found, install imagemagick" && return 1 - convert -background none -density 192 - png:- | display - } - function displayVID() { - ffmpeg -i "$1" -vf scale=720:-1 -r 10 -f image2pipe -vcodec ppm - &>/dev/null | convert -delay 10 -loop 1 - gif:- | display - } - - if [ ! -t 0 ]; then - input="$(cat - | base64)" - headers="$(echo "$input" | base64 -d | file - --mime-type | cut -d " " -f2-)" - - case $headers in - *svg*) echo "$input" | base64 -d | displaySVG ;; - *video*) echo "haven't figured this part out yet" && return 1;; - *image*) echo "$input" | base64 -d | display ;; - *) echo "Unknown file type" && return 1 ;; - esac - elif [[ "$1" == http* ]]; then - case "$(curl -sSLI "$1" | grep -i "^content-type:")" in - *svg*) curl -fsSL "$1" | displaySVG ;; - *video*) echo "haven't figured this part out yet" && return 1;; - *image*) curl -fsSL "$1" | display ;; - *) echo "Unknown file type" && return 1 ;; - esac - else - [[ -z "$1" ]] && echo "Usage: icat " && return 1 - [[ ! -f "$1" ]] && echo "File not found: $1" && return 1 - case "$(file -b --mime-type "$1")" in - *svg*) cat "$1" | displaySVG ;; - *video*) displayVID $1 ;; - *image*) cat "$1" | display ;; - *) echo "Unknown file type" && return 1 ;; - esac - fi -} - -# export M2_HOME="$HOME/.local/bin/apache-maven-3.8.6/bin" -# export PATH="$PATH:$M2_HOME" - -# Node -export NVM_DIR="$HOME/.nvm" -[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm -[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion - -eval "$(direnv hook zsh)" - -#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!! -export SDKMAN_DIR="$HOME/.sdkman" -[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh" diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..0bea81d --- /dev/null +++ b/flake.lock @@ -0,0 +1,236 @@ +{ + "nodes": { + "crane": { + "inputs": { + "flake-compat": "flake-compat", + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs", + "rust-overlay": "rust-overlay" + }, + "locked": { + "lastModified": 1676846788, + "narHash": "sha256-XLsHLgXyMdliMeAXuzdGP+TXBaV44kG1RPTUHNOs6Jk=", + "owner": "ipetkov", + "repo": "crane", + "rev": "953b70da2813fb882c39890f2514e7db76fc8843", + "type": "github" + }, + "original": { + "owner": "ipetkov", + "ref": "v0.11.3", + "repo": "crane", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-utils": { + "locked": { + "lastModified": 1676283394, + "narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1683833146, + "narHash": "sha256-ELF0oXgg0NYGyKtU74HW8CeLstFJwwCGbuahnQla67I=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "cc9f65d104e5227d103a529a9fc3687ef4ccb117", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "nekowinston-nur": { + "inputs": { + "crane": "crane", + "nixpkgs": "nixpkgs_2", + "wezterm-src": "wezterm-src" + }, + "locked": { + "lastModified": 1685775911, + "narHash": "sha256-bXuKB89qJnUbE6h0Q677UC6aKh+9Yi3tGSbqqO0cs3A=", + "owner": "nekowinston", + "repo": "nur", + "rev": "8912d039043c039ba0bb5a1a7ff51c2efee57202", + "type": "github" + }, + "original": { + "owner": "nekowinston", + "repo": "nur", + "type": "github" + } + }, + "nix-index-database": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1683638468, + "narHash": "sha256-tQEaGZfZ2Hpw+XIVEHaJ8FaF1yNQyMDDhUyIQ7LTIEg=", + "owner": "Mic92", + "repo": "nix-index-database", + "rev": "219067a5e3cf4b9581c8b4fcfc59ecd5af953d07", + "type": "github" + }, + "original": { + "owner": "Mic92", + "repo": "nix-index-database", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1676426280, + "narHash": "sha256-7DltKPrvCP0A9Iemv2ts1vnBYn5xQKScK/sb1VALlao=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "6d33e5e14fd12f99ba621683ae90cebadda753ca", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1685677062, + "narHash": "sha256-zoHF7+HNwNwne2XEomphbdc4Y8tdWT16EUxUTXpOKpQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "95be94370d09f97f6af6a1df1eb9649b5260724e", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1687288566, + "narHash": "sha256-VckkiJ88Gzdc2cstm0z5eFcrHbvkm4VjxavHBGssvZI=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "b6c73c5fe53bb3afbf65e870541e0645e9145171", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-23.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nur": { + "locked": { + "lastModified": 1685803539, + "narHash": "sha256-S/yHjHu4xrcuT9VyVPKWGPjOSYyY8hG9//1X6F8urpI=", + "owner": "nix-community", + "repo": "nur", + "rev": "364559535aae66fbc459d5190b0feb264a619d06", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nur", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "nekowinston-nur": "nekowinston-nur", + "nix-index-database": "nix-index-database", + "nixpkgs": "nixpkgs_3", + "nur": "nur" + } + }, + "rust-overlay": { + "inputs": { + "flake-utils": [ + "nekowinston-nur", + "crane", + "flake-utils" + ], + "nixpkgs": [ + "nekowinston-nur", + "crane", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1676437770, + "narHash": "sha256-mhJye91Bn0jJIE7NnEywGty/U5qdELfsT8S+FBjTdG4=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "a619538647bd03e3ee1d7b947f7c11ff289b376e", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, + "wezterm-src": { + "flake": false, + "locked": { + "lastModified": 1685453249, + "narHash": "sha256-w/iQoWng7nrE+HAg0umpq8RCU0bjw5JogR2HHufspI8=", + "ref": "refs/heads/main", + "rev": "95e44f2199d9779e353bccf387a1eb2dbaf41f44", + "revCount": 7255, + "submodules": true, + "type": "git", + "url": "https://github.com/wez/wezterm" + }, + "original": { + "submodules": true, + "type": "git", + "url": "https://github.com/wez/wezterm" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..1743b05 --- /dev/null +++ b/flake.nix @@ -0,0 +1,77 @@ +{ + description = "Home Manager configuration of hammy"; + + inputs = { + # At the time of writing, nixos-unstable doesn't work for home manager + # FIXME: https://github.com/NixOS/nixpkgs/issues/236940#issuecomment-1585223723 + nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05"; + nur.url = "github:nix-community/nur"; + nekowinston-nur.url = "github:nekowinston/nur"; + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + nix-index-database.url = "github:Mic92/nix-index-database"; + nix-index-database.inputs.nixpkgs.follows = "nixpkgs"; + }; + + nixConfig = { + extra-substituters = [ + "https://nekowinston.cachix.org" + "https://nix-community.cachix.org" + ]; + extra-trusted-public-keys = [ + "nekowinston.cachix.org-1:lucpmaO+JwtoZj16HCO1p1fOv68s/RL1gumpVzRHRDs=" + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + ]; + extra-trusted-users = ["@wheel"]; + tarball-ttl = 604800; + warn-dirty = false; + }; + + outputs = { + nixpkgs, + nur, + nekowinston-nur, + home-manager, + nix-index-database, + ... + }: let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + overlays = final: prev: { + nur = import nur { + nurpkgs = prev; + pkgs = prev; + repoOverrides = { + nekowinston = nekowinston-nur.packages.${prev.system}; + }; + }; + }; + in { + homeConfigurations."hammy" = home-manager.lib.homeManagerConfiguration { + inherit pkgs; + + # Specify your home configuration modules here, for example, + # the path to your home.nix. + modules = [ + ./home + nix-index-database.hmModules.nix-index + ({config, ...}: { + config = { + nixpkgs.overlays = [ + overlays + ]; + }; + }) + ]; + + extraSpecialArgs = { + flakePath = + if pkgs.stdenv.isDarwin + then "/Users/hammy/.config/home-manager" + else "/home/hammy/.config/home-manager"; + }; + }; + }; +} diff --git a/home/apps/deno.nix b/home/apps/deno.nix new file mode 100644 index 0000000..e598c68 --- /dev/null +++ b/home/apps/deno.nix @@ -0,0 +1,5 @@ +{pkgs, ...}: { + home.packages = with pkgs; [ + deno + ]; +} diff --git a/home/apps/fish.nix b/home/apps/fish.nix new file mode 100644 index 0000000..f1d3ea9 --- /dev/null +++ b/home/apps/fish.nix @@ -0,0 +1,323 @@ +{ + config, + pkgs, + flakePath, + ... +}: let + symlink = fileName: {recursive ? false}: { + source = config.lib.file.mkOutOfStoreSymlink "${flakePath}/${fileName}"; + inherit recursive; + }; +in { + programs = { + bat = let + themepkg = pkgs.fetchFromGitHub { + owner = "catppuccin"; + repo = "bat"; + rev = "ba4d16880d63e656acced2b7d4e034e4a93f74b1"; + sha256 = "sha256-6WVKQErGdaqb++oaXnY3i6/GuH2FhTgK0v4TN4Y0Wbw="; + }; + in { + enable = true; + config.theme = "Catppuccin-mocha"; + themes = let + getTheme = flavour: + builtins.readFile ( + themepkg + "/Catppuccin-${flavour}.tmTheme" + ); + in { + Catppuccin-latte = getTheme "latte"; + Catppuccin-frappe = getTheme "frappe"; + Catppuccin-macchiato = getTheme "macchiato"; + Catppuccin-mocha = getTheme "mocha"; + }; + }; + mcfly = { + enable = false; + fuzzySearchFactor = 3; + keyScheme = "vim"; + }; + btop = { + enable = true; + settings = { + theme_background = false; + vim_keys = true; + }; + }; + lsd = { + enable = true; + enableAliases = true; + settings = { + no-symlink = false; + }; + }; + tealdeer = { + enable = true; + settings = { + style = { + description.foreground = "white"; + command_name.foreground = "green"; + example_text.foreground = "blue"; + example_code.foreground = "white"; + example_variable.foreground = "yellow"; + }; + updates.auto_update = true; + }; + }; + fzf = { + enable = true; + colors = { + "bg+" = "#040404"; + "fg+" = "#cdd6f4"; + "hl+" = "#f38ba8"; + border = "#74c7ec"; + fg = "#cdd6f4"; + header = "#f38ba8"; + hl = "#f38ba8"; + info = "#cba6f7"; + marker = "#f5e0dc"; + pointer = "#f5e0dc"; + prompt = "#cba6f7"; + spinner = "#f5e0dc"; + }; + defaultOptions = [ + "--height 40%" + "--reverse" + ]; + }; + + nix-index.enable = true; + starship.enable = true; + direnv.enable = true; + direnv.nix-direnv.enable = true; + + fish = { + enable = true; + shellAbbrs = { + # Git + ga = "git add"; + gb = "git branch"; + gc = "git commit"; + gca = "git commit --amend"; + gcan = "git commit --amend --no-edit"; + gcm = "git checkout main"; + gco = "git checkout"; + gcb = "git checkout -b"; + gd = "git diff"; + gl = "git pull"; + gp = "git push"; + gr = "git rebase"; + gri = "git rebase -i"; + gra = "git rebase --abort"; + grc = "git rebase --continue"; + gs = "git switch"; + gst = "git status"; + + # Kubectl + + # TODO: Migrate these to fish functions + # Execute a kubectl command against all namespaces + # alias kca='_kca(){ kubectl "$@" --all-namespaces; unset -f _kca; }; _kca' + # kres(){; + # kubectl set env $@ REFRESHED_AT=$(date +%Y%m%d%H%M%S) + # } + + # This command is used a LOT both below and in daily life + k = "kubectl"; + # Apply a YML file + kaf = "kubectl apply -f"; + # Drop into an interactive terminal on a container + keti = "kubectl exec -t -i"; + # Manage configuration quickly to switch contexts between local, dev ad staging. + kcuc = "kubectl config use-context"; + kcsc = "kubectl config set-context"; + kcdc = "kubectl config delete-context"; + kccc = "kubectl config current-context"; + # List all contexts + kcgc = "kubectl config get-contexts"; + # General aliases + kdel = "kubectl delete"; + kdelf = "kubectl delete -f"; + # Pod management. + kgp = "kubectl get pods"; + kgpa = "kubectl get pods --all-namespaces"; + kgpw = "kubectl get pods --watch"; + kgpwide = "kubectl get pods -o wide"; + kep = "kubectl edit pods"; + kdp = "kubectl describe pods"; + kdelp = "kubectl delete pods"; + kgpall = "kubectl get pods --all-namespaces -o wide"; + # get pod by label: kgpl "app=myapp" -n myns + kgpl = "kubectl get pods -l"; + # get pod by namespace: kgpn kube-system" + kgpn = "kubectl get pods -n"; + # Service management. + kgs = "kubectl get svc"; + kgsa = "kubectl get svc --all-namespaces"; + kgsw = "kubectl get svc --watch"; + kgswide = "kubectl get svc -o wide"; + kes = "kubectl edit svc"; + kds = "kubectl describe svc"; + kdels = "kubectl delete svc"; + # Ingress management + kgi = "kubectl get ingress"; + kgia = "kubectl get ingress --all-namespaces"; + kei = "kubectl edit ingress"; + kdi = "kubectl describe ingress"; + kdeli = "kubectl delete ingress"; + # Namespace management + kgns = "kubectl get namespaces"; + kens = "kubectl edit namespace"; + kdns = "kubectl describe namespace"; + kdelns = "kubectl delete namespace"; + kcn = "kubectl config set-context --current --namespace"; + kns = "kubens"; + # ConfigMap management + kgcm = "kubectl get configmaps"; + kgcma = "kubectl get configmaps --all-namespaces"; + kecm = "kubectl edit configmap"; + kdcm = "kubectl describe configmap"; + kdelcm = "kubectl delete configmap"; + # Secret management + kgsec = "kubectl get secret"; + kgseca = "kubectl get secret --all-namespaces"; + kdsec = "kubectl describe secret"; + kdelsec = "kubectl delete secret"; + # Deployment management. + kgd = "kubectl get deployment"; + kgda = "kubectl get deployment --all-namespaces"; + kgdw = "kubectl get deployment --watch"; + kgdwide = "kubectl get deployment -o wide"; + ked = "kubectl edit deployment"; + kdd = "kubectl describe deployment"; + kdeld = "kubectl delete deployment"; + ksd = "kubectl scale deployment"; + krsd = "kubectl rollout status deployment"; + # Rollout management. + kgrs = "kubectl get replicaset"; + kdrs = "kubectl describe replicaset"; + kers = "kubectl edit replicaset"; + krh = "kubectl rollout history"; + kru = "kubectl rollout undo"; + # Statefulset management. + kgss = "kubectl get statefulset"; + kgssa = "kubectl get statefulset --all-namespaces"; + kgssw = "kubectl get statefulset --watch"; + kgsswide = "kubectl get statefulset -o wide"; + kess = "kubectl edit statefulset"; + kdss = "kubectl describe statefulset"; + kdelss = "kubectl delete statefulset"; + ksss = "kubectl scale statefulset"; + krsss = "kubectl rollout status statefulset"; + # Port forwarding + kpf = "kubectl port-forward"; + # Tools for accessing all information + kga = "kubectl get all"; + kgaa = "kubectl get all --all-namespaces"; + # Logs + kl = "kubectl logs"; + kl1h = "kubectl logs --since 1h"; + kl1m = "kubectl logs --since 1m"; + kl1s = "kubectl logs --since 1s"; + klf = "kubectl logs -f"; + klf1h = "kubectl logs --since 1h -f"; + klf1m = "kubectl logs --since 1m -f"; + klf1s = "kubectl logs --since 1s -f"; + # File copy + kcp = "kubectl cp"; + # Node Management + kgno = "kubectl get nodes"; + keno = "kubectl edit node"; + kdno = "kubectl describe node"; + kdelno = "kubectl delete node"; + # PVC management. + kgpvc = "kubectl get pvc"; + kgpvca = "kubectl get pvc --all-namespaces"; + kgpvcw = "kubectl get pvc --watch"; + kepvc = "kubectl edit pvc"; + kdpvc = "kubectl describe pvc"; + kdelpvc = "kubectl delete pvc"; + # Service account management. + kdsa = "kubectl describe sa"; + kdelsa = "kubectl delete sa"; + # DaemonSet management. + kgds = "kubectl get daemonset"; + kgdsw = "kubectl get daemonset --watch"; + keds = "kubectl edit daemonset"; + kdds = "kubectl describe daemonset"; + kdelds = "kubectl delete daemonset"; + # CronJob management. + kgcj = "kubectl get cronjob"; + kecj = "kubectl edit cronjob"; + kdcj = "kubectl describe cronjob"; + kdelcj = "kubectl delete cronjob"; + # Job management. + kgj = "kubectl get job"; + kej = "kubectl edit job"; + kdj = "kubectl describe job"; + kdelj = "kubectl delete job"; + }; + + interactiveShellInit = '' + set fish_greeting + + # set vi bindings + fish_vi_key_bindings + + # set vi cursor + # wezterm isn't supported out of the box, but we can safely force-enable it. + set fish_vi_force_cursor 1 + fish_vi_cursor + + # cursor modes + set fish_cursor_default block + set fish_cursor_insert line + set fish_cursor_replace_one underscore + set fish_cursor_visual block + + function pythonEnv --description 'start a nix-shell with the given python packages' --argument pythonVersion + if set -q argv[2] + set argv $argv[2..-1] + end + + for el in $argv + set ppkgs $ppkgs "python"$pythonVersion"Packages.$el" + end + + nix-shell -p $ppkgs + end + + + bind -s --user -M insert \e "if commandline -P; commandline -f cancel; else; set fish_bind_mode default; commandline -f repaint-mode; end" + # bind -s --user -M insert \t accept-autosuggestion + + yes | fish_config theme save "Catppuccin Mocha" + ''; + + plugins = [ + # Use the PR Version for now + { + name = "fzf.fish"; + src = pkgs.fetchFromGitHub { + owner = "oddlama"; + repo = "fzf.fish"; + rev = "6331eedaf680323dd5a2e2f7fba37a1bc89d6564"; + sha256 = "sha256-BO+KFvHdbBz7SRA6EuOk2dEC8zORsCH9V04dHhJ6gxw="; + }; + } + ]; + }; + }; + + xdg.configFile = { + "starship.toml" = symlink "home/apps/starship/config.toml" {}; + "fish/functions" = symlink "home/apps/fish/functions" {recursive = true;}; + "fish/themes/Catppuccin Mocha.theme".text = builtins.readFile (pkgs.fetchurl { + url = "https://raw.githubusercontent.com/catppuccin/fish/main/themes/Catppuccin%20Mocha.theme"; + sha256 = "sha256-MlI9Bg4z6uGWnuKQcZoSxPEsat9vfi5O1NkeYFaEb2I="; + }); + }; + xdg.dataFile = { + "scripts" = symlink "home/apps/scripts" {recursive = true;}; + }; +} diff --git a/home/apps/fish/functions/bj.fish b/home/apps/fish/functions/bj.fish new file mode 100644 index 0000000..707314d --- /dev/null +++ b/home/apps/fish/functions/bj.fish @@ -0,0 +1,3 @@ +function bj --description "easily run background jobs" + nohup $argv /dev/null & +end diff --git a/home/apps/fonts.nix b/home/apps/fonts.nix new file mode 100644 index 0000000..c293fd1 --- /dev/null +++ b/home/apps/fonts.nix @@ -0,0 +1,8 @@ +{pkgs, ...}: { + fonts.fontconfig.enable = true; + home.packages = with pkgs; [ + (iosevka-bin.override {variant = "sgr-iosevka-term";}) + (nerdfonts.override {fonts = ["NerdFontsSymbolsOnly"];}) + victor-mono + ]; +} diff --git a/home/apps/git.nix b/home/apps/git.nix new file mode 100644 index 0000000..2297fff --- /dev/null +++ b/home/apps/git.nix @@ -0,0 +1,46 @@ +{...}: { + programs.git = { + enable = true; + lfs.enable = true; + userEmail = "sgoudham@gmail.com"; + userName = "sgoudham"; + signing = { + signByDefault = true; + key = "44E818FD5457EEA4"; + }; + difftastic = { + enable = true; + background = "dark"; + }; + ignores = [ + # General + ".DS_Store" + ".DS_Store?" + "Thumbs.db" + "desktop.ini" + # Temporary Files + "*.bak" + "*.swp" + "*.swo" + "*~" + # Editors + ".idea/" + ".iml" + # Nix + ".direnv/" + ".envrc" + # Rust + "target/" + # Node + "node_modules/" + ]; + extraConfig = { + push.autoSetupRemote = true; + core = { + autocrlf = "input"; + editor = "nvim"; + }; + init.defaultBranch = "main"; + }; + }; +} diff --git a/home/apps/go.nix b/home/apps/go.nix new file mode 100644 index 0000000..10959ac --- /dev/null +++ b/home/apps/go.nix @@ -0,0 +1,9 @@ +{config, ...}: { + programs.go.enable = true; + home.sessionVariables = { + GOPATH = "${config.xdg.dataHome}/go"; + }; + home.sessionPath = [ + "${config.home.sessionVariables.GOPATH}/bin" + ]; +} diff --git a/dot_config/ideavim/ideavimrc b/home/apps/ideavim/ideavimrc similarity index 100% rename from dot_config/ideavim/ideavimrc rename to home/apps/ideavim/ideavimrc diff --git a/home/apps/k8s.nix b/home/apps/k8s.nix new file mode 100644 index 0000000..42b4080 --- /dev/null +++ b/home/apps/k8s.nix @@ -0,0 +1,22 @@ +{ + config, + pkgs, + ... +}: { + home.packages = with pkgs; [ + (wrapHelm kubernetes-helm {plugins = [kubernetes-helmPlugins.helm-diff];}) + kubectl + kubectx + kubeseal + krew + ]; + + home.sessionPath = [ + "${config.home.sessionVariables.KREW_ROOT}/bin" + ]; + + home.sessionVariables = { + KREW_ROOT = "${config.xdg.dataHome}/krew"; + KUBECACHEDIR = "${config.xdg.cacheHome}/kube"; + }; +} diff --git a/home/apps/nap.nix b/home/apps/nap.nix new file mode 100644 index 0000000..c38d461 --- /dev/null +++ b/home/apps/nap.nix @@ -0,0 +1,14 @@ +{pkgs, ...}: { + home.packages = [pkgs.nap]; + home.sessionVariables = { + NAP_THEME = "catppuccin_mocha"; + NAP_PRIMARY_COLOR = "#f5c2e7"; + NAP_RED = "#f38ba8"; + NAP_GREEN = "#a6e3a1"; + NAP_FOREGROUND = "#b4befe"; + NAP_BACKGROUND = "#11111b"; + NAP_BLACK = "#11111b"; + NAP_GRAY = "#bac2de"; + NAP_WHITE = "#FFFFFF"; + }; +} diff --git a/home/apps/rust.nix b/home/apps/rust.nix new file mode 100644 index 0000000..fcb568d --- /dev/null +++ b/home/apps/rust.nix @@ -0,0 +1,13 @@ +{pkgs, ...}: { + home.packages = with pkgs; [ + rustup + sccache + mdbook + ]; + home.sessionVariables = { + RUSTC_WRAPPER = "sccache"; + }; + home.sessionPath = [ + "$HOME/.cargo/bin" + ]; +} diff --git a/private_dot_local/scripts/executable_checkout-pr.sh b/home/apps/scripts/checkout-pr old mode 100644 new mode 100755 similarity index 78% rename from private_dot_local/scripts/executable_checkout-pr.sh rename to home/apps/scripts/checkout-pr index 3d6977e..b4e345e --- a/private_dot_local/scripts/executable_checkout-pr.sh +++ b/home/apps/scripts/checkout-pr @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash git fetch $1 pull/$2/head:pull-request-$2 git checkout pull-request-$2 diff --git a/private_dot_local/scripts/executable_disable-static-workspaces.sh b/home/apps/scripts/disable-static-workspaces old mode 100644 new mode 100755 similarity index 93% rename from private_dot_local/scripts/executable_disable-static-workspaces.sh rename to home/apps/scripts/disable-static-workspaces index f5f731c..d01b209 --- a/private_dot_local/scripts/executable_disable-static-workspaces.sh +++ b/home/apps/scripts/disable-static-workspaces @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash gsettings set org.gnome.mutter dynamic-workspaces true gsettings set org.gnome.desktop.wm.preferences num-workspaces 4 diff --git a/private_dot_local/scripts/executable_enable-static-workspaces.sh b/home/apps/scripts/enable-static-workspaces old mode 100644 new mode 100755 similarity index 94% rename from private_dot_local/scripts/executable_enable-static-workspaces.sh rename to home/apps/scripts/enable-static-workspaces index 289a054..09520ff --- a/private_dot_local/scripts/executable_enable-static-workspaces.sh +++ b/home/apps/scripts/enable-static-workspaces @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash gsettings set org.gnome.mutter dynamic-workspaces false gsettings set org.gnome.desktop.wm.preferences num-workspaces 12 diff --git a/home/apps/scripts/icat b/home/apps/scripts/icat new file mode 100755 index 0000000..5f32ec7 --- /dev/null +++ b/home/apps/scripts/icat @@ -0,0 +1,70 @@ +#!/usr/bin/env bash + +set -euo pipefail +IFS=$'\n\t' + +local MAPPINGS=' +video/3gpp,3gp +video/3gpp2,3g2 +video/MP2T,mpegts +video/MP2T,mpegtsraw +video/mp4,mp4 +video/mpeg,mpeg +video/ogg,ogv +video/quicktime,mov +video/webm,webm +' +# format=$(echo "$MAPPINGS" | grep "$headers" | cut -d "," -f2-) + +function icat() { + function display() { + if [[ "$TERM_PROGRAM" == "WezTerm" ]]; then + cat - | wezterm imgcat + elif [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then + cat - | $(alias imgcat | cut -d "=" -f2-) + elif [[ "$TERM" = "xterm-kitty" ]]; then + cat - | kitty +kitten icat + else + echo "No image viewer defined for this terminal" && return 1 + fi + return 0 + } + function displaySVG() { + [[ ! -x "$(command -v convert)" ]] && echo "convert not found, install imagemagick" && return 1 + convert -background none -density 192 - png:- | display + } + function displayVID() { + ffmpeg -loglevel fatal -hide_banner -i "$1" -vf scale=720:-1 -r 10 -f image2pipe -vcodec ppm pipe:1 | \ + convert -delay 10 -loop 1 - gif:- | \ + display + } + + if [ ! -t 0 ]; then + input="$(cat - | base64)" + headers="$(echo "$input" | base64 -d | file - --mime-type | cut -d " " -f2-)" + + case $headers in + *svg*) echo "$input" | base64 -d | displaySVG ;; + *video*) echo "haven't figured this part out yet" && return 1;; + *image*) echo "$input" | base64 -d | display ;; + *) echo "Unknown file type" && return 1 ;; + esac + elif [[ "$1" == http* ]]; then + case "$(curl -sSLI "$1" | grep -i "^content-type:")" in + *svg*) curl -fsSL "$1" | displaySVG ;; + *video*) echo "haven't figured this part out yet" && return 1;; + *image*) curl -fsSL "$1" | display ;; + *) echo "Unknown file type" && return 1 ;; + esac + else + [[ -z "$1" ]] && echo "Usage: icat " && return 1 + [[ ! -f "$1" ]] && echo "File not found: $1" && return 1 + case "$(file -b --mime-type "$1")" in + *svg*) cat "$1" | displaySVG ;; + *video*) displayVID $1 ;; + *image*) cat "$1" | display ;; + *) echo "Unknown file type" && return 1 ;; + esac + fi +} + diff --git a/home/apps/scripts/pomo b/home/apps/scripts/pomo new file mode 100755 index 0000000..ca3767e --- /dev/null +++ b/home/apps/scripts/pomo @@ -0,0 +1,31 @@ +#!/usr/bin/env bash +# study stream aliases +# Requires https://github.com/caarlos0/timer to be installed. + +declare -A pomo_options +pomo_options["work"]="25" +pomo_options["break"]="5" + +exit_if_ctrl_c() { + exit +} + +trap exit_if_ctrl_c SIGINT + +pomodoro() { + if [ -n "$1" -a -n "${pomo_options["$1"]}" ]; then + val=$1 + echo $val | lolcat + timer ${pomo_options["$val"]}m + notify-send "'$val' session done" + fi +} + +cycle_work_break() { + for i in $(seq $1); do + pomodoro 'work' + pomodoro 'break' + done +} + +cycle_work_break $1 diff --git a/private_dot_local/scripts/executable_toggle-keyboard-backlights.sh b/home/apps/scripts/toggle-keyboard-backlights old mode 100644 new mode 100755 similarity index 96% rename from private_dot_local/scripts/executable_toggle-keyboard-backlights.sh rename to home/apps/scripts/toggle-keyboard-backlights index 6f36034..608e924 --- a/private_dot_local/scripts/executable_toggle-keyboard-backlights.sh +++ b/home/apps/scripts/toggle-keyboard-backlights @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash OFF=0 ON=2 diff --git a/dot_config/starship.toml b/home/apps/starship/config.toml similarity index 88% rename from dot_config/starship.toml rename to home/apps/starship/config.toml index b3b3657..384c15e 100644 --- a/dot_config/starship.toml +++ b/home/apps/starship/config.toml @@ -78,16 +78,6 @@ $shell\ └ \ $character""" -# [custom.top] -# symbol = "┌ " -# style = "bold black" -# when = true -# -# [custom.bottom] -# symbol = "└ " -# style = "bold black" -# when = true -# [character] # The name of the module we are configuring is "character" success_symbol = "[\\$](bold green)" # The "success_symbol" segment is being set to "➜" with the color "bold green" error_symbol = "[\\$](bold red)" # The "success_symbol" segment is being set to "➜" with the color "bold green" @@ -119,7 +109,7 @@ symbol = " " [directory] style = "#cba6f7 bold" -read_only = " " +read_only = " 󰌾" [docker_context] style = "#74c7ec bold" @@ -142,7 +132,7 @@ symbol = " " [haskell] style = "#74c7ec bold" -symbol = " " +symbol = "󰲒 " [hg_branch] style = "#74c7ec bold" @@ -150,7 +140,7 @@ symbol = " " [java] style = "#74c7ec bold" -symbol = " " +symbol = "󰬷 " [julia] style = "#74c7ec bold" @@ -162,15 +152,15 @@ symbol = " " [memory_usage] style = "#74c7ec bold" -symbol = " " +symbol = "󰍛 " [meson] style = "#74c7ec bold" -symbol = "喝 " +symbol = "󰔷 " [nim] style = "#74c7ec bold" -symbol = " " +symbol = "󰆥 " [nix_shell] style = "#74c7ec bold" @@ -182,7 +172,7 @@ symbol = " " [package] style = "#fab387 bold" -symbol = " " +symbol = ' ' [python] style = "#74c7ec bold" @@ -190,7 +180,7 @@ symbol = " " [rlang] style = "#74c7ec bold" -symbol = "ﳒ " +symbol = "󰟔 " [ruby] style = "#74c7ec bold" @@ -198,7 +188,7 @@ symbol = " " [rust] style = "#74c7ec bold" -symbol = " " +symbol = "󱘗 " [scala] style = "#74c7ec bold" @@ -209,6 +199,6 @@ style = "#74c7ec bold" [kubernetes] style = "#74c7ec bold" -symbol = '󱃾 ' +symbol = "󱃾 " format = '[ $symbol($cluster/$namespace) ]($style)' disabled = false diff --git a/home/apps/wezterm.nix b/home/apps/wezterm.nix new file mode 100644 index 0000000..26551dc --- /dev/null +++ b/home/apps/wezterm.nix @@ -0,0 +1,19 @@ +{ + config, + flakePath, + ... +}: { + # Sleep well my prince, one day you will be enabled + + # programs.wezterm = { + # enable = true; + # package = pkgs.nur.repos.nekowinston.wezterm-nightly; + # }; + # xdg.configFile."wezterm/wezterm.lua".enable = false; + + # xdg.configFile."wezterm" = { + # source = config.lib.file.mkOutOfStoreSymlink "${flakePath}/home/apps/wezterm"; + # recursive = true; + # }; + # home.file.".terminfo/w/wezterm".source = wezterm/wezterm_terminfo; +} diff --git a/home/apps/wezterm/.gitignore b/home/apps/wezterm/.gitignore new file mode 100644 index 0000000..b62627e --- /dev/null +++ b/home/apps/wezterm/.gitignore @@ -0,0 +1 @@ +wezterm-bar \ No newline at end of file diff --git a/dot_config/lvim/stylua.toml b/home/apps/wezterm/stylua.toml similarity index 100% rename from dot_config/lvim/stylua.toml rename to home/apps/wezterm/stylua.toml diff --git a/dot_config/wezterm/wezterm.lua b/home/apps/wezterm/wezterm.lua similarity index 65% rename from dot_config/wezterm/wezterm.lua rename to home/apps/wezterm/wezterm.lua index a7334b9..9247916 100644 --- a/dot_config/wezterm/wezterm.lua +++ b/home/apps/wezterm/wezterm.lua @@ -28,21 +28,23 @@ c.set_environment_variables = { ZVM_TERM = "xterm-256color", } +c.front_end = "OpenGL" c.term = "wezterm" -c.font = wezterm.font_with_fallback({ "VictorMono Nerd Font" }) -c.font_size = 13 -c.background = { +c.font = wezterm.font_with_fallback({ { - source = { File = "Pictures/astronaut.png" }, - hsb = { brightness = 0.07, hue = 1.0, saturation = 0.1 }, + family = "Iosevka Term", + weight = "Bold", }, -} + "Symbols Nerd Font", + "Builtin", +}) +c.font_size = 12 c.default_domain = default_domain c.wsl_domains = wsl_domains -c.default_prog = default_prog +c.default_prog = { "fish", "-l" } -c.window_padding = { top = 0, bottom = 0, left = 0, right = 0 } +c.window_padding = { top = 1, bottom = 1, left = 1, right = 1 } c.adjust_window_size_when_changing_font_size = false c.window_decorations = "RESIZE" c.window_close_confirmation = "NeverPrompt" @@ -59,7 +61,6 @@ c.audible_bell = "Disabled" c.disable_default_key_bindings = false c.mouse_bindings = { - -- Ctrl-click will open the link under the mouse cursor { event = { Up = { streak = 1, button = "Left" } }, mods = "CTRL", @@ -78,10 +79,10 @@ c.keys = { -- CMD Palette { key = "p", mods = "ALT|SHIFT", action = act.ActivateCommandPalette }, - -- Navigating Panes + -- Navigating Tabs { key = "h", mods = "ALT|SHIFT", action = act.ActivateTabRelative(-1) }, { key = "l", mods = "ALT|SHIFT", action = act.ActivateTabRelative(1) }, - -- Close Pane + -- Close Tabs { key = "d", mods = "ALT|SHIFT", action = act.CloseCurrentTab({ confirm = false }) }, -- Swap Panes { key = "i", mods = "ALT|SHIFT", action = act.PaneSelect({ alphabet = "asdfghjkl;", mode = "Activate" }) }, @@ -90,14 +91,13 @@ c.keys = { mods = "ALT|SHIFT", action = act.PaneSelect({ alphabet = "asdfghjkl;", mode = "SwapWithActive" }), }, - -- Resize Panes - { key = "LeftArrow", mods = "ALT|SHIFT", action = act({ AdjustPaneSize = { "Left", 5 } }) }, - { key = "DownArrow", mods = "ALT|SHIFT", action = act({ AdjustPaneSize = { "Down", 5 } }) }, - { key = "UpArrow", mods = "ALT|SHIFT", action = act({ AdjustPaneSize = { "Up", 5 } }) }, - { key = "RightArrow", mods = "ALT|SHIFT", action = act({ AdjustPaneSize = { "Right", 5 } }) }, + -- Move Tabs Relatively + { key = "{", mods = "ALT|SHIFT", action = act.MoveTabRelative(-1) }, + { key = "}", mods = "ALT|SHIFT", action = act.MoveTabRelative(1) }, -- New Tab { key = "n", mods = "ALT|SHIFT", action = act({ SpawnTab = "CurrentPaneDomain" }) }, + { key = "m", mods = "ALT|SHIFT", action = act({ SpawnTab = "DefaultDomain" }) }, -- Open Links Via Keyboard { @@ -120,20 +120,66 @@ c.keys = { { key = "DownArrow", mods = "CTRL|SHIFT", action = act.ScrollToPrompt(1) }, } +c.ssh_domains = { + { + multiplexing = "None", + name = "catppuccin", + username = "hammy", + remote_address = "catppuccin", + ssh_option = { + identityfile = "~/.ssh/github", + }, + }, + { + multiplexing = "None", + name = "destiny", + username = "hammy", + remote_address = "destiny", + }, + { + multiplexing = "None", + name = "university", + username = "2563586s", + remote_address = "ssh1.dcs.gla.ac.uk", + }, +} + wezterm.plugin.require("https://github.com/catppuccin/wezterm").apply_to_config(c, { flavor = "mocha", sync = wezterm.target_triple:find("darwin") ~= nil, sync_flavors = { light = "latte", dark = "mocha" }, }) -wezterm.plugin.require("https://github.com/nekowinston/wezterm-bar").apply_to_config(c, { + +require("wezterm-bar.plugin").apply_to_config(c, { indicator = { leader = { enabled = false }, }, + tabs = { + overrides = { + ssh = { + matcher = function(override, title, tab, pane, _) + return tab.active_pane.foreground_process_name:find(override) + end, + title = function(title) + return "🐎 " .. title + end, + }, + nvim = { + background = "#ffffff", + }, + }, + }, }) -wezterm.on("update-status", function(window, pane) - -- local colours = conf.resolved_palette.tab_bar - wezterm.log_info(window:effective_config()) -end) +local custom = wezterm.color.get_builtin_schemes()["Catppuccin Mocha"] +custom.background = "#000000" +custom.tab_bar.background = "#040404" +custom.tab_bar.inactive_tab.bg_color = "#0f0f0f" +custom.tab_bar.new_tab.bg_color = "#080808" + +c.color_schemes = { + ["OLEDppuccin"] = custom, +} +c.color_scheme = "OLEDppuccin" return c diff --git a/home/apps/wezterm/wezterm.sh b/home/apps/wezterm/wezterm.sh new file mode 100644 index 0000000..c0ad63d --- /dev/null +++ b/home/apps/wezterm/wezterm.sh @@ -0,0 +1,463 @@ +# shellcheck shell=bash + +# This file hooks up shell integration for wezterm. +# It is suitable for zsh and bash. +# +# Although wezterm is mentioned here, the sequences used are not wezterm +# specific and may provide the same functionality for other terminals. Most +# terminals are good at ignoring OSC sequences that they don't understand, but +# if not there are some bypasses: +# +# WEZTERM_SHELL_SKIP_ALL - disables all +# WEZTERM_SHELL_SKIP_SEMANTIC_ZONES - disables zones +# WEZTERM_SHELL_SKIP_CWD - disables OSC 7 cwd setting + +# shellcheck disable=SC2166 +if [ -z "${BASH_VERSION}" -a -z "${ZSH_NAME}" ] ; then + # Only for bash or zsh + return 0 +fi + +if [ "${WEZTERM_SHELL_SKIP_ALL}" = "1" ] ; then + return 0 +fi + +if [[ $- != *i* ]] ; then + # Shell integration is only useful in interactive sessions + return 0 +fi + +case "$TERM" in + linux | dumb ) + # Avoid terminals that don't like OSC sequences + return 0 + ;; +esac + +# This function wraps bash-preexec.sh so that it can be included verbatim +# in this file, even though it uses `return` to short-circuit in some cases. +__wezterm_install_bash_prexec() { + +# bash-preexec.sh -- Bash support for ZSH-like 'preexec' and 'precmd' functions. +# https://github.com/rcaloras/bash-preexec +# +# 'preexec' functions are executed before each interactive command is +# executed, with the interactive command as its argument. The 'precmd' +# function is executed before each prompt is displayed. +# +# Author: Ryan Caloras (ryan@bashhub.com) +# Forked from Original Author: Glyph Lefkowitz +# +# V0.4.1 +# + +# General Usage: +# +# 1. Source this file at the end of your bash profile so as not to interfere +# with anything else that's using PROMPT_COMMAND. +# +# 2. Add any precmd or preexec functions by appending them to their arrays: +# e.g. +# precmd_functions+=(my_precmd_function) +# precmd_functions+=(some_other_precmd_function) +# +# preexec_functions+=(my_preexec_function) +# +# 3. Consider changing anything using the DEBUG trap or PROMPT_COMMAND +# to use preexec and precmd instead. Preexisting usages will be +# preserved, but doing so manually may be less surprising. +# +# Note: This module requires two Bash features which you must not otherwise be +# using: the "DEBUG" trap, and the "PROMPT_COMMAND" variable. If you override +# either of these after bash-preexec has been installed it will most likely break. + +# Make sure this is bash that's running and return otherwise. +if [[ -z "${BASH_VERSION:-}" ]]; then + return 1; +fi + +# Avoid duplicate inclusion +if [[ "${__bp_imported:-}" == "defined" ]]; then + return 0 +fi +__bp_imported="defined" + +# Should be available to each precmd and preexec +# functions, should they want it. $? and $_ are available as $? and $_, but +# $PIPESTATUS is available only in a copy, $BP_PIPESTATUS. +# TODO: Figure out how to restore PIPESTATUS before each precmd or preexec +# function. +__bp_last_ret_value="$?" +BP_PIPESTATUS=("${PIPESTATUS[@]}") +__bp_last_argument_prev_command="$_" + +__bp_inside_precmd=0 +__bp_inside_preexec=0 + +# Initial PROMPT_COMMAND string that is removed from PROMPT_COMMAND post __bp_install +__bp_install_string=$'__bp_trap_string="$(trap -p DEBUG)"\ntrap - DEBUG\n__bp_install' + +# Fails if any of the given variables are readonly +# Reference https://stackoverflow.com/a/4441178 +__bp_require_not_readonly() { + local var + for var; do + if ! ( unset "$var" 2> /dev/null ); then + echo "bash-preexec requires write access to ${var}" >&2 + return 1 + fi + done +} + +# Remove ignorespace and or replace ignoreboth from HISTCONTROL +# so we can accurately invoke preexec with a command from our +# history even if it starts with a space. +__bp_adjust_histcontrol() { + local histcontrol + histcontrol="${HISTCONTROL//ignorespace}" + # Replace ignoreboth with ignoredups + if [[ "$histcontrol" == *"ignoreboth"* ]]; then + histcontrol="ignoredups:${histcontrol//ignoreboth}" + fi; + export HISTCONTROL="$histcontrol" +} + +# This variable describes whether we are currently in "interactive mode"; +# i.e. whether this shell has just executed a prompt and is waiting for user +# input. It documents whether the current command invoked by the trace hook is +# run interactively by the user; it's set immediately after the prompt hook, +# and unset as soon as the trace hook is run. +__bp_preexec_interactive_mode="" + +# Trims leading and trailing whitespace from $2 and writes it to the variable +# name passed as $1 +__bp_trim_whitespace() { + local var=${1:?} text=${2:-} + text="${text#"${text%%[![:space:]]*}"}" # remove leading whitespace characters + text="${text%"${text##*[![:space:]]}"}" # remove trailing whitespace characters + printf -v "$var" '%s' "$text" +} + + +# Trims whitespace and removes any leading or trailing semicolons from $2 and +# writes the resulting string to the variable name passed as $1. Used for +# manipulating substrings in PROMPT_COMMAND +__bp_sanitize_string() { + local var=${1:?} text=${2:-} sanitized + __bp_trim_whitespace sanitized "$text" + sanitized=${sanitized%;} + sanitized=${sanitized#;} + __bp_trim_whitespace sanitized "$sanitized" + printf -v "$var" '%s' "$sanitized" +} + +# This function is installed as part of the PROMPT_COMMAND; +# It sets a variable to indicate that the prompt was just displayed, +# to allow the DEBUG trap to know that the next command is likely interactive. +__bp_interactive_mode() { + __bp_preexec_interactive_mode="on"; +} + + +# This function is installed as part of the PROMPT_COMMAND. +# It will invoke any functions defined in the precmd_functions array. +__bp_precmd_invoke_cmd() { + # Save the returned value from our last command, and from each process in + # its pipeline. Note: this MUST be the first thing done in this function. + __bp_last_ret_value="$?" BP_PIPESTATUS=("${PIPESTATUS[@]}") + + # Don't invoke precmds if we are inside an execution of an "original + # prompt command" by another precmd execution loop. This avoids infinite + # recursion. + if (( __bp_inside_precmd > 0 )); then + return + fi + local __bp_inside_precmd=1 + + # Invoke every function defined in our function array. + local precmd_function + for precmd_function in "${precmd_functions[@]}"; do + + # Only execute this function if it actually exists. + # Test existence of functions with: declare -[Ff] + if type -t "$precmd_function" 1>/dev/null; then + __bp_set_ret_value "$__bp_last_ret_value" "$__bp_last_argument_prev_command" + # Quote our function invocation to prevent issues with IFS + "$precmd_function" + fi + done + + return $__bp_last_ret_value +} + +# Sets a return value in $?. We may want to get access to the $? variable in our +# precmd functions. This is available for instance in zsh. We can simulate it in bash +# by setting the value here. +__bp_set_ret_value() { + return ${1:-} +} + +__bp_in_prompt_command() { + + local prompt_command_array + IFS=$'\n;' read -rd '' -a prompt_command_array <<< "$PROMPT_COMMAND" + + local trimmed_arg + __bp_trim_whitespace trimmed_arg "${1:-}" + + local command trimmed_command + for command in "${prompt_command_array[@]:-}"; do + __bp_trim_whitespace trimmed_command "$command" + if [[ "$trimmed_command" == "$trimmed_arg" ]]; then + return 0 + fi + done + + return 1 +} + +# This function is installed as the DEBUG trap. It is invoked before each +# interactive prompt display. Its purpose is to inspect the current +# environment to attempt to detect if the current command is being invoked +# interactively, and invoke 'preexec' if so. +__bp_preexec_invoke_exec() { + + # Save the contents of $_ so that it can be restored later on. + # https://stackoverflow.com/questions/40944532/bash-preserve-in-a-debug-trap#40944702 + __bp_last_argument_prev_command="${1:-}" + # Don't invoke preexecs if we are inside of another preexec. + if (( __bp_inside_preexec > 0 )); then + return + fi + local __bp_inside_preexec=1 + + # Checks if the file descriptor is not standard out (i.e. '1') + # __bp_delay_install checks if we're in test. Needed for bats to run. + # Prevents preexec from being invoked for functions in PS1 + if [[ ! -t 1 && -z "${__bp_delay_install:-}" ]]; then + return + fi + + if [[ -n "${COMP_LINE:-}" ]]; then + # We're in the middle of a completer. This obviously can't be + # an interactively issued command. + return + fi + if [[ -z "${__bp_preexec_interactive_mode:-}" ]]; then + # We're doing something related to displaying the prompt. Let the + # prompt set the title instead of me. + return + else + # If we're in a subshell, then the prompt won't be re-displayed to put + # us back into interactive mode, so let's not set the variable back. + # In other words, if you have a subshell like + # (sleep 1; sleep 2) + # You want to see the 'sleep 2' as a set_command_title as well. + if [[ 0 -eq "${BASH_SUBSHELL:-}" ]]; then + __bp_preexec_interactive_mode="" + fi + fi + + if __bp_in_prompt_command "${BASH_COMMAND:-}"; then + # If we're executing something inside our prompt_command then we don't + # want to call preexec. Bash prior to 3.1 can't detect this at all :/ + __bp_preexec_interactive_mode="" + return + fi + + local this_command + this_command=$( + export LC_ALL=C + HISTTIMEFORMAT= builtin history 1 | sed '1 s/^ *[0-9][0-9]*[* ] //' + ) + + # Sanity check to make sure we have something to invoke our function with. + if [[ -z "$this_command" ]]; then + return + fi + + # Invoke every function defined in our function array. + local preexec_function + local preexec_function_ret_value + local preexec_ret_value=0 + for preexec_function in "${preexec_functions[@]:-}"; do + + # Only execute each function if it actually exists. + # Test existence of function with: declare -[fF] + if type -t "$preexec_function" 1>/dev/null; then + __bp_set_ret_value ${__bp_last_ret_value:-} + # Quote our function invocation to prevent issues with IFS + "$preexec_function" "$this_command" + preexec_function_ret_value="$?" + if [[ "$preexec_function_ret_value" != 0 ]]; then + preexec_ret_value="$preexec_function_ret_value" + fi + fi + done + + # Restore the last argument of the last executed command, and set the return + # value of the DEBUG trap to be the return code of the last preexec function + # to return an error. + # If `extdebug` is enabled a non-zero return value from any preexec function + # will cause the user's command not to execute. + # Run `shopt -s extdebug` to enable + __bp_set_ret_value "$preexec_ret_value" "$__bp_last_argument_prev_command" +} + +__bp_install() { + # Exit if we already have this installed. + if [[ "${PROMPT_COMMAND:-}" == *"__bp_precmd_invoke_cmd"* ]]; then + return 1; + fi + + trap '__bp_preexec_invoke_exec "$_"' DEBUG + + # Preserve any prior DEBUG trap as a preexec function + local prior_trap=$(sed "s/[^']*'\(.*\)'[^']*/\1/" <<<"${__bp_trap_string:-}") + unset __bp_trap_string + if [[ -n "$prior_trap" ]]; then + eval '__bp_original_debug_trap() { + '"$prior_trap"' + }' + preexec_functions+=(__bp_original_debug_trap) + fi + + # Adjust our HISTCONTROL Variable if needed. + __bp_adjust_histcontrol + + # Issue #25. Setting debug trap for subshells causes sessions to exit for + # backgrounded subshell commands (e.g. (pwd)& ). Believe this is a bug in Bash. + # + # Disabling this by default. It can be enabled by setting this variable. + if [[ -n "${__bp_enable_subshells:-}" ]]; then + + # Set so debug trap will work be invoked in subshells. + set -o functrace > /dev/null 2>&1 + shopt -s extdebug > /dev/null 2>&1 + fi; + + local existing_prompt_command + # Remove setting our trap install string and sanitize the existing prompt command string + existing_prompt_command="${PROMPT_COMMAND//$__bp_install_string[;$'\n']}" # Edge case of appending to PROMPT_COMMAND + existing_prompt_command="${existing_prompt_command//$__bp_install_string}" + __bp_sanitize_string existing_prompt_command "$existing_prompt_command" + + # Install our hooks in PROMPT_COMMAND to allow our trap to know when we've + # actually entered something. + PROMPT_COMMAND=$'__bp_precmd_invoke_cmd\n' + if [[ -n "$existing_prompt_command" ]]; then + PROMPT_COMMAND+=${existing_prompt_command}$'\n' + fi; + PROMPT_COMMAND+='__bp_interactive_mode' + + # Add two functions to our arrays for convenience + # of definition. + precmd_functions+=(precmd) + preexec_functions+=(preexec) + + # Invoke our two functions manually that were added to $PROMPT_COMMAND + __bp_precmd_invoke_cmd + __bp_interactive_mode +} + +# Sets an installation string as part of our PROMPT_COMMAND to install +# after our session has started. This allows bash-preexec to be included +# at any point in our bash profile. +__bp_install_after_session_init() { + # bash-preexec needs to modify these variables in order to work correctly + # if it can't, just stop the installation + __bp_require_not_readonly PROMPT_COMMAND HISTCONTROL HISTTIMEFORMAT || return + + local sanitized_prompt_command + __bp_sanitize_string sanitized_prompt_command "$PROMPT_COMMAND" + if [[ -n "$sanitized_prompt_command" ]]; then + PROMPT_COMMAND=${sanitized_prompt_command}$'\n' + fi; + PROMPT_COMMAND+=${__bp_install_string} +} + +# Run our install so long as we're not delaying it. +if [[ -z "${__bp_delay_install:-}" ]]; then + __bp_install_after_session_init +fi; + +} # end of __wezterm_install_bash_prexec + +# blesh provides it's own preexec mechanism which is recommended over bash-preexec +# See https://github.com/akinomyoga/ble.sh/wiki/Manual-%C2%A71-Introduction#user-content-fn-blehook for more details +if [[ ! -n "$BLE_VERSION" ]]; then + __wezterm_install_bash_prexec +fi + +# This function emits an OSC 7 sequence to inform the terminal +# of the current working directory. It prefers to use a helper +# command provided by wezterm if wezterm is installed, but falls +# back to a simple printf command otherwise. +__wezterm_osc7() { + if hash wezterm 2>/dev/null ; then + wezterm set-working-directory 2>/dev/null && return 0 + # If the command failed (perhaps the installed wezterm + # is too old?) then fall back to the simple version below. + fi + printf "\033]7;file://%s%s\033\\" "${HOSTNAME}" "${PWD}" +} + +# The semantic precmd and prexec functions generate semantic +# zones, marking up the prompt, the user input and the command +# output so that the terminal can better reason about the display. +__wezterm_semantic_precmd_executing="" +__wezterm_semantic_precmd() { + local ret="$?" + if [[ "$__wezterm_semantic_precmd_executing" != "0" ]] ; then + __wezterm_save_ps1="$PS1" + __wezterm_save_ps2="$PS2" + # Markup the left and right prompts so that the terminal + # knows that they are semantically prompt output. + if [[ -n "$ZSH_NAME" ]] ; then + PS1=$'%{\e]133;P;k=i\a%}'$PS1$'%{\e]133;B\a%}' + PS2=$'%{\e]133;P;k=s\a%}'$PS2$'%{\e]133;B\a%}' + else + PS1='\[\e]133;P;k=i\a\]'$PS1'\[\e]133;B\a\]' + PS2='\[\e]133;P;k=s\a\]'$PS2'\[\e]133;B\a\]' + fi + fi + if [[ "$__wezterm_semantic_precmd_executing" != "" ]] ; then + # Report last command status + printf "\033]133;D;%s;aid=%s\007" "$ret" "$$" + fi + # Fresh line and start the prompt + printf "\033]133;A;cl=m;aid=%s\007" "$$" + __wezterm_semantic_precmd_executing=0 +} + +function __wezterm_semantic_preexec() { + # Restore the original PS1/PS2 + PS1="$__wezterm_save_ps1" + PS2="$__wezterm_save_ps2" + # Indicate that the command output begins here + printf "\033]133;C;\007" + __wezterm_semantic_precmd_executing=1 +} + +# Register the various functions; take care to perform osc7 after +# the semantic zones as we don't want to perturb the last command +# status before we've had a chance to report it to the terminal +if [[ -z "${WEZTERM_SHELL_SKIP_SEMANTIC_ZONES}" ]]; then + if [[ -n "$BLE_VERSION" ]]; then + blehook PRECMD+=__wezterm_semantic_precmd + blehook PREEXEC+=__wezterm_semantic_preexec + else + precmd_functions+=(__wezterm_semantic_precmd) + preexec_functions+=(__wezterm_semantic_preexec) + fi +fi + +if [[ -z "${WEZTERM_SHELL_SKIP_CWD}" ]] ; then + if [[ -n "$BLE_VERSION" ]]; then + blehook PRECMD+=__wezterm_osc7 + else + precmd_functions+=(__wezterm_osc7) + fi +fi + +true diff --git a/home/apps/wezterm/wezterm_terminfo b/home/apps/wezterm/wezterm_terminfo new file mode 100644 index 0000000..f7a4af4 --- /dev/null +++ b/home/apps/wezterm/wezterm_terminfo @@ -0,0 +1,89 @@ +# This is Wez's term definition for wezterm. +# It was reconstructed via infocmp from file: /lib/terminfo/x/xterm-256color +# and then has some additions in the top few lines (until the line starting +# with am). +# Tc: true color boolean for tmux +# sitm/ritm: italics +# Ms modifies the selection/clipboard. Its parameters are +# p1 = the storage unit (clipboard, selection or cut buffer) +# p2 = the base64-encoded clipboard content. +# +# Ss is used to set the cursor style as described by the DECSCUSR +# function to a block or underline. +# Se resets the cursor style to the terminal power-on default. +# Smulx defines kitty style underline escape sequence support +# +# hs, dsl, fsl, tsl are used by nvim to amend the "status line". +# These are not normally present for xterm and have assumed values +# when TERM==xterm. When using this terminfo file that assumption is not +# true and that functionality is broken. +# We follow the foot's terminfo settings for these, based on +# https://codeberg.org/dnkl/foot/pulls/243/files +# although we use OSC 0 for the title rather than OSC 2. +# https://github.com/neovim/neovim/issues/20706 +# https://github.com/wez/wezterm/issues/2635 +wezterm|Wez's terminal emulator, + Tc, + hs, + sitm=\E[3m, ritm=\E[23m, + Cr=\E]112\007, Cs=\E]12;%p1%s\007, Ms=\E]52;%p1%s;%p2%s\007, Se=\E[2\sq, + Ss=\E[%p1%d\sq, + Smulx=\E[4:%p1%dm, + Sync=\E[?2026%?%p1%{1}%-%tl%eh, + Setulc=\E[58:2::%p1%{65536}%/%d:%p1%{256}%/%{255}%&%d:%p1%{255}%&%d%;m, + Smol=\E[53m, + am, bce, ccc, km, mc5i, mir, msgr, npc, xenl, + colors#0x100, cols#80, it#8, lines#24, pairs#0x7fff, + acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, + bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, civis=\E[?25l, + clear=\E[H\E[2J, cnorm=\E[?12l\E[?25h, cr=\r, + csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H, + cud=\E[%p1%dB, cud1=\n, cuf=\E[%p1%dC, cuf1=\E[C, + cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A, + cvvis=\E[?12;25h, dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m, + dl=\E[%p1%dM, dl1=\E[M, dsl=\E]2;\E\\, + ech=\E[%p1%dX, ed=\E[J, el=\E[K, + el1=\E[1K, flash=\E[?5h$<100/>\E[?5l, fsl=\E\\, home=\E[H, + hpa=\E[%i%p1%dG, ht=^I, hts=\EH, ich=\E[%p1%d@, + il=\E[%p1%dL, il1=\E[L, ind=\n, indn=\E[%p1%dS, + initc=\E]4;%p1%d;rgb\:%p2%{255}%*%{1000}%/%2.2X/%p3%{255}%*%{1000}%/%2.2X/%p4%{255}%*%{1000}%/%2.2X\E\\, + invis=\E[8m, is2=\E[!p\E[?3;4l\E[4l\E>, kDC=\E[3;2~, + kEND=\E[1;2F, kHOM=\E[1;2H, kIC=\E[2;2~, kLFT=\E[1;2D, + kNXT=\E[6;2~, kPRV=\E[5;2~, kRIT=\E[1;2C, kb2=\EOE, kbs=^?, + kcbt=\E[Z, kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, + kdch1=\E[3~, kend=\EOF, kent=\EOM, kf1=\EOP, kf10=\E[21~, + kf11=\E[23~, kf12=\E[24~, kf13=\E[1;2P, kf14=\E[1;2Q, + kf15=\E[1;2R, kf16=\E[1;2S, kf17=\E[15;2~, kf18=\E[17;2~, + kf19=\E[18;2~, kf2=\EOQ, kf20=\E[19;2~, kf21=\E[20;2~, + kf22=\E[21;2~, kf23=\E[23;2~, kf24=\E[24;2~, + kf25=\E[1;5P, kf26=\E[1;5Q, kf27=\E[1;5R, kf28=\E[1;5S, + kf29=\E[15;5~, kf3=\EOR, kf30=\E[17;5~, kf31=\E[18;5~, + kf32=\E[19;5~, kf33=\E[20;5~, kf34=\E[21;5~, + kf35=\E[23;5~, kf36=\E[24;5~, kf37=\E[1;6P, kf38=\E[1;6Q, + kf39=\E[1;6R, kf4=\EOS, kf40=\E[1;6S, kf41=\E[15;6~, + kf42=\E[17;6~, kf43=\E[18;6~, kf44=\E[19;6~, + kf45=\E[20;6~, kf46=\E[21;6~, kf47=\E[23;6~, + kf48=\E[24;6~, kf49=\E[1;3P, kf5=\E[15~, kf50=\E[1;3Q, + kf51=\E[1;3R, kf52=\E[1;3S, kf53=\E[15;3~, kf54=\E[17;3~, + kf55=\E[18;3~, kf56=\E[19;3~, kf57=\E[20;3~, + kf58=\E[21;3~, kf59=\E[23;3~, kf6=\E[17~, kf60=\E[24;3~, + kf61=\E[1;4P, kf62=\E[1;4Q, kf63=\E[1;4R, kf7=\E[18~, + kf8=\E[19~, kf9=\E[20~, khome=\EOH, kich1=\E[2~, + kind=\E[1;2B, knp=\E[6~, kpp=\E[5~, + kri=\E[1;2A, mc0=\E[i, mc4=\E[4i, mc5=\E[5i, meml=\El, + memu=\Em, oc=\E]104\007, op=\E[39;49m, rc=\E8, + rep=%p1%c\E[%p2%{1}%-%db, rev=\E[7m, ri=\EM, + rin=\E[%p1%dT, ritm=\E[23m, rmacs=\E(B, rmam=\E[?7l, + rmcup=\E[?1049l\E[23;0;0t, rmir=\E[4l, rmkx=\E[?1l\E>, + rmm=\E[?1034l, rmso=\E[27m, rmul=\E[24m, rmxx=\E[29m, + rs1=\Ec\E]104\007, rs2=\E[!p\E[?3;4l\E[4l\E>, sc=\E7, + setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m, + setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m, + sgr=%?%p9%t\E(0%e\E(B%;\E[0%?%p6%t;1%;%?%p5%t;2%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m, + sgr0=\E(B\E[m, sitm=\E[3m, smacs=\E(0, smam=\E[?7h, + smcup=\E[?1049h\E[22;0;0t, smir=\E[4h, smkx=\E[?1h\E=, + smm=\E[?1034h, smso=\E[7m, smul=\E[4m, smxx=\E[9m, + tbc=\E[3g, tsl=\E]0;, u6=\E[%i%d;%dR, u7=\E[6n, u8=\E[?%[;0123456789]c, + u9=\E[c, vpa=\E[%i%p1%dd, XM=\E[?1003;1006%?%p1%{1}%=%th%el%;, + kmous=\E[<, XM=\E[?1006;1000%?%p1%{1}%=%th%el%;, + xm=\E[<%i%p3%d;%p1%d;%p2%d;%?%p4%tM%em%;, diff --git a/home/apps/zsh.nix b/home/apps/zsh.nix new file mode 100644 index 0000000..f6b38a4 --- /dev/null +++ b/home/apps/zsh.nix @@ -0,0 +1,72 @@ +{ + config, + pkgs, + ... +}: { + programs.zsh = { + enable = true; + enableAutosuggestions = true; + enableCompletion = true; + # Idk why the highlighting doesn't work properly now + # https://github.com/zsh-users/zsh-syntax-highlighting/issues/922 + # source /nix/store/vzwfgm1a53ihs5x0vwzqd9rbs04vsmgk-zsh-syntax-highlighting-0.7.1/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh + enableSyntaxHighlighting = false; + + envExtra = '' + export ZVM_INIT_MODE=sourcing + ''; + initExtra = '' + # WezTerm + if [[ "$TERM_PROGRAM" == "WezTerm" ]]; then + TERM=wezterm + source $HOME/.config/wezterm/wezterm.sh + fi + ''; + + dotDir = ".config/zsh"; + oh-my-zsh = { + enable = true; + plugins = [ + "colored-man-pages" + "colorize" + "docker" + "docker-compose" + "git" + "kubectl" + ]; + }; + plugins = let + themepkg = pkgs.fetchFromGitHub { + owner = "catppuccin"; + repo = "zsh-syntax-highlighting"; + rev = "06d519c20798f0ebe275fc3a8101841faaeee8ea"; + sha256 = "sha256-Q7KmwUd9fblprL55W0Sf4g7lRcemnhjh4/v+TacJSfo="; + }; + in [ + { + name = "zsh-vi-mode"; + src = pkgs.zsh-vi-mode; + file = "share/zsh-vi-mode/zsh-vi-mode.plugin.zsh"; + } + { + name = "zsh-nix-shell"; + src = pkgs.zsh-nix-shell; + file = "share/zsh-nix-shell/nix-shell.plugin.zsh"; + } + { + name = "nix-zsh-completions"; + src = pkgs.nix-zsh-completions; + file = "share/nix-zsh-completions/nix-zsh-completions.plugin.zsh"; + } + { + name = "ctp-zsh-syntax-highlighting"; + src = themepkg; + file = themepkg + "/themes/catppuccin_mocha-zsh-syntax-highlighting.zsh"; + } + ]; + + history = { + path = "${config.home.homeDirectory}/${config.programs.zsh.dotDir}/history"; + }; + }; +} diff --git a/home/default.nix b/home/default.nix new file mode 100644 index 0000000..a2f8e6a --- /dev/null +++ b/home/default.nix @@ -0,0 +1,58 @@ +{ + config, + pkgs, + flakePath, + ... +}: { + imports = [ + # ./apps/wezterm.nix + # ./apps/zsh.nix + ./apps/fonts.nix + ./apps/git.nix + ./apps/fish.nix + ./apps/k8s.nix + ./apps/nap.nix + ./apps/go.nix + ./apps/deno.nix + ./apps/rust.nix + ]; + + programs.home-manager.enable = true; + + nix.package = pkgs.nix; + nix.settings = { + experimental-features = "nix-command flakes"; + }; + + home.username = "hammy"; + home.homeDirectory = "/home/hammy"; + home.stateVersion = "22.11"; + home.packages = with pkgs; [ + imagemagick + alejandra + fd + vivid + ]; + home.sessionVariables = { + EDITOR = "nvim"; + SUDO_EDITOR = "nvim"; + TERMINAL = "wezterm-gui"; + LIBVA_DRIVER_NAME = "iHD"; + LS_COLORS = "$(vivid generate catppuccin-mocha)"; + JAVA_HOME = "$SDKMAN_DIR/candidates/java/current"; + GRAALVM_HOME = "$SDKMAN_DIR/candidates/java/22.3.r17-grl"; + }; + home.sessionPath = [ + "${config.xdg.dataHome}/nvim/mason/bin" + "${config.xdg.dataHome}/JetBrains/Toolbox/scripts" + "${config.xdg.dataHome}/scripts" + ]; + home.shellAliases = { + magit = "nvim '+Neogit kind=replace'"; + }; + + xdg.configFile."ideavim/ideavimrc".source = config.lib.file.mkOutOfStoreSymlink "${flakePath}/home/apps/ideavim/ideavimrc"; + xdg.mime.enable = true; + # turn off if on nixos (you have bigger problems than that if you get to this point) + targets.genericLinux.enable = true; +} diff --git a/private_dot_local/private_share/eclipse/eclipse-java-google-style.xml b/private_dot_local/private_share/eclipse/eclipse-java-google-style.xml deleted file mode 100644 index 1769362..0000000 --- a/private_dot_local/private_share/eclipse/eclipse-java-google-style.xml +++ /dev/null @@ -1,714 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -