From dde724ef347e3efbe7e4dcda1628e5017e922735 Mon Sep 17 00:00:00 2001 From: Michael Thomson Date: Thu, 5 Sep 2024 07:22:41 -0400 Subject: [PATCH] big update again --- flake.lock | 203 ++++++++++++- flake.nix | 1 + hosts/macbook/home.nix | 6 +- modules/home-manager/email/default.nix | 46 --- modules/home-manager/neovim/default.nix | 6 +- modules/home-manager/neovim/nvim/init.lua | 40 --- .../neovim/nvim/lua/plugins/catppuccin.lua | 24 -- .../neovim/nvim/lua/plugins/fidget.lua | 10 - .../neovim/nvim/lua/plugins/gitsigns.lua | 12 - .../neovim/nvim/lua/plugins/leap.lua | 6 - .../neovim/nvim/lua/plugins/lint.lua | 52 ---- .../neovim/nvim/lua/plugins/lsp.lua | 273 +++++++++++------- .../neovim/nvim/lua/plugins/luasnip.lua | 12 - .../neovim/nvim/lua/plugins/mini.lua | 64 +++- .../neovim/nvim/lua/plugins/neorg.lua | 43 --- .../nvim/lua/plugins/nvim-ts-autotag.lua | 3 - .../neovim/nvim/lua/plugins/oxocarbon.lua | 7 + modules/home-manager/wezterm/default.nix | 4 +- 18 files changed, 452 insertions(+), 360 deletions(-) delete mode 100644 modules/home-manager/neovim/nvim/lua/plugins/catppuccin.lua delete mode 100644 modules/home-manager/neovim/nvim/lua/plugins/fidget.lua delete mode 100644 modules/home-manager/neovim/nvim/lua/plugins/gitsigns.lua delete mode 100644 modules/home-manager/neovim/nvim/lua/plugins/leap.lua delete mode 100644 modules/home-manager/neovim/nvim/lua/plugins/lint.lua delete mode 100644 modules/home-manager/neovim/nvim/lua/plugins/luasnip.lua delete mode 100644 modules/home-manager/neovim/nvim/lua/plugins/neorg.lua delete mode 100644 modules/home-manager/neovim/nvim/lua/plugins/nvim-ts-autotag.lua create mode 100644 modules/home-manager/neovim/nvim/lua/plugins/oxocarbon.lua diff --git a/flake.lock b/flake.lock index 8031bfc..902af1c 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,150 @@ { "nodes": { + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_2": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "neovim-nightly-overlay", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1725234343, + "narHash": "sha256-+ebgonl3NbiKD2UD0x4BszCZQ6sTfL4xioaM49o5B3Y=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "567b938d64d4b4112ee253b9274472dc3a346eb6", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_2": { + "inputs": { + "nixpkgs-lib": [ + "neovim-nightly-overlay", + "hercules-ci-effects", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1712014858, + "narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "9126214d0a59633752a136528f5f3b9aa8565b7d", + "type": "github" + }, + "original": { + "id": "flake-parts", + "type": "indirect" + } + }, + "git-hooks": { + "inputs": { + "flake-compat": "flake-compat_2", + "gitignore": "gitignore", + "nixpkgs": [ + "neovim-nightly-overlay", + "nixpkgs" + ], + "nixpkgs-stable": [ + "neovim-nightly-overlay", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1724857454, + "narHash": "sha256-Qyl9Q4QMTLZnnBb/8OuQ9LSkzWjBU1T5l5zIzTxkkhk=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "4509ca64f1084e73bc7a721b20c669a8d4c5ebe6", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "neovim-nightly-overlay", + "git-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "hercules-ci-effects": { + "inputs": { + "flake-parts": "flake-parts_2", + "nixpkgs": [ + "neovim-nightly-overlay", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1724947644, + "narHash": "sha256-MHHrHasTngp7EYQOObHJ1a/IsRF+wodHqOckhH6uZbk=", + "owner": "hercules-ci", + "repo": "hercules-ci-effects", + "rev": "dba4367b9a9d9615456c430a6d6af716f6e84cef", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "hercules-ci-effects", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -20,6 +165,45 @@ "type": "github" } }, + "neovim-nightly-overlay": { + "inputs": { + "flake-compat": "flake-compat", + "flake-parts": "flake-parts", + "git-hooks": "git-hooks", + "hercules-ci-effects": "hercules-ci-effects", + "neovim-src": "neovim-src", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1725415370, + "narHash": "sha256-F5Obt4M07Jal6P0QMkbL9Qrsux7CmhbmEuO4d1NWOrk=", + "owner": "nix-community", + "repo": "neovim-nightly-overlay", + "rev": "fdc7d407e29b17633d2568b5f46ead383ef85172", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "neovim-nightly-overlay", + "type": "github" + } + }, + "neovim-src": { + "flake": false, + "locked": { + "lastModified": 1725402926, + "narHash": "sha256-FEwqYuoLu5gZ6Kc8DWTKAWAR0iZ6dSvdIC9RARLKhWc=", + "owner": "neovim", + "repo": "neovim", + "rev": "7b7c95dac97d6ea4f10855cc198dce650a796c20", + "type": "github" + }, + "original": { + "owner": "neovim", + "repo": "neovim", + "type": "github" + } + }, "nix-darwin": { "inputs": { "nixpkgs": [ @@ -57,6 +241,22 @@ } }, "nixpkgs": { + "locked": { + "lastModified": 1725194671, + "narHash": "sha256-tLGCFEFTB5TaOKkpfw3iYT9dnk4awTP/q4w+ROpMfuw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "b833ff01a0d694b910daca6e2ff4a3f26dee478c", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { "locked": { "lastModified": 1725103162, "narHash": "sha256-Ym04C5+qovuQDYL/rKWSR+WESseQBbNAe5DsXNx5trY=", @@ -75,9 +275,10 @@ "root": { "inputs": { "home-manager": "home-manager", + "neovim-nightly-overlay": "neovim-nightly-overlay", "nix-darwin": "nix-darwin", "nixos-hardware": "nixos-hardware", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs_2" } } }, diff --git a/flake.nix b/flake.nix index 4a2483b..1d715f8 100644 --- a/flake.nix +++ b/flake.nix @@ -12,6 +12,7 @@ inputs.nixpkgs.follows = "nixpkgs"; }; nixos-hardware.url = "github:NixOS/nixos-hardware/master"; + neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay"; }; outputs = inputs@{ self, nixpkgs, home-manager, nix-darwin, nixos-hardware, ... }: { diff --git a/hosts/macbook/home.nix b/hosts/macbook/home.nix index c02d674..84afae8 100644 --- a/hosts/macbook/home.nix +++ b/hosts/macbook/home.nix @@ -27,12 +27,13 @@ enableZshIntegration = true; # see note on other shells below nix-direnv.enable = true; }; + spotify-player = { + enable = true; + }; }; home.packages = with pkgs; [ btop - spotify - spotify-player neofetch jq tldr @@ -57,6 +58,7 @@ calcurse glow gcc + luajit ]; programs.home-manager.enable = true; diff --git a/modules/home-manager/email/default.nix b/modules/home-manager/email/default.nix index 53abe9c..b75e1fa 100644 --- a/modules/home-manager/email/default.nix +++ b/modules/home-manager/email/default.nix @@ -10,14 +10,6 @@ source = ./calendar-password.sh; executable = true; }; - "work-calendar-client-id.sh" = { - source = ./work-calendar-client-id.sh; - executable = true; - }; - "work-calendar-client-secret.sh" = { - source = ./work-calendar-client-secret.sh; - executable = true; - }; }; services = { @@ -164,22 +156,6 @@ enable = true; }; }; - accounts.work = { - primary = false; - flavor = "gmail.com"; - address = "mthomson@konradgroup.com"; - realName = "Michael Thomson"; - aerc = { - enable = true; - extraAccounts = { source = "maildir://~/Maildir/work"; }; - }; - notmuch = { - enable = true; - }; - lieer = { - enable = true; - }; - }; }; calendar = { basePath = ".calendar"; @@ -210,28 +186,6 @@ color = "#f2d5cf"; }; }; - accounts.work = { - primary = false; - remote = { - type = "google_calendar"; - }; - vdirsyncer = { - enable = true; - collections = [ "from a" "from b" ]; - clientIdCommand = [ - "~/work-calendar-client-id.sh" - ]; - clientSecretCommand = [ - "~/work-calendar-client-secret.sh" - ]; - tokenFile = "~/token_file"; - }; - khal = { - enable = true; - type = "discover"; - color = "#e78284"; - }; - }; }; }; } diff --git a/modules/home-manager/neovim/default.nix b/modules/home-manager/neovim/default.nix index f0e735b..7164e00 100644 --- a/modules/home-manager/neovim/default.nix +++ b/modules/home-manager/neovim/default.nix @@ -1,14 +1,18 @@ -{ pkgs, config, ... }: +{ inputs, pkgs, config, ... }: { home.packages = with pkgs; [ fzf ripgrep luarocks + luajit + lua-language-server + nil ]; programs.neovim = { enable = true; + package = inputs.neovim-nightly-overlay.packages.${pkgs.system}.default; }; home.file.".config/nvim/" = { diff --git a/modules/home-manager/neovim/nvim/init.lua b/modules/home-manager/neovim/nvim/init.lua index ce95f71..4326a8b 100644 --- a/modules/home-manager/neovim/nvim/init.lua +++ b/modules/home-manager/neovim/nvim/init.lua @@ -1,5 +1,3 @@ -local api = vim.api -local g = vim.g local opt = vim.opt -- Bootstrap lazy.nvim @@ -19,11 +17,6 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then end vim.opt.rtp:prepend(lazypath) --- Remap leader and local leader to -api.nvim_set_keymap("", "", "", { noremap = true, silent = true }) -g.mapleader = " " -g.maplocalleader = "," - -- Setup lazy.nvim require("lazy").setup({ spec = { @@ -33,34 +26,20 @@ require("lazy").setup({ checker = { enabled = true }, }) -vim.cmd 'colorscheme catppuccin-frappe' - -- Load core settings -opt.termguicolors = true -- Enable colors in terminal opt.hlsearch = false -- turn off highlight on search -opt.incsearch = true -- Keep incremental highlighting on search -opt.number = true --Make line numbers default opt.relativenumber = true --Make relative number default -opt.mouse = "a" --Enable mouse mode -opt.breakindent = true --Enable break indent -opt.undofile = true --Save undo history -opt.ignorecase = true --Case insensitive searching unless /C or capital in search -opt.smartcase = true -- Smart case opt.updatetime = 50 --Decrease update time -opt.signcolumn = 'yes' -- Always show sign column opt.clipboard = 'unnamedplus' -- Access system clipboard opt.laststatus = 3 -- Global status line opt.swapfile = false -opt.wrap = false vim.opt_local.conceallevel = 2 vim.opt.inccommand = 'split' -- Time in milliseconds to wait for a mapped sequence to complete. opt.timeoutlen = 300 -opt.showmode = false -- Do not need to show the mode. We use the statusline instead. opt.scrolloff = 10 -- Lines of context -opt.smartindent = true --Smart indent opt.expandtab = true opt.smarttab = true opt.textwidth = 0 @@ -68,15 +47,8 @@ opt.autoindent = true opt.shiftwidth = 2 opt.tabstop = 2 opt.softtabstop = 2 -opt.splitbelow = true -opt.splitright = true -opt.cursorline = true opt.guifont = "Iosevka Nerd Font Mono" --- Remappings -vim.keymap.set("v", "J", ":m '>+1gv=gv") -vim.keymap.set("v", "K", ":m '<-2gv=gv") - vim.keymap.set("n", "", "zz") vim.keymap.set("n", "", "zz") vim.keymap.set("n", "n", "nzzzv") @@ -90,16 +62,4 @@ vim.keymap.set({"n", "v"}, "d", [["_d]]) vim.keymap.set("n", "Q", "") vim.keymap.set("n", "", "") -vim.keymap.set("n", "", "silent !tmux neww tmux-sessionizer") - -vim.keymap.set("n", "J", "mzJ`z") - vim.keymap.set("i", "jk", "") - -vim.api.nvim_create_autocmd('TextYankPost', { - desc = 'Highlight when yanking (copying) text', - group = vim.api.nvim_create_augroup('highlight-yank', { clear = true }), - callback = function() - vim.highlight.on_yank() - end, -}) diff --git a/modules/home-manager/neovim/nvim/lua/plugins/catppuccin.lua b/modules/home-manager/neovim/nvim/lua/plugins/catppuccin.lua deleted file mode 100644 index 9dd458f..0000000 --- a/modules/home-manager/neovim/nvim/lua/plugins/catppuccin.lua +++ /dev/null @@ -1,24 +0,0 @@ -return { - "catppuccin/nvim", - name = "catppuccin", - priority = 1000, - opts = { - integrations = { - cmp = true, - gitsigns = true, - treesitter = true, - fidget = true, - harpoon = true, - leap = true, - mason = true, - mini = { - enabled = true, - }, - neotest = true, - markdown = true, - telescope = { - enabled = true, - }, - }, - }, -} diff --git a/modules/home-manager/neovim/nvim/lua/plugins/fidget.lua b/modules/home-manager/neovim/nvim/lua/plugins/fidget.lua deleted file mode 100644 index f314638..0000000 --- a/modules/home-manager/neovim/nvim/lua/plugins/fidget.lua +++ /dev/null @@ -1,10 +0,0 @@ -return { - 'j-hui/fidget.nvim', - opts = { - notification = { - window = { - winblend = 0, - }, - } - } -} diff --git a/modules/home-manager/neovim/nvim/lua/plugins/gitsigns.lua b/modules/home-manager/neovim/nvim/lua/plugins/gitsigns.lua deleted file mode 100644 index f25ff44..0000000 --- a/modules/home-manager/neovim/nvim/lua/plugins/gitsigns.lua +++ /dev/null @@ -1,12 +0,0 @@ -return { -- Adds git related signs to the gutter, as well as utilities for managing changes - 'lewis6991/gitsigns.nvim', - opts = { - signs = { - add = { text = '+' }, - change = { text = '~' }, - delete = { text = '_' }, - topdelete = { text = '‾' }, - changedelete = { text = '~' }, - } - } -} diff --git a/modules/home-manager/neovim/nvim/lua/plugins/leap.lua b/modules/home-manager/neovim/nvim/lua/plugins/leap.lua deleted file mode 100644 index 93c2345..0000000 --- a/modules/home-manager/neovim/nvim/lua/plugins/leap.lua +++ /dev/null @@ -1,6 +0,0 @@ -return { - 'ggandor/leap.nvim', - config = function() - require("leap").set_default_keymaps() - end -} diff --git a/modules/home-manager/neovim/nvim/lua/plugins/lint.lua b/modules/home-manager/neovim/nvim/lua/plugins/lint.lua deleted file mode 100644 index a2cff75..0000000 --- a/modules/home-manager/neovim/nvim/lua/plugins/lint.lua +++ /dev/null @@ -1,52 +0,0 @@ -return { -- Linting - 'mfussenegger/nvim-lint', - event = { 'BufReadPre', 'BufNewFile' }, - config = function() - local lint = require 'lint' - lint.linters_by_ft = { - vue = { 'stylelint' }, - } - - -- To allow other plugins to add linters to require('lint').linters_by_ft, - -- instead set linters_by_ft like this: - -- lint.linters_by_ft = lint.linters_by_ft or {} - -- lint.linters_by_ft['markdown'] = { 'markdownlint' } - -- - -- However, note that this will enable a set of default linters, - -- which will cause errors unless these tools are available: - -- { - -- clojure = { "clj-kondo" }, - -- dockerfile = { "hadolint" }, - -- inko = { "inko" }, - -- janet = { "janet" }, - -- json = { "jsonlint" }, - -- markdown = { "vale" }, - -- rst = { "vale" }, - -- ruby = { "ruby" }, - -- terraform = { "tflint" }, - -- text = { "vale" } - -- } - -- - -- You can disable the default linters by setting their filetypes to nil: - -- lint.linters_by_ft['clojure'] = nil - -- lint.linters_by_ft['dockerfile'] = nil - -- lint.linters_by_ft['inko'] = nil - -- lint.linters_by_ft['janet'] = nil - -- lint.linters_by_ft['json'] = nil - -- lint.linters_by_ft['markdown'] = nil - -- lint.linters_by_ft['rst'] = nil - -- lint.linters_by_ft['ruby'] = nil - -- lint.linters_by_ft['terraform'] = nil - -- lint.linters_by_ft['text'] = nil - - -- Create autocommand which carries out the actual linting - -- on the specified events. - local lint_augroup = vim.api.nvim_create_augroup('lint', { clear = true }) - vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, { - group = lint_augroup, - callback = function() - require('lint').try_lint() - end, - }) - end, -} diff --git a/modules/home-manager/neovim/nvim/lua/plugins/lsp.lua b/modules/home-manager/neovim/nvim/lua/plugins/lsp.lua index b944018..9c7968e 100644 --- a/modules/home-manager/neovim/nvim/lua/plugins/lsp.lua +++ b/modules/home-manager/neovim/nvim/lua/plugins/lsp.lua @@ -1,112 +1,183 @@ return { - 'VonHeikemen/lsp-zero.nvim', - branch = 'v3.x', - dependencies = { - -- LSP Support - {'neovim/nvim-lspconfig'}, -- Required - -- {'williamboman/mason.nvim'}, -- Optional - -- {'williamboman/mason-lspconfig.nvim'}, -- Optional - - -- Autocompletion - {'hrsh7th/nvim-cmp'}, -- Required - {'hrsh7th/cmp-nvim-lsp'}, -- Required - {'L3MON4D3/LuaSnip'}, -- Required - {'saadparwaiz1/cmp_luasnip'}, - {'onsails/lspkind.nvim'} -- Optional + { + 'folke/lazydev.nvim', + ft = 'lua', + opts = { + library = { + { path = 'luvit-meta/library', words = { 'vim%.uv' } }, + }, + }, }, - config = function() - local lsp_zero = require('lsp-zero') + { 'Bilal2453/luvit-meta', lazy = true }, + { + 'neovim/nvim-lspconfig', + cmd = 'LspInfo', + event = {'BufReadPre', 'BufNewFile'}, + config = function() + vim.api.nvim_create_autocmd('LspAttach', { + group = vim.api.nvim_create_augroup('lsp-attach', { clear = true }), + callback = function(event) + local map = function(keys, func, desc, mode) + mode = mode or 'n' + vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = "LSP: " .. desc }) + end - lsp_zero.on_attach(function(client, bufnr) - local opts = {buffer = bufnr, remap = false} + map("gd", function() vim.lsp.buf.definition() end, 'goto defintion') + map("gr", function() vim.lsp.buf.references() end, 'goto references') + map("K", function() vim.lsp.buf.hover() end, 'hover') + map("ws", function() vim.lsp.buf.workspace_symbol() end, 'workspace symbols') + map("d", function() vim.diagnostic.open_float() end, 'diagnostic float') + map("[d", function() vim.diagnostic.jump({ count = 1, float = true }) end, 'next diagnostic') + map("]d", function() vim.diagnostic.jump({ count = -1, float = true }) end, 'prev diagnostic') + map("ca", function() vim.lsp.buf.code_action() end, 'code actions') + map("rn", function() vim.lsp.buf.rename() end, 'rename') + map("", function() vim.lsp.buf.signature_help() end, 'signature help', "i") + end + }) - vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts) - vim.keymap.set("n", "gr", function() vim.lsp.buf.references() end, opts) - vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts) - vim.keymap.set("n", "ws", function() vim.lsp.buf.workspace_symbol() end, opts) - vim.keymap.set("n", "d", function() vim.diagnostic.open_float() end, opts) - vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts) - vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts) - vim.keymap.set("n", "ca", function() vim.lsp.buf.code_action() end, opts) - vim.keymap.set("n", "rn", function() vim.lsp.buf.rename() end, opts) - vim.keymap.set("i", "", function() vim.lsp.buf.signature_help() end, opts) - end) + local capabilities = vim.lsp.protocol.make_client_capabilities() + capabilities = vim.tbl_deep_extend('force', capabilities, require('cmp_nvim_lsp').default_capabilities()) - -- Mason Config - -- require('mason').setup({}) - -- require('mason-lspconfig').setup({ - -- ensure_installed = {}, - -- handlers = { - -- lsp_zero.default_setup, - -- } - -- }) + -- Server configs + local lsp = require('lspconfig') - -- cmp Config + -- vue + lsp.volar.setup({ + capabilities = capabilities, + }) - local cmp = require('cmp') - local cmp_action = require('lsp-zero').cmp_action() + -- typescript / javascript + require'lspconfig'.ts_ls.setup{ + capabilities = capabilities, + init_options = { + plugins = { + { + name = "@vue/typescript-plugin", + location = "", + languages = {"javascript", "typescript", "vue"}, + }, + }, + }, + filetypes = { "javascript", "javascriptreact", "javascript.jsx", "typescript", "typescriptreact", "typescript.tsx", "vue" } + } - cmp.setup({ - sources = { - {name = 'path'}, - {name = 'nvim_lsp'}, - {name = 'nvim_lua'}, - {name = 'luasnip'}, - {name = 'cmp_luasnip'}, - {name = 'buffer'}, - {name = 'neorg'} + -- eslint + lsp.eslint.setup({ + capabilities = capabilities, + }) + + -- tailwind + lsp.tailwindcss.setup({ + capabilities = capabilities, + root_dir = lsp.util.root_pattern('tailwind.config.js', 'tailwind.config.cjs', 'tailwind.config.mjs', 'tailwind.config.ts') + }) + + -- html + lsp.html.setup({ + capabilities = capabilities, + }) + + -- go + lsp.gopls.setup({ + capabilities = capabilities, + settings = { + gopls = { + usePlaceholders = true, + } + } + }) + lsp.golangci_lint_ls.setup({ + capabilities = capabilities, + }) + + -- templ + vim.filetype.add({ extension = { templ = "templ" } }) + lsp.templ.setup({ + capabilities = capabilities, + }) + + lsp.lua_ls.setup({ + capabilities = capabilities, + }) + + lsp.nil_ls.setup({ + capabilities = capabilities, + }) + end, + }, + { + 'hrsh7th/nvim-cmp', + event = 'InsertEnter', + dependencies = { + { + 'L3MON4D3/LuaSnip', + build = (function() + -- Build Step is needed for regex support in snippets. + -- This step is not supported in many windows environments. + -- Remove the below condition to re-enable on windows. + if vim.fn.has 'win32' == 1 or vim.fn.executable 'make' == 0 then + return + end + return 'make install_jsregexp' + end)(), + dependencies = { + { + 'rafamadriz/friendly-snippets', + config = function() + require('luasnip.loaders.from_vscode').lazy_load() + end, + }, + }, }, - window = { - completion = cmp.config.window.bordered(), - documentation = cmp.config.window.bordered(), - }, - formatting = { - fields = {'abbr', 'kind', 'menu'}, - format = require('lspkind').cmp_format({ - mode = 'symbol', -- show only symbol annotations - maxwidth = 50, -- prevent the popup from showing more than provided characters - ellipsis_char = '...', -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead - }) - }, - mapping = cmp.mapping.preset.insert({ - [''] = cmp.mapping.confirm({select = false}), - -- scroll up and down the documentation window - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - -- [''] = cmp_action.luasnip_supertab(), - -- [''] = cmp_action.luasnip_shift_supertab(), - }), - }) + 'saadparwaiz1/cmp_luasnip', + 'hrsh7th/cmp-nvim-lsp', + 'hrsh7th/cmp-path', + }, + config = function() + -- See `:help cmp` + local cmp = require 'cmp' + local luasnip = require 'luasnip' + luasnip.config.setup {} - -- Server configs - local lsp = require('lspconfig') - - -- vue - lsp.volar.setup({}) - - -- typescript / javascript - require'lspconfig'.tsserver.setup{ - filetypes = { "javascript", "javascriptreact", "javascript.jsx", "typescript", "typescriptreact", "typescript.tsx", "vue" } - } - - -- eslint - lsp.eslint.setup({}) - - -- tailwind - lsp.tailwindcss.setup({ - root_dir = lsp.util.root_pattern('tailwind.config.js', 'tailwind.config.cjs', 'tailwind.config.mjs', 'tailwind.config.ts') - }) - - -- html - lsp.html.setup({}) - - -- go - lsp.gopls.setup({}) - lsp.golangci_lint_ls.setup{} - - -- templ - vim.filetype.add({ extension = { templ = "templ" } }) - lsp.templ.setup{} - - end, + cmp.setup { + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) + end, + }, + completion = { completeopt = 'menu,menuone,noinsert' }, + mapping = cmp.mapping.preset.insert { + [''] = cmp.mapping.select_next_item(), + [''] = cmp.mapping.select_prev_item(), + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping.confirm { select = true }, + [''] = cmp.mapping.complete {}, + [''] = cmp.mapping(function() + if luasnip.expand_or_locally_jumpable() then + luasnip.expand_or_jump() + end + end, { 'i', 's' }), + [''] = cmp.mapping(function() + if luasnip.locally_jumpable(-1) then + luasnip.jump(-1) + end + end, { 'i', 's' }), + }, + sources = { + { + name = 'lazydev', + -- set group index to 0 to skip loading LuaLS completions as lazydev recommends it + group_index = 0, + }, + { name = 'nvim_lsp' }, + { name = 'luasnip' }, + { name = 'path' }, + }, + } + end, + }, + { + 'nvim-tree/nvim-web-devicons', + } } diff --git a/modules/home-manager/neovim/nvim/lua/plugins/luasnip.lua b/modules/home-manager/neovim/nvim/lua/plugins/luasnip.lua deleted file mode 100644 index 0a31f6a..0000000 --- a/modules/home-manager/neovim/nvim/lua/plugins/luasnip.lua +++ /dev/null @@ -1,12 +0,0 @@ -return { - "L3MON4D3/LuaSnip", - dependencies = { "rafamadriz/friendly-snippets" }, - -- follow latest release. - version = "v2.*", -- Replace by the latest released major (first number of latest release) - -- install jsregexp (optional!). - build = "make install_jsregexp", - config = function () - require('luasnip.loaders.from_vscode').lazy_load() - end - -} diff --git a/modules/home-manager/neovim/nvim/lua/plugins/mini.lua b/modules/home-manager/neovim/nvim/lua/plugins/mini.lua index b7ee8b0..21699ba 100644 --- a/modules/home-manager/neovim/nvim/lua/plugins/mini.lua +++ b/modules/home-manager/neovim/nvim/lua/plugins/mini.lua @@ -1,5 +1,6 @@ return { -- Collection of various small independent plugins/modules 'echasnovski/mini.nvim', + version = false, config = function() local keymap = vim.keymap.set @@ -14,17 +15,37 @@ return { -- Collection of various small independent plugins/modules return '%2l:%-2v' end + require('mini.basics').setup({ + options = { + extra_ui = true, + win_borders = "bold" + } + }) + require('mini.comment').setup() - require('mini.icons').setup() + -- local icons = require('mini.icons') + -- icons.setup() + -- icons.tweak_lsp_kind() - require('mini.cursorword').setup() + require('mini.indentscope').setup({ + draw = { + delay = 0, + animation = require('mini.indentscope').gen_animation.none() + } + }) + + require('mini.diff').setup() require('mini.extra').setup() - files = require('mini.files') + require('mini.jump').setup() + + require('mini.jump2d').setup() + + local files = require('mini.files') files.setup() - keymap("n", "fe", files.open, { noremap = true, silent = true }) + keymap("n", "fe", function() files.open(vim.api.nvim_buf_get_name(0)) end, { noremap = true, silent = true }) require('mini.git').setup() @@ -53,10 +74,43 @@ return { -- Collection of various small independent plugins/modules keymap("n", "ff", pick.builtin.files, { noremap = true, silent = true }) keymap("n", "fg", pick.builtin.grep_live, { noremap = true, silent = true }) keymap("n", "fwg", function() - local wrd = vim.fn.expand("") + local wrd = vim.fn.expand("") pick.builtin.grep_live({ pattern = wrd }) end, { noremap = true, silent = true }) + -- require('mini.base16').setup({ + -- palette = { + -- base00 = "#303446", + -- base01 = "#292c3c", + -- base02 = "#414559", + -- base03 = "#51576d", + -- base04 = "#626880", + -- base05 = "#c6d0f5", + -- base06 = "#f2d5cf", + -- base07 = "#babbf1", + -- base08 = "#e78284", + -- base09 = "#ef9f76", + -- base0A = "#e5c890", + -- base0B = "#a6d189", + -- base0C = "#81c8be", + -- base0D = "#8caaee", + -- base0E = "#ca9ee6", + -- base0F = "#eebebe", + -- } + -- }) + -- + -- require('mini.hues').setup({ + -- foreground = '#fbf7f0', + -- background = '#000000', + -- n_hues = 4, + -- accent = 'bg', + -- saturation = 'high' + -- }) + -- require('mini.completion').setup() + + require('mini.splitjoin').setup() + + require('mini.trailspace').setup() end, } diff --git a/modules/home-manager/neovim/nvim/lua/plugins/neorg.lua b/modules/home-manager/neovim/nvim/lua/plugins/neorg.lua deleted file mode 100644 index 8051692..0000000 --- a/modules/home-manager/neovim/nvim/lua/plugins/neorg.lua +++ /dev/null @@ -1,43 +0,0 @@ -return { - "nvim-neorg/neorg", - lazy = false, - version = "*", - config = function() - require("neorg").setup({ - load = { - ["core.defaults"] = {}, - ["core.completion"] = { config = { engine = "nvim-cmp", name = "[Neorg]" } }, - ["core.integrations.nvim-cmp"] = {}, - ["core.concealer"] = {}, - ["core.keybinds"] = { - config = { - default_keybinds = true, - }, - }, - ["core.dirman"] = { - config = { - workspaces = { - notes = "~/notes", - } - } - }, - ["core.esupports.metagen"] = { config = { type = "auto", update_date = true } }, - ["core.qol.toc"] = {}, - ["core.qol.todo_items"] = {}, - ["core.looking-glass"] = {}, - ["core.presenter"] = { config = { zen_mode = "zen-mode" } }, - ["core.export"] = {}, - ["core.export.markdown"] = { config = { extensions = "all" } }, - ["core.summary"] = {}, - ["core.tangle"] = { config = { report_on_empty = false } }, - ["core.ui.calendar"] = {}, - ["core.journal"] = { - config = { - strategy = "flat", - workspace = "notes", - }, - }, - }, - }) - end, -} diff --git a/modules/home-manager/neovim/nvim/lua/plugins/nvim-ts-autotag.lua b/modules/home-manager/neovim/nvim/lua/plugins/nvim-ts-autotag.lua deleted file mode 100644 index 2981246..0000000 --- a/modules/home-manager/neovim/nvim/lua/plugins/nvim-ts-autotag.lua +++ /dev/null @@ -1,3 +0,0 @@ -return { - 'windwp/nvim-ts-autotag', -} diff --git a/modules/home-manager/neovim/nvim/lua/plugins/oxocarbon.lua b/modules/home-manager/neovim/nvim/lua/plugins/oxocarbon.lua new file mode 100644 index 0000000..7b23677 --- /dev/null +++ b/modules/home-manager/neovim/nvim/lua/plugins/oxocarbon.lua @@ -0,0 +1,7 @@ +return { + "shatur/neovim-ayu", + config = function() + require('ayu').setup({}) + vim.cmd.colorscheme "ayu" + end +} diff --git a/modules/home-manager/wezterm/default.nix b/modules/home-manager/wezterm/default.nix index a354ceb..5fa9976 100644 --- a/modules/home-manager/wezterm/default.nix +++ b/modules/home-manager/wezterm/default.nix @@ -5,7 +5,7 @@ enable = true; extraConfig = '' return { - color_scheme = 'catppuccin-frappe', + color_scheme = 'Ayu Dark (Gogh)', font = wezterm.font('Iosevka Nerd Font'), font_size = 16, use_fancy_tab_bar = false, @@ -27,7 +27,7 @@ top = 0, bottom = 0, }, - window_background_opacity = 0.90, + window_background_opacity = 1, macos_window_background_blur = 0, front_end = "WebGpu", }