updates
This commit is contained in:
parent
e0a811ea58
commit
e582ebeab1
2
init.vim
2
init.vim
@ -36,6 +36,7 @@ source ~/.config/nvim/plugin-confs/nvim-cmp.lua
|
|||||||
source ~/.config/nvim/plugin-confs/fidget.lua
|
source ~/.config/nvim/plugin-confs/fidget.lua
|
||||||
source ~/.config/nvim/plugin-confs/symbols-outline.lua
|
source ~/.config/nvim/plugin-confs/symbols-outline.lua
|
||||||
source ~/.config/nvim/plugin-confs/chatgpt.lua
|
source ~/.config/nvim/plugin-confs/chatgpt.lua
|
||||||
|
source ~/.config/nvim/plugin-confs/nvim-colorizer.lua
|
||||||
" source ~/.config/nvim/plugin-confs/copilot.lua
|
" source ~/.config/nvim/plugin-confs/copilot.lua
|
||||||
" source ~/.config/nvim/plugin-confs/lsp-signature.lua
|
" source ~/.config/nvim/plugin-confs/lsp-signature.lua
|
||||||
" source ~/.config/nvim/plugin-confs/nvim-docs-view.lua
|
" source ~/.config/nvim/plugin-confs/nvim-docs-view.lua
|
||||||
@ -75,7 +76,6 @@ command! Env execute ":Dotenv .env"
|
|||||||
command! MakeTags !ctags -R .
|
command! MakeTags !ctags -R .
|
||||||
command! Ovewrite execute ":w !sudo tee %"
|
command! Ovewrite execute ":w !sudo tee %"
|
||||||
command! PS execute ":PackerSync"
|
command! PS execute ":PackerSync"
|
||||||
command! Aniwrapper execute ":FloatermNew aniwrapper -qtdoomone -D 144"
|
|
||||||
|
|
||||||
" set termguicolors
|
" set termguicolors
|
||||||
" colorscheme doom-one
|
" colorscheme doom-one
|
||||||
|
149
lua/plugins.lua
149
lua/plugins.lua
@ -4,7 +4,9 @@ require('packer').startup(function(use)
|
|||||||
use 'nvim-lua/plenary.nvim'
|
use 'nvim-lua/plenary.nvim'
|
||||||
use {
|
use {
|
||||||
'nvim-treesitter/nvim-treesitter',
|
'nvim-treesitter/nvim-treesitter',
|
||||||
run = function() require('nvim-treesitter.install').update({ with_sync = true }) end,
|
run = function()
|
||||||
|
require('nvim-treesitter.install').update({ with_sync = true })
|
||||||
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
use {
|
use {
|
||||||
@ -12,11 +14,10 @@ require('packer').startup(function(use)
|
|||||||
requires = { 'kyazdani42/nvim-web-devicons', opt = true }
|
requires = { 'kyazdani42/nvim-web-devicons', opt = true }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
use {
|
use {
|
||||||
"zbirenbaum/copilot.lua",
|
"zbirenbaum/copilot.lua",
|
||||||
event = "VimEnter",
|
event = "VimEnter",
|
||||||
config = function ()
|
config = function()
|
||||||
vim.defer_fn(function()
|
vim.defer_fn(function()
|
||||||
require('copilot').setup({
|
require('copilot').setup({
|
||||||
panel = {
|
panel = {
|
||||||
@ -32,7 +33,7 @@ require('packer').startup(function(use)
|
|||||||
layout = {
|
layout = {
|
||||||
position = "right", -- | top | left | right
|
position = "right", -- | top | left | right
|
||||||
ratio = 0.4
|
ratio = 0.4
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
suggestion = {
|
suggestion = {
|
||||||
enabled = false,
|
enabled = false,
|
||||||
@ -43,8 +44,8 @@ require('packer').startup(function(use)
|
|||||||
-- accept = "<Right>",
|
-- accept = "<Right>",
|
||||||
next = "<M-]>",
|
next = "<M-]>",
|
||||||
prev = "<M-[>",
|
prev = "<M-[>",
|
||||||
dismiss = "<C-]>",
|
dismiss = "<C-]>"
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
-- filetypes = {
|
-- filetypes = {
|
||||||
-- yaml = false,
|
-- yaml = false,
|
||||||
@ -58,29 +59,30 @@ require('packer').startup(function(use)
|
|||||||
-- ["."] = false,
|
-- ["."] = false,
|
||||||
-- },
|
-- },
|
||||||
copilot_node_command = 'node', -- Node version must be < 18
|
copilot_node_command = 'node', -- Node version must be < 18
|
||||||
plugin_manager_path = vim.fn.stdpath("data") .. "/site/pack/packer",
|
plugin_manager_path = vim.fn.stdpath("data") ..
|
||||||
|
"/site/pack/packer",
|
||||||
server_opts_overrides = {
|
server_opts_overrides = {
|
||||||
trace = "verbose",
|
trace = "verbose",
|
||||||
settings = {
|
settings = {
|
||||||
advanced = {
|
advanced = {
|
||||||
listCount = 10, -- #completions for panel
|
listCount = 10, -- #completions for panel
|
||||||
inlineSuggestCount = 4, -- #completions for getCompletions
|
inlineSuggestCount = 4 -- #completions for getCompletions
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
require("copilot.suggestion").toggle_auto_trigger()
|
require("copilot.suggestion").toggle_auto_trigger()
|
||||||
end, 100)
|
end, 100)
|
||||||
end,
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
use {
|
use {
|
||||||
"zbirenbaum/copilot-cmp",
|
"zbirenbaum/copilot-cmp",
|
||||||
-- after = { "copilot.lua" },
|
-- after = { "copilot.lua" },
|
||||||
config = function ()
|
config = function()
|
||||||
require("copilot_cmp").setup({
|
require("copilot_cmp").setup({
|
||||||
suggestion = { enabled = false },
|
suggestion = { enabled = false },
|
||||||
panel = { enabled = false },
|
panel = { enabled = false }
|
||||||
-- method = "getCompletionsCycling",
|
-- method = "getCompletionsCycling",
|
||||||
-- formatters = {
|
-- formatters = {
|
||||||
-- insert_text = require("copilot_cmp.format").remove_existing
|
-- insert_text = require("copilot_cmp.format").remove_existing
|
||||||
@ -89,10 +91,7 @@ require('packer').startup(function(use)
|
|||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
use {
|
use { 'junegunn/fzf', run = function() vim.fn['fzf#install']() end }
|
||||||
'junegunn/fzf',
|
|
||||||
run = function() vim.fn['fzf#install']() end
|
|
||||||
}
|
|
||||||
|
|
||||||
-- use {
|
-- use {
|
||||||
-- "lewis6991/hover.nvim",
|
-- "lewis6991/hover.nvim",
|
||||||
@ -131,7 +130,7 @@ require('packer').startup(function(use)
|
|||||||
-- end
|
-- end
|
||||||
-- }
|
-- }
|
||||||
|
|
||||||
use 'ap/vim-css-color'
|
use 'norcalli/nvim-colorizer.lua'
|
||||||
use 'jiangmiao/auto-pairs'
|
use 'jiangmiao/auto-pairs'
|
||||||
use 'junegunn/fzf.vim'
|
use 'junegunn/fzf.vim'
|
||||||
use 'pechorin/any-jump.vim'
|
use 'pechorin/any-jump.vim'
|
||||||
@ -140,87 +139,47 @@ require('packer').startup(function(use)
|
|||||||
use 'voldikss/vim-floaterm'
|
use 'voldikss/vim-floaterm'
|
||||||
use 'wakatime/vim-wakatime'
|
use 'wakatime/vim-wakatime'
|
||||||
|
|
||||||
use {
|
use { 'akinsho/nvim-bufferline.lua' }
|
||||||
'akinsho/nvim-bufferline.lua'
|
use { 'andweeb/presence.nvim' }
|
||||||
}
|
use { 'folke/which-key.nvim' }
|
||||||
use {
|
use { 'glepnir/dashboard-nvim' }
|
||||||
'andweeb/presence.nvim'
|
use { 'kyazdani42/nvim-tree.lua' }
|
||||||
}
|
|
||||||
use {
|
|
||||||
'folke/which-key.nvim'
|
|
||||||
}
|
|
||||||
use {
|
|
||||||
'glepnir/dashboard-nvim'
|
|
||||||
}
|
|
||||||
use {
|
|
||||||
'kyazdani42/nvim-tree.lua'
|
|
||||||
}
|
|
||||||
use 'kyazdani42/nvim-web-devicons'
|
use 'kyazdani42/nvim-web-devicons'
|
||||||
use {
|
use { 'lewis6991/gitsigns.nvim' }
|
||||||
'lewis6991/gitsigns.nvim'
|
use { 'nvim-telescope/telescope.nvim' }
|
||||||
}
|
use { 'nvim-telescope/telescope-file-browser.nvim' }
|
||||||
use {
|
|
||||||
'nvim-telescope/telescope.nvim'
|
|
||||||
}
|
|
||||||
use {
|
|
||||||
'nvim-telescope/telescope-file-browser.nvim'
|
|
||||||
}
|
|
||||||
|
|
||||||
use {
|
use { 'ojroques/nvim-lspfuzzy' }
|
||||||
'ojroques/nvim-lspfuzzy'
|
|
||||||
}
|
|
||||||
|
|
||||||
use 'L3MON4D3/LuaSnip'
|
use 'L3MON4D3/LuaSnip'
|
||||||
-- use 'amrbashir/nvim-docs-view'
|
-- use 'amrbashir/nvim-docs-view'
|
||||||
|
use { 'hrsh7th/nvim-cmp' }
|
||||||
|
use { 'hrsh7th/cmp-nvim-lsp' }
|
||||||
|
use { 'hrsh7th/cmp-nvim-lua' }
|
||||||
|
use { 'hrsh7th/cmp-nvim-lsp-signature-help' }
|
||||||
|
use { 'hrsh7th/cmp-path' }
|
||||||
|
use { 'hrsh7th/cmp-cmdline' }
|
||||||
|
use { 'hrsh7th/cmp-buffer' }
|
||||||
|
use { 'hrsh7th/cmp-nvim-lsp-document-symbol' }
|
||||||
use {
|
use {
|
||||||
'hrsh7th/nvim-cmp'
|
'j-hui/fidget.nvim',
|
||||||
|
tag = 'legacy',
|
||||||
|
config = function()
|
||||||
|
require("fidget").setup {
|
||||||
|
-- options
|
||||||
}
|
}
|
||||||
use {
|
end
|
||||||
'hrsh7th/cmp-nvim-lsp'
|
|
||||||
}
|
|
||||||
use {
|
|
||||||
'hrsh7th/cmp-nvim-lua'
|
|
||||||
}
|
|
||||||
use {
|
|
||||||
'hrsh7th/cmp-nvim-lsp-signature-help'
|
|
||||||
}
|
|
||||||
use {
|
|
||||||
'hrsh7th/cmp-path'
|
|
||||||
}
|
|
||||||
use {
|
|
||||||
'hrsh7th/cmp-cmdline'
|
|
||||||
}
|
|
||||||
use {
|
|
||||||
'hrsh7th/cmp-buffer'
|
|
||||||
}
|
|
||||||
use {
|
|
||||||
'hrsh7th/cmp-nvim-lsp-document-symbol'
|
|
||||||
}
|
|
||||||
use {
|
|
||||||
'j-hui/fidget.nvim'
|
|
||||||
}
|
|
||||||
use {
|
|
||||||
'jose-elias-alvarez/null-ls.nvim'
|
|
||||||
}
|
|
||||||
use {
|
|
||||||
'ksyasuda/lsp_lines.nvim'
|
|
||||||
}
|
|
||||||
use {
|
|
||||||
'neovim/nvim-lspconfig'
|
|
||||||
}
|
|
||||||
use {
|
|
||||||
'onsails/lspkind-nvim'
|
|
||||||
}
|
}
|
||||||
|
use { 'jose-elias-alvarez/null-ls.nvim' }
|
||||||
|
use { 'ksyasuda/lsp_lines.nvim' }
|
||||||
|
use { 'neovim/nvim-lspconfig' }
|
||||||
|
use { 'onsails/lspkind-nvim' }
|
||||||
-- use 'ray-x/lsp_signature.nvim'
|
-- use 'ray-x/lsp_signature.nvim'
|
||||||
use {
|
use { 'rmagatti/goto-preview' }
|
||||||
'rmagatti/goto-preview'
|
|
||||||
}
|
|
||||||
use 'saadparwaiz1/cmp_luasnip'
|
use 'saadparwaiz1/cmp_luasnip'
|
||||||
use 'williamboman/nvim-lsp-installer'
|
use 'williamboman/nvim-lsp-installer'
|
||||||
|
|
||||||
use {
|
use { 'Mofiqul/dracula.nvim' }
|
||||||
'Mofiqul/dracula.nvim'
|
|
||||||
}
|
|
||||||
use {
|
use {
|
||||||
'NTBBloodbath/doom-one.nvim',
|
'NTBBloodbath/doom-one.nvim',
|
||||||
setup = function()
|
setup = function()
|
||||||
@ -253,20 +212,15 @@ require('packer').startup(function(use)
|
|||||||
vim.g.doom_one_plugin_indent_blankline = true
|
vim.g.doom_one_plugin_indent_blankline = true
|
||||||
vim.g.doom_one_plugin_vim_illuminate = false
|
vim.g.doom_one_plugin_vim_illuminate = false
|
||||||
vim.g.doom_one_plugin_lspsaga = true
|
vim.g.doom_one_plugin_lspsaga = true
|
||||||
end,
|
end
|
||||||
}
|
|
||||||
use {
|
|
||||||
'olimorris/onedarkpro.nvim'
|
|
||||||
}
|
|
||||||
use {
|
|
||||||
'projekt0n/github-nvim-theme'
|
|
||||||
}
|
}
|
||||||
|
use { 'olimorris/onedarkpro.nvim' }
|
||||||
|
use { 'projekt0n/github-nvim-theme' }
|
||||||
|
|
||||||
use({
|
use({
|
||||||
"jackMort/ChatGPT.nvim",
|
"jackMort/ChatGPT.nvim",
|
||||||
requires = {
|
requires = {
|
||||||
"MunifTanjim/nui.nvim",
|
"MunifTanjim/nui.nvim", "nvim-lua/plenary.nvim",
|
||||||
"nvim-lua/plenary.nvim",
|
|
||||||
"nvim-telescope/telescope.nvim"
|
"nvim-telescope/telescope.nvim"
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -274,4 +228,9 @@ require('packer').startup(function(use)
|
|||||||
use 'khaveesh/vim-fish-syntax'
|
use 'khaveesh/vim-fish-syntax'
|
||||||
|
|
||||||
use { "catppuccin/nvim", as = "catppuccin" }
|
use { "catppuccin/nvim", as = "catppuccin" }
|
||||||
|
|
||||||
|
use({
|
||||||
|
"iamcco/markdown-preview.nvim",
|
||||||
|
run = function() vim.fn["mkdp#util#install"]() end
|
||||||
|
})
|
||||||
end)
|
end)
|
||||||
|
@ -6,7 +6,7 @@ local l = vim.lsp
|
|||||||
g.mapleader = " "
|
g.mapleader = " "
|
||||||
g.maplocalleader = ','
|
g.maplocalleader = ','
|
||||||
g.fzf_command = 'fzf --height 90% --width=85% --layout=reverse --preview "bat --color=always {}"'
|
g.fzf_command = 'fzf --height 90% --width=85% --layout=reverse --preview "bat --color=always {}"'
|
||||||
o.completeopt="menu,menuone,noselect"
|
o.completeopt = "menu,menuone,noselect"
|
||||||
o.showmode = false
|
o.showmode = false
|
||||||
o.termguicolors = true
|
o.termguicolors = true
|
||||||
o.background = 'dark'
|
o.background = 'dark'
|
||||||
@ -30,7 +30,7 @@ o.cursorline = true
|
|||||||
o.scrolloff = 8
|
o.scrolloff = 8
|
||||||
o.sidescrolloff = 8
|
o.sidescrolloff = 8
|
||||||
o.wildmenu = true
|
o.wildmenu = true
|
||||||
o.wildignore= '.git,.hg,.svn,CVS,.DS_Store,.idea,.vscode,.vscode-test,node_modules'
|
o.wildignore = '.git,.hg,.svn,CVS,.DS_Store,.idea,.vscode,.vscode-test,node_modules'
|
||||||
o.showmatch = true
|
o.showmatch = true
|
||||||
o.list = true
|
o.list = true
|
||||||
o.listchars = 'tab:»·,trail:·,nbsp:·,extends:>,precedes:<'
|
o.listchars = 'tab:»·,trail:·,nbsp:·,extends:>,precedes:<'
|
||||||
@ -41,7 +41,8 @@ o.hidden = true
|
|||||||
o.cmdheight = 1
|
o.cmdheight = 1
|
||||||
o.updatetime = 300
|
o.updatetime = 300
|
||||||
o.timeoutlen = 500
|
o.timeoutlen = 500
|
||||||
o.pumwidth=35
|
o.pumwidth = 35
|
||||||
|
o.foldmethod = 'marker'
|
||||||
|
|
||||||
local border = {
|
local border = {
|
||||||
{ "╭", "FloatBorder" },
|
{ "╭", "FloatBorder" },
|
||||||
|
@ -15,12 +15,12 @@ require("null-ls").setup({
|
|||||||
sources = {
|
sources = {
|
||||||
-- null_ls.builtins.completion.spell,
|
-- null_ls.builtins.completion.spell,
|
||||||
null_ls.builtins.completion.luasnip,
|
null_ls.builtins.completion.luasnip,
|
||||||
null_ls.builtins.code_actions.gitsigns,
|
-- null_ls.builtins.code_actions.gitsigns,
|
||||||
null_ls.builtins.code_actions.shellcheck,
|
null_ls.builtins.code_actions.shellcheck,
|
||||||
null_ls.builtins.diagnostics.cppcheck,
|
null_ls.builtins.diagnostics.cppcheck,
|
||||||
null_ls.builtins.diagnostics.gitlint,
|
null_ls.builtins.diagnostics.gitlint,
|
||||||
null_ls.builtins.diagnostics.jsonlint,
|
null_ls.builtins.diagnostics.jsonlint,
|
||||||
-- require("null-ls").builtins.diagnostics.luacheck,
|
require("null-ls").builtins.diagnostics.luacheck,
|
||||||
null_ls.builtins.diagnostics.markdownlint,
|
null_ls.builtins.diagnostics.markdownlint,
|
||||||
-- null_ls.builtins.diagnostics.sqlfluff.with({
|
-- null_ls.builtins.diagnostics.sqlfluff.with({
|
||||||
-- extra_args = {
|
-- extra_args = {
|
||||||
@ -31,28 +31,26 @@ require("null-ls").setup({
|
|||||||
null_ls.builtins.diagnostics.pylint,
|
null_ls.builtins.diagnostics.pylint,
|
||||||
null_ls.builtins.diagnostics.pydocstyle.with({
|
null_ls.builtins.diagnostics.pydocstyle.with({
|
||||||
extra_args = { "--config=$ROOT/setup.cfg" }
|
extra_args = { "--config=$ROOT/setup.cfg" }
|
||||||
}),
|
}), null_ls.builtins.diagnostics.vint,
|
||||||
null_ls.builtins.diagnostics.vint,
|
|
||||||
null_ls.builtins.diagnostics.shellcheck.with({
|
null_ls.builtins.diagnostics.shellcheck.with({
|
||||||
extra_args = { "-s", "bash", "-o", "add-default-case, check-set-e-suppressed, check-unassigned-uppercase, deprecate-which, quote-safe-variables" }
|
extra_args = {
|
||||||
}),
|
"-s", "bash", "-o",
|
||||||
null_ls.builtins.diagnostics.ansiblelint,
|
"add-default-case, check-set-e-suppressed, check-unassigned-uppercase, deprecate-which, quote-safe-variables"
|
||||||
|
}
|
||||||
|
}), null_ls.builtins.diagnostics.ansiblelint,
|
||||||
null_ls.builtins.formatting.json_tool,
|
null_ls.builtins.formatting.json_tool,
|
||||||
-- require("null-ls").builtins.formatting.lua_format,
|
require("null-ls").builtins.formatting.lua_format,
|
||||||
null_ls.builtins.formatting.markdownlint,
|
null_ls.builtins.formatting.markdownlint,
|
||||||
null_ls.builtins.formatting.prettier,
|
null_ls.builtins.formatting.prettier, -- handled by lsp server
|
||||||
-- handled by lsp server
|
|
||||||
-- require("null-ls").builtins.formatting.rustfmt,
|
-- require("null-ls").builtins.formatting.rustfmt,
|
||||||
null_ls.builtins.formatting.shfmt.with({
|
null_ls.builtins.formatting.shfmt.with({
|
||||||
filetypes = { "sh", "bash" },
|
filetypes = { "sh", "bash" },
|
||||||
extra_args = { "-i", "0", "-ci", "-sr" }
|
extra_args = { "-i", "0", "-ci", "-sr" }
|
||||||
}),
|
}), null_ls.builtins.formatting.black,
|
||||||
null_ls.builtins.formatting.black,
|
null_ls.builtins.formatting.isort, null_ls.builtins.formatting.djlint
|
||||||
null_ls.builtins.formatting.isort,
|
|
||||||
null_ls.builtins.formatting.djlint,
|
|
||||||
-- null_ls.builtins.hover.printenv
|
-- null_ls.builtins.hover.printenv
|
||||||
-- null_ls.builtins.formatting.tidy
|
-- null_ls.builtins.formatting.tidy
|
||||||
},
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
-- local markdownlint = {
|
-- local markdownlint = {
|
||||||
|
@ -7,18 +7,18 @@ local luasnip = require 'luasnip'
|
|||||||
local highlight = require('cmp.utils.highlight')
|
local highlight = require('cmp.utils.highlight')
|
||||||
|
|
||||||
local has_words_before = function()
|
local has_words_before = function()
|
||||||
if vim.api.nvim_buf_get_option(0, "buftype") == "prompt" then return false end
|
if vim.api.nvim_buf_get_option(0, "buftype") == "prompt" then
|
||||||
|
return false
|
||||||
|
end
|
||||||
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
||||||
return col ~= 0 and vim.api.nvim_buf_get_text(0, line-1, 0, line-1, col, {})[1]:match("^%s*$") == nil
|
return col ~= 0 and
|
||||||
|
vim.api.nvim_buf_get_text(0, line - 1, 0, line - 1, col, {})[1]:match(
|
||||||
|
"^%s*$") == nil
|
||||||
end
|
end
|
||||||
|
|
||||||
lspkind.init({
|
lspkind.init({ symbol_map = { Copilot = "" } })
|
||||||
symbol_map = {
|
|
||||||
Copilot = "",
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
vim.api.nvim_set_hl(0, "CmpItemKindCopilot", {fg ="#6CC644"})
|
vim.api.nvim_set_hl(0, "CmpItemKindCopilot", { fg = "#6CC644" })
|
||||||
|
|
||||||
cmp.setup({
|
cmp.setup({
|
||||||
snippet = {
|
snippet = {
|
||||||
@ -27,7 +27,7 @@ cmp.setup({
|
|||||||
require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
|
require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
|
||||||
-- require('snippy').expand_snippet(args.body) -- For `snippy` users.
|
-- require('snippy').expand_snippet(args.body) -- For `snippy` users.
|
||||||
-- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
|
-- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
|
||||||
end,
|
end
|
||||||
},
|
},
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
mapping = {
|
mapping = {
|
||||||
@ -59,7 +59,7 @@ cmp.setup({
|
|||||||
['<C-e>'] = cmp.mapping.abort(),
|
['<C-e>'] = cmp.mapping.abort(),
|
||||||
['<CR>'] = cmp.mapping.confirm {
|
['<CR>'] = cmp.mapping.confirm {
|
||||||
behavior = cmp.ConfirmBehavior.Replace,
|
behavior = cmp.ConfirmBehavior.Replace,
|
||||||
select = false,
|
select = false
|
||||||
},
|
},
|
||||||
-- ["<Tab>"] = cmp.mapping(function(fallback)
|
-- ["<Tab>"] = cmp.mapping(function(fallback)
|
||||||
-- if cmp.visible() then
|
-- if cmp.visible() then
|
||||||
@ -80,10 +80,8 @@ cmp.setup({
|
|||||||
end
|
end
|
||||||
end),
|
end),
|
||||||
['<S-Tab>'] = cmp.mapping(function()
|
['<S-Tab>'] = cmp.mapping(function()
|
||||||
if cmp.visible() then
|
if cmp.visible() then cmp.select_prev_item() end
|
||||||
cmp.select_prev_item()
|
end, { "i", "s" })
|
||||||
end
|
|
||||||
end, { "i", "s"}),
|
|
||||||
},
|
},
|
||||||
window = {
|
window = {
|
||||||
completion = {
|
completion = {
|
||||||
@ -92,28 +90,14 @@ cmp.setup({
|
|||||||
side_padding = 0,
|
side_padding = 0,
|
||||||
border = "rounded",
|
border = "rounded",
|
||||||
borderchars = {
|
borderchars = {
|
||||||
"─",
|
"─", "│", "─", "│", "╭", "╮", "╯", "╰"
|
||||||
"│",
|
}
|
||||||
"─",
|
|
||||||
"│",
|
|
||||||
"╭",
|
|
||||||
"╮",
|
|
||||||
"╯",
|
|
||||||
"╰",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
documentation = {
|
documentation = {
|
||||||
border = "rounded",
|
border = "rounded",
|
||||||
borderchars = {
|
borderchars = {
|
||||||
"─",
|
"─", "│", "─", "│", "╭", "╮", "╯", "╰"
|
||||||
"│",
|
}
|
||||||
"─",
|
|
||||||
"│",
|
|
||||||
"╭",
|
|
||||||
"╮",
|
|
||||||
"╯",
|
|
||||||
"╰",
|
|
||||||
},
|
|
||||||
-- padding = 15,
|
-- padding = 15,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -150,15 +134,15 @@ cmp.setup({
|
|||||||
Constant = "",
|
Constant = "",
|
||||||
Struct = "",
|
Struct = "",
|
||||||
Event = "",
|
Event = "",
|
||||||
TypeParameter = "",
|
TypeParameter = ""
|
||||||
},
|
}
|
||||||
})(entry, vim_item)
|
})(entry, vim_item)
|
||||||
local strings = vim.split(kind.kind, "%s", { trimempty = true })
|
local strings = vim.split(kind.kind, "%s", { trimempty = true })
|
||||||
kind.kind = " " .. strings[1] .. " "
|
kind.kind = " " .. strings[1] .. " "
|
||||||
kind.menu = " (" .. strings[2] .. ")"
|
kind.menu = " (" .. strings[2] .. ")"
|
||||||
|
|
||||||
return kind
|
return kind
|
||||||
end,
|
end
|
||||||
-- format = lspkind.cmp_format({
|
-- format = lspkind.cmp_format({
|
||||||
-- mode = 'symbol_text', -- show only symbol annotations
|
-- mode = 'symbol_text', -- show only symbol annotations
|
||||||
-- menu = ({
|
-- menu = ({
|
||||||
@ -171,8 +155,7 @@ cmp.setup({
|
|||||||
-- })
|
-- })
|
||||||
},
|
},
|
||||||
sources = cmp.config.sources({
|
sources = cmp.config.sources({
|
||||||
{ name = "copilot", group_index = 2 },
|
{ name = "copilot", group_index = 2 }, { name = "path", group_index = 2 },
|
||||||
{ name = "path", group_index = 2 },
|
|
||||||
{ name = 'nvim_lsp', group_index = 2 },
|
{ name = 'nvim_lsp', group_index = 2 },
|
||||||
{ name = 'nvim_lsp_signature_help', group_index = 2 },
|
{ name = 'nvim_lsp_signature_help', group_index = 2 },
|
||||||
{ name = 'nvim_lsp_document_symbol', group_index = 2 },
|
{ name = 'nvim_lsp_document_symbol', group_index = 2 },
|
||||||
@ -191,9 +174,7 @@ cmp.setup({
|
|||||||
}
|
}
|
||||||
-- { name = 'ultisnips' }, -- For ultisnips users.
|
-- { name = 'ultisnips' }, -- For ultisnips users.
|
||||||
-- { name = 'snippy' }, -- For snippy users.
|
-- { name = 'snippy' }, -- For snippy users.
|
||||||
}, {
|
}, { { name = 'buffer' } }),
|
||||||
{ name = 'buffer' },
|
|
||||||
}),
|
|
||||||
sorting = {
|
sorting = {
|
||||||
priority_weight = 2,
|
priority_weight = 2,
|
||||||
comparators = {
|
comparators = {
|
||||||
@ -208,52 +189,40 @@ cmp.setup({
|
|||||||
-- Below is the default comparitor list and order for nvim-cmp
|
-- Below is the default comparitor list and order for nvim-cmp
|
||||||
cmp.config.compare.offset,
|
cmp.config.compare.offset,
|
||||||
-- cmp.config.compare.scopes, --this is commented in nvim-cmp too
|
-- cmp.config.compare.scopes, --this is commented in nvim-cmp too
|
||||||
cmp.config.compare.exact,
|
cmp.config.compare.exact, cmp.config.compare.score,
|
||||||
cmp.config.compare.score,
|
cmp.config.compare.recently_used, cmp.config.compare.locality,
|
||||||
cmp.config.compare.recently_used,
|
cmp.config.compare.kind, cmp.config.compare.sort_text,
|
||||||
cmp.config.compare.locality,
|
cmp.config.compare.length, cmp.config.compare.order
|
||||||
cmp.config.compare.kind,
|
}
|
||||||
cmp.config.compare.sort_text,
|
}
|
||||||
cmp.config.compare.length,
|
|
||||||
cmp.config.compare.order,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
|
||||||
cmp.setup.cmdline('/', {
|
cmp.setup.cmdline('/', {
|
||||||
mapping = cmp.mapping.preset.cmdline(),
|
mapping = cmp.mapping.preset.cmdline(),
|
||||||
sources = {
|
sources = { { name = 'buffer' } }
|
||||||
{ name = 'buffer' }
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
cmp.setup.cmdline(':', {
|
cmp.setup.cmdline(':', {
|
||||||
mapping = cmp.mapping.preset.cmdline(),
|
mapping = cmp.mapping.preset.cmdline(),
|
||||||
sources = cmp.config.sources({
|
sources = cmp.config.sources({ { name = 'path' } }, {
|
||||||
{ name = 'path' }
|
{ name = 'cmdline', option = { ignore_cmds = { 'Man', '!' } } }
|
||||||
}, {
|
|
||||||
{
|
|
||||||
name = 'cmdline',
|
|
||||||
option = {
|
|
||||||
ignore_cmds = { 'Man', '!' }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||||
|
|
||||||
local servers = { 'bashls', 'jedi_language_server', 'sqlls', 'jsonls', 'yamlls', 'vimls', 'dotls', 'dockerls', 'html', 'cssls', 'lua_ls' }
|
local servers = {
|
||||||
|
'bashls', 'jedi_language_server', 'sqlls', 'jsonls', 'yamlls', 'vimls',
|
||||||
|
'dotls', 'dockerls', 'html', 'cssls', 'lua_ls'
|
||||||
|
}
|
||||||
for _, lsp in ipairs(servers) do
|
for _, lsp in ipairs(servers) do
|
||||||
lspconfig[lsp].setup {
|
lspconfig[lsp].setup {
|
||||||
-- on_attach = my_custom_on_attach,
|
-- on_attach = my_custom_on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
cmp.event:on("menu_opened", function()
|
cmp.event:on("menu_opened",
|
||||||
vim.b.copilot_suggestion_hidden = true
|
function() vim.b.copilot_suggestion_hidden = true end)
|
||||||
end)
|
cmp.event:on("menu_closed",
|
||||||
cmp.event:on("menu_closed", function()
|
function() vim.b.copilot_suggestion_hidden = false end)
|
||||||
vim.b.copilot_suggestion_hidden = false
|
|
||||||
end)
|
|
||||||
|
1
plugin-confs/nvim-colorizer.lua
Normal file
1
plugin-confs/nvim-colorizer.lua
Normal file
@ -0,0 +1 @@
|
|||||||
|
require 'colorizer'.setup()
|
@ -1,34 +1,48 @@
|
|||||||
require 'nvim-treesitter.configs'.setup {
|
require 'nvim-treesitter.configs'.setup {
|
||||||
-- One of "all", "maintained" (parsers with maintainers), or a list of languages
|
-- A list of parser names, or "all" (the five listed parsers should always be installed)
|
||||||
-- ensure_installed = "maintained",
|
ensure_installed = {
|
||||||
|
"c", "lua", "vim", "vimdoc", "query", "cpp", "python", "bash", "sql",
|
||||||
|
"yaml", "toml", "dockerfile", "gitcommit", "gitignore", "html", "css",
|
||||||
|
"javascript", "typescript", "rust", "go", "json", "regex", "latex",
|
||||||
|
"comment", "cmake", "graphql", "haskell", "java", "php", "ruby",
|
||||||
|
"sparql", "vue"
|
||||||
|
},
|
||||||
|
|
||||||
-- Install languages synchronously (only applied to `ensure_installed`)
|
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||||
sync_install = false,
|
sync_install = false,
|
||||||
|
|
||||||
-- List of parsers to ignore installing
|
-- Automatically install missing parsers when entering buffer
|
||||||
|
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
|
||||||
|
auto_install = true,
|
||||||
|
|
||||||
|
-- List of parsers to ignore installing (for "all")
|
||||||
-- ignore_install = { "javascript" },
|
-- ignore_install = { "javascript" },
|
||||||
|
|
||||||
|
---- If you need to change the installation directory of the parsers (see -> Advanced Setup)
|
||||||
|
-- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")!
|
||||||
|
|
||||||
highlight = {
|
highlight = {
|
||||||
-- `false` will disable the whole extension
|
|
||||||
enable = true,
|
enable = true,
|
||||||
|
|
||||||
|
-- NOTE: these are the names of the parsers and not the filetype. (for example if you want to
|
||||||
|
-- disable highlighting for the `tex` filetype, you need to include `latex` in this list as this is
|
||||||
|
-- the name of the parser)
|
||||||
-- list of language that will be disabled
|
-- list of language that will be disabled
|
||||||
-- disable = { "c", "rust" },
|
-- disable = { "c", "rust" },
|
||||||
|
-- Or use a function for more flexibility, e.g. to disable slow treesitter highlight for large files
|
||||||
|
-- disable = function(lang, buf)
|
||||||
|
-- local max_filesize = 100 * 1024 -- 100 KB
|
||||||
|
-- local ok, stats = pcall(vim.loop.fs_stat,
|
||||||
|
-- vim.api.nvim_buf_get_name(buf))
|
||||||
|
-- if ok and stats and stats.size > max_filesize then
|
||||||
|
-- return true
|
||||||
|
-- end
|
||||||
|
-- end,
|
||||||
|
|
||||||
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
|
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
|
||||||
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
|
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
|
||||||
-- Using this option may slow down your editor, and you may see some duplicate highlights.
|
-- Using this option may slow down your editor, and you may see some duplicate highlights.
|
||||||
-- Instead of true it can also be a list of languages
|
-- Instead of true it can also be a list of languages
|
||||||
additional_vim_regex_highlighting = false,
|
additional_vim_regex_highlighting = false
|
||||||
},
|
}
|
||||||
|
|
||||||
incremental_selection = {
|
|
||||||
enable = true,
|
|
||||||
keymaps = {
|
|
||||||
init_selection = "gnn",
|
|
||||||
node_incremental = "grn",
|
|
||||||
scope_incremental = "grc",
|
|
||||||
node_decremental = "grm",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user