|
@@ -143,14 +143,6 @@ vim.api.nvim_create_autocmd("LspAttach", {
|
|
|
-- === === === === === === === === === === === === === === === === === === ===
|
|
-- === === === === === === === === === === === === === === === === === === ===
|
|
|
|
|
|
|
|
vim.pack.add({
|
|
vim.pack.add({
|
|
|
- "https://github.com/hrsh7th/cmp-buffer",
|
|
|
|
|
- "https://github.com/hrsh7th/cmp-calc",
|
|
|
|
|
- "https://github.com/hrsh7th/cmp-cmdline",
|
|
|
|
|
- "https://github.com/hrsh7th/cmp-nvim-lsp",
|
|
|
|
|
- "https://github.com/hrsh7th/cmp-nvim-lsp-signature-help",
|
|
|
|
|
- "https://github.com/hrsh7th/cmp-nvim-lua",
|
|
|
|
|
- "https://github.com/hrsh7th/cmp-path",
|
|
|
|
|
- "https://github.com/hrsh7th/nvim-cmp",
|
|
|
|
|
"https://github.com/kylechui/nvim-surround",
|
|
"https://github.com/kylechui/nvim-surround",
|
|
|
"https://github.com/lewis6991/gitsigns.nvim",
|
|
"https://github.com/lewis6991/gitsigns.nvim",
|
|
|
"https://github.com/lukas-reineke/virt-column.nvim",
|
|
"https://github.com/lukas-reineke/virt-column.nvim",
|
|
@@ -158,10 +150,11 @@ vim.pack.add({
|
|
|
"https://github.com/nvim-telescope/telescope-file-browser.nvim",
|
|
"https://github.com/nvim-telescope/telescope-file-browser.nvim",
|
|
|
"https://github.com/nvim-telescope/telescope-ui-select.nvim",
|
|
"https://github.com/nvim-telescope/telescope-ui-select.nvim",
|
|
|
"https://github.com/nvim-telescope/telescope.nvim",
|
|
"https://github.com/nvim-telescope/telescope.nvim",
|
|
|
- "https://github.com/nvim-treesitter/nvim-treesitter",
|
|
|
|
|
"https://github.com/nvim-treesitter/nvim-treesitter-context",
|
|
"https://github.com/nvim-treesitter/nvim-treesitter-context",
|
|
|
- "https://github.com/nvim-treesitter/nvim-treesitter-textobjects",
|
|
|
|
|
|
|
+ { src = "https://github.com/nvim-treesitter/nvim-treesitter-textobjects", version = "master" },
|
|
|
|
|
+ { src = "https://github.com/nvim-treesitter/nvim-treesitter", version = "master" },
|
|
|
"https://github.com/stevearc/aerial.nvim",
|
|
"https://github.com/stevearc/aerial.nvim",
|
|
|
|
|
+ "https://github.com/saghen/blink.cmp",
|
|
|
"https://github.com/tpope/vim-commentary"
|
|
"https://github.com/tpope/vim-commentary"
|
|
|
})
|
|
})
|
|
|
|
|
|
|
@@ -288,61 +281,62 @@ local function config_pandoctrinated()
|
|
|
})
|
|
})
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
-local function config_nvim_cmp()
|
|
|
|
|
- local cmp = require("cmp")
|
|
|
|
|
- local mapping = {
|
|
|
|
|
- ["<Tab>"] = function(fallback)
|
|
|
|
|
- if cmp.visible() then
|
|
|
|
|
- cmp.select_next_item(
|
|
|
|
|
- { behavior = cmp.SelectBehavior.Select })
|
|
|
|
|
- else
|
|
|
|
|
- fallback()
|
|
|
|
|
- end
|
|
|
|
|
- end,
|
|
|
|
|
- ["<S-Tab>"] = function(fallback)
|
|
|
|
|
- if cmp.visible() then
|
|
|
|
|
- cmp.select_prev_item(
|
|
|
|
|
- { behavior = cmp.SelectBehavior.Select })
|
|
|
|
|
- else
|
|
|
|
|
- fallback()
|
|
|
|
|
- end
|
|
|
|
|
- end,
|
|
|
|
|
- ["<CR>"] = function(fallback)
|
|
|
|
|
- if cmp.visible() and cmp.get_active_entry() then
|
|
|
|
|
- cmp.confirm({ behavior = cmp.ConfirmBehavior.Replace })
|
|
|
|
|
- else
|
|
|
|
|
- fallback()
|
|
|
|
|
- end
|
|
|
|
|
- end
|
|
|
|
|
- }
|
|
|
|
|
- cmp.setup({
|
|
|
|
|
- snippet = {},
|
|
|
|
|
- mapping = mapping,
|
|
|
|
|
- sources = cmp.config.sources({ { name = "nvim_lsp" } }, {
|
|
|
|
|
- { name = "buffer" }, { name = "nvim_lua" }, { name = "calc" },
|
|
|
|
|
- { name = "nvim_lsp_signature_help" }, { name = "path" }
|
|
|
|
|
- })
|
|
|
|
|
- })
|
|
|
|
|
- cmp.setup.cmdline("/", {
|
|
|
|
|
- mapping = cmp.mapping.preset.cmdline(),
|
|
|
|
|
- sources = { { name = "buffer" } }
|
|
|
|
|
- })
|
|
|
|
|
- cmp.setup.cmdline(":", {
|
|
|
|
|
- mapping = cmp.mapping.preset.cmdline(),
|
|
|
|
|
- sources = cmp.config.sources({ { name = "path" } }, {
|
|
|
|
|
- { name = "cmdline", option = { ignore_cmds = { "Man", "!" } } }
|
|
|
|
|
- })
|
|
|
|
|
- })
|
|
|
|
|
-
|
|
|
|
|
- vim.api.nvim_create_autocmd("LspAttach", {
|
|
|
|
|
- callback = function(args)
|
|
|
|
|
- local client = vim.lsp.get_client_by_id(args.data.client_id)
|
|
|
|
|
- if client == nil then return end
|
|
|
|
|
- if client:supports_method('textDocument/completion') then
|
|
|
|
|
- vim.lsp.completion.enable(true, client.id, args.buf,
|
|
|
|
|
- { autotrigger = false })
|
|
|
|
|
- end
|
|
|
|
|
- end
|
|
|
|
|
|
|
+local function config_blink_cmp()
|
|
|
|
|
+ local blink = require("blink.cmp")
|
|
|
|
|
+ blink.setup({
|
|
|
|
|
+ keymap = {
|
|
|
|
|
+ preset = 'none',
|
|
|
|
|
+ ['<C-space>'] = { 'show', 'show_documentation', 'hide_documentation' },
|
|
|
|
|
+ ['<C-e>'] = { 'hide' },
|
|
|
|
|
+ ['<C-y>'] = { 'select_and_accept' },
|
|
|
|
|
+ ['<Tab>'] = { 'select_next', 'snippet_forward', 'fallback' },
|
|
|
|
|
+ ['<S-Tab>'] = { 'select_prev', 'snippet_backward', 'fallback' },
|
|
|
|
|
+ ['<CR>'] = { 'accept', 'fallback' },
|
|
|
|
|
+ ['<C-p>'] = { 'scroll_documentation_up', 'fallback' },
|
|
|
|
|
+ ['<C-n>'] = { 'scroll_documentation_down', 'fallback' },
|
|
|
|
|
+ },
|
|
|
|
|
+ completion = {
|
|
|
|
|
+ list = {
|
|
|
|
|
+ selection = {
|
|
|
|
|
+ preselect = false,
|
|
|
|
|
+ auto_insert = false
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ menu = {
|
|
|
|
|
+ draw = {
|
|
|
|
|
+ columns = { { "kind_icon" }, { "label", "label_description", gap = 1 } },
|
|
|
|
|
+ },
|
|
|
|
|
+ border = { "⌌", "-", "⌍", "¦", "⌏", "-", "⌎", "¦" }
|
|
|
|
|
+ },
|
|
|
|
|
+ documentation = {
|
|
|
|
|
+ auto_show = true,
|
|
|
|
|
+ auto_show_delay_ms = 200,
|
|
|
|
|
+ window = {
|
|
|
|
|
+ border = { "⌌", "-", "⌍", "¦", "⌏", "-", "⌎", "¦" }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ },
|
|
|
|
|
+ appearance = {
|
|
|
|
|
+ use_nvim_cmp_as_default = true,
|
|
|
|
|
+ nerd_font_variant = 'mono',
|
|
|
|
|
+ },
|
|
|
|
|
+ fuzzy = { implementation = "prefer_rust", prebuilt_binaries = { download = true, force_version = "v1.8.0" } },
|
|
|
|
|
+ sources = {
|
|
|
|
|
+ default = { 'lsp', 'path', 'snippets', 'buffer' },
|
|
|
|
|
+ providers = {
|
|
|
|
|
+ lsp = { score_offset = 100 },
|
|
|
|
|
+ buffer = { score_offset = 0 },
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ signature = { enabled = true },
|
|
|
|
|
+ cmdline = {
|
|
|
|
|
+ enabled = true,
|
|
|
|
|
+ keymap = {
|
|
|
|
|
+ ['<Tab>'] = { 'show', 'select_next', 'fallback' },
|
|
|
|
|
+ ['<S-Tab>'] = { 'select_prev', 'fallback' },
|
|
|
|
|
+ ['<CR>'] = { 'accept', 'fallback' },
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
})
|
|
})
|
|
|
end
|
|
end
|
|
|
|
|
|
|
@@ -585,7 +579,7 @@ local function config_status_beast()
|
|
|
{
|
|
{
|
|
|
group = vim.api.nvim_create_augroup('StatusBeast',
|
|
group = vim.api.nvim_create_augroup('StatusBeast',
|
|
|
{ clear = true }),
|
|
{ clear = true }),
|
|
|
- callback = function (args)
|
|
|
|
|
|
|
+ callback = function(args)
|
|
|
if vim.bo[args.buf].filetype == "aerial" then
|
|
if vim.bo[args.buf].filetype == "aerial" then
|
|
|
return
|
|
return
|
|
|
end
|
|
end
|
|
@@ -908,7 +902,7 @@ local setup_plugins = function()
|
|
|
config_virt_column()
|
|
config_virt_column()
|
|
|
config_nvim_surround()
|
|
config_nvim_surround()
|
|
|
config_like_a_butterfly()
|
|
config_like_a_butterfly()
|
|
|
- config_nvim_cmp()
|
|
|
|
|
|
|
+ config_blink_cmp()
|
|
|
config_telescope()
|
|
config_telescope()
|
|
|
config_jxdash()
|
|
config_jxdash()
|
|
|
config_nvim_treesitter_textobjects()
|
|
config_nvim_treesitter_textobjects()
|