stable lsp colors + signature + misc updates

main
spike 2 years ago
parent 0759467fee
commit 4ecf95bcf1

2
.gitignore vendored

@ -1,3 +1,3 @@
plugin
plugin/*compiled.lua
spell
examples

19
TODO

@ -1,6 +1,18 @@
- [navigator] sync icons between navigator and nvchad lspconfig
- set neovim shell to bash/sh for faster commands (fish is slow)
see https://www.reddit.com/r/neovim/comments/opipij/guide_tips_and_tricks_to_reduce_startup_and/
- yank until end of line $ mapping
- remove registers from which-key plugin
- fix color/icon of status line diagnostics to match navigator
- pin all plugins
- autocommand move current directory when move to new window
- add/read language docs in vim
- vim.diagnostics.hide()/show() /
- create toggle diagnostics that overrides vim diagnostic show handler
- [navigator] use colors for codelens icons
- [navigator] remap C-k keymap
- [navigator] neovim diagnositc toggle (use hide() instead of disable)
- [navigator] check codelens icons
- [navigator] disable diagnostic on startup
- [navigator] manually setup all keymaps
- dynamic C-x: if number default or close window
- load custom/init.lua (autocommands) as vimscript file ?
- install neorg (neovim org mode)
@ -8,3 +20,6 @@
[x] [navigator] fix 'gi' keymap overriden by navigator (use space leader)
- welcome screen (use mini)
- incorporate changes in nvchad_ui to override
- [x]nvim C-p should not work in ft=qf

@ -11,6 +11,7 @@ require("core.utils").load_mappings()
local fn = vim.fn
local install_path = fn.stdpath "data" .. "/site/pack/packer/opt/packer.nvim"
if fn.empty(fn.glob(install_path)) > 0 then
vim.api.nvim_set_hl(0, "NormalFloat", { bg = "#1e222a" })
print "Cloning packer .."

@ -1,3 +1,4 @@
---@diagnostic disable: trailing-space
-- vim: foldmethod=marker foldlevel=0
-- n, v, i, t, c = mode name.s
@ -8,7 +9,7 @@ end
local M = {}
M.general = { --{{{
i = {
i = {--{{{
["jk"] = { "<esc>", "escape" },
@ -22,9 +23,9 @@ M.general = { --{{{
-- luasnip change choice
["<C-u>"] = { "<Plug>luasnip-next-choice", "change luasnip choice" },
},
},--}}}
n = {
n = {--{{{
["<ESC>"] = { "<cmd> noh <CR>", "no highlight" },
-- switch between windows
@ -35,8 +36,8 @@ M.general = { --{{{
-- Window resizing
["<C-Left>"] = { "<cmd> vert res -2 <CR>", "window width +" },
["<C-Right>"] = { "<cmd> vert res +2 <CR>", "window width -" },
["<C-Left>"] = { "<cmd> vert res +2 <CR>", "window width +" },
["<C-Right>"] = { "<cmd> vert res -2 <CR>", "window width -" },
["<C-Up>"] = { "<cmd>res +2 <CR>", "window height +" },
["<C-Down>"] = { "<cmd>res -2 <CR>", "window height -" },
@ -82,6 +83,42 @@ M.general = { --{{{
end
, "packer snapshot"},
["<leader>pr"] = { function()
-- require("plenary.reload").reload_module("plugins")
-- require("plenary.reload").reload_module("custom.plugins")
-- vim.cmd "LuaCacheClear"
-- package.loaded["plugins"] = nil
--
-- package.loaded["custom.plugins"] = nil
-- dofile(vim.fn.stdpath("config") .. '/lua/plugins/init.lua')
-- dofile(vim.fn.stdpath("config") .. '/lua/custom/plugins/init.lua')
--
require("sp4ke.utils").unload_lua_ns("plugins")
require("sp4ke.utils").unload_lua_ns("custom")
require("plugins")
-- require("sp4ke.utils").unload_lua_ns("custom")
vim.cmd "PackerCompile"
print("reloaded plugin config !")
end,
"packer reload/compile"
},
-- lua source current file
["<leader>.."] = {"<cmd> :w | source %<CR>", "save and source script "},
["<leader>.m"] = { function ()
local ok, core = pcall(require, "core")
if not ok then
return
end
-- reload nvchad mappings
require("plenary.reload").reload_module("core.utils")
require("plenary.reload").reload_module("core.default_config")
require("plenary.reload").reload_module("core.mappings")
require("core.utils").load_mappings()
print("mappings reloaded !")
end, "config reload mappings"},
["<leader>ss"] = { "<cmd> mks! <CR>", "save session"},
["<leader>sl"] = { "<cmd> source Session.vim <CR>", "load session"},
@ -131,7 +168,7 @@ M.general = { --{{{
},
-- quick close window
["<leader><Down>"] = {"<C-w>c", "close window"},
["<C-x>"] = {"<C-w>c", "close window"},
@ -150,8 +187,14 @@ M.general = { --{{{
["<leader>f8"] = { ":set foldlevel=8<CR>", "set fold level" },
["<leader>f9"] = { ":set foldlevel=9<CR>", "set fold level" },
["<leader>tf"] = { "<cmd> set foldmethod=expr | set \
foldexpr=nvim_treesitter#foldexpr()<CR>",
"enable Treesitter folding"},
["<leader>en"] = { "<cmd> cn <CR>", "next error" },
["]e"] = { "<cmd> cn <CR>", "next error" },
["<leader>ep"] = { "<cmd> cp <CR>", "previous error" },
["[e"] = { "<cmd> cp <CR>", "previous error" },
-- Tabularize mappings
@ -181,8 +224,11 @@ M.general = { --{{{
-- TODO: move to lspconfig section
-- ["<leader>lsp"] = { "<cmd> lua require('custom.plugins.configs.navigator').enable()<CR>", "lsp enable"},
["<leader>lsp"] = { "<cmd> LspStart<CR>", "lsp enable"},
["<M-s>"] = { "<cmd> LspStart<CR>", "lsp enable"},
["<leader>lst"] = { "<cmd> LspStop<CR>", "lsp disable"},
---------------
-- Programming languages specifics
---------------
@ -199,11 +245,11 @@ M.general = { --{{{
-- config files
["<leader>ev"] = {"<cmd> source ~/.config/nvim/Session.vim<CR>" , "edit vim config"},
},
},--}}}
t = { ["<C-x>"] = { termcodes "<C-\\><C-N>", "escape terminal mode" } },
v = {
v = {--{{{
-- ["j"] = { 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', opts = { expr = true } },
-- ["k"] = { 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', opts = { expr = true } },
["j"] = { "gj" },
@ -230,10 +276,10 @@ M.general = { --{{{
["<leader>a,"] = { "<cmd> Tabularize /,<CR>" },
["<leader>a<Bar>"] = { "<cmd> Tabularize /<Bar><CR>" },
},
},--}}}
-- command line mappings
c = {
c = {--{{{
["Tabe"] = { "tabe" },
-- Change Working Directory to that of the current file
@ -243,7 +289,11 @@ M.general = { --{{{
["%%"] = { "<C-R>=fnameescape(expand('%:h')).'/'<cr>",
"alias to current working dir"},
["Tab"] = { "Tabularize"},
}
["tsf"] = { "set foldmethod=expr | set foldexpr=nvim_treesitter#foldexpr()",
"enable Treesitter folding"}
}--}}}
} --}}}
M.tabufline = { --{{{
@ -436,7 +486,21 @@ M.fzf_lua = { --{{{
n = {
-- find
["<C-p>"] = { "<cmd> FzfLua files <CR>", "FzfLua find files" },
-- ["<C-p>"] = { "<cmd> FzfLua files <CR>", "FzfLua find files" },
["<C-p>"] = { function ()
local ignored_bufs = {
"qf",
}
for _, ignored in ipairs(ignored_bufs) do
if vim.bo.filetype == ignored then
local default_keyseq = termcodes("<C-p>")
vim.api.nvim_feedkeys(default_keyseq, 'n', false)
return
end
end
vim.cmd "FzfLua files"
end, "FzfLua find files" },
["<leader>fl"] = { "<cmd> FzfLua lines <CR>", "FzfLua grep open buffer lines" },
-- grep
@ -449,8 +513,9 @@ M.fzf_lua = { --{{{
["<leader>fr"] = { "<cmd> FzfLua resume <CR>", "FzfLua resume last search" },
["<leader>;"] = { "<cmd> FzfLua buffers <CR>", "FzfLua find buffers" },
["<leader>fb"] = { "<cmd> FzfLua builtins <CR>", "FzfLua builtins" },
["<leader>fb"] = { "<cmd> FzfLua builtin <CR>", "FzfLua builtins" },
["<leader>fh"] = { "<cmd> FzfLua help_tags <CR>", "FzfLua find help pages" },
["<leader>fm"] = { "<cmd> FzfLua marks <CR>", "FzfLua marks" },
["<leader>fo"] = { "<cmd> FzfLua oldfiles <CR>", "FzfLua find oldfiles" },
["<leader>tk"] = { "<cmd> FzfLua keymaps <CR>", "FzfLua show keymaps" },
@ -568,25 +633,25 @@ M.whichkey = { --{{{
} --}}}
M.blankline = { --{{{
-- plugin = true,
--
-- n = {
-- ["<leader>cc"] = {
-- function()
-- local ok, start = require("indent_blankline.utils").get_current_context(
-- vim.g.indent_blankline_context_patterns,
-- vim.g.indent_blankline_use_treesitter_scope
-- )
--
-- if ok then
-- vim.api.nvim_win_set_cursor(vim.api.nvim_get_current_win(), { start, 0 })
-- vim.cmd [[normal! _]]
-- end
-- end,
--
-- "Jump to current context",
-- },
-- },
plugin = true,
n = {
["<leader>cc"] = {
function()
local ok, start = require("indent_blankline.utils").get_current_context(
vim.g.indent_blankline_context_patterns,
vim.g.indent_blankline_use_treesitter_scope
)
if ok then
vim.api.nvim_win_set_cursor(vim.api.nvim_get_current_win(), { start, 0 })
vim.cmd [[normal! _]]
end
end,
"Jump to current context",
},
},
} --}}}
M.navigator = {--{{{

@ -7,6 +7,7 @@ g.nvchad_theme = config.ui.theme
g.toggle_theme_icon = ""
g.transparency = config.ui.transparency
g.theme_switcher_loaded = false
-- g.fg_man_folding_enable = true -- enable folding for man pages
-- use filetype.lua instead of filetype.vim. it's enabled by default in neovim 0.8 (nightly)
if g.vim_version < 8 then
@ -32,7 +33,7 @@ opt.softtabstop = 2 -- Let backspace delete indent
-- http://vim.wikia.com/wiki/Converting_tabs_to_spaces
opt.tabpagemax = 10
opt.fillchars = { eob = " " }
opt.fillchars = { eob = "" }
opt.ignorecase = true
opt.smartcase = true
opt.mouse = "a"
@ -61,12 +62,12 @@ opt.iskeyword:remove("-")
-- set foldmethod=expr
-- set foldexpr=nvim_treesitter#foldexpr()
--
opt.foldminlines = 3
opt.foldminlines = 2
opt.foldlevelstart = 0
opt.conceallevel=1 -- how to show text with :syn-conceal syntax
opt.list = true -- show tabs,trailing spaces and non-breakable spaces
opt.listchars = "tab: ,trail:•,extends:#,nbsp:." -- Highlight problematic whitespace
opt.listchars = "tab: ,trail:,extends:#,nbsp:⋅,eol:↴" -- Highlight problematic whitespace
opt.diffopt:append("vertical")
opt.completeopt = "menu,menuone,noselect"
opt.wrap = false

@ -8,11 +8,65 @@ local M = {}
M.ui = {
theme = "monekai",
theme_toggle = { "monekai", "blossom" },
hl_override = {
DiagnosticWarn = {
fg = "yellow",
italic = true,
},
St_LspWarning = {
fg = "yello"
},
DiagnosticHint = {
fg = "purple",
italic = true,
},
St_LspHints = {
fg = "pruple",
},
DiagnosticError = {
italic = true,
},
St_LspInfo = {
fg = "teal"
},
},
hl_add = {
DiagnosticInfo = { -- nvchad uses DiagnosticInformation wrong hi group for lsp
fg = "teal",
italic = true,
},
DiagnosticFloatingInfo = {
fg="white",
italic=true,
},
-- Code Lens related colors
LspCodeLens = {
fg = "vibrant_green",
underline = true,
},
LspDiagnosticsSignHint = { -- LspDiagnostics Code Action
fg = "vibrant_green",
italic = true,
},
-- end of code lens colors
DiffText = {
bg = "vigrant_green"
}
},
-- hl_override = {
-- CursorLine = {
-- underline = 1
-- }
-- },
myicons = {
lsp = {
diagnostic_head = '', -- default diagnostic head on dialogs
diagnostic_err = '', -- severity 1
diagnostic_warn = '', -- 2
diagnostic_info = '', -- 3
diagnostic_hint = '', -- 4
}
},
}
M.plugins = {

@ -9,11 +9,14 @@
-- if character under cursor is number
-- use normal C-x or close window
local vimscriptsfolder = vim.env.XDG_CONFIG_HOME .. "/nvim/myvimscript" -- relative to .config/nvim dir
vim.opt.runtimepath:prepend(vimscriptsfolder)
-- highlights {
vim.cmd [[
hi CursorLine gui=underline
]]
-- handled in chadrc ui
-- see also plugin/after highlihght.vim
-- vim.cmd[[ runtime highlight.vim ]]
--}
-- Shift key typos{

@ -0,0 +1,18 @@
local present, signature = pcall(require, "lsp_signature")
if not present then
return
end
local config = {
floating_window = false,
hint_enable = true,
}
M = {}
M.setup = function()
signature.setup(config)
end
return M

@ -9,9 +9,9 @@ M = {}
local config = {
-- debug = true,
debug = false,
transparency = 5,
lsp_signature_help = true,
lsp_signature_help = false, -- needs plugin lsp_signature
default_mapping = false,
keymaps = {
{ key = 'gr', func = require('navigator.reference').async_ref, desc = 'lsp async_ref' },
@ -43,7 +43,8 @@ local config = {
{ key = '<Space>D', func = vim.lsp.buf.type_definition, desc = 'lsp type_definition' },
{ key = 'gL', func = require('navigator.diagnostics').show_diagnostics, desc = 'lsp show_diagnostics' },
{ key = 'gG', func = require('navigator.diagnostics').show_buf_diagnostics, desc = 'lsp show_buf_diagnostics' },
{ key = '<Leader>dt', func = require('navigator.diagnostics').toggle_diagnostics, desc = 'lsp toggle_diagnostics' },
-- { key = '<Leader>dt', func = require('navigator.diagnostics').toggle_diagnostics, desc = 'lsp toggle_diagnostics' },
{ key = '<Leader>dt', func = require('sp4ke.lsp').toggle_diagnostics, desc = 'lsp toggle_diagnostics' },
{ key = ']d', func = vim.diagnostic.goto_next, desc = 'lsp next diagnostics' },
{ key = '[d', func = vim.diagnostic.goto_prev, desc = 'lsp prev diagnostics' },
{ key = ']O', func = vim.diagnostic.set_loclist, desc = 'lsp diagnostics set loclist' },
@ -73,16 +74,16 @@ local config = {
icons = {
icons = true, -- set to false to use system default ( if you using a terminal does not have nerd/icon)
-- Code action
code_action_icon = ' ', -- "",
code_action_icon = ' ', -- "",
-- code lens
code_lens_action_icon = '',
code_lens_action_icon = '',
-- Diagnostics
diagnostic_head = '', -- default diagnostic head on dialogs
diagnostic_err = '', -- severity 1
diagnostic_err = '', -- severity 1
diagnostic_warn = '', -- 2
diagnostic_info = '', -- 3
diagnostic_info = '', -- 3
diagnostic_hint = '', -- 4
-- used in the diagnostics summary window
@ -124,7 +125,7 @@ local config = {
document_highlight = false,
mason = true,
format_on_save = false, -- applies to all formatting feature of neovim
-- including auto-fold
-- including auto-fold
diagnostic = {
underline = true,
virtual_text = {
@ -135,13 +136,34 @@ local config = {
severity_sort = { reverse = true },
},
-- disable_lsp = {"sqls"},
diagnostic_scrollbar_sign = false,
disable_lsp = {"clangd"},
-- disable auto start of lsp per language
-- set global default on lspconfig (see lspconfig doc)
-- ["lua-dev"] = { -- only for lua-dev.nvim
-- autostart = false,
-- }
gopls = {
settings = {
hints = {
assignVariableTypes = true,
compositeLiteralFields = true,
compositeLiteralTypes = true,
constantValues = true,
functionTypeParameters = true,
parameterNames = true,
rangeVariableTypes = true,
},
}
},
["lua-dev"] = {
library = {
enabled = true,
plugins = {"navigator.lua"},
runtime = true,
types = true,
}
},
}
}
@ -151,18 +173,18 @@ end
-- make sure LSP is not started automatically
-- TODO: how to it per project basis
M.enable = function()
local lspconfig = require("lspconfig")
lspconfig.util.default_config = vim.tbl_extend(
"force",
lspconfig.util.default_config,
{
autostart = true
}
)
vim.cmd[[
LspStart
]]
end
-- M.enable = function()
-- local lspconfig = require("lspconfig")
-- lspconfig.util.default_config = vim.tbl_extend(
-- "force",
-- lspconfig.util.default_config,
-- {
-- autostart = true
-- }
-- )
-- vim.cmd[[
-- LspStart
-- ]]
-- end
return M

@ -2,6 +2,33 @@
--
-- TODO: interesting plugins to install
-- - neovim minisurround to replace vim-surround
--
-- #### notes on Lua and requiring modules
-- https://github.com/wbthomason/packer.nvim/issues/955
-- - when you require(...) a file in lua, it gets cached, so future require calls don't hit the filesystem.
-- This means reloading your lua config won't apply any changes because the old files are cached.
-- - Cached required modules are stored in `package.loaded` table
-- - for example if `require("foo.bar")` was issued it's cache would be in
-- `package.loaded["foo.bar"]`
--
-- - to remove the cached module
--
-- lua << EOF
--
-- for k, v in pairs(package.loaded) do
-- if string.match(k, "^my_lua_config") then
-- package.loaded[k] = nil
-- end
-- end
--
-- EOF
--
-- #### Proper way to reload packer while picking up all changes from configs/setup
-- - Remove the cached module using package.loaded["foo.bar"] = nil
-- - Execute :PackerCompile
--
-- This doesn't seem to work:
-- - XXX ~~Reload all lua modules with `"pleanery.reload".reload_module(mod)`~~ XXX
return {
["nvim-treesitter/nvim-treesitter-textobjects"] = {
@ -12,9 +39,20 @@ return {
end
},
["mfussenegger/nvim-dap"] = {
lock = true,
module = "dap"
},
["rcarriga/nvim-dap-ui"] = {
lock = true,
after = "nvim-dap",
config = function ()
require('dapui').setup()
end
},
["theHamsta/nvim-dap-virtual-text"] = {
lock = true,
after = "nvim-dap"
},
-- side panel with symbols (replaced by Navigator :LspSymbols cmd)
-- ["liuchengxu/vista.vim"] = {
-- cmd = "Vista",
@ -24,9 +62,11 @@ return {
-- },
--
["folke/which-key.nvim"] = {
lock = true,
disable = false,
},
["nvim-telescope/telescope.nvim"] = {
lock = true,
disable = true
},
["ibhagwan/fzf-lua"] = {
@ -42,6 +82,7 @@ return {
},
-- Run async commands (make & errors)
["skywind3000/asyncrun.vim"] = {
lock = true,
cmd = "AsyncRun",
config = function()
require("core.utils").load_mappings "asyncrun"
@ -49,11 +90,13 @@ return {
end
},
["tpope/vim-fugitive"] = {
lock = true,
cmd = {"G", "Git", "G*"}
},
-- session and view
["vim-scripts/restore_view.vim"] = {},
-- ["rmagatti/auto-session"] = {
-- config = function ()
-- require("auto-session").setup {
@ -69,13 +112,10 @@ return {
["tpope/vim-repeat"] = {
keys = {"."},
},
["justinmk/vim-sneak"] = {
lock = true,
keys = {"s", "S"},
setup = function()
vim.cmd[[
let g:sneak#s_next=1
]]
end
},
["tpope/vim-surround"] = {},
["godlygeek/tabular"] = {
@ -87,13 +127,11 @@ return {
--
["https://gitlab.com/HiPhish/info.vim.git"] = {
cmd = "Info",
setup = function()
require("custom.plugins.info").set_mappings()
end
},
-- snippets
["L3MON4D3/LuaSnip"] = {
lock = true,
config = function()
-- load default config first
require("plugins.configs.others").luasnip()
@ -118,6 +156,7 @@ return {
event = "InsertEnter",
},
["neovim/nvim-lspconfig"] = {
lock = true,
config = function()
local lspconfig = require("lspconfig")
lspconfig.util.default_config = vim.tbl_extend(
@ -130,6 +169,7 @@ return {
end-- disable lspconfig, handled by navigator
},
["williamboman/mason-lspconfig.nvim"] = {
lock = true,
requires = {"williamboman/mason.nvim", "nvim-lspconfig"},
after = "mason.nvim",
module = "mson-lspconfig.nvim",
@ -137,16 +177,16 @@ return {
require("mason-lspconfig").setup({})
end,
},
["hrsh7th/cmp-nvim-lsp-signature-help"] = {
after = "cmp-path"
},
["ray-x/guihua.lua"] = {
module = "navigator",
lock = true,
module = {"navigator"},
run= "cd lua/fzy && make"
},
-- ["https://git.sp4ke.xyz/sp4ke/navigator.lua"] =
--
["ray-x/navigator.lua"] = {
lock = true,
opt = true,
after = { "nvim-lspconfig", "base46", "ui" },
requires = {"neovim/nvim-lspconfig", "ray-x/guihua.lua", "nvim-treesitter/nvim-treesitter"},
setup = function()
@ -161,10 +201,23 @@ return {
end
},
["ray-x/lsp_signature.nvim"] = {
after = {"navigator.lua"},
config = function()
require("custom.plugins.configs.lsp_signature").setup()
end
},
-- per language plugins
-- -------
-- lua dev
-- -------
-- Eval Lua lines/selections
["bfredl/nvim-luadev"] = {
lock = true,
cmd = "Luadev",
keys = {
"<Plug>(Luadev-RunLine)",
@ -184,10 +237,13 @@ return {
})
end
},
-- REPL for Lua development
["ii14/neorepl.nvim"] = {
lock = true,
cmd = "Repl",
after = "nvim-cmp",
setup = function ()
config = function ()
local autocmd = vim.api.nvim_create_autocmd
autocmd("FileType",{
pattern = "neorepl",
@ -200,5 +256,32 @@ return {
end
})
end
},
-- Lua dev env
-- check setup in configs/navigator.lua
["folke/lua-dev.nvim"] = {
module = "lua-dev",
before = {"navigator.lua"},
},
-- golang dev
["ray-x/go.nvim"] = {
lock = true,
-- after = {"nvim-lspconfig", "navigator.lua", "guihua.lua"},
ft = {"go"},
opt = true,
config = function()
require("go").setup({
run_in_floaterm = true,
icons = false,
-- icons = { breakpoint = "🧘", currentpos = "🏃" }, -- set to false to disable
lsp_cfg = false, -- handled by navigator
-- lsp_keymaps = false, -- use navigator
-- lsp_diag_signs = false,
lsp_codelens = false, -- use navigator
textobjects = true,
})
end
}
}

@ -0,0 +1,48 @@
local fn = vim.fn
local sep_style = vim.g.statusline_sep_style
local separators = (type(sep_style) == "table" and sep_style)
or require("nvchad_ui.icons").statusline_separators[sep_style]
local sep_r = separators["right"]
local myicons = require("custom.chadrc").ui.myicons
-- called in chadrc
--
return {
fileInfo = function ()
local icon = ""
local filename = (fn.expand "%" == "" and "Empty ") or fn.expand "%:t"
local modified = (vim.bo[0].modified and "+ ") or ""
if filename ~= "Empty " then
local devicons_present, devicons = pcall(require, "nvim-web-devicons")
if devicons_present then
local ft_icon = devicons.get_icon(filename)
icon = (ft_icon ~= nil and " " .. ft_icon) or ""
end
filename = " " .. filename .. " "
end
return "%#St_file_info#" .. icon .. filename .. modified .. "%#St_file_sep#" .. sep_r
end,
LSP_Diagnostics = function()
if not rawget(vim, "lsp") then
return ""
end
local errors = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.ERROR })
local warnings = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.WARN })
local hints = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.HINT })
local info = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.INFO })
errors = (errors and errors > 0) and ("%#St_lspError#" .. myicons.lsp.diagnostic_err .. " " .. errors .. " ") or ""
warnings = (warnings and warnings > 0) and ("%#St_lspWarning#" .. myicons.lsp.diagnostic_warn .. " " .. warnings .. " ") or ""
hints = (hints and hints > 0) and ("%#St_lspHints#" .. myicons.lsp.diagnostic_hint .. " " .. hints .. " ") or ""
info = (info and info > 0) and ("%#St_lspInfo#" .. myicons.lsp.diagnostic_info .. " " .. info .. " ") or ""
return errors .. warnings .. hints .. info
end
}

@ -118,7 +118,6 @@ local options = {
{ name = "buffer" },
{ name = "nvim_lua" },
{ name = "path" },
{ name = "nvim_lsp_signature_help" },
},
}

@ -55,8 +55,9 @@ M.blankline = function()
buftype_exclude = { "terminal" },
show_trailing_blankline_indent = false,
show_first_indent_level = false,
show_current_context = false,
show_current_context_start = false,
show_current_context = true,
show_current_context_start = true,
show_end_of_line = true,
}
options = load_override(options, "lukas-reineke/indent-blankline.nvim")

@ -0,0 +1,14 @@
M = {}
M.shown = true
-- toggle diagnostics with show/hide
M.toggle_diagnostics = function ()
if M.shown then
M.shown = false
return vim.diagnostic.hide()
end
vim.diagnostic.show()
M.shown = true
end
return M

@ -0,0 +1,22 @@
local M = {}
M["unload_lua_ns"] = function (prefix)
local prefix_with_dot = prefix .. '.'
for key, _ in pairs(package.loaded) do
if key == prefix or key:sub(1, #prefix_with_dot) == prefix_with_dot then
print("removing: ", key)
package.loaded[key] = nil
end
end
end
-- M.unload_lua_ns("core")
M.list_loaded_modules = function ()
local loaded = {}
for k, _ in pairs(package.loaded) do
loaded[#loaded + 1] = k
end
vim.ui.select(loaded, {}, nil)
end
return M

@ -0,0 +1,11 @@
" vim modeline
" vim: foldmarker={,} foldmethod=marker foldlevel=0
" example usage
" for NvChad highlihgts chould be handled in chadrc
" au BufEnter * hi CursorLine gui=underline
" au BufEnter * hi CursorLine guifg=red
"
" GuiGua selected item (navigator etc )
au BufEnter * hi GuihuaListSelHl gui=underline guibg=bg

@ -0,0 +1,16 @@
nnoremap <leader>I :tab Info<CR>
augroup INFO
au!
au FileType info nnoremap i <NOP>
au FileType info nmap <buffer> <Up> <Plug>(InfoUp)
au FileType info nmap <buffer> iu <Plug>(InfoUp)
au FileType info nmap <buffer> <Down> <Plug>(InfoMenu)
au FileType info nmap <buffer> im <Plug>(InfoMenu)
au FileType info nmap <buffer> <C-F> <Plug>(InfoFollow)
au FileType info nmap <buffer> if <Plug>(InfoFollow)
au FileType info nmap <buffer> <Right> <Plug>(InfoNext)
au FileType info nmap <buffer> in <Plug>(InfoNext)
au FileType info nmap <buffer> <Left> <Plug>(InfoPrev)
au FileType info nmap <buffer> ip <Plug>(InfoPrev)
au FileType info nmap <buffer> ig <Plug>(InfoGoto)
augroup END

@ -0,0 +1,2 @@
let g:sneak#s_next=1
let g:sneak#use_ic_scs=1
Loading…
Cancel
Save