diff --git a/completion.lua b/completion.lua index f94b568..7d142cb 100644 --- a/completion.lua +++ b/completion.lua @@ -21,12 +21,8 @@ autocmd CursorHold * lua vim.diagnostic.open_float(nil, { focusable = false }) vim.opt.spell = true vim.opt.spelllang = {'en_us'} vim.lsp.handlers["textDocument/publishDiagnostics"] = - vim.lsp.with( - vim.lsp.diagnostic.on_publish_diagnostics, - { - virtual_text = true, - } -) + vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, + {virtual_text = true}) -- Completion Plugin Setup local cmp = require 'cmp' cmp.setup({ @@ -56,7 +52,6 @@ cmp.setup({ {name = 'nvim_lsp_signature_help'}, -- display function signatures with current parameter emphasized {name = 'nvim_lua', keyword_length = 2}, -- complete neovim's Lua runtime API such vim.lsp.* {name = 'buffer', keyword_length = 2}, -- source current buffer - {name = 'vsnip', keyword_length = 2}, -- nvim-cmp source for vim-vsnip {name = 'calc'}, -- source for math calculation { name = 'spell', @@ -64,33 +59,34 @@ cmp.setup({ keep_all_entries = false, enable_in_context = function() return true end } - }, - {name = 'conventionalcommits', keyword_length = 1 }, - {name = 'crates'}, + }, {name = 'conventionalcommits', keyword_length = 1}, {name = 'crates'} }, window = { completion = cmp.config.window.bordered(), documentation = cmp.config.window.bordered() }, formatting = { - fields = {'menu', 'abbr', 'kind'}, + fields = {'menu', 'abbr' --[[ 'kind' ]] }, format = function(entry, item) local menu_icon = { nvim_lsp = 'Ξ»', vsnip = 'β‹—', - buffer = 'Ξ©', - path = 'πŸ“', - spell = 'πŸ’¬', - calc = '√', - crates = 'πŸ“¦', + buffer = '', + path = 'ο„•', + spell = 'ΒΆ', + calc = '√', + crates = '' } item.menu = menu_icon[entry.source.name] + if entry.source.name == "calc" then item.kind = "Math" end return item end } }) -cmp.setup.cmdline('/', { - sources = { - { name = 'buffer' }, - } +cmp.setup.cmdline('/', {sources = {{name = 'buffer'}}}) +cmp.setup.cmdline(':', { + mapping = cmp.mapping.preset.cmdline(), + sources = cmp.config.sources({{name = 'path'}}, { + {name = 'cmdline', option = {ignore_cmds = {'Man', '!'}}} + }) }) diff --git a/default.nix b/default.nix index b06f9a4..b55e033 100644 --- a/default.nix +++ b/default.nix @@ -55,6 +55,7 @@ in cmp-spell cmp-conventionalcommits cmp-calc + cmp-cmdline rustaceanvim lsp-inlayhints-nvim # https://github.com/mrcjkb/rustaceanvim/discussions/46#discussioncomment-7620822 plenary-nvim