commit a07fd70754150930dec098f98161fd97f0533799
parent eef251ac89fd19bdcd62698eb1d2726ba71bb6f6
Author: Tomas Nemec <nemi@skaut.cz>
Date: Thu, 22 Dec 2022 12:33:20 +0100
update
Diffstat:
4 files changed, 36 insertions(+), 6 deletions(-)
diff --git a/after/plugin/cmp.lua b/after/plugin/cmp.lua
@@ -122,6 +122,21 @@ cmp.setup({
experimental = { ghost_text = true },
})
+cmp.setup.cmdline('/', { --
+ mapping = cmp.mapping.preset.cmdline(),
+ sources = cmp.config.sources({ --
+ { name = 'nvim_lsp_document_symbol' },
+ }, { --
+ { name = 'buffer' },
+ }),
+})
+
+-- `:` cmdline setup.
+cmp.setup.cmdline(':', {
+ mapping = cmp.mapping.preset.cmdline(),
+ sources = cmp.config.sources({ { name = 'path' } }, { { name = 'cmdline' } }, { { name = 'cmdline_history' } }),
+})
+
-- cmp.setup.cmdline('/', { mapping = cmp.mapping.preset.cmdline(), sources = { { name = 'buffer' } } })
-- cmp.setup.cmdline(':', {
-- mapping = cmp.mapping.preset.cmdline(),
diff --git a/after/plugin/dap.lua b/after/plugin/dap.lua
@@ -2,6 +2,16 @@ if not pcall(require, 'dap') then
return
end
+if pcall(require, 'cmp') then
+ require('cmp').setup({
+ enabled = function()
+ return vim.api.nvim_buf_get_option(0, 'buftype') ~= 'prompt' or require('cmp_dap').is_dap_buffer()
+ end,
+ })
+
+ require('cmp').setup.filetype({ 'dap-repl', 'dapui_watches', 'dapui_hover' }, { sources = { { name = 'dap' } } })
+end
+
local dap = require('dap')
local repl = require('dap.repl')
-- dap.set_log_level('TRACE')
diff --git a/ftplugin/zsh.lua b/ftplugin/zsh.lua
@@ -4,9 +4,10 @@ vim.bo.efm = [[%f:%l: %m,%f: line %l: %m, %-G%.%#]]
if pcall(require, 'cmp') then
require('cmp').setup.buffer {
--
- completion = { autocomplete = false },
+ -- completion = { autocomplete = false },
sources = {
--
+ { name = 'zsh' },
{ name = 'nvim_lsp' },
{ name = 'exe' },
{ name = 'path' },
diff --git a/lua/plugins.lua b/lua/plugins.lua
@@ -94,18 +94,22 @@ return packer.startup({
use {
'hrsh7th/nvim-cmp',
requires = {
+ 'dmitmel/cmp-cmdline-history',
+ 'f3fora/cmp-spell',
'hrsh7th/cmp-buffer',
+ 'hrsh7th/cmp-calc',
+ 'hrsh7th/cmp-cmdline',
'hrsh7th/cmp-nvim-lsp',
+ 'hrsh7th/cmp-nvim-lsp-document-symbol',
'hrsh7th/cmp-nvim-lsp-signature-help',
- 'hrsh7th/cmp-path',
- 'hrsh7th/cmp-cmdline',
'hrsh7th/cmp-nvim-lua',
+ 'hrsh7th/cmp-path',
'petertriho/cmp-git',
- 'f3fora/cmp-spell',
- 'hrsh7th/cmp-calc',
'ray-x/cmp-treesitter',
- 'uga-rosa/cmp-dictionary',
+ 'rcarriga/cmp-dap',
'saadparwaiz1/cmp_luasnip',
+ 'tamago324/cmp-zsh',
+ 'uga-rosa/cmp-dictionary',
},
}
use 'aduros/ai.vim'