nvim: misc
This commit is contained in:
parent
5c5dc16367
commit
83636bb0ee
6 changed files with 106 additions and 56 deletions
|
@ -9,5 +9,4 @@ insert_final_newline = true
|
||||||
continuation_indent = 2
|
continuation_indent = 2
|
||||||
quote_style = single
|
quote_style = single
|
||||||
call_arg_parentheses = keep
|
call_arg_parentheses = keep
|
||||||
table_separator_style = comma
|
|
||||||
trailing_table_separator = smart
|
trailing_table_separator = smart
|
||||||
|
|
|
@ -19,7 +19,7 @@ require('lazy').setup(
|
||||||
-- rtp = { disabled_plugins = { 'netrwPlugin' } },
|
-- rtp = { disabled_plugins = { 'netrwPlugin' } },
|
||||||
change_detection = {
|
change_detection = {
|
||||||
-- automatically check for config file changes and reload the ui
|
-- automatically check for config file changes and reload the ui
|
||||||
enabled = true,
|
enabled = false,
|
||||||
notify = false, -- get a notification when changes are found
|
notify = false, -- get a notification when changes are found
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -123,10 +123,22 @@ function M.setup()
|
||||||
|
|
||||||
vim.b[args.buf].trouble_mode = table.concat(words, ' ')
|
vim.b[args.buf].trouble_mode = table.concat(words, ' ')
|
||||||
|
|
||||||
vim.wo.statusline = '%Y [%{b:trouble_mode}]%=%P'
|
vim.opt_local.statusline = '%Y [%{b:trouble_mode}]%=%P'
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
vim.diagnostic.config({
|
||||||
|
virtual_text = {
|
||||||
|
format = function(diag)
|
||||||
|
local s = vim.diagnostic.severity
|
||||||
|
if diag.severity == s.E or diag.severity == s.W then
|
||||||
|
return diag.message
|
||||||
|
end
|
||||||
|
return nil
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
if vim.g.neoray then -- {{{
|
if vim.g.neoray then -- {{{
|
||||||
vim.cmd.NeoraySet('CursorAnimTime', 0)
|
vim.cmd.NeoraySet('CursorAnimTime', 0)
|
||||||
vim.cmd.NeoraySet('Transparency', '0.95')
|
vim.cmd.NeoraySet('Transparency', '0.95')
|
||||||
|
|
|
@ -186,10 +186,9 @@ local function config() -- {{{
|
||||||
|
|
||||||
local nvim_lsp = require('lspconfig')
|
local nvim_lsp = require('lspconfig')
|
||||||
|
|
||||||
-- Use a loop to conveniently both setup defined servers
|
|
||||||
-- and map buffer local keybindings when the language server attaches
|
|
||||||
local servers = {
|
local servers = {
|
||||||
-- powershell_es = {},
|
-- {{{
|
||||||
|
powershell_es = {},
|
||||||
gopls = {},
|
gopls = {},
|
||||||
clangd = {},
|
clangd = {},
|
||||||
zls = {},
|
zls = {},
|
||||||
|
@ -205,15 +204,8 @@ local function config() -- {{{
|
||||||
-- {{{
|
-- {{{
|
||||||
handlers = {
|
handlers = {
|
||||||
['textDocument/definition'] = require('omnisharp_extended').handler,
|
['textDocument/definition'] = require('omnisharp_extended').handler,
|
||||||
-- ['textDocument/publishDiagnostics'] = vim.lsp.with(
|
|
||||||
-- vim.lsp.diagnostic.on_publish_diagnostics, {
|
|
||||||
-- virtual_text = {
|
|
||||||
-- severity = { vim.diagnostic.severity.WARN, vim.diagnostic.severity.ERROR },
|
|
||||||
-- },
|
|
||||||
-- }
|
|
||||||
-- ),
|
|
||||||
},
|
},
|
||||||
cmd = { 'omnisharp' },
|
cmd = { 'omnisharp', 'RoslynExtensionsOptions:EnableDecompilationSupport=true' },
|
||||||
enable_editorconfig_support = true,
|
enable_editorconfig_support = true,
|
||||||
enable_ms_build_load_projects_on_demand = false,
|
enable_ms_build_load_projects_on_demand = false,
|
||||||
enable_roslyn_analyzers = true,
|
enable_roslyn_analyzers = true,
|
||||||
|
@ -293,6 +285,7 @@ local function config() -- {{{
|
||||||
},
|
},
|
||||||
}, -- }}}
|
}, -- }}}
|
||||||
}
|
}
|
||||||
|
-- }}}
|
||||||
|
|
||||||
local mlsp = require('mason-lspconfig')
|
local mlsp = require('mason-lspconfig')
|
||||||
local available = mlsp.get_available_servers()
|
local available = mlsp.get_available_servers()
|
||||||
|
@ -301,7 +294,7 @@ local function config() -- {{{
|
||||||
for name, conf in pairs(servers) do
|
for name, conf in pairs(servers) do
|
||||||
conf.capabilities = capabilities
|
conf.capabilities = capabilities
|
||||||
nvim_lsp[name].setup(conf)
|
nvim_lsp[name].setup(conf)
|
||||||
if vim.tbl_contains(available, name) then
|
if vim.tbl_contains(available, name) and name ~= 'phpactor' then
|
||||||
ensure[#ensure + 1] = name
|
ensure[#ensure + 1] = name
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,13 +1,15 @@
|
||||||
return {
|
return {
|
||||||
{ 'norcalli/nvim-colorizer.lua',
|
{
|
||||||
|
'norcalli/nvim-colorizer.lua',
|
||||||
config = true,
|
config = true,
|
||||||
keys = { { '<leader>oc', '<Cmd>ColorizerToggle<Cr>' } },
|
keys = { { '<leader>oc', '<Cmd>ColorizerToggle<Cr>', desc = 'Toggle colorizer' } },
|
||||||
cmd = 'ColorizerToggle',
|
cmd = 'ColorizerToggle',
|
||||||
},
|
},
|
||||||
|
|
||||||
{ 'AndrewRadev/linediff.vim', cmd = 'Linediff' },
|
{ 'AndrewRadev/linediff.vim', cmd = 'Linediff' },
|
||||||
|
|
||||||
{ 'lukas-reineke/indent-blankline.nvim',
|
{
|
||||||
|
'lukas-reineke/indent-blankline.nvim',
|
||||||
event = 'VeryLazy',
|
event = 'VeryLazy',
|
||||||
config = true,
|
config = true,
|
||||||
opts = {
|
opts = {
|
||||||
|
@ -23,8 +25,72 @@ return {
|
||||||
'man',
|
'man',
|
||||||
'',
|
'',
|
||||||
},
|
},
|
||||||
}, },
|
},
|
||||||
{ 'echasnovski/mini.trailspace', version = '*', config = function() require('mini.trailspace').setup({}) end },
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
'chrisgrieser/nvim-various-textobjs',
|
||||||
|
keys = {
|
||||||
|
{ 'ii', function() require('various-textobjs').indentation(true, true) end, mode = { 'o', 'x' },
|
||||||
|
desc =
|
||||||
|
'Inside indent' },
|
||||||
|
{ 'ai', function() require('various-textobjs').indentation(false, false) end, mode = { 'o', 'x' },
|
||||||
|
desc =
|
||||||
|
'Around indent' },
|
||||||
|
-- { 'iI', function() require('various-textobjs').indentation(true, true) end, mode = { 'o', 'x' }, desc = '' },
|
||||||
|
-- { 'aI', function() require('various-textobjs').indentation(false, false) end, mode = { 'o', 'x' }, desc = '' },
|
||||||
|
{ 'iS', function() require('various-textobjs').subword(true) end, mode = { 'o', 'x' }, desc = '' },
|
||||||
|
{ 'aS', function() require('various-textobjs').subword(false) end, mode = { 'o', 'x' }, desc = '' },
|
||||||
|
{ '|', function() require('various-textobjs').column() end, mode = { 'o', 'x' }, desc = '' },
|
||||||
|
{ 'L', function() require('various-textobjs').url() end, mode = { 'o', 'x' }, desc = '' },
|
||||||
|
-- {"YOUR_MAPPING",function() require("various-textobjs").toNextClosingBracket() end, mode = { "o", "x" }, desc = "" },
|
||||||
|
-- {"YOUR_MAPPING",function() require("various-textobjs").restOfParagraph() end, mode = { "o", "x" }, desc = "" },
|
||||||
|
-- {"YOUR_MAPPING",function() require("various-textobjs").entireBuffer() end, mode = { "o", "x" }, desc = "" },
|
||||||
|
-- {"YOUR_MAPPING",function() require("various-textobjs").nearEoL() end, mode = { "o", "x" }, desc = "" },
|
||||||
|
-- {"YOUR_MAPPING",function() require("various-textobjs").lineCharacterwise() end, mode = { "o", "x" }, desc = "" },
|
||||||
|
-- {"YOUR_MAPPING",function() require("various-textobjs").value(true) end, mode = { "o", "x" }, desc = "" },
|
||||||
|
-- {"YOUR_MAPPING",function() require("various-textobjs").value(false) end, mode = { "o", "x" }, desc = "" },
|
||||||
|
-- {"YOUR_MAPPING",function() require("various-textobjs").key(true) end, mode = { "o", "x" }, desc = "" },
|
||||||
|
-- {"YOUR_MAPPING",function() require("various-textobjs").key(false) end, mode = { "o", "x" }, desc = "" },
|
||||||
|
-- {"YOUR_MAPPING",function() require("various-textobjs").diagnostic() end, mode = { "o", "x" }, desc = "" },
|
||||||
|
--------------------------------------------------------------------------------------
|
||||||
|
-- put these into the ftplugins or autocms for the filetypes you want to use them with
|
||||||
|
-- {"YOUR_MAPPING",function() require("various-textobjs").mdlink(true) end, { buffer = true }, mode = { "o", "x" }, desc = "" },
|
||||||
|
-- {"YOUR_MAPPING",function() require("various-textobjs").mdlink(false) end, { buffer = true }, mode = { "o", "x" }, desc = "" },
|
||||||
|
--
|
||||||
|
-- {"YOUR_MAPPING",function() require("various-textobjs").mdFencedCodeBlock(true) end, { buffer = true }, mode = { "o", "x" }, desc = "" },
|
||||||
|
-- {"YOUR_MAPPING",function() require("various-textobjs").mdFencedCodeBlock(false) end, { buffer = true }, mode = { "o", "x" }, desc = "" },
|
||||||
|
--
|
||||||
|
-- {"YOUR_MAPPING",function() require("various-textobjs").cssSelector(true) end, { buffer = true }, mode = { "o", "x" }, desc = "" },
|
||||||
|
-- {"YOUR_MAPPING",function() require("various-textobjs").cssSelector(false) end, { buffer = true }, mode = { "o", "x" }, desc = "" },
|
||||||
|
--
|
||||||
|
-- {"YOUR_MAPPING",function() require("various-textobjs").htmlAttribute(true) end, { buffer = true }, mode = { "o", "x" }, desc = "" },
|
||||||
|
-- {"YOUR_MAPPING",function() require("various-textobjs").htmlAttribute(false) end, { buffer = true }, mode = { "o", "x" }, desc = "" },
|
||||||
|
--
|
||||||
|
-- {"YOUR_MAPPING",function() require("various-textobjs").doubleSquareBrackets(true) end, { buffer = true }, mode = { "o", "x" }, desc = "" },
|
||||||
|
-- {"YOUR_MAPPING",function() require("various-textobjs").doubleSquareBrackets(false) end, { buffer = true }, mode = { "o", "x" }, desc = "" },
|
||||||
|
--
|
||||||
|
-- {"YOUR_MAPPING",function() require("various-textobjs").shellPipe(true) end, { buffer = true }, mode = { "o", "x" }, desc = "" },
|
||||||
|
-- {"YOUR_MAPPING",function() require("various-textobjs").shellPipe(false) end, { buffer = true }, mode = { "o", "x" }, desc = "" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'chrisgrieser/nvim-spider',
|
||||||
|
keys = {
|
||||||
|
{ '<M-w>', function() require('spider').motion('w') end, mode = { 'n', 'o', 'x' }, desc = 'Spider-w' },
|
||||||
|
{ '<M-e>', function() require('spider').motion('e') end, mode = { 'n', 'o', 'x' }, desc = 'Spider-e' },
|
||||||
|
{ '<M-b>', function() require('spider').motion('b') end, mode = { 'n', 'o', 'x' }, desc = 'Spider-b' },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
'echasnovski/mini.trailspace',
|
||||||
|
version = '*',
|
||||||
|
keys = {
|
||||||
|
{ '<leader>eT', function() MiniTrailspace.trim() end, desc = 'Trim whiltespace' },
|
||||||
|
},
|
||||||
|
config = true,
|
||||||
|
},
|
||||||
|
|
||||||
-- stolen from LazyVim
|
-- stolen from LazyVim
|
||||||
{
|
{
|
||||||
|
@ -44,7 +110,8 @@ return {
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
{ 'stevearc/overseer.nvim',
|
{
|
||||||
|
'stevearc/overseer.nvim',
|
||||||
config = true,
|
config = true,
|
||||||
cmd = {
|
cmd = {
|
||||||
'OverseerBuild',
|
'OverseerBuild',
|
||||||
|
@ -77,40 +144,22 @@ return {
|
||||||
|
|
||||||
'editorconfig/editorconfig-vim',
|
'editorconfig/editorconfig-vim',
|
||||||
|
|
||||||
|
{ 'dyng/ctrlsf.vim', cmd = 'CtrlSF' },
|
||||||
|
|
||||||
{
|
{
|
||||||
'vlada-dudr/vdebug',
|
'andymass/vim-matchup',
|
||||||
lazy = true,
|
|
||||||
enabled = false,
|
|
||||||
keys = {
|
|
||||||
{ '<F5>', desc = 'Start Vdebug' },
|
|
||||||
{ '<F10>', desc = 'Vdebug breakpoint' },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
{ 'dyng/ctrlsf.vim', cmd = 'CtrlSF' },
|
|
||||||
|
|
||||||
{ 'andymass/vim-matchup',
|
|
||||||
event = 'BufRead',
|
event = 'BufRead',
|
||||||
config = function()
|
config = function()
|
||||||
vim.g.matchup_matchparen_offscreen = {}
|
vim.g.matchup_matchparen_offscreen = {}
|
||||||
end, },
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
'echasnovski/mini.surround',
|
'echasnovski/mini.surround',
|
||||||
version = '*',
|
version = '*',
|
||||||
event = 'BufEnter',
|
event = 'BufEnter',
|
||||||
config = function()
|
config = true,
|
||||||
require('mini.surround').setup({})
|
main = 'mini.surround',
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
{ 'echasnovski/mini.statusline',
|
|
||||||
enabled = false,
|
|
||||||
event = 'VeryLazy',
|
|
||||||
version = '*',
|
|
||||||
config = function()
|
|
||||||
require('mini.statusline').setup({})
|
|
||||||
end,
|
|
||||||
},
|
},
|
||||||
|
|
||||||
{ 'fpob/nette.vim', ft = 'nette' },
|
{ 'fpob/nette.vim', ft = 'nette' },
|
||||||
|
@ -141,7 +190,6 @@ return {
|
||||||
information = '',
|
information = '',
|
||||||
other = '',
|
other = '',
|
||||||
},
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -36,18 +36,16 @@ function M.config()
|
||||||
swap = {
|
swap = {
|
||||||
enable = true,
|
enable = true,
|
||||||
swap_next = {
|
swap_next = {
|
||||||
[' pl'] = '@parameter.inner',
|
['<leader>ep'] = '@parameter.inner',
|
||||||
},
|
},
|
||||||
swap_previous = {
|
swap_previous = {
|
||||||
[' ph'] = '@parameter.inner',
|
['<leader>eP'] = '@parameter.inner',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
select = {
|
select = {
|
||||||
enable = true,
|
enable = true,
|
||||||
|
|
||||||
-- Automatically jump forward to textobj, similar to targets.vim
|
-- Automatically jump forward to textobj, similar to targets.vim
|
||||||
lookahead = true,
|
lookahead = true,
|
||||||
|
|
||||||
keymaps = {
|
keymaps = {
|
||||||
-- You can use the capture groups defined in textobjects.scm
|
-- You can use the capture groups defined in textobjects.scm
|
||||||
['af'] = '@function.outer',
|
['af'] = '@function.outer',
|
||||||
|
@ -66,7 +64,7 @@ function M.config()
|
||||||
-- mapping query_strings to modes.
|
-- mapping query_strings to modes.
|
||||||
selection_modes = {
|
selection_modes = {
|
||||||
['@parameter.outer'] = 'v', -- charwise
|
['@parameter.outer'] = 'v', -- charwise
|
||||||
['@function.outer'] = 'V', -- linewise
|
['@function.outer'] = 'V', -- linewise
|
||||||
['@class.outer'] = '<c-v>', -- blockwise
|
['@class.outer'] = '<c-v>', -- blockwise
|
||||||
},
|
},
|
||||||
-- If you set this to `true` (default is `false`) then any textobject is
|
-- If you set this to `true` (default is `false`) then any textobject is
|
||||||
|
@ -89,11 +87,11 @@ function M.config()
|
||||||
url = 'https://github.com/dorgnarg/tree-sitter-xml', -- local path or git repo
|
url = 'https://github.com/dorgnarg/tree-sitter-xml', -- local path or git repo
|
||||||
files = { 'src/parser.c' },
|
files = { 'src/parser.c' },
|
||||||
-- optional entries:
|
-- optional entries:
|
||||||
branch = 'main', -- default branch in case of git repo if different from master
|
branch = 'main', -- default branch in case of git repo if different from master
|
||||||
generate_requires_npm = false, -- if stand-alone parser without npm dependencies
|
generate_requires_npm = false, -- if stand-alone parser without npm dependencies
|
||||||
requires_generate_from_grammar = true, -- if folder contains pre-generated src/parser.c
|
requires_generate_from_grammar = true, -- if folder contains pre-generated src/parser.c
|
||||||
},
|
},
|
||||||
filetype = 'xml', -- if filetype does not match the parser name
|
filetype = 'xml', -- if filetype does not match the parser name
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue