lsp ghost text optional config

This commit is contained in:
asep komarudin 2023-03-08 06:31:31 +07:00
parent 9faad80261
commit f60855a938
8 changed files with 149 additions and 36 deletions

View file

@ -40,6 +40,8 @@ config = {
cmpcalc = opt("cmpcalc", false),
cmptag = opt("cmptag", false),
lsp_virtualtext = opt("lsp_virtualtext", false),
lspghost_text = opt("lspghost_text", false),
loadnvimtree_lazy = opt("loadnvimtree_lazy", false),
}
return config

View file

@ -4,7 +4,7 @@ require("config.lazy")
require("user.colorscheme")
require("user.keymaps")
require("user.snip")
require("user.nvim-tree")
-- require("user.nvim-tree")
-- require("user.options")
-- require("user.keymaps")
-- require("user.autocommands")

View file

@ -12,7 +12,7 @@
-- catppuccin, catppuccin-latte, catppuccin-frappe, catppuccin-macchiato, catppuccin-mocha
-- dracula
-- nightfox, dayfox, dawnfox, duskfox, nordfox, terafox, carbonfox
vim.g.pcode_colorscheme = "gruvbox-baby"
vim.g.pcode_colorscheme = "tokyonight"
-- custom transparent mode
-- only support
@ -31,7 +31,7 @@ vim.g.pcode_transparent_mode = 0
-- 0 disable progress
-- 1 lualine lsp progress
-- 2 fidget progress
vim.g.pcode_progress = 1
vim.g.pcode_progress = 2
-- style
-- 0 = default
@ -85,7 +85,10 @@ vim.g.pcode_lsp_installer = {
}
-- use for lsp diagnostics virtual text
vim.g.pcode_lsp_virtualtext = false
vim.g.pcode_lsp_virtualtext = true
-- use for lsp ghost text config
vim.g.pcode_lspghost_text = true
-- untuk referesi support language kunjungi link dibawah
-- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
@ -145,3 +148,6 @@ vim.g.pcode_coderunner = {
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
-- load nvim-tree or not
vim.g.pcode_loadnvimtree_lazy = true

View file

@ -1,3 +1,4 @@
vim.opt.lazyredraw = false
return {
{ "gelguy/wilder.nvim", enabled = false },
{
@ -7,23 +8,92 @@ return {
"rcarriga/nvim-notify",
"nvim-treesitter/nvim-treesitter",
},
event = "BufWinEnter",
config = function()
vim.opt.lazyredraw = false
require("noice").setup({
messages = {
-- event = "BufWinEnter",
event = "VeryLazy",
opts = {
messages = {
enabled = false,
},
notify = {
enabled = false,
},
lsp = {
progress = {
enabled = false,
},
notify = {
enabled = false,
},
lsp = {
progress = {
enabled = false,
},
},
})
end,
},
},
keys = {
{
"<S-Enter>",
function()
require("noice").redirect(vim.fn.getcmdline())
end,
mode = "c",
desc = "Redirect Cmdline",
},
{
"<leader>snl",
function()
require("noice").cmd("last")
end,
desc = "Noice Last Message",
},
{
"<leader>snh",
function()
require("noice").cmd("history")
end,
desc = "Noice History",
},
{
"<leader>sna",
function()
require("noice").cmd("all")
end,
desc = "Noice All",
},
{
"<c-f>",
function()
if not require("noice.lsp").scroll(4) then
return "<c-f>"
end
end,
silent = true,
expr = true,
desc = "Scroll forward",
mode = { "i", "n", "s" },
},
{
"<c-b>",
function()
if not require("noice.lsp").scroll(-4) then
return "<c-b>"
end
end,
silent = true,
expr = true,
desc = "Scroll backward",
mode = { "i", "n", "s" },
},
},
-- config = function()
-- vim.opt.lazyredraw = false
-- require("noice").setup({
-- messages = {
-- enabled = false,
-- },
-- notify = {
-- enabled = false,
-- },
-- lsp = {
-- progress = {
-- enabled = false,
-- },
-- },
-- })
-- end,
},
{
"hrsh7th/cmp-cmdline",

View file

@ -1,11 +1,13 @@
local cmprg = false
local cmpcalc = false
local cmptag = false
local lspghost_text = 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
lspghost_text = custom_cmp.lspghost_text
end
return {
"hrsh7th/nvim-cmp",
@ -90,7 +92,7 @@ return {
documentation = cmp.config.window.bordered(),
},
experimental = {
ghost_text = true,
ghost_text = lspghost_text,
native_menu = false,
},
}

View file

@ -163,7 +163,7 @@ return {
-- for Speed up loading Lua modules in Neovim to improve startup time.
{
"lewis6991/impatient.nvim",
event = "BufRead",
event = "VeryLazy",
config = function()
require("user.impatient")
end,
@ -217,8 +217,26 @@ return {
-- for popup alert
{
"rcarriga/nvim-notify",
event = "BufWinEnter",
config = function()
keys = {
{
"<leader>un",
function()
require("notify").dismiss({ silent = true, pending = true })
end,
desc = "Delete all Notifications",
},
},
opts = {
timeout = 3000,
max_height = function()
return math.floor(vim.o.lines * 0.75)
end,
max_width = function()
return math.floor(vim.o.columns * 0.75)
end,
},
-- event = "BufWinEnter",
init = function()
local notify = require("notify")
-- this for transparency
notify.setup({ background_colour = "#000000" })
@ -237,12 +255,20 @@ return {
-- for popup input
{
"stevearc/dressing.nvim",
event = "BufWinEnter",
config = function()
require("user.dressing")
lazy = true,
init = function()
---@diagnostic disable-next-line: duplicate-set-field
vim.ui.select = function(...)
require("lazy").load({ plugins = { "dressing.nvim" } })
return vim.ui.select(...)
end
---@diagnostic disable-next-line: duplicate-set-field
vim.ui.input = function(...)
require("lazy").load({ plugins = { "dressing.nvim" } })
return vim.ui.input(...)
end
end,
},
-- mini scrollview
}, -- mini scrollview
{
"karb94/neoscroll.nvim",
event = "BufRead",
@ -275,5 +301,6 @@ return {
require("user.gitsigns")
end,
},
-- for loading info
-- remove duplicate
{ "tpope/vim-repeat", event = "VeryLazy" },
}

View file

@ -32,9 +32,14 @@ return {
-- event = "BufWinEnter",
cmd = { "NvimTree", "NvimTreeToggle", "NvimTreeFocus", "NvimTreeClose" },
-- dependencies = "kyazdani42/nvim-web-devicons",
-- config = function()
-- require("user.nvim-tree")
-- end,
config = function()
local data_exists, treeconfig = pcall(require, "core.config")
if data_exists then
if treeconfig.loadnvimtree_lazy then
require("user.nvim-tree")
end
end
end,
},
-- for file tab
{