mirror of
https://github.com/tiyn/dotfiles.git
synced 2025-10-13 04:51:15 +02:00
nvim: swapped explorer and tagger for new lua plugins
This commit is contained in:
@@ -1,2 +1,2 @@
|
||||
-- itchyny/lightline.vim
|
||||
vim.g.lightline = { colorscheme = 'tccs'}
|
||||
vim.g.lightline = { colorscheme = 'tccs' }
|
||||
|
@@ -1,2 +0,0 @@
|
||||
-- scrooloose/nerdtree
|
||||
vim.g.NERDTreeWinPos = 'left'
|
@@ -1,21 +1,14 @@
|
||||
-- hrsh7th/nvim-cmp
|
||||
|
||||
-- mason package manager
|
||||
require("mason").setup()
|
||||
require("mason-lspconfig").setup({
|
||||
-- automatically install language servers setup below for lspconfig
|
||||
automatic_setup = true,
|
||||
})
|
||||
|
||||
-- jose-elias-alvarez/null-ls.nvim
|
||||
local null_ls = require("null-ls")
|
||||
|
||||
null_ls.setup({
|
||||
sources = {
|
||||
require("null-ls-embedded").nls_source,
|
||||
null_ls.builtins.formatting.black,
|
||||
null_ls.builtins.formatting.mdformat,
|
||||
},
|
||||
sources = {
|
||||
require("null-ls-embedded").nls_source,
|
||||
null_ls.builtins.formatting.black,
|
||||
null_ls.builtins.formatting.mdformat,
|
||||
},
|
||||
})
|
||||
|
||||
require("null-ls").setup({
|
||||
@@ -27,9 +20,17 @@ require("null-ls").setup({
|
||||
},
|
||||
})
|
||||
|
||||
-- mason package manager
|
||||
require("mason").setup()
|
||||
|
||||
require("mason-lspconfig").setup({
|
||||
-- automatically install language servers setup below for lspconfig
|
||||
automatic_setup = true,
|
||||
})
|
||||
|
||||
require("mason-null-ls").setup({
|
||||
automatic_installation = true,
|
||||
ensure_installed = {}
|
||||
automatic_installation = true,
|
||||
ensure_installed = {}
|
||||
})
|
||||
|
||||
-- Add additional capabilities supported by nvim-cmp
|
||||
@@ -43,6 +44,18 @@ local cmp = require("cmp")
|
||||
local luasnip = require("luasnip")
|
||||
local lspkind = require("lspkind")
|
||||
cmp.setup {
|
||||
sorting = {
|
||||
comparators = {
|
||||
cmp.config.compare.offset,
|
||||
cmp.config.compare.exact,
|
||||
cmp.config.compare.score,
|
||||
require "cmp-under-comparator".under,
|
||||
cmp.config.compare.kind,
|
||||
cmp.config.compare.sort_text,
|
||||
cmp.config.compare.length,
|
||||
cmp.config.compare.order,
|
||||
},
|
||||
},
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
@@ -51,27 +64,28 @@ cmp.setup {
|
||||
mapping = {
|
||||
['<S-Tab>'] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
cmp.select_prev_item()
|
||||
elseif luasnip.jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
['<Tab>'] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
luasnip.expand_or_jump()
|
||||
else
|
||||
fallback()
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
['<C-e>'] = cmp.mapping.close(),
|
||||
['<CR>'] = cmp.mapping.confirm {
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = true,
|
||||
}},
|
||||
}
|
||||
},
|
||||
sources = {
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'path' },
|
||||
@@ -84,10 +98,10 @@ cmp.setup {
|
||||
preset = "codicons",
|
||||
maxwidth = 50,
|
||||
menu = {
|
||||
nvim_lsp = "[LSP]",
|
||||
path = "[PATH]",
|
||||
nvim_lsp = "[LSP]",
|
||||
path = "[PATH]",
|
||||
buffer = "[BUF]",
|
||||
luasnip = "[SNIP]",
|
||||
luasnip = "[SNIP]",
|
||||
},
|
||||
symbol_map = {
|
||||
Text = "",
|
||||
@@ -124,33 +138,47 @@ require("luasnip.loaders.from_snipmate").lazy_load()
|
||||
-- neovim/nvim-lspconfig
|
||||
local nvim_lsp = require('lspconfig')
|
||||
|
||||
require "lsp_signature".setup({
|
||||
bind = true,
|
||||
handler_opts = {
|
||||
border = "rounded"
|
||||
}
|
||||
})
|
||||
|
||||
local navbuddy = require("nvim-navbuddy")
|
||||
|
||||
local attach_func = function(client, bufnr)
|
||||
navbuddy.attach(client, bufnr)
|
||||
end
|
||||
|
||||
-- Use a loop to conveniently call 'setup' on multiple servers and
|
||||
-- map buffer local keybindings when the language server attaches
|
||||
local servers = { "pyright", "bashls", "texlab", "ccls", "nimls", "marksman" }
|
||||
for _, lsp in ipairs(servers) do
|
||||
nvim_lsp[lsp].setup {
|
||||
on_attach=on_attach,
|
||||
capabilities=capabilities,
|
||||
flags = {
|
||||
debounce_text_changes = 150
|
||||
}
|
||||
}
|
||||
nvim_lsp[lsp].setup {
|
||||
on_attach = attach_func,
|
||||
capabilities = capabilities,
|
||||
flags = {
|
||||
debounce_text_changes = 150
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
require'lspconfig'.jdtls.setup{
|
||||
on_attach=on_attach,
|
||||
flags = {
|
||||
debounce_text_changes = 150
|
||||
},
|
||||
cmd = { 'jdtls' }
|
||||
require 'lspconfig'.jdtls.setup {
|
||||
on_attach = attach_func,
|
||||
flags = {
|
||||
debounce_text_changes = 150
|
||||
},
|
||||
cmd = { 'jdtls' }
|
||||
}
|
||||
|
||||
require'lspconfig'.lua_ls.setup {
|
||||
require 'lspconfig'.lua_ls.setup {
|
||||
on_attach = attach_func,
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = { version = 'LuaJIT' },
|
||||
diagnostics = { globals = {'vim'} },
|
||||
diagnostics = { globals = { 'vim' } },
|
||||
workspace = { library = vim.api.nvim_get_runtime_file("", true) },
|
||||
telemetry = { enable = false },
|
||||
},
|
||||
|
@@ -1,5 +1,5 @@
|
||||
-- norcalli/nvim-colorizer.lua
|
||||
require 'colorizer'.setup {
|
||||
'*';
|
||||
'!markdown';
|
||||
'*',
|
||||
'!markdown',
|
||||
}
|
||||
|
@@ -1,21 +1,21 @@
|
||||
-- folke/todo-comments.nvim
|
||||
|
||||
require 'todo-comments'.setup {
|
||||
signs = true, -- show icons in the signs column
|
||||
signs = true, -- show icons in the signs column
|
||||
sign_priority = 8, -- sign priority
|
||||
-- keywords recognized as todo comments
|
||||
keywords = {
|
||||
ERRO = { icon = " ", color = "error"},
|
||||
ERRO = { icon = " ", color = "error" },
|
||||
TODO = { icon = " ", color = "info" },
|
||||
HACK = { icon = " ", color = "warning"},
|
||||
WARN = { icon = " ", color = "warning"},
|
||||
PERF = { icon = " ", color = "default"},
|
||||
NOTE = { icon = " ", color = "hint"},
|
||||
TEST = { icon = " ", color = "test"},
|
||||
HACK = { icon = " ", color = "warning" },
|
||||
WARN = { icon = " ", color = "warning" },
|
||||
PERF = { icon = " ", color = "default" },
|
||||
NOTE = { icon = " ", color = "hint" },
|
||||
TEST = { icon = " ", color = "test" },
|
||||
},
|
||||
gui_style = {
|
||||
fg = "NONE", -- The gui style to use for the fg highlight group.
|
||||
bg = "BOLD", -- The gui style to use for the bg highlight group.
|
||||
fg = "NONE", -- The gui style to use for the fg highlight group.
|
||||
bg = "BOLD", -- The gui style to use for the bg highlight group.
|
||||
},
|
||||
merge_keywords = true, -- when true, custom keywords will be merged with the defaults
|
||||
-- highlighting of the line containing the todo comment
|
||||
@@ -23,16 +23,16 @@ require 'todo-comments'.setup {
|
||||
-- * keyword: highlights of the keyword
|
||||
-- * after: highlights after the keyword (todo text)
|
||||
highlight = {
|
||||
multiline = true, -- enable multine todo comments
|
||||
multiline_pattern = "^.", -- lua pattern to match the next multiline from the start of the matched keyword
|
||||
multiline_context = 10, -- extra lines that will be re-evaluated when changing a line
|
||||
before = "", -- "fg" or "bg" or empty
|
||||
keyword = "wide", -- "fg", "bg", "wide", "wide_bg", "wide_fg" or empty. (wide and wide_bg is the same as bg, but will also highlight surrounding characters, wide_fg acts accordingly but with fg)
|
||||
after = "fg", -- "fg" or "bg" or empty
|
||||
multiline = true, -- enable multine todo comments
|
||||
multiline_pattern = "^.", -- lua pattern to match the next multiline from the start of the matched keyword
|
||||
multiline_context = 10, -- extra lines that will be re-evaluated when changing a line
|
||||
before = "", -- "fg" or "bg" or empty
|
||||
keyword = "wide", -- "fg", "bg", "wide", "wide_bg", "wide_fg" or empty. (wide and wide_bg is the same as bg, but will also highlight surrounding characters, wide_fg acts accordingly but with fg)
|
||||
after = "fg", -- "fg" or "bg" or empty
|
||||
pattern = [[.*<(KEYWORDS)\s*:]], -- pattern or table of patterns, used for highlighting (vim regex)
|
||||
comments_only = true, -- uses treesitter to match keywords in comments only
|
||||
max_line_len = 400, -- ignore lines longer than this
|
||||
exclude = {}, -- list of file types to exclude highlighting
|
||||
comments_only = true, -- uses treesitter to match keywords in comments only
|
||||
max_line_len = 400, -- ignore lines longer than this
|
||||
exclude = {}, -- list of file types to exclude highlighting
|
||||
},
|
||||
-- list of named colors where we try to extract the guifg from the
|
||||
-- list of highlight groups or use the hex color if hl not found as a fallback
|
||||
|
Reference in New Issue
Block a user