Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dot_config/nvim/lua/plugins/disabled.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ return {
{ "williamboman/mason-lspconfig.nvim", enabled = false },
{ "williamboman/mason.nvim", enabled = false },
{ "jay-babu/mason-nvim-dap.nvim", enabled = false },
{ "mfusenegger/nvim-dap-python", enabled = false },
-- { "mfusenegger/nvim-dap-python", enabled = false },
{ "catppuccin/nvim", enabled = false },
{ "folke/tokyonight.nvim", enabled = false },
}
85 changes: 46 additions & 39 deletions dot_config/nvim/lua/plugins/nvim-cmp_config.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,28 @@
return {
"hrsh7th/nvim-cmp",
dependencies = {
"hrsh7th/cmp-cmdline"
"amarz45/nvim-cmp-buffer-lines",
"chrisgrieser/cmp_yanky",
"delphinus/cmp-ctags",
"Dosx001/cmp-commit",
"hrsh7th/cmp-nvim-lua",
"hrsh7th/cmp-calc",
"hrsh7th/cmp-nvim-lsp-signature-help",
"hrsh7th/cmp-nvim-lsp-document-symbol",
"hrsh7th/cmp-cmdline",
"KadoBOT/cmp-plugins",
"lukas-reineke/cmp-rg",
"micangl/cmp-vimtex",
"petertriho/cmp-git",
"rasulomaroff/cmp-bufname",
"ray-x/cmp-treesitter",
"rcarriga/cmp-dap",
"tamago324/cmp-zsh"
},
enabled = function()
return vim.api.nvim_buf_get_option(0, "buftype") ~= "prompt"
or require("cmp_dap").is_dap_buffer()
end,
opts = function(_, opts)
local cmp = require("cmp")

Expand All @@ -17,36 +37,6 @@ return {

local lspkind = require("lspkind")

opts.formatting = vim.tbl_extend("force", opts.formatting, {
fields = { "abbr", "kind", "menu" },
format = lspkind.cmp_format({
mode = "symbol_text", -- show only symbol annotations
maxwidth = 50, -- prevent the popup from showing more than provided characters
ellipsis_char = "...", -- the truncated part when popup menu exceed maxwidth
before = function(entry, item)
local menu_icon = {
nvim_lsp = "",
vsnip = "",
path = "",
cmp_zotcite = "z",
cmp_r = "R",
}
item.menu = menu_icon[entry.source.name]
return item
end,
}),
})

--opts.snippet = vim.tbl_extend("force", opts.snippet, {
-- expand = function(args)
-- vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
-- end,
--})

-- opts.window = vim.tbl_extend("force", opts.window, {
-- completion = cmp.config.window.bordered(),
-- documentation = cmp.config.window.bordered(),
-- })

opts.mapping = vim.tbl_extend("force", opts.mapping, {
["<C-e>"] = cmp.mapping.abort(),
Expand Down Expand Up @@ -84,23 +74,40 @@ return {
c = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true }),
}),
})
-- opts.sources = cmp.config.sources({
-- { name = "nvim_lsp" },
-- { name = "vsnip" },
-- { name = "cmp_r" },
-- { name = "buffer" },
-- { name = "path" },
-- { name = "tmux" },
-- })

opts.sources = opts.sources or {}
table.insert(
opts.sources,
{
-- { name = "buffer-lines" },
{ name = "bufname" },
{ name = "calc" },
{ name = "cmp_yanky" },
{ name = "ctags" },
{ name = "nvim_lsp_signature_help"},
{ name = "nvim_lsp_signature_help"},
{ name = "nvim_lua" },
{ name = "rg" },
{ name = "vimtex" },
{ name = "zsh" }
}
)

-- Set configuration for git.
cmp.setup.filetype("gitcommit", {
sources = cmp.config.sources({
{ name = "cmp_git" },
{ name = "commit" },
{ name = "buffer" },
}),
})

cmp.setup.filetype({ "dap-repl", "dapui_watches", "dapui_hover" }, {
sources = {
{ name = "dap" },
},
})
--
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
-- cmp.setup.cmdline({ "/", "?" }, {
-- mapping = cmp.mapping.preset.cmdline(),
Expand Down
6 changes: 6 additions & 0 deletions dot_config/nvim/lua/plugins/nvim-dap-python.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
return {
"mfussenegger/nvim-dap-python",
config = function()
require("dap-python").setup("python3")
end
}