mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-27 19:28:52 +02:00
add lsp optional plugins and add config virtual text
This commit is contained in:
parent
7433474605
commit
9faad80261
7 changed files with 52 additions and 10 deletions
|
@ -36,6 +36,10 @@ config = {
|
|||
coderunner = opt("coderunner", {}),
|
||||
null_ls_ensure_installed = opt("null_ls_ensure_installed", {}),
|
||||
dap_ensure_installed = opt("dap_ensure_installed", {}),
|
||||
cmprg = opt("cmprg", false),
|
||||
cmpcalc = opt("cmpcalc", false),
|
||||
cmptag = opt("cmptag", false),
|
||||
lsp_virtualtext = opt("lsp_virtualtext", false),
|
||||
}
|
||||
|
||||
return config
|
||||
|
|
|
@ -4,6 +4,7 @@ require("config.lazy")
|
|||
require("user.colorscheme")
|
||||
require("user.keymaps")
|
||||
require("user.snip")
|
||||
require("user.nvim-tree")
|
||||
-- require("user.options")
|
||||
-- require("user.keymaps")
|
||||
-- require("user.autocommands")
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
-- dracula
|
||||
-- nightfox, dayfox, dawnfox, duskfox, nordfox, terafox, carbonfox
|
||||
vim.g.pcode_colorscheme = "gruvbox-baby"
|
||||
|
||||
-- custom transparent mode
|
||||
-- only support
|
||||
-- gruvbox-baby,
|
||||
|
@ -26,21 +27,25 @@ vim.g.pcode_colorscheme = "gruvbox-baby"
|
|||
-- nightfox
|
||||
-- 0 =off 1= on
|
||||
vim.g.pcode_transparent_mode = 0
|
||||
|
||||
-- 0 disable progress
|
||||
-- 1 lualine lsp progress
|
||||
-- 2 fidget progress
|
||||
vim.g.pcode_progress = 2
|
||||
vim.g.pcode_progress = 1
|
||||
|
||||
-- style
|
||||
-- 0 = default
|
||||
-- 1 = { left = "", right = "" },
|
||||
-- 2 = { left = " ", right = " " },
|
||||
-- 3 = { left = "", right = "" },
|
||||
vim.g.pcode_lualine_style = 0
|
||||
|
||||
-- style status icon
|
||||
-- 0 = default
|
||||
-- 1 = vim icon " "
|
||||
-- 2 = vim icon " "
|
||||
vim.g.pcode_status_icon = 0
|
||||
|
||||
-- start custom lualine style
|
||||
-- contoh style
|
||||
-- {
|
||||
|
@ -67,8 +72,10 @@ vim.g.pcode_status_icon = 0
|
|||
vim.g.pcode_custom_lualine = false
|
||||
vim.g.pcode_component_separators = { left = " ", right = " " }
|
||||
vim.g.pcode_section_separators = { left = "", right = " " }
|
||||
|
||||
-- 0 ( format jalan) 1 (fromat off)
|
||||
vim.g.pcode_format_on_save = 1
|
||||
|
||||
-- ini hanya untuk lsp yg tidak support masson
|
||||
-- untuk referesi support language kunjungi link dibawah
|
||||
-- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
|
||||
|
@ -76,6 +83,10 @@ vim.g.pcode_lsp_installer = {
|
|||
-- "yamlls",
|
||||
-- tambahkan di bawah sini setelah melakukan :masoninstall
|
||||
}
|
||||
|
||||
-- use for lsp diagnostics virtual text
|
||||
vim.g.pcode_lsp_virtualtext = false
|
||||
|
||||
-- untuk referesi support language kunjungi link dibawah
|
||||
-- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
|
||||
vim.g.pcode_mason_ensure_installed = { -- sebelumnya register_lsp
|
||||
|
@ -129,3 +140,8 @@ vim.g.pcode_whichkey = {
|
|||
vim.g.pcode_coderunner = {
|
||||
go = "go run $fileName",
|
||||
}
|
||||
|
||||
-- config for optional cmp
|
||||
vim.g.pcode_cmprg = false --https://github.com/lukas-reineke/cmp-rg
|
||||
vim.g.pcode_cmpcalc = false --https://github.com/hrsh7th/cmp-calc
|
||||
vim.g.pcode_cmptag = false --https://github.com/quangnguyen30192/cmp-nvim-tags
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
local cmprg = false
|
||||
local cmpcalc = false
|
||||
local cmptag = false
|
||||
local data_exists, custom_cmp = pcall(require, "core.config")
|
||||
if data_exists then
|
||||
cmprg = custom_cmp.cmprg
|
||||
cmpcalc = custom_cmp.cmpcalc
|
||||
cmptag = custom_cmp.cmptag
|
||||
end
|
||||
return {
|
||||
"hrsh7th/nvim-cmp",
|
||||
version = false, -- last release is way too old
|
||||
|
@ -8,6 +17,9 @@ return {
|
|||
"hrsh7th/cmp-path",
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
"hrsh7th/cmp-nvim-lua",
|
||||
{ "lukas-reineke/cmp-rg", enabled = cmprg }, -- experimental
|
||||
{ "hrsh7th/cmp-calc", enabled = cmpcalc }, -- experimental
|
||||
{ "quangnguyen30192/cmp-nvim-tags", enabled = cmptag }, -- experimental
|
||||
},
|
||||
opts = function()
|
||||
local cmp = require("cmp")
|
||||
|
@ -56,6 +68,9 @@ return {
|
|||
{ name = "buffer" },
|
||||
{ name = "path" },
|
||||
{ name = "nvim_lua" },
|
||||
{ name = "rg" }, -- experimental
|
||||
{ name = "calc" }, -- experimental
|
||||
{ name = "tags" }, --experimental
|
||||
}),
|
||||
formatting = {
|
||||
fields = { "kind", "abbr", "menu" },
|
||||
|
|
|
@ -32,9 +32,9 @@ return {
|
|||
-- event = "BufWinEnter",
|
||||
cmd = { "NvimTree", "NvimTreeToggle", "NvimTreeFocus", "NvimTreeClose" },
|
||||
-- dependencies = "kyazdani42/nvim-web-devicons",
|
||||
config = function()
|
||||
require("user.nvim-tree")
|
||||
end,
|
||||
-- config = function()
|
||||
-- require("user.nvim-tree")
|
||||
-- end,
|
||||
},
|
||||
-- for file tab
|
||||
{
|
||||
|
|
|
@ -5,6 +5,12 @@ if not status_cmp_ok then
|
|||
return
|
||||
end
|
||||
|
||||
local lspvitualtext = false
|
||||
local data_exists, lspconfig = pcall(require, "core.config")
|
||||
if data_exists then
|
||||
lspvitualtext = lspconfig.lsp_virtualtext
|
||||
end
|
||||
|
||||
local icons = require("user.icons")
|
||||
|
||||
M.capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
|
@ -29,7 +35,7 @@ M.setup = function()
|
|||
end
|
||||
|
||||
local config = {
|
||||
virtual_text = false, -- disable virtual text
|
||||
virtual_text = lspvitualtext, -- disable virtual text
|
||||
signs = {
|
||||
active = signs, -- show signs
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue