diff --git a/config/completion/cmp.nix b/config/completion/cmp.nix index 760e4df..dcc10ac 100644 --- a/config/completion/cmp.nix +++ b/config/completion/cmp.nix @@ -1,115 +1,77 @@ { plugins = { - nvim-cmp = { + cmp-nvim-lsp = {enable = true;}; # lsp + cmp-buffer = {enable = true;}; + copilot-cmp = {enable = true;}; # copilot suggestions + cmp-path = {enable = true;}; # file system paths + cmp_luasnip = {enable = true;}; # snippets + cmp-cmdline = {enable = false;}; # autocomplete for cmdline + cmp = { enable = true; autoEnableSources = true; - experimental = { - ghost_text = true; - }; - performance = { - debounce = 60; - fetchingTimeout = 200; - maxViewEntries = 30; - }; - snippet = { - expand = "luasnip"; - }; - formatting = { - fields = ["kind" "abbr" "menu"]; - expandableIndicator = true; - }; - window = { - completion = { - border = "rounded"; - winhighlight = "Normal:Normal,FloatBorder:FloatBorder,CursorLine:Visual,Search:None"; - }; - documentation = { - border = "rounded"; + extraOptions = { + experimental = { + ghost_text = true; }; }; - sources = [ - { - name = "nvim_lsp"; # lsp - } - { - name = "buffer"; # text within current buffer - option.get_bufnrs.__raw = "vim.api.nvim_list_bufs"; - keywordLength = 3; - } - { - name = "copilot"; # copilot suggestions - } - { - name = "path"; # file system paths - keywordLength = 3; - } - { - name = "luasnip"; # snippets - keywordLength = 3; - } - ]; + settings = { + # FIX: Fix error in mappings that's breaking Neve - mapping = { - "" = { - modes = ["i" "s"]; - action = '' - function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - else - fallback() - end - end - ''; - }; - "" = { - modes = ["i" "s"]; - action = '' - function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end + mapping = { + __raw = '' + cmp.mapping.preset.insert({ + [''] = cmp.mapping.select_next_item(), + [''] = cmp.mapping.select_prev_item(), + [''] = cmp.mapping.abort(), + + [''] = cmp.mapping.scroll_docs(-4), + + [''] = cmp.mapping.scroll_docs(4), + + [''] = cmp.mapping.complete(), + + [''] = cmp.mapping.confirm({ select = true }), + + [''] = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true }), + }) ''; }; - "" = { - action = "cmp.mapping.select_next_item()"; - }; - "" = { - action = "cmp.mapping.select_prev_item()"; + snippet = { + expand = "function(args) require('luasnip').lsp_expand(args.body) end"; }; - "" = { - action = "cmp.mapping.abort()"; - }; - "" = { - action = "cmp.mapping.scroll_docs(-4)"; - }; - "" = { - action = "cmp.mapping.scroll_docs(4)"; + sources = { + __raw = '' + cmp.config.sources({ + {name = 'nvim_lsp'}, + {name = 'copilot'}, + {name = 'path'}, + {name = 'luasnip'}, + {name = 'cmdline'}, + }, { + {name = 'buffer'}, + }) + ''; }; - "" = { - action = "cmp.mapping.complete()"; + performance = { + debounce = 60; + fetching_timeout = 200; + max_view_entries = 30; }; - "" = { - action = "cmp.mapping.confirm({ select = true })"; + window = { + completion = { + border = "rounded"; + winhighlight = "Normal:Normal,FloatBorder:FloatBorder,CursorLine:Visual,Search:None"; + }; + documentation = { + border = "rounded"; + }; }; - "" = { - action = "cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true })"; + formatting = { + fields = ["kind" "abbr" "menu"]; + expandable_indicator = true; }; }; }; - cmp-nvim-lsp = {enable = true;}; # lsp - cmp-buffer = {enable = true;}; - copilot-cmp = {enable = true;}; # copilot suggestions - cmp-path = {enable = true;}; # file system paths - cmp_luasnip = {enable = true;}; # snippets - cmp-cmdline = {enable = false;}; # autocomplete for cmdline }; extraConfigLua = '' luasnip = require("luasnip") diff --git a/config/git/neogit.nix b/config/git/neogit.nix index 026d1f0..a39a9ea 100644 --- a/config/git/neogit.nix +++ b/config/git/neogit.nix @@ -1,7 +1,6 @@ { plugins.neogit = { enable = true; - disableBuiltinNotifications = true; }; keymaps = [ { diff --git a/config/lsp/trouble.nix b/config/lsp/trouble.nix index 0d24973..783aa08 100644 --- a/config/lsp/trouble.nix +++ b/config/lsp/trouble.nix @@ -1,8 +1,11 @@ { plugins.trouble = { enable = true; - autoClose = true; + settings = { + auto_close = true; + }; }; + # TODO: Add keybinds to close trouble (q would be nice), rn I need to use :x to close it... keymaps = [ { mode = "n"; diff --git a/config/none-ls/none-ls.nix b/config/none-ls/none-ls.nix index 4991b0d..5eaaf6d 100644 --- a/config/none-ls/none-ls.nix +++ b/config/none-ls/none-ls.nix @@ -29,12 +29,6 @@ statix = { enable = true; }; - luacheck = { - enable = true; - }; - flake8 = { - enable = true; - }; }; formatting = { alejandra = { @@ -51,9 +45,6 @@ google_java_format = { enable = true; }; - rustfmt = { - enable = true; - }; stylua = { enable = true; }; @@ -65,9 +56,6 @@ } ''; }; - jq = { - enable = true; - }; }; }; }; diff --git a/config/telescope/telescope.nix b/config/telescope/telescope.nix index 29585d1..825c96c 100644 --- a/config/telescope/telescope.nix +++ b/config/telescope/telescope.nix @@ -17,18 +17,6 @@ }; undo = { enable = true; - mappings = { - i = { - "" = "yank_additions"; - "" = "yank_deletions"; - "" = "restore"; - }; - n = { - "y" = "yank_additions"; - "Y" = "yank_deletions"; - "u" = "restore"; - }; - }; }; }; # If you'd prefer Telescope not to enter a normal-like mode when hitting escape (and instead exiting), you can map to do so via: @@ -47,95 +35,95 @@ keymaps = { "" = { action = "find_files, {}"; - desc = "Find project files"; + options.desc = "Find project files"; }; "/" = { action = "live_grep"; - desc = "Grep (root dir)"; + options.desc = "Grep (root dir)"; }; ":" = { action = "command_history, {}"; - desc = "Command History"; + options.desc = "Command History"; }; "b" = { action = "buffers, {}"; - desc = "+buffer"; + options.desc = "+buffer"; }; "ff" = { action = "find_files, {}"; - desc = "Find project files"; + options.desc = "Find project files"; }; "fr" = { action = "oldfiles, {}"; - desc = "Recent"; + options.desc = "Recent"; }; "fb" = { action = "buffers, {}"; - desc = "Buffers"; + options.desc = "Buffers"; }; "" = { action = "git_files, {}"; - desc = "Search git files"; + options.desc = "Search git files"; }; "gc" = { action = "git_commits, {}"; - desc = "Commits"; + options.desc = "Commits"; }; "gs" = { action = "git_status, {}"; - desc = "Status"; + options.desc = "Status"; }; "sa" = { action = "autocommands, {}"; - desc = "Auto Commands"; + options.desc = "Auto Commands"; }; "sb" = { action = "current_buffer_fuzzy_find, {}"; - desc = "Buffer"; + options.desc = "Buffer"; }; "sc" = { action = "command_history, {}"; - desc = "Command History"; + options.desc = "Command History"; }; "sC" = { action = "commands, {}"; - desc = "Commands"; + options.desc = "Commands"; }; "sD" = { action = "diagnostics, {}"; - desc = "Workspace diagnostics"; + options.desc = "Workspace diagnostics"; }; "sh" = { action = "help_tags, {}"; - desc = "Help pages"; + options.desc = "Help pages"; }; "sH" = { action = "highlights, {}"; - desc = "Search Highlight Groups"; + options.desc = "Search Highlight Groups"; }; "sk" = { action = "keymaps, {}"; - desc = "Keymaps"; + options.desc = "Keymaps"; }; "sM" = { action = "man_pages, {}"; - desc = "Man pages"; + options.desc = "Man pages"; }; "sm" = { action = "marks, {}"; - desc = "Jump to Mark"; + options.desc = "Jump to Mark"; }; "so" = { action = "vim_options, {}"; - desc = "Options"; + options.desc = "Options"; }; "sR" = { action = "resume, {}"; - desc = "Resume"; + options.desc = "Resume"; }; "uC" = { action = "colorscheme, {}"; - desc = "Colorscheme preview"; + options.desc = "Colorscheme preview"; }; }; };