nvim: colors, lazy, lsp
This commit is contained in:
parent
e3685c070a
commit
8f7ae28a48
10 changed files with 215 additions and 197 deletions
|
@ -1,7 +1,21 @@
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
|
local function toggle_win_opt(name)
|
||||||
|
local newval = not vim.api.nvim_win_get_option(0, name)
|
||||||
|
vim.api.nvim_win_set_option(
|
||||||
|
0,
|
||||||
|
name,
|
||||||
|
newval
|
||||||
|
)
|
||||||
|
if newval then
|
||||||
|
vim.notify(name .. ' is on')
|
||||||
|
else
|
||||||
|
vim.notify(name .. ' is off')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function M.setup()
|
function M.setup()
|
||||||
-- scroll up and down with shift+arrow
|
-- scroll up and down with shift+arrow {{
|
||||||
vim.keymap.set('n', '<S-Down>', '<C-E>')
|
vim.keymap.set('n', '<S-Down>', '<C-E>')
|
||||||
vim.keymap.set('n', '<S-Up>', '<C-Y>')
|
vim.keymap.set('n', '<S-Up>', '<C-Y>')
|
||||||
--}}}
|
--}}}
|
||||||
|
@ -9,12 +23,13 @@ function M.setup()
|
||||||
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to next diagnostic' })
|
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to next diagnostic' })
|
||||||
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to prev diagnostic' })
|
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to prev diagnostic' })
|
||||||
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist, { desc = 'Diagnostic to loclist' })
|
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist, { desc = 'Diagnostic to loclist' })
|
||||||
vim.keymap.set('n', 'n', "'Nn'[v:searchforward]", { expr = true, desc = 'Next search result' })
|
|
||||||
vim.keymap.set('x', 'n', "'Nn'[v:searchforward]", { expr = true, desc = 'Next search result' })
|
vim.keymap.set({ 'n', 'x', 'o' }, 'n', "'Nn'[v:searchforward]", { expr = true, desc = 'Next search result' })
|
||||||
vim.keymap.set('o', 'n', "'Nn'[v:searchforward]", { expr = true, desc = 'Next search result' })
|
vim.keymap.set({ 'n', 'x', 'o' }, 'N', "'nN'[v:searchforward]", { expr = true, desc = 'Prev search result' })
|
||||||
vim.keymap.set('n', 'N', "'nN'[v:searchforward]", { expr = true, desc = 'Prev search result' })
|
|
||||||
vim.keymap.set('x', 'N', "'nN'[v:searchforward]", { expr = true, desc = 'Prev search result' })
|
vim.keymap.set('n', '<leader>ow', function() toggle_win_opt('wrap') end, { desc = 'Toggle wrap' })
|
||||||
vim.keymap.set('o', 'N', "'nN'[v:searchforward]", { expr = true, desc = 'Prev search result' })
|
vim.keymap.set('n', '<leader>on', function() toggle_win_opt('number') end, { desc = 'Toggle number' })
|
||||||
|
vim.keymap.set('n', '<leader>or', function() toggle_win_opt('relativenumber') end, { desc = 'Toggle relativenumber' })
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
@ -60,7 +60,7 @@ function M.setup()
|
||||||
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd('FileType', {
|
vim.api.nvim_create_autocmd('FileType', {
|
||||||
pattern = { 'qf', 'man', 'help' },
|
pattern = { 'qf', 'man', 'help', 'tsplayground' },
|
||||||
callback = function(args)
|
callback = function(args)
|
||||||
local buf = args.buf
|
local buf = args.buf
|
||||||
local bo = vim.bo[buf]
|
local bo = vim.bo[buf]
|
||||||
|
@ -75,7 +75,6 @@ function M.setup()
|
||||||
if vim.bo[buf].filetype ~= 'qf' then
|
if vim.bo[buf].filetype ~= 'qf' then
|
||||||
vim.wo.statusline = '%Y %f%=%l:%v %P'
|
vim.wo.statusline = '%Y %f%=%l:%v %P'
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -5,114 +5,6 @@ local M = {
|
||||||
}
|
}
|
||||||
|
|
||||||
function M.config()
|
function M.config()
|
||||||
|
|
||||||
local function normalizeTSHighlight() --- {{{
|
|
||||||
-- helper {{{
|
|
||||||
local hl = function(group, opts)
|
|
||||||
if (opts.default == nil) then
|
|
||||||
opts.default = true
|
|
||||||
end
|
|
||||||
vim.api.nvim_set_hl(0, group, opts)
|
|
||||||
end
|
|
||||||
-- }}}
|
|
||||||
-- Misc {{{
|
|
||||||
hl('@comment', { link = 'Comment' })
|
|
||||||
hl('@none', { bg = 'NONE', fg = 'NONE' })
|
|
||||||
hl('@preproc', { link = 'PreProc' })
|
|
||||||
hl('@define', { link = 'Define' })
|
|
||||||
hl('@operator', { link = 'Operator' })
|
|
||||||
-- }}}
|
|
||||||
-- Punctuation {{{
|
|
||||||
hl('@punctuation.delimiter', { link = 'Delimiter' })
|
|
||||||
hl('@punctuation.bracket', { link = 'Delimiter' })
|
|
||||||
hl('@punctuation.special', { link = 'Delimiter' })
|
|
||||||
-- }}}
|
|
||||||
-- Literals {{{
|
|
||||||
hl('@string', { link = 'String' })
|
|
||||||
hl('@string.regex', { link = 'String' })
|
|
||||||
hl('@string.escape', { link = 'SpecialChar' })
|
|
||||||
hl('@string.special', { link = 'SpecialChar' })
|
|
||||||
|
|
||||||
hl('@character', { link = 'Character' })
|
|
||||||
hl('@character.special', { link = 'SpecialChar' })
|
|
||||||
|
|
||||||
hl('@boolean', { link = 'Boolean' })
|
|
||||||
hl('@number', { link = 'Number' })
|
|
||||||
hl('@float', { link = 'Float' })
|
|
||||||
-- }}}
|
|
||||||
-- Functions {{{
|
|
||||||
hl('@function', { link = 'Function' })
|
|
||||||
hl('@function.call', { link = 'Function' })
|
|
||||||
hl('@function.builtin', { link = 'Special' })
|
|
||||||
hl('@function.macro', { link = 'Macro' })
|
|
||||||
|
|
||||||
hl('@method', { link = 'Function' })
|
|
||||||
hl('@method.call', { link = 'Function' })
|
|
||||||
|
|
||||||
hl('@constructor', { link = 'Special' })
|
|
||||||
hl('@parameter', { link = 'Identifier' })
|
|
||||||
-- }}}
|
|
||||||
-- Keywords {{{
|
|
||||||
hl('@keyword', { link = 'Keyword' })
|
|
||||||
hl('@keyword.function', { link = 'Keyword' })
|
|
||||||
hl('@keyword.operator', { link = 'Keyword' })
|
|
||||||
hl('@keyword.return', { link = 'Keyword' })
|
|
||||||
|
|
||||||
hl('@conditional', { link = 'Conditional' })
|
|
||||||
hl('@repeat', { link = 'Repeat' })
|
|
||||||
hl('@debug', { link = 'Debug' })
|
|
||||||
hl('@label', { link = 'Label' })
|
|
||||||
hl('@include', { link = 'Include' })
|
|
||||||
hl('@exception', { link = 'Exception' })
|
|
||||||
-- }}}
|
|
||||||
-- Types {{{
|
|
||||||
hl('@type', { link = 'Type' })
|
|
||||||
hl('@type.builtin', { link = 'Type' })
|
|
||||||
hl('@type.qualifier', { link = 'Keyword' }) -- protected, public & friends
|
|
||||||
hl('@type.definition', { link = 'Typedef' })
|
|
||||||
|
|
||||||
hl('@storageclass', { link = 'StorageClass' })
|
|
||||||
hl('@attribute', { link = 'PreProc' })
|
|
||||||
hl('@field', { link = 'Identifier' })
|
|
||||||
hl('@property', { link = 'Identifier' })
|
|
||||||
-- }}}
|
|
||||||
-- Identifiers {{{
|
|
||||||
hl('@variable', { link = 'Identifier' })
|
|
||||||
hl('@variable.builtin', { link = 'Identifier' })
|
|
||||||
|
|
||||||
hl('@constant', { link = 'Constant' })
|
|
||||||
hl('@constant.builtin', { link = 'Special' })
|
|
||||||
hl('@constant.macro', { link = 'Define' })
|
|
||||||
|
|
||||||
hl('@namespace', { link = 'Include' })
|
|
||||||
hl('@symbol', { link = 'Identifier' })
|
|
||||||
-- }}}
|
|
||||||
-- Text {{{
|
|
||||||
hl('@text', {})
|
|
||||||
hl('@text.strong', { bold = true })
|
|
||||||
hl('@text.emphasis', { italic = true })
|
|
||||||
hl('@text.underline', { underline = true })
|
|
||||||
hl('@text.strike', { strikethrough = true })
|
|
||||||
hl('@text.title', { link = 'Title' })
|
|
||||||
hl('@text.literal', { link = 'String' })
|
|
||||||
hl('@text.uri', { link = 'Underlined' })
|
|
||||||
hl('@text.math', { link = 'Special' })
|
|
||||||
hl('@text.environment', { link = 'Macro' })
|
|
||||||
hl('@text.environment.name', { link = 'Type' })
|
|
||||||
hl('@text.reference', { link = 'Constant' })
|
|
||||||
|
|
||||||
hl('@text.todo', { link = 'Todo' })
|
|
||||||
hl('@text.note', { link = 'SpecialComment' })
|
|
||||||
hl('@text.warning', { link = 'WarningMsg' })
|
|
||||||
hl('@text.danger', { link = 'ErrorMsg' })
|
|
||||||
-- }}}
|
|
||||||
-- Tags {{{
|
|
||||||
hl('@tag', { link = 'Tag' })
|
|
||||||
hl('@tag.attribute', { link = 'Identifier' })
|
|
||||||
hl('@tag.delimiter', { link = 'Delimiter' })
|
|
||||||
-- }}}
|
|
||||||
end -- }}}
|
|
||||||
|
|
||||||
local function normalizeTerminal() -- {{{
|
local function normalizeTerminal() -- {{{
|
||||||
vim.g.terminal_color_0 = 0
|
vim.g.terminal_color_0 = 0
|
||||||
vim.g.terminal_color_1 = 1
|
vim.g.terminal_color_1 = 1
|
||||||
|
@ -170,6 +62,16 @@ function M.config()
|
||||||
vim.api.nvim_set_hl(0, hl, { link = to })
|
vim.api.nvim_set_hl(0, hl, { link = to })
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function normalizeTSHighlight() --- {{{
|
||||||
|
link('@class', 'Type')
|
||||||
|
link('@interface', 'Type')
|
||||||
|
link('@namespace', 'Type')
|
||||||
|
link('@event', 'Type')
|
||||||
|
|
||||||
|
link('@type.qualifier', 'Keyword')
|
||||||
|
link('@storageclass', 'Keyword')
|
||||||
|
end -- }}}
|
||||||
|
|
||||||
local function normalizeTroubleHighlight() -- {{{
|
local function normalizeTroubleHighlight() -- {{{
|
||||||
copyFg('TroubleText', 'Normal')
|
copyFg('TroubleText', 'Normal')
|
||||||
copyFg('TroubleFoldIcon', 'CursorLineNr')
|
copyFg('TroubleFoldIcon', 'CursorLineNr')
|
||||||
|
@ -236,19 +138,28 @@ function M.config()
|
||||||
link('CmpItemAbbrMatch', 'GruvboxAquaBold')
|
link('CmpItemAbbrMatch', 'GruvboxAquaBold')
|
||||||
link('CmpItemAbbrMatchFuzzy', 'GruvboxAquaBold')
|
link('CmpItemAbbrMatchFuzzy', 'GruvboxAquaBold')
|
||||||
|
|
||||||
link('WhiteSpace', 'GruvboxBg3') -- make it more bright
|
link('FloatBorder', 'GruvBoxFg1')
|
||||||
|
|
||||||
gr:hl('LineNr', 'gray', 'dark0_hard', { 'underdotted' })
|
link('NonText', 'GruvboxBg3') -- make it more bright
|
||||||
gr:hl('LspCodeLens', 'gray', nil, { 'italic' })
|
|
||||||
|
|
||||||
gr:hl('IndentBlanklineContextChar', 'orange', nil, { 'nocombine' })
|
local linenr_style = { 'underdotted' }
|
||||||
|
if vim.fn.has('nvim-0.9') then
|
||||||
|
linenr_style = {}
|
||||||
|
end
|
||||||
|
|
||||||
gr:hl('DiagnosticVirtualTextError', 'error', nil, { 'italic' })
|
gr:hl('LineNr', 'gray', 'dark0_hard', linenr_style)
|
||||||
gr:hl('DiagnosticVirtualTextWarn', 'warn', nil, { 'italic' })
|
gr:hl('LspCodeLens', 'gray', nil, { 'italic', })
|
||||||
gr:hl('DiagnosticVirtualTextInfo', 'info', nil, { 'italic' })
|
|
||||||
gr:hl('DiagnosticVirtualTextHint', 'hint', nil, { 'italic' })
|
|
||||||
|
|
||||||
end
|
gr:hl('IndentBlanklineContextChar', 'orange', nil, { 'nocombine', })
|
||||||
|
|
||||||
|
gr:hl('DiagnosticVirtualTextError', 'error', nil, { 'italic', })
|
||||||
|
gr:hl('DiagnosticVirtualTextWarn', 'warn', nil, { 'italic', })
|
||||||
|
gr:hl('DiagnosticVirtualTextInfo', 'info', nil, { 'italic', })
|
||||||
|
gr:hl('DiagnosticVirtualTextHint', 'hint', nil, { 'italic', })
|
||||||
|
|
||||||
|
-- gr:hl('GitSignsAddLine', nil, 'faded_green', {})
|
||||||
|
-- vim.fn.sign_define('GitSignsAdd', { text = '│', texthl = 'GitSignsAdd', linehl = 'GitSignsAddLine', culhl='CursorLine' })
|
||||||
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd('ColorschemePre', {
|
vim.api.nvim_create_autocmd('ColorschemePre', {
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
return {
|
return {
|
||||||
'lewis6991/gitsigns.nvim',
|
'lewis6991/gitsigns.nvim',
|
||||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||||
|
event = 'VeryLazy',
|
||||||
opts = {
|
opts = {
|
||||||
on_attach = function(bufnr)
|
on_attach = function(bufnr)
|
||||||
local gs = package.loaded.gitsigns
|
local gs = package.loaded.gitsigns
|
||||||
|
|
|
@ -37,11 +37,13 @@ local function on_attach(args) -- {{{
|
||||||
vim.keymap.set('i', '<C-k>', vim.lsp.buf.signature_help, mkOpts('LSP signature help'))
|
vim.keymap.set('i', '<C-k>', vim.lsp.buf.signature_help, mkOpts('LSP signature help'))
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd(
|
if client.server_capabilities.codeLensProvider then
|
||||||
{ 'BufEnter', 'CursorHold', 'InsertLeave' }, {
|
vim.api.nvim_create_autocmd(
|
||||||
callback = vim.lsp.codelens.refresh,
|
{ 'BufEnter', 'CursorHold', 'InsertLeave', }, {
|
||||||
buffer = bufnr,
|
callback = vim.lsp.codelens.refresh,
|
||||||
})
|
buffer = bufnr,
|
||||||
|
})
|
||||||
|
end
|
||||||
vim.keymap.set('n', '<leader>cl', vim.lsp.codelens.run, mkOpts('LSP Run code lens'))
|
vim.keymap.set('n', '<leader>cl', vim.lsp.codelens.run, mkOpts('LSP Run code lens'))
|
||||||
vim.keymap.set('n', '<leader>ci', vim.lsp.buf.implementation, mkOpts('LSP implementation'))
|
vim.keymap.set('n', '<leader>ci', vim.lsp.buf.implementation, mkOpts('LSP implementation'))
|
||||||
vim.keymap.set('n', '<leader>cd', vim.lsp.buf.type_definition, mkOpts('LSP type definition'))
|
vim.keymap.set('n', '<leader>cd', vim.lsp.buf.type_definition, mkOpts('LSP type definition'))
|
||||||
|
@ -53,7 +55,6 @@ local function on_attach(args) -- {{{
|
||||||
vim.keymap.set('n', '<leader>cco', vim.lsp.buf.outgoing_calls, mkOpts('LSP outgoing calls'))
|
vim.keymap.set('n', '<leader>cco', vim.lsp.buf.outgoing_calls, mkOpts('LSP outgoing calls'))
|
||||||
-- vim.keymap.set('n', 'gr', vim.lsp.buf.references, mkOpts('LSP references'))
|
-- vim.keymap.set('n', 'gr', vim.lsp.buf.references, mkOpts('LSP references'))
|
||||||
vim.keymap.set('n', '<leader>cr', '<Cmd>Trouble lsp_references<CR>', mkOpts('LSP references'))
|
vim.keymap.set('n', '<leader>cr', '<Cmd>Trouble lsp_references<CR>', mkOpts('LSP references'))
|
||||||
|
|
||||||
vim.keymap.set(
|
vim.keymap.set(
|
||||||
{ 'v', 'n' }, '<leader>F', function()
|
{ 'v', 'n' }, '<leader>F', function()
|
||||||
vim.lsp.buf.format({ async = true, filter = formatting_filter, })
|
vim.lsp.buf.format({ async = true, filter = formatting_filter, })
|
||||||
|
@ -64,13 +65,86 @@ local function on_attach(args) -- {{{
|
||||||
if (formatting_filter(client)) then
|
if (formatting_filter(client)) then
|
||||||
vim.api.nvim_buf_set_option(bufnr, 'formatexpr', 'v:lua.vim.lsp.formatexpr(#{timeout_ms:250})')
|
vim.api.nvim_buf_set_option(bufnr, 'formatexpr', 'v:lua.vim.lsp.formatexpr(#{timeout_ms:250})')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if client.name == 'omnisharp' then
|
||||||
|
client.server_capabilities.semanticTokensProvider.legend = {
|
||||||
|
tokenModifiers = { 'static' },
|
||||||
|
tokenTypes = {
|
||||||
|
'comment', -- "comment",
|
||||||
|
'comment', -- "excluded_code",
|
||||||
|
'identifier', -- "identifier",
|
||||||
|
'keyword', -- "keyword",
|
||||||
|
'keyword', -- "keyword_control",
|
||||||
|
'number', -- "number",
|
||||||
|
'operator', -- "operator",
|
||||||
|
'operator', -- "operator_overloaded",
|
||||||
|
'preproc', -- "preprocessor_keyword",
|
||||||
|
'string', -- "string",
|
||||||
|
'whitespace', -- "whitespace",
|
||||||
|
'text', -- "text",
|
||||||
|
'static', -- "static_symbol",
|
||||||
|
'preproc', -- "preprocessor_text",
|
||||||
|
'punctuation', -- "punctuation",
|
||||||
|
'string.escape', -- "string_verbatim",
|
||||||
|
'character.special', -- "string_escape_character",
|
||||||
|
'class', -- "class_name",
|
||||||
|
'type', -- "delegate_name",
|
||||||
|
'enum', -- "enum_name",
|
||||||
|
'interface', -- "interface_name",
|
||||||
|
'namespace', -- "module_name",
|
||||||
|
'struct', -- "struct_name",
|
||||||
|
'typeParameter', -- "type_parameter_name",
|
||||||
|
'field', -- "field_name",
|
||||||
|
'enumMember', -- "enum_member_name",
|
||||||
|
'constant', -- "constant_name",
|
||||||
|
'variable', -- "local_name",
|
||||||
|
'parameter', -- "parameter_name",
|
||||||
|
'method', -- "method_name",
|
||||||
|
'method', -- "extension_method_name",
|
||||||
|
'property', -- "property_name",
|
||||||
|
'event', -- "event_name",
|
||||||
|
'namespace', -- "namespace_name",
|
||||||
|
'label', -- "label_name",
|
||||||
|
'text.literal', -- "xml_doc_comment_attribute_name",
|
||||||
|
'text.literal', -- "xml_doc_comment_attribute_quotes",
|
||||||
|
'text.literal', -- "xml_doc_comment_attribute_value",
|
||||||
|
'text.literal', -- "xml_doc_comment_cdata_section",
|
||||||
|
'text.literal', -- "xml_doc_comment_comment",
|
||||||
|
'text.literal', -- "xml_doc_comment_delimiter",
|
||||||
|
'text.literal', -- "xml_doc_comment_entity_reference",
|
||||||
|
'text.literal', -- "xml_doc_comment_name",
|
||||||
|
'text.literal', -- "xml_doc_comment_processing_instruction",
|
||||||
|
'text.literal', -- "xml_doc_comment_text",
|
||||||
|
'text.literal', -- "xml_literal_attribute_name",
|
||||||
|
'text.literal', -- "xml_literal_attribute_quotes",
|
||||||
|
'text.literal', -- "xml_literal_attribute_value",
|
||||||
|
'text.literal', -- "xml_literal_cdata_section",
|
||||||
|
'text.literal', -- "xml_literal_comment",
|
||||||
|
'text.literal', -- "xml_literal_delimiter",
|
||||||
|
'text.literal', -- "xml_literal_embedded_expression",
|
||||||
|
'text.literal', -- "xml_literal_entity_reference",
|
||||||
|
'text.literal', -- "xml_literal_name",
|
||||||
|
'text.literal', -- "xml_literal_processing_instruction",
|
||||||
|
'text.literal', -- "xml_literal_text",
|
||||||
|
'regexp', -- "regex_comment",
|
||||||
|
'regexp', -- "regex_character_class",
|
||||||
|
'regexp', -- "regex_anchor",
|
||||||
|
'regexp', -- "regex_quantifier",
|
||||||
|
'regexp', -- "regex_grouping",
|
||||||
|
'regexp', -- "regex_alternation",
|
||||||
|
'regexp', -- "regex_text",
|
||||||
|
'regexp', -- "regex_self_escaped_character",
|
||||||
|
'regexp' -- "regex_other_escape",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end
|
||||||
end -- }}}
|
end -- }}}
|
||||||
|
|
||||||
local function config()
|
local function config()
|
||||||
require('neodev').setup({})
|
require('neodev').setup({})
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd('LspAttach', {
|
vim.api.nvim_create_autocmd('LspAttach', {
|
||||||
callback = on_attach
|
callback = on_attach,
|
||||||
})
|
})
|
||||||
|
|
||||||
local nvim_lsp = require('lspconfig')
|
local nvim_lsp = require('lspconfig')
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
return {
|
return {
|
||||||
{ 'chrisbra/Colorizer', cmd = 'ColorToggle' },
|
{ 'norcalli/nvim-colorizer.lua',
|
||||||
|
config = true,
|
||||||
|
cmd = 'ColorizerToggle',
|
||||||
|
},
|
||||||
|
|
||||||
{ 'AndrewRadev/linediff.vim', cmd = 'Linediff' },
|
{ 'AndrewRadev/linediff.vim', cmd = 'Linediff' },
|
||||||
|
|
||||||
|
@ -11,17 +14,17 @@ return {
|
||||||
|
|
||||||
-- stolen from LazyVim
|
-- stolen from LazyVim
|
||||||
{
|
{
|
||||||
"stevearc/dressing.nvim",
|
'stevearc/dressing.nvim',
|
||||||
lazy = true,
|
lazy = true,
|
||||||
init = function()
|
init = function()
|
||||||
---@diagnostic disable-next-line: duplicate-set-field
|
---@diagnostic disable-next-line: duplicate-set-field
|
||||||
vim.ui.select = function(...)
|
vim.ui.select = function(...)
|
||||||
require("lazy").load({ plugins = { "dressing.nvim" } })
|
require('lazy').load({ plugins = { 'dressing.nvim', }, })
|
||||||
return vim.ui.select(...)
|
return vim.ui.select(...)
|
||||||
end
|
end
|
||||||
---@diagnostic disable-next-line: duplicate-set-field
|
---@diagnostic disable-next-line: duplicate-set-field
|
||||||
vim.ui.input = function(...)
|
vim.ui.input = function(...)
|
||||||
require("lazy").load({ plugins = { "dressing.nvim" } })
|
require('lazy').load({ plugins = { 'dressing.nvim', }, })
|
||||||
return vim.ui.input(...)
|
return vim.ui.input(...)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
@ -67,11 +70,11 @@ return {
|
||||||
version = '*',
|
version = '*',
|
||||||
config = function()
|
config = function()
|
||||||
require('mini.statusline').setup({})
|
require('mini.statusline').setup({})
|
||||||
end
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
{ 'fpob/nette.vim', ft = 'nette' },
|
{ 'fpob/nette.vim', ft = 'nette', },
|
||||||
{ 'ziglang/zig.vim', ft = 'zig' },
|
{ 'ziglang/zig.vim', ft = 'zig', },
|
||||||
|
|
||||||
{
|
{
|
||||||
'mfussenegger/nvim-jdtls',
|
'mfussenegger/nvim-jdtls',
|
||||||
|
@ -80,25 +83,25 @@ return {
|
||||||
|
|
||||||
{
|
{
|
||||||
'folke/trouble.nvim',
|
'folke/trouble.nvim',
|
||||||
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
dependencies = { 'nvim-tree/nvim-web-devicons', },
|
||||||
lazy = true,
|
lazy = true,
|
||||||
cmd = { 'Trouble', 'TroubleToggle' },
|
cmd = { 'Trouble', 'TroubleToggle', },
|
||||||
keys = {
|
keys = {
|
||||||
{ '<Leader>tt', '<Cmd>TroubleToggle<CR>', desc = 'Trouble toggle' },
|
{ '<Leader>tt', '<Cmd>TroubleToggle<CR>', desc = 'Trouble toggle', },
|
||||||
{ '<Leader>td', '<Cmd>Trouble document_diagnostics<CR>', desc = 'Trouble toggle' }
|
{ '<Leader>td', '<Cmd>Trouble document_diagnostics<CR>', desc = 'Trouble toggle', },
|
||||||
},
|
},
|
||||||
config = {
|
config = {
|
||||||
mode = 'document_diagnostics',
|
mode = 'document_diagnostics',
|
||||||
signs = {
|
signs = {
|
||||||
-- icons / text used for a diagnostic
|
-- icons / text used for a diagnostic
|
||||||
error = "",
|
error = '',
|
||||||
warning = "",
|
warning = '',
|
||||||
hint = "",
|
hint = '',
|
||||||
information = "",
|
information = '',
|
||||||
other = ""
|
other = '',
|
||||||
},
|
},
|
||||||
|
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ local M = {
|
||||||
}
|
}
|
||||||
|
|
||||||
function M.config()
|
function M.config()
|
||||||
vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]])
|
vim.g.neo_tree_remove_legacy_commands = 1
|
||||||
|
|
||||||
require('neo-tree').setup({
|
require('neo-tree').setup({
|
||||||
close_if_last_window = false, -- Close Neo-tree if it is the last window left in the tab
|
close_if_last_window = false, -- Close Neo-tree if it is the last window left in the tab
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
local M = {
|
local M = {
|
||||||
'jose-elias-alvarez/null-ls.nvim',
|
'jose-elias-alvarez/null-ls.nvim',
|
||||||
dependencies = { 'nvim-lua/plenary.nvim' }
|
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||||
}
|
}
|
||||||
|
|
||||||
function M.config()
|
function M.config()
|
||||||
|
@ -18,43 +18,46 @@ function M.config()
|
||||||
cwd = function(params)
|
cwd = function(params)
|
||||||
-- falls back to root if return value is nil
|
-- falls back to root if return value is nil
|
||||||
return params.root:match('jopixel') and not params.root:match('repo') and 'www';
|
return params.root:match('jopixel') and not params.root:match('repo') and 'www';
|
||||||
end
|
end,
|
||||||
}),
|
}),
|
||||||
nls.builtins.formatting.phpcsfixer.with({
|
nls.builtins.formatting.phpcsfixer.with({
|
||||||
extra_args = { '--rules', [[ {
|
extra_args = {
|
||||||
"@Symfony":true,
|
'--rules',
|
||||||
"nullable_type_declaration_for_default_null_value":true,
|
vim.fn.json_encode({
|
||||||
"array_syntax":{"syntax":"short"},
|
['@Symfony'] = true,
|
||||||
"binary_operator_spaces":{
|
nullable_type_declaration_for_default_null_value = true,
|
||||||
"default":"single_space",
|
array_syntax = { syntax = 'short' },
|
||||||
"operators": {
|
fully_qualified_strict_types = false,
|
||||||
"=>":"align_single_space_minimal",
|
binary_operator_spaces = {
|
||||||
"=":"align_single_space_minimal",
|
default = 'single_space',
|
||||||
"??=":"align_single_space_minimal",
|
operators = {
|
||||||
"^=":"align_single_space_minimal",
|
['=>'] = 'align_single_space_minimal',
|
||||||
"|=":"align_single_space_minimal",
|
['='] = 'align_single_space_minimal',
|
||||||
"+=":"align_single_space_minimal",
|
['??='] = 'align_single_space_minimal',
|
||||||
"%=":"align_single_space_minimal",
|
['^='] = 'align_single_space_minimal',
|
||||||
"&=":"align_single_space_minimal",
|
['|='] = 'align_single_space_minimal',
|
||||||
"**=":"align_single_space_minimal",
|
['+='] = 'align_single_space_minimal',
|
||||||
"*=":"align_single_space_minimal",
|
['%='] = 'align_single_space_minimal',
|
||||||
"-=":"align_single_space_minimal",
|
['&='] = 'align_single_space_minimal',
|
||||||
".=":"align_single_space_minimal",
|
['**='] = 'align_single_space_minimal',
|
||||||
"/=":"align_single_space_minimal",
|
['*='] = 'align_single_space_minimal',
|
||||||
"<<=":"align_single_space_minimal",
|
['-='] = 'align_single_space_minimal',
|
||||||
"<=":"align_single_space_minimal",
|
['.='] = 'align_single_space_minimal',
|
||||||
">=":"align_single_space_minimal",
|
['/='] = 'align_single_space_minimal',
|
||||||
">>=":"align_single_space_minimal"
|
['<<='] = 'align_single_space_minimal',
|
||||||
}
|
['<='] = 'align_single_space_minimal',
|
||||||
},
|
['>='] = 'align_single_space_minimal',
|
||||||
"fully_qualified_strict_types":false
|
['>>='] = 'align_single_space_minimal'
|
||||||
} ]] }
|
},
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
},
|
||||||
}),
|
}),
|
||||||
nls.builtins.diagnostics.shellcheck,
|
nls.builtins.diagnostics.shellcheck,
|
||||||
nls.builtins.formatting.eslint,
|
nls.builtins.formatting.eslint,
|
||||||
-- nls.builtins.diagnostics.eslint,
|
-- nls.builtins.diagnostics.eslint,
|
||||||
nls.builtins.code_actions.eslint,
|
nls.builtins.code_actions.eslint,
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ local M = {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
function M.opts()
|
function M.config()
|
||||||
local cmp = require('cmp')
|
local cmp = require('cmp')
|
||||||
local kind_func = require('lspkind').cmp_format({})
|
local kind_func = require('lspkind').cmp_format({})
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ function M.opts()
|
||||||
-- folders don't exist on UNIX!
|
-- folders don't exist on UNIX!
|
||||||
modif.kind = string.gsub(modif.kind, 'Folder', 'Directory')
|
modif.kind = string.gsub(modif.kind, 'Folder', 'Directory')
|
||||||
return modif
|
return modif
|
||||||
end
|
end,
|
||||||
},
|
},
|
||||||
window = {
|
window = {
|
||||||
-- completion = cmp.config.window.bordered(),
|
-- completion = cmp.config.window.bordered(),
|
||||||
|
@ -49,6 +49,23 @@ function M.opts()
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
--
|
||||||
|
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
|
||||||
|
cmp.setup.cmdline({ '/', '?' }, {
|
||||||
|
mapping = cmp.mapping.preset.cmdline(),
|
||||||
|
sources = {
|
||||||
|
{ name = 'buffer' },
|
||||||
|
},
|
||||||
|
})
|
||||||
|
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
|
||||||
|
cmp.setup.cmdline(':', {
|
||||||
|
mapping = cmp.mapping.preset.cmdline(),
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = 'path' },
|
||||||
|
}, {
|
||||||
|
{ name = 'cmdline' },
|
||||||
|
}),
|
||||||
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
@ -30,14 +30,14 @@ function M.config()
|
||||||
preview = {
|
preview = {
|
||||||
hide_on_startup = true
|
hide_on_startup = true
|
||||||
},
|
},
|
||||||
mappings = {
|
mappings = {
|
||||||
i = {
|
i = {
|
||||||
['<M-i>'] = layout_actions.toggle_preview,
|
['<M-i>'] = layout_actions.toggle_preview,
|
||||||
},
|
},
|
||||||
n = {
|
n = {
|
||||||
['<M-i>'] = layout_actions.toggle_preview,
|
['<M-i>'] = layout_actions.toggle_preview,
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
pickers = {
|
pickers = {
|
||||||
buffers = {
|
buffers = {
|
||||||
|
@ -55,11 +55,6 @@ function M.config()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
extensions = {
|
|
||||||
['ui-select'] = {
|
|
||||||
require('telescope.themes').get_dropdown {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
telescope.load_extension('fzf')
|
telescope.load_extension('fzf')
|
||||||
|
|
Loading…
Add table
Reference in a new issue