From 16e2a07019a6eef285c9f10aff7caea5a98f71a1 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Sat, 20 Apr 2024 00:26:23 +0200 Subject: [PATCH] Use nvim cmp only on C-h --- flake.lock | 62 +++++++++---------- modules/common/ghostty.config | 4 -- modules/common/gtk.nix | 2 +- modules/misc/home.nix | 2 +- modules/misc/nvim/lazy-lock.json | 29 +++++---- modules/misc/nvim/lua/plugins/cmp.lua | 26 +++----- modules/misc/nvim/lua/plugins/colorscheme.lua | 2 +- modules/misc/nvim/lua/plugins/motions.lua | 15 +++-- 8 files changed, 62 insertions(+), 80 deletions(-) diff --git a/flake.lock b/flake.lock index 23a7e3a..809d178 100644 --- a/flake.lock +++ b/flake.lock @@ -196,11 +196,11 @@ "systems": "systems_2" }, "locked": { - "lastModified": 1701680307, - "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", "type": "github" }, "original": { @@ -252,11 +252,11 @@ "zls": "zls" }, "locked": { - "lastModified": 1713285560, - "narHash": "sha256-PlApALZSdBnRtXLk1XYksOzf47BU/V+vnIGjqrO1DmY=", + "lastModified": 1713483637, + "narHash": "sha256-TgtTMmVD1cRxeOgs/b47nv5GOhtveAHiNeE04ObkjAY=", "ref": "refs/heads/main", - "rev": "06c5528a59f61e61c7b8b21a51bb60a172ca7955", - "revCount": 5909, + "rev": "915e09367ad3284b7747b811225aba14e04e6da8", + "revCount": 5937, "type": "git", "url": "ssh://git@github.com/mitchellh/ghostty" }, @@ -316,11 +316,11 @@ ] }, "locked": { - "lastModified": 1713294767, - "narHash": "sha256-LmaabaQZdx52MPGKPRt9Opoc9Gd9RbwvCdysUUYQoXI=", + "lastModified": 1713539802, + "narHash": "sha256-aub7mcsDv5J6PcYNxcLUCIaNGNlInPCAYYoCA1x76oY=", "owner": "nix-community", "repo": "home-manager", - "rev": "fa8c16e2452bf092ac76f09ee1fb1e9f7d0796e7", + "rev": "1f305c363ecd7c6505f03fc7baba15505f3aa630", "type": "github" }, "original": { @@ -366,11 +366,11 @@ }, "locked": { "dir": "contrib", - "lastModified": 1713307949, - "narHash": "sha256-hfiUG/nGWaPnYdiDXVHagVLoezxflWHdKiAtghkIHYc=", + "lastModified": 1713476725, + "narHash": "sha256-OBDeB3+2hgWqABtqg+PwfjbWzL49dmJeG32qOEzhtUY=", "owner": "neovim", "repo": "neovim", - "rev": "2f371ad7d0294072d407bb05816425b5694d1935", + "rev": "13ebfafc958c6feb4d908eed913c6dc3c6f05b4e", "type": "github" }, "original": { @@ -391,11 +391,11 @@ ] }, "locked": { - "lastModified": 1713312222, - "narHash": "sha256-81xZFNHBLV8+oD3Q3SkesXFLh2U1UFeGQBLw75moOh4=", + "lastModified": 1713485028, + "narHash": "sha256-bl1EURik5le68rLBcHsfLKyPtEPlumhcA5kKOx88zkQ=", "owner": "nix-community", "repo": "neovim-nightly-overlay", - "rev": "542a3c18b471dbaaf8ffda27a65d3aa8e829a5e2", + "rev": "403633f6af2703c057707b31b1ca6bec00bdaaca", "type": "github" }, "original": { @@ -426,11 +426,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1712909959, - "narHash": "sha256-7/5ubuwdEbQ7Z+Vqd4u0mM5L2VMNDsBh54visp27CtQ=", + "lastModified": 1713521961, + "narHash": "sha256-EwR8wW9AqJhSIY+0oxWRybUZ32BVKuZ9bjlRh8SJvQ8=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "f58b25254be441cd2a9b4b444ed83f1e51244f1f", + "rev": "5d48925b815fd202781bfae8fb6f45c07112fdb2", "type": "github" }, "original": { @@ -449,11 +449,11 @@ ] }, "locked": { - "lastModified": 1713348128, - "narHash": "sha256-n+RMDvfxqLLxD4/I19wyYJQMbXct/4Sj5FDhVL2rff0=", + "lastModified": 1713528946, + "narHash": "sha256-IBQta+xrEaI2S5UmYrXcgV7Tu7rGLQu2V3TeJseLPSg=", "owner": "nix-community", "repo": "NixOS-WSL", - "rev": "fc58f5c486f8056bc5fd38488d5510ab5fd294b7", + "rev": "63c1247e12f269396ed2df8cdec3aed1f0f3928c", "type": "github" }, "original": { @@ -464,11 +464,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1713248628, - "narHash": "sha256-NLznXB5AOnniUtZsyy/aPWOk8ussTuePp2acb9U+ISA=", + "lastModified": 1713297878, + "narHash": "sha256-hOkzkhLT59wR8VaMbh1ESjtZLbGi+XNaBN6h49SPqEc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5672bc9dbf9d88246ddab5ac454e82318d094bb8", + "rev": "66adc1e47f8784803f2deb6cacd5e07264ec2d5c", "type": "github" }, "original": { @@ -511,11 +511,11 @@ }, "nixpkgs-zig-0-12": { "locked": { - "lastModified": 1712247214, - "narHash": "sha256-7PTw86NnE2nCQPf+PPI/kOKwmlbbTqUthYSz/nDnAoc=", + "lastModified": 1713479535, + "narHash": "sha256-PnquFNhs0vtXwHkKk44dmnrNTMMCQelgi8pS/DGh6Ks=", "owner": "vancluever", "repo": "nixpkgs", - "rev": "6726262c930716f601345b2c9d0c42ba069991b8", + "rev": "153458bf17bfeedd3ab8b9a3250ba1168135e8ae", "type": "github" }, "original": { @@ -595,11 +595,11 @@ ] }, "locked": { - "lastModified": 1711109355, - "narHash": "sha256-VZPO5mq2di5yjHkkY9ZGEIZaX7EtdusSkxICBAtHAec=", + "lastModified": 1713476117, + "narHash": "sha256-97U178Ob/D+EYiGMg/ne7je292ZLCghclhXiPfIfpdQ=", "owner": "mitchellh", "repo": "zig-overlay", - "rev": "5fe52bdf2c213e47712d93c9ce12dfed4c4cef86", + "rev": "8f336c6f54b57492ac1d8a7385a79fefac84b7dc", "type": "github" }, "original": { diff --git a/modules/common/ghostty.config b/modules/common/ghostty.config index 793c518..e561ef3 100644 --- a/modules/common/ghostty.config +++ b/modules/common/ghostty.config @@ -17,10 +17,6 @@ keybind = clear keybind = ctrl+shift+c=copy_to_clipboard keybind = ctrl+shift+v=paste_from_clipboard -keybind = alt+h=previous_tab -keybind = alt+l=next_tab -keybind = alt+t=new_tab - keybind = ctrl+plus=increase_font_size:1 keybind = ctrl+equal=increase_font_size:1 keybind = ctrl+minus=decrease_font_size:1 diff --git a/modules/common/gtk.nix b/modules/common/gtk.nix index 477ce11..e4d3628 100644 --- a/modules/common/gtk.nix +++ b/modules/common/gtk.nix @@ -16,7 +16,7 @@ qt = { enable = true; - platformTheme = "gtk"; + platformTheme.name = "gtk"; }; home.pointerCursor = { diff --git a/modules/misc/home.nix b/modules/misc/home.nix index 961f545..47bb102 100644 --- a/modules/misc/home.nix +++ b/modules/misc/home.nix @@ -61,7 +61,7 @@ bind-key -r f run-shell "tmux neww tmux-sessionizer" bind-key -r F run-shell "tmux-sessionizer ~/projects/flake" - bind-key -r H run-shell "tmux-sessionizer ~/projects/kyoo" + bind-key -r h run-shell "tmux-sessionizer ~/projects/kyoo" run-shell ${pkgs.tmuxPlugins.sensible.rtp} ''; diff --git a/modules/misc/nvim/lazy-lock.json b/modules/misc/nvim/lazy-lock.json index 0762a1f..b1b3f09 100644 --- a/modules/misc/nvim/lazy-lock.json +++ b/modules/misc/nvim/lazy-lock.json @@ -1,22 +1,21 @@ { - "LuaSnip": { "branch": "master", "commit": "be7be2ca7f55bb881a7ffc16b2efa5af034ab06b" }, "ReplaceWithRegister": { "branch": "master", "commit": "832efc23111d19591d495dc72286de2fb0b09345" }, - "SchemaStore.nvim": { "branch": "main", "commit": "8b9002aae3c284e20020966c8b33242251b079e7" }, + "SchemaStore.nvim": { "branch": "main", "commit": "f7cae6f1b38cb296f48ce1a9c5ed1a419d912a42" }, "auto-save.nvim": { "branch": "main", "commit": "213f92ad96e366f2bf95193a8948ed097faf810d" }, "blame.nvim": { "branch": "main", "commit": "20cf0918962fa2da787c4b25331f6024d1b1d808" }, "catppuccin": { "branch": "main", "commit": "a1439ad7c584efb3d0ce14ccb835967f030450fe" }, - "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-git": { "branch": "main", "commit": "b9603f18496bc3ca07e6bd474607081af709e750" }, "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, - "conform.nvim": { "branch": "master", "commit": "820eec990d5f332d30cf939954c8672a43a0459e" }, + "conform.nvim": { "branch": "master", "commit": "a6965ac128eba75537ec2bc5ddd5d5e357062bdc" }, "dressing.nvim": { "branch": "master", "commit": "18e5beb3845f085b6a33c24112b37988f3f93c06" }, "flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" }, "git-conflict.nvim": { "branch": "main", "commit": "4c8e252b87d54d944c1e56bfb477f78b6fdaf661" }, - "gitsigns.nvim": { "branch": "main", "commit": "d96ef3bbff0bdbc3916a220f5c74a04c4db033f2" }, + "gitsigns.nvim": { "branch": "main", "commit": "7e38f07cab0e5387f9f41e92474db174a63a4725" }, "harpoon": { "branch": "harpoon2", "commit": "0378a6c428a0bed6a2781d459d7943843f374bce" }, "increment-activator": { "branch": "master", "commit": "b49fc24094f93aa29a7592034b97095b709c3528" }, "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, - "lazy-lsp.nvim": { "branch": "master", "commit": "f9b68260ea89c3ccec4f80e0cc7f3774fce6f254" }, + "lazy-lsp.nvim": { "branch": "master", "commit": "19d2a4de3a57deed4aab304704c1f5e77454f4f3" }, "lazy.nvim": { "branch": "main", "commit": "31ddbea7c10b6920c9077b66c97951ca8682d5c8" }, "lsp_signature.nvim": { "branch": "master", "commit": "c6aeb2f1d2538bbdfdaab1664d9d4c3c75aa9db8" }, "lspkind.nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" }, @@ -31,29 +30,29 @@ "nui.nvim": { "branch": "main", "commit": "cbd2668414331c10039278f558630ed19b93e69b" }, "nvim-cmp": { "branch": "main", "commit": "ce16de5665c766f39c271705b17fff06f7bcb84f" }, "nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" }, - "nvim-lint": { "branch": "master", "commit": "4055dc856d5ac8f6b85748006fd8fa6457e086e8" }, - "nvim-lspconfig": { "branch": "master", "commit": "9266dc26862d8f3556c2ca77602e811472b4c5b8" }, + "nvim-lint": { "branch": "master", "commit": "f098232d70cebe90e27404928c9bc19ca7a5a7b5" }, + "nvim-lspconfig": { "branch": "master", "commit": "ed8b8a15acc441aec669f97d75f2c1f2ac8c8aa5" }, "nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" }, "nvim-pqf": { "branch": "main", "commit": "ba0e291cb5c0249838132e197dac082777bdc7d6" }, "nvim-scrollbar": { "branch": "main", "commit": "35f99d559041c7c0eff3a41f9093581ceea534e8" }, "nvim-surround": { "branch": "main", "commit": "a4e30d33add8a9743b4f518b3a788b3c8e5def71" }, - "nvim-treesitter": { "branch": "master", "commit": "2a95ff14764af20d32ec1edb27e11c38a84b9478" }, + "nvim-treesitter": { "branch": "master", "commit": "bc808622986b0ba8eb64780b94d30cdfbd7c6a9f" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "23b820146956b3b681c19e10d3a8bc0cbd9a1d4c" }, - "nvim-ts-context-commentstring": { "branch": "main", "commit": "734ebad31c81c6198dfe102aa23280937c937c42" }, + "nvim-ts-context-commentstring": { "branch": "main", "commit": "a6382f744f584bbf71d0a563af789af7190aabda" }, "nvim-type-fmt": { "branch": "main", "commit": "59ce3d837de63633801ba0b28ed88164e14d6b87" }, "nvim-web-devicons": { "branch": "master", "commit": "b3468391470034353f0e5110c70babb5c62967d3" }, - "oil.nvim": { "branch": "master", "commit": "e462a3446505185adf063566f5007771b69027a1" }, + "oil.nvim": { "branch": "master", "commit": "1f05774e1c2dbc1940104b5c950d5c7b65ec6e0b" }, "omnisharp-extended-lsp.nvim": { "branch": "main", "commit": "6e0aa6465f8fa8ac6c833f6ac4713adfee0202a0" }, "plenary.nvim": { "branch": "master", "commit": "8aad4396840be7fc42896e3011751b7609ca4119" }, "statuscol.nvim": { "branch": "0.10", "commit": "e9e4c30b68abe456d80a0b144149ebf3f4527ed8" }, "telescope-fzf-native.nvim": { "branch": "feature/69-prebuilt-release-binaries", "commit": "af1d3c6efa0124123272bba094a60e15682c9cd5" }, - "telescope.nvim": { "branch": "master", "commit": "4d4ade7f2b8f403e8816ca50c05ed16e259b21fb" }, + "telescope.nvim": { "branch": "master", "commit": "d00d9df48c00d8682c14c2b5da78bda7ef06b939" }, "todo-comments.nvim": { "branch": "main", "commit": "a7e39ae9e74f2c8c6dc4eea6d40c3971ae84752d" }, "trouble.nvim": { "branch": "main", "commit": "b9cf677f20bb2faa2dacfa870b084e568dca9572" }, - "undotree": { "branch": "master", "commit": "aa93a7e5890dbbebbc064cd22260721a6db1a196" }, + "undotree": { "branch": "master", "commit": "56c684a805fe948936cda0d1b19505b84ad7e065" }, "vim-helm": { "branch": "master", "commit": "86cc6766db60b8cc5731068d0c2111dee1f2b328" }, - "vim-illuminate": { "branch": "master", "commit": "305bf07b919ac526deb5193280379e2f8b599926" }, - "vim-lumen": { "branch": "master", "commit": "58a4ba8c7c674196bcc7e9220aa7b8c1ac800de6" }, + "vim-illuminate": { "branch": "master", "commit": "e522e0dd742a83506db0a72e1ced68c9c130f185" }, + "vim-lumen": { "branch": "master", "commit": "6864405e06a90d077b04b9f95faf3f9cd5ae7b10" }, "vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" }, "vim-wordmotion": { "branch": "master", "commit": "81d9bd298376ab0dc465c85d55afa4cb8d5f47a1" }, "virtcolumn.nvim": { "branch": "main", "commit": "2291fe12098f1541483e7ee4d0fa0835c1f028f6" }, diff --git a/modules/misc/nvim/lua/plugins/cmp.lua b/modules/misc/nvim/lua/plugins/cmp.lua index 93c6b5b..3292d49 100644 --- a/modules/misc/nvim/lua/plugins/cmp.lua +++ b/modules/misc/nvim/lua/plugins/cmp.lua @@ -1,22 +1,12 @@ return { - { - "L3MON4D3/LuaSnip", - event = "InsertEnter", - opts = { - history = true, - delete_check_events = "TextChanged", - }, - }, - { "hrsh7th/nvim-cmp", version = false, -- last release is way too old event = "InsertEnter", dependencies = { "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", + { "petertriho/cmp-git", opts = true }, "hrsh7th/cmp-path", - "LuaSnip", "onsails/lspkind.nvim", }, opts = function() @@ -24,19 +14,18 @@ return { return { snippet = { expand = function(args) - require("luasnip").lsp_expand(args.body) + vim.snippet.expand(args.body) end, }, mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }), - [""] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }), [""] = cmp.mapping.scroll_docs(-4), [""] = cmp.mapping.scroll_docs(4), [""] = cmp.mapping.complete(), [""] = cmp.mapping.abort(), - [""] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + [""] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. }), sources = cmp.config.sources({ + { name = "git" }, { name = "nvim_lsp" }, { name = "path" }, }), @@ -47,24 +36,23 @@ return { }, window = { completion = { - winhighlight = "Normal:Pmenu,FloatBorder:Pmenu,Search:None", + -- winhighlight = "Normal:Pmenu,FloatBorder:Pmenu,Search:None", col_offset = -3, side_padding = 0, }, }, formatting = { - fields = { "kind", "abbr", "menu" }, + fields = { "kind", "abbr" }, format = function(entry, vim_item) local kind = require("lspkind").cmp_format({ mode = "symbol_text", maxwidth = 50 })(entry, vim_item) local strings = vim.split(kind.kind, "%s", { trimempty = true }) kind.kind = " " .. (strings[1] or "") .. " " - kind.menu = " (" .. (strings[2] or "") .. ")" return kind end, }, experimental = { - ghost_text = true, + ghost_text = false, }, } end, diff --git a/modules/misc/nvim/lua/plugins/colorscheme.lua b/modules/misc/nvim/lua/plugins/colorscheme.lua index 53c06ab..29811f4 100644 --- a/modules/misc/nvim/lua/plugins/colorscheme.lua +++ b/modules/misc/nvim/lua/plugins/colorscheme.lua @@ -28,7 +28,7 @@ return { }, illuminate = true, }, - custom_highlights = function (colors) + custom_highlights = function(colors) return { FlashLabel = { fg = colors.red }, NotCommitedBlame = { fg = "DimGray" }, diff --git a/modules/misc/nvim/lua/plugins/motions.lua b/modules/misc/nvim/lua/plugins/motions.lua index 4535216..070dd07 100644 --- a/modules/misc/nvim/lua/plugins/motions.lua +++ b/modules/misc/nvim/lua/plugins/motions.lua @@ -27,17 +27,16 @@ return { "ThePrimeagen/harpoon", branch = "harpoon2", keys = { - { "a", 'lua require("harpoon"):list():append()', desc = "Mark file" }, + { "a", 'lua require("harpoon"):list():add()', desc = "Mark file" }, { "h", 'lua require("harpoon").ui:toggle_quick_menu(require("harpoon"):list())', desc = "Harpoon menu" }, - { "", 'lua require("harpoon"):list():select(1)', desc = "Navigate to harpoon 1" }, - { "", 'lua require("harpoon"):list():select(2)', desc = "Navigate to harpoon 2" }, - { "", 'lua require("harpoon"):list():select(3)', desc = "Navigate to harpoon 3" }, - { "", 'lua require("harpoon"):list():select(4)', desc = "Navigate to harpoon 4" }, + { "", 'lua require("harpoon"):list():select(1)', desc = "Navigate to harpoon 1" }, + { "", 'lua require("harpoon"):list():select(2)', desc = "Navigate to harpoon 2" }, + { "", 'lua require("harpoon"):list():select(3)', desc = "Navigate to harpoon 3" }, + { "", 'lua require("harpoon"):list():select(4)', desc = "Navigate to harpoon 4" }, -- is not a valid sequence so use HJKL instead. - { "", 'lua require("harpoon"):list():select(1)', desc = "Navigate to harpoon 1" }, - { "", 'lua require("harpoon"):list():select(2)', desc = "Navigate to harpoon 2" }, - { "", 'lua require("harpoon"):list():select(3)', desc = "Navigate to harpoon 3" }, + { "", 'lua require("harpoon"):list():select(2)', desc = "Navigate to harpoon 2" }, + { "", 'lua require("harpoon"):list():select(3)', desc = "Navigate to harpoon 3" }, -- is already taken but since I use harpoon less on querty no worry }, config = function(_, opts)