astro-nvim-v3 - add cmp on cmdlines

This commit is contained in:
huyjaky
2025-01-17 00:29:25 +07:00
parent 7fd986783a
commit 48552a05a6
5 changed files with 52 additions and 22 deletions

View File

@@ -8,6 +8,9 @@ return {
{
"github/copilot.vim",
},
{
"hrsh7th/cmp-cmdline",
},
{
"hrsh7th/nvim-cmp",
opts = function(_, opts)
@@ -19,6 +22,29 @@ return {
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match "%s" == nil
end
-- `/` cmdline setup.
cmp.setup.cmdline("/", {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = "buffer" },
},
})
-- `:` cmdline setup.
cmp.setup.cmdline(":", {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = "path" },
}, {
{
name = "cmdline",
option = {
ignore_cmds = { "Man", "!" },
},
},
}),
})
cmp.setup.filetype("python", {
sources = cmp.config.sources {
{ name = "nvim_lsp", priority = 1000 },

View File

@@ -35,6 +35,10 @@ return {
{ "nvim-neo-tree/neo-tree.nvim", enabled = true },
{ "folke/flash.nvim", enabled = true },
{ "github/copilot.vim", enabled = true },
{ "rafamadriz/friendly-snippets", enabled = false },
{ "JoosepAlviste/nvim-ts-context-commentstring", enabled = false },
{ "windwp/nvim-ts-autotag", enabled = true },
}
-- if true then return {} end

View File

@@ -2,7 +2,6 @@ return {
"folke/noice.nvim",
event = "VeryLazy",
dependencies = { "MunifTanjim/nui.nvim" },
config = function()
require("noice").setup {
-- Configuration here, or leave empty to use defaults

View File

@@ -6,9 +6,9 @@ return {
opts = function(_, opts)
-- add more things to the ensure_installed table protecting against community packs modifying it
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, {
"lua",
"c",
"cpp",
-- "lua",
-- "c",
-- "cpp",
"python",
-- "javascript",
})