From 8f7ae28a488e3c8a3118b3d0975d152ad4ebc60b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Dudr?= Date: Wed, 8 Feb 2023 00:23:39 +0100 Subject: [PATCH] nvim: colors, lazy, lsp --- dot_config/nvim/lua/configs/keys.lua | 29 +++- dot_config/nvim/lua/configs/options.lua | 3 +- .../nvim/lua/configs/packages/colors.lua | 145 ++++-------------- .../nvim/lua/configs/packages/gitsigns.lua | 1 + dot_config/nvim/lua/configs/packages/lsp.lua | 88 ++++++++++- dot_config/nvim/lua/configs/packages/misc.lua | 37 +++-- .../nvim/lua/configs/packages/neotree.lua | 2 +- .../nvim/lua/configs/packages/null-ls.lua | 67 ++++---- .../nvim/lua/configs/packages/nvim-cmp.lua | 21 ++- .../nvim/lua/configs/packages/telescope.lua | 19 +-- 10 files changed, 215 insertions(+), 197 deletions(-) diff --git a/dot_config/nvim/lua/configs/keys.lua b/dot_config/nvim/lua/configs/keys.lua index 231ce5c..69ee6f1 100644 --- a/dot_config/nvim/lua/configs/keys.lua +++ b/dot_config/nvim/lua/configs/keys.lua @@ -1,7 +1,21 @@ local M = {} +local function toggle_win_opt(name) + local newval = not vim.api.nvim_win_get_option(0, name) + vim.api.nvim_win_set_option( + 0, + name, + newval + ) + if newval then + vim.notify(name .. ' is on') + else + vim.notify(name .. ' is off') + end +end + function M.setup() - -- scroll up and down with shift+arrow + -- scroll up and down with shift+arrow {{ vim.keymap.set('n', '', '') vim.keymap.set('n', '', '') --}}} @@ -9,12 +23,13 @@ function M.setup() vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to next diagnostic' }) vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to prev diagnostic' }) vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Diagnostic to loclist' }) - vim.keymap.set('n', 'n', "'Nn'[v:searchforward]", { expr = true, desc = 'Next search result' }) - vim.keymap.set('x', 'n', "'Nn'[v:searchforward]", { expr = true, desc = 'Next search result' }) - vim.keymap.set('o', 'n', "'Nn'[v:searchforward]", { expr = true, desc = 'Next search result' }) - vim.keymap.set('n', 'N', "'nN'[v:searchforward]", { expr = true, desc = 'Prev search result' }) - vim.keymap.set('x', 'N', "'nN'[v:searchforward]", { expr = true, desc = 'Prev search result' }) - vim.keymap.set('o', 'N', "'nN'[v:searchforward]", { expr = true, desc = 'Prev search result' }) + + vim.keymap.set({ 'n', 'x', 'o' }, 'n', "'Nn'[v:searchforward]", { expr = true, desc = 'Next search result' }) + vim.keymap.set({ 'n', 'x', 'o' }, 'N', "'nN'[v:searchforward]", { expr = true, desc = 'Prev search result' }) + + vim.keymap.set('n', 'ow', function() toggle_win_opt('wrap') end, { desc = 'Toggle wrap' }) + vim.keymap.set('n', 'on', function() toggle_win_opt('number') end, { desc = 'Toggle number' }) + vim.keymap.set('n', 'or', function() toggle_win_opt('relativenumber') end, { desc = 'Toggle relativenumber' }) end return M diff --git a/dot_config/nvim/lua/configs/options.lua b/dot_config/nvim/lua/configs/options.lua index 4d9ea57..92ef3b2 100644 --- a/dot_config/nvim/lua/configs/options.lua +++ b/dot_config/nvim/lua/configs/options.lua @@ -60,7 +60,7 @@ function M.setup() vim.api.nvim_create_autocmd('FileType', { - pattern = { 'qf', 'man', 'help' }, + pattern = { 'qf', 'man', 'help', 'tsplayground' }, callback = function(args) local buf = args.buf local bo = vim.bo[buf] @@ -75,7 +75,6 @@ function M.setup() if vim.bo[buf].filetype ~= 'qf' then vim.wo.statusline = '%Y %f%=%l:%v %P' end - end }) diff --git a/dot_config/nvim/lua/configs/packages/colors.lua b/dot_config/nvim/lua/configs/packages/colors.lua index 1972ede..40e3723 100644 --- a/dot_config/nvim/lua/configs/packages/colors.lua +++ b/dot_config/nvim/lua/configs/packages/colors.lua @@ -5,114 +5,6 @@ local M = { } function M.config() - - local function normalizeTSHighlight() --- {{{ - -- helper {{{ - local hl = function(group, opts) - if (opts.default == nil) then - opts.default = true - end - vim.api.nvim_set_hl(0, group, opts) - end - -- }}} - -- Misc {{{ - hl('@comment', { link = 'Comment' }) - hl('@none', { bg = 'NONE', fg = 'NONE' }) - hl('@preproc', { link = 'PreProc' }) - hl('@define', { link = 'Define' }) - hl('@operator', { link = 'Operator' }) - -- }}} - -- Punctuation {{{ - hl('@punctuation.delimiter', { link = 'Delimiter' }) - hl('@punctuation.bracket', { link = 'Delimiter' }) - hl('@punctuation.special', { link = 'Delimiter' }) - -- }}} - -- Literals {{{ - hl('@string', { link = 'String' }) - hl('@string.regex', { link = 'String' }) - hl('@string.escape', { link = 'SpecialChar' }) - hl('@string.special', { link = 'SpecialChar' }) - - hl('@character', { link = 'Character' }) - hl('@character.special', { link = 'SpecialChar' }) - - hl('@boolean', { link = 'Boolean' }) - hl('@number', { link = 'Number' }) - hl('@float', { link = 'Float' }) - -- }}} - -- Functions {{{ - hl('@function', { link = 'Function' }) - hl('@function.call', { link = 'Function' }) - hl('@function.builtin', { link = 'Special' }) - hl('@function.macro', { link = 'Macro' }) - - hl('@method', { link = 'Function' }) - hl('@method.call', { link = 'Function' }) - - hl('@constructor', { link = 'Special' }) - hl('@parameter', { link = 'Identifier' }) - -- }}} - -- Keywords {{{ - hl('@keyword', { link = 'Keyword' }) - hl('@keyword.function', { link = 'Keyword' }) - hl('@keyword.operator', { link = 'Keyword' }) - hl('@keyword.return', { link = 'Keyword' }) - - hl('@conditional', { link = 'Conditional' }) - hl('@repeat', { link = 'Repeat' }) - hl('@debug', { link = 'Debug' }) - hl('@label', { link = 'Label' }) - hl('@include', { link = 'Include' }) - hl('@exception', { link = 'Exception' }) - -- }}} - -- Types {{{ - hl('@type', { link = 'Type' }) - hl('@type.builtin', { link = 'Type' }) - hl('@type.qualifier', { link = 'Keyword' }) -- protected, public & friends - hl('@type.definition', { link = 'Typedef' }) - - hl('@storageclass', { link = 'StorageClass' }) - hl('@attribute', { link = 'PreProc' }) - hl('@field', { link = 'Identifier' }) - hl('@property', { link = 'Identifier' }) - -- }}} - -- Identifiers {{{ - hl('@variable', { link = 'Identifier' }) - hl('@variable.builtin', { link = 'Identifier' }) - - hl('@constant', { link = 'Constant' }) - hl('@constant.builtin', { link = 'Special' }) - hl('@constant.macro', { link = 'Define' }) - - hl('@namespace', { link = 'Include' }) - hl('@symbol', { link = 'Identifier' }) - -- }}} - -- Text {{{ - hl('@text', {}) - hl('@text.strong', { bold = true }) - hl('@text.emphasis', { italic = true }) - hl('@text.underline', { underline = true }) - hl('@text.strike', { strikethrough = true }) - hl('@text.title', { link = 'Title' }) - hl('@text.literal', { link = 'String' }) - hl('@text.uri', { link = 'Underlined' }) - hl('@text.math', { link = 'Special' }) - hl('@text.environment', { link = 'Macro' }) - hl('@text.environment.name', { link = 'Type' }) - hl('@text.reference', { link = 'Constant' }) - - hl('@text.todo', { link = 'Todo' }) - hl('@text.note', { link = 'SpecialComment' }) - hl('@text.warning', { link = 'WarningMsg' }) - hl('@text.danger', { link = 'ErrorMsg' }) - -- }}} - -- Tags {{{ - hl('@tag', { link = 'Tag' }) - hl('@tag.attribute', { link = 'Identifier' }) - hl('@tag.delimiter', { link = 'Delimiter' }) - -- }}} - end -- }}} - local function normalizeTerminal() -- {{{ vim.g.terminal_color_0 = 0 vim.g.terminal_color_1 = 1 @@ -170,6 +62,16 @@ function M.config() vim.api.nvim_set_hl(0, hl, { link = to }) end + local function normalizeTSHighlight() --- {{{ + link('@class', 'Type') + link('@interface', 'Type') + link('@namespace', 'Type') + link('@event', 'Type') + + link('@type.qualifier', 'Keyword') + link('@storageclass', 'Keyword') + end -- }}} + local function normalizeTroubleHighlight() -- {{{ copyFg('TroubleText', 'Normal') copyFg('TroubleFoldIcon', 'CursorLineNr') @@ -236,19 +138,28 @@ function M.config() link('CmpItemAbbrMatch', 'GruvboxAquaBold') link('CmpItemAbbrMatchFuzzy', 'GruvboxAquaBold') - link('WhiteSpace', 'GruvboxBg3') -- make it more bright + link('FloatBorder', 'GruvBoxFg1') - gr:hl('LineNr', 'gray', 'dark0_hard', { 'underdotted' }) - gr:hl('LspCodeLens', 'gray', nil, { 'italic' }) + link('NonText', 'GruvboxBg3') -- make it more bright - gr:hl('IndentBlanklineContextChar', 'orange', nil, { 'nocombine' }) + local linenr_style = { 'underdotted' } + if vim.fn.has('nvim-0.9') then + linenr_style = {} + end - gr:hl('DiagnosticVirtualTextError', 'error', nil, { 'italic' }) - gr:hl('DiagnosticVirtualTextWarn', 'warn', nil, { 'italic' }) - gr:hl('DiagnosticVirtualTextInfo', 'info', nil, { 'italic' }) - gr:hl('DiagnosticVirtualTextHint', 'hint', nil, { 'italic' }) + gr:hl('LineNr', 'gray', 'dark0_hard', linenr_style) + gr:hl('LspCodeLens', 'gray', nil, { 'italic', }) - end + gr:hl('IndentBlanklineContextChar', 'orange', nil, { 'nocombine', }) + + gr:hl('DiagnosticVirtualTextError', 'error', nil, { 'italic', }) + gr:hl('DiagnosticVirtualTextWarn', 'warn', nil, { 'italic', }) + gr:hl('DiagnosticVirtualTextInfo', 'info', nil, { 'italic', }) + gr:hl('DiagnosticVirtualTextHint', 'hint', nil, { 'italic', }) + + -- gr:hl('GitSignsAddLine', nil, 'faded_green', {}) + -- vim.fn.sign_define('GitSignsAdd', { text = '│', texthl = 'GitSignsAdd', linehl = 'GitSignsAddLine', culhl='CursorLine' }) + end, }) vim.api.nvim_create_autocmd('ColorschemePre', { diff --git a/dot_config/nvim/lua/configs/packages/gitsigns.lua b/dot_config/nvim/lua/configs/packages/gitsigns.lua index 6d3951f..5d5b946 100644 --- a/dot_config/nvim/lua/configs/packages/gitsigns.lua +++ b/dot_config/nvim/lua/configs/packages/gitsigns.lua @@ -1,6 +1,7 @@ return { 'lewis6991/gitsigns.nvim', dependencies = { 'nvim-lua/plenary.nvim' }, + event = 'VeryLazy', opts = { on_attach = function(bufnr) local gs = package.loaded.gitsigns diff --git a/dot_config/nvim/lua/configs/packages/lsp.lua b/dot_config/nvim/lua/configs/packages/lsp.lua index 07da490..1c09d6d 100644 --- a/dot_config/nvim/lua/configs/packages/lsp.lua +++ b/dot_config/nvim/lua/configs/packages/lsp.lua @@ -37,11 +37,13 @@ local function on_attach(args) -- {{{ vim.keymap.set('i', '', vim.lsp.buf.signature_help, mkOpts('LSP signature help')) end - vim.api.nvim_create_autocmd( - { 'BufEnter', 'CursorHold', 'InsertLeave' }, { - callback = vim.lsp.codelens.refresh, - buffer = bufnr, - }) + if client.server_capabilities.codeLensProvider then + vim.api.nvim_create_autocmd( + { 'BufEnter', 'CursorHold', 'InsertLeave', }, { + callback = vim.lsp.codelens.refresh, + buffer = bufnr, + }) + end vim.keymap.set('n', 'cl', vim.lsp.codelens.run, mkOpts('LSP Run code lens')) vim.keymap.set('n', 'ci', vim.lsp.buf.implementation, mkOpts('LSP implementation')) vim.keymap.set('n', 'cd', vim.lsp.buf.type_definition, mkOpts('LSP type definition')) @@ -53,7 +55,6 @@ local function on_attach(args) -- {{{ vim.keymap.set('n', 'cco', vim.lsp.buf.outgoing_calls, mkOpts('LSP outgoing calls')) -- vim.keymap.set('n', 'gr', vim.lsp.buf.references, mkOpts('LSP references')) vim.keymap.set('n', 'cr', 'Trouble lsp_references', mkOpts('LSP references')) - vim.keymap.set( { 'v', 'n' }, 'F', function() vim.lsp.buf.format({ async = true, filter = formatting_filter, }) @@ -64,13 +65,86 @@ local function on_attach(args) -- {{{ if (formatting_filter(client)) then vim.api.nvim_buf_set_option(bufnr, 'formatexpr', 'v:lua.vim.lsp.formatexpr(#{timeout_ms:250})') end + + if client.name == 'omnisharp' then + client.server_capabilities.semanticTokensProvider.legend = { + tokenModifiers = { 'static' }, + tokenTypes = { + 'comment', -- "comment", + 'comment', -- "excluded_code", + 'identifier', -- "identifier", + 'keyword', -- "keyword", + 'keyword', -- "keyword_control", + 'number', -- "number", + 'operator', -- "operator", + 'operator', -- "operator_overloaded", + 'preproc', -- "preprocessor_keyword", + 'string', -- "string", + 'whitespace', -- "whitespace", + 'text', -- "text", + 'static', -- "static_symbol", + 'preproc', -- "preprocessor_text", + 'punctuation', -- "punctuation", + 'string.escape', -- "string_verbatim", + 'character.special', -- "string_escape_character", + 'class', -- "class_name", + 'type', -- "delegate_name", + 'enum', -- "enum_name", + 'interface', -- "interface_name", + 'namespace', -- "module_name", + 'struct', -- "struct_name", + 'typeParameter', -- "type_parameter_name", + 'field', -- "field_name", + 'enumMember', -- "enum_member_name", + 'constant', -- "constant_name", + 'variable', -- "local_name", + 'parameter', -- "parameter_name", + 'method', -- "method_name", + 'method', -- "extension_method_name", + 'property', -- "property_name", + 'event', -- "event_name", + 'namespace', -- "namespace_name", + 'label', -- "label_name", + 'text.literal', -- "xml_doc_comment_attribute_name", + 'text.literal', -- "xml_doc_comment_attribute_quotes", + 'text.literal', -- "xml_doc_comment_attribute_value", + 'text.literal', -- "xml_doc_comment_cdata_section", + 'text.literal', -- "xml_doc_comment_comment", + 'text.literal', -- "xml_doc_comment_delimiter", + 'text.literal', -- "xml_doc_comment_entity_reference", + 'text.literal', -- "xml_doc_comment_name", + 'text.literal', -- "xml_doc_comment_processing_instruction", + 'text.literal', -- "xml_doc_comment_text", + 'text.literal', -- "xml_literal_attribute_name", + 'text.literal', -- "xml_literal_attribute_quotes", + 'text.literal', -- "xml_literal_attribute_value", + 'text.literal', -- "xml_literal_cdata_section", + 'text.literal', -- "xml_literal_comment", + 'text.literal', -- "xml_literal_delimiter", + 'text.literal', -- "xml_literal_embedded_expression", + 'text.literal', -- "xml_literal_entity_reference", + 'text.literal', -- "xml_literal_name", + 'text.literal', -- "xml_literal_processing_instruction", + 'text.literal', -- "xml_literal_text", + 'regexp', -- "regex_comment", + 'regexp', -- "regex_character_class", + 'regexp', -- "regex_anchor", + 'regexp', -- "regex_quantifier", + 'regexp', -- "regex_grouping", + 'regexp', -- "regex_alternation", + 'regexp', -- "regex_text", + 'regexp', -- "regex_self_escaped_character", + 'regexp' -- "regex_other_escape", + }, + } + end end -- }}} local function config() require('neodev').setup({}) vim.api.nvim_create_autocmd('LspAttach', { - callback = on_attach + callback = on_attach, }) local nvim_lsp = require('lspconfig') diff --git a/dot_config/nvim/lua/configs/packages/misc.lua b/dot_config/nvim/lua/configs/packages/misc.lua index 3789baf..e7ebfb5 100644 --- a/dot_config/nvim/lua/configs/packages/misc.lua +++ b/dot_config/nvim/lua/configs/packages/misc.lua @@ -1,5 +1,8 @@ return { - { 'chrisbra/Colorizer', cmd = 'ColorToggle' }, + { 'norcalli/nvim-colorizer.lua', + config = true, + cmd = 'ColorizerToggle', + }, { 'AndrewRadev/linediff.vim', cmd = 'Linediff' }, @@ -11,17 +14,17 @@ return { -- stolen from LazyVim { - "stevearc/dressing.nvim", + 'stevearc/dressing.nvim', lazy = true, init = function() ---@diagnostic disable-next-line: duplicate-set-field vim.ui.select = function(...) - require("lazy").load({ plugins = { "dressing.nvim" } }) + require('lazy').load({ plugins = { 'dressing.nvim', }, }) return vim.ui.select(...) end ---@diagnostic disable-next-line: duplicate-set-field vim.ui.input = function(...) - require("lazy").load({ plugins = { "dressing.nvim" } }) + require('lazy').load({ plugins = { 'dressing.nvim', }, }) return vim.ui.input(...) end end, @@ -67,11 +70,11 @@ return { version = '*', config = function() require('mini.statusline').setup({}) - end + end, }, - { 'fpob/nette.vim', ft = 'nette' }, - { 'ziglang/zig.vim', ft = 'zig' }, + { 'fpob/nette.vim', ft = 'nette', }, + { 'ziglang/zig.vim', ft = 'zig', }, { 'mfussenegger/nvim-jdtls', @@ -80,25 +83,25 @@ return { { 'folke/trouble.nvim', - dependencies = { 'nvim-tree/nvim-web-devicons' }, + dependencies = { 'nvim-tree/nvim-web-devicons', }, lazy = true, - cmd = { 'Trouble', 'TroubleToggle' }, + cmd = { 'Trouble', 'TroubleToggle', }, keys = { - { 'tt', 'TroubleToggle', desc = 'Trouble toggle' }, - { 'td', 'Trouble document_diagnostics', desc = 'Trouble toggle' } + { 'tt', 'TroubleToggle', desc = 'Trouble toggle', }, + { 'td', 'Trouble document_diagnostics', desc = 'Trouble toggle', }, }, config = { mode = 'document_diagnostics', signs = { -- icons / text used for a diagnostic - error = "", - warning = "", - hint = "", - information = "", - other = "" + error = '', + warning = '', + hint = '', + information = '', + other = '', }, - } + }, }, } diff --git a/dot_config/nvim/lua/configs/packages/neotree.lua b/dot_config/nvim/lua/configs/packages/neotree.lua index af65b4f..ded4dbb 100644 --- a/dot_config/nvim/lua/configs/packages/neotree.lua +++ b/dot_config/nvim/lua/configs/packages/neotree.lua @@ -16,7 +16,7 @@ local M = { } function M.config() - vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]]) + vim.g.neo_tree_remove_legacy_commands = 1 require('neo-tree').setup({ close_if_last_window = false, -- Close Neo-tree if it is the last window left in the tab diff --git a/dot_config/nvim/lua/configs/packages/null-ls.lua b/dot_config/nvim/lua/configs/packages/null-ls.lua index 44ef359..a416eef 100644 --- a/dot_config/nvim/lua/configs/packages/null-ls.lua +++ b/dot_config/nvim/lua/configs/packages/null-ls.lua @@ -1,6 +1,6 @@ local M = { -'jose-elias-alvarez/null-ls.nvim', - dependencies = { 'nvim-lua/plenary.nvim' } + 'jose-elias-alvarez/null-ls.nvim', + dependencies = { 'nvim-lua/plenary.nvim' }, } function M.config() @@ -18,43 +18,46 @@ function M.config() cwd = function(params) -- falls back to root if return value is nil return params.root:match('jopixel') and not params.root:match('repo') and 'www'; - end + end, }), nls.builtins.formatting.phpcsfixer.with({ - extra_args = { '--rules', [[ { - "@Symfony":true, - "nullable_type_declaration_for_default_null_value":true, - "array_syntax":{"syntax":"short"}, - "binary_operator_spaces":{ - "default":"single_space", - "operators": { - "=>":"align_single_space_minimal", - "=":"align_single_space_minimal", - "??=":"align_single_space_minimal", - "^=":"align_single_space_minimal", - "|=":"align_single_space_minimal", - "+=":"align_single_space_minimal", - "%=":"align_single_space_minimal", - "&=":"align_single_space_minimal", - "**=":"align_single_space_minimal", - "*=":"align_single_space_minimal", - "-=":"align_single_space_minimal", - ".=":"align_single_space_minimal", - "/=":"align_single_space_minimal", - "<<=":"align_single_space_minimal", - "<=":"align_single_space_minimal", - ">=":"align_single_space_minimal", - ">>=":"align_single_space_minimal" - } - }, - "fully_qualified_strict_types":false - } ]] } + extra_args = { + '--rules', + vim.fn.json_encode({ + ['@Symfony'] = true, + nullable_type_declaration_for_default_null_value = true, + array_syntax = { syntax = 'short' }, + fully_qualified_strict_types = false, + binary_operator_spaces = { + default = 'single_space', + operators = { + ['=>'] = 'align_single_space_minimal', + ['='] = 'align_single_space_minimal', + ['??='] = 'align_single_space_minimal', + ['^='] = 'align_single_space_minimal', + ['|='] = 'align_single_space_minimal', + ['+='] = 'align_single_space_minimal', + ['%='] = 'align_single_space_minimal', + ['&='] = 'align_single_space_minimal', + ['**='] = 'align_single_space_minimal', + ['*='] = 'align_single_space_minimal', + ['-='] = 'align_single_space_minimal', + ['.='] = 'align_single_space_minimal', + ['/='] = 'align_single_space_minimal', + ['<<='] = 'align_single_space_minimal', + ['<='] = 'align_single_space_minimal', + ['>='] = 'align_single_space_minimal', + ['>>='] = 'align_single_space_minimal' + }, + }, + }), + }, }), nls.builtins.diagnostics.shellcheck, nls.builtins.formatting.eslint, -- nls.builtins.diagnostics.eslint, nls.builtins.code_actions.eslint, - } + }, }) end diff --git a/dot_config/nvim/lua/configs/packages/nvim-cmp.lua b/dot_config/nvim/lua/configs/packages/nvim-cmp.lua index 836f006..e241ba9 100644 --- a/dot_config/nvim/lua/configs/packages/nvim-cmp.lua +++ b/dot_config/nvim/lua/configs/packages/nvim-cmp.lua @@ -10,7 +10,7 @@ local M = { }, } -function M.opts() +function M.config() local cmp = require('cmp') local kind_func = require('lspkind').cmp_format({}) @@ -30,7 +30,7 @@ function M.opts() -- folders don't exist on UNIX! modif.kind = string.gsub(modif.kind, 'Folder', 'Directory') return modif - end + end, }, window = { -- completion = cmp.config.window.bordered(), @@ -49,6 +49,23 @@ function M.opts() end } }) + -- + -- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). + cmp.setup.cmdline({ '/', '?' }, { + mapping = cmp.mapping.preset.cmdline(), + sources = { + { name = 'buffer' }, + }, + }) + -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). + cmp.setup.cmdline(':', { + mapping = cmp.mapping.preset.cmdline(), + sources = cmp.config.sources({ + { name = 'path' }, + }, { + { name = 'cmdline' }, + }), + }) end return M diff --git a/dot_config/nvim/lua/configs/packages/telescope.lua b/dot_config/nvim/lua/configs/packages/telescope.lua index f02e2b9..7d60092 100644 --- a/dot_config/nvim/lua/configs/packages/telescope.lua +++ b/dot_config/nvim/lua/configs/packages/telescope.lua @@ -30,14 +30,14 @@ function M.config() preview = { hide_on_startup = true }, - mappings = { - i = { - [''] = layout_actions.toggle_preview, - }, - n = { - [''] = layout_actions.toggle_preview, - } + mappings = { + i = { + [''] = layout_actions.toggle_preview, + }, + n = { + [''] = layout_actions.toggle_preview, } + } }, pickers = { buffers = { @@ -55,11 +55,6 @@ function M.config() } } }, - extensions = { - ['ui-select'] = { - require('telescope.themes').get_dropdown {} - } - } } telescope.load_extension('fzf')