Compare commits
2 commits
541f654042
...
df708c7d47
Author | SHA1 | Date | |
---|---|---|---|
|
df708c7d47 | ||
|
b34d32b101 |
3 changed files with 43 additions and 8 deletions
|
@ -87,6 +87,7 @@
|
||||||
"pavucontrol" = floating900x600;
|
"pavucontrol" = floating900x600;
|
||||||
# blueman-манагер надо флоатинг
|
# blueman-манагер надо флоатинг
|
||||||
"discord" = { monitor = "^2"; desktop = "3"; };
|
"discord" = { monitor = "^2"; desktop = "3"; };
|
||||||
|
"vesktop" = { monitor = "^2"; desktop = "3"; };
|
||||||
"firefox" = { monitor = "^1"; desktop = "2"; };
|
"firefox" = { monitor = "^1"; desktop = "2"; };
|
||||||
"librewolf" = { monitor = "^1"; desktop = "1"; };
|
"librewolf" = { monitor = "^1"; desktop = "1"; };
|
||||||
"obsidian" = { monitor = "^2"; desktop = "2"; };
|
"obsidian" = { monitor = "^2"; desktop = "2"; };
|
||||||
|
|
|
@ -29,14 +29,6 @@ vim.opt.rtp:prepend(lazypath)
|
||||||
-- NOTE: Here is where you install your plugins.
|
-- NOTE: Here is where you install your plugins.
|
||||||
require('lazy').setup({
|
require('lazy').setup({
|
||||||
|
|
||||||
{
|
|
||||||
'Wansmer/symbol-usage.nvim',
|
|
||||||
event = 'LspAttach', -- need run before LspAttach if you use nvim 0.9. On 0.10 use 'LspAttach'
|
|
||||||
config = function()
|
|
||||||
require('symbol-usage').setup()
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
---------------------------------------------
|
---------------------------------------------
|
||||||
-- Установлены из коробки в kickstart.nvim --
|
-- Установлены из коробки в kickstart.nvim --
|
||||||
---------------------------------------------
|
---------------------------------------------
|
||||||
|
@ -105,6 +97,9 @@ require('lazy').setup({
|
||||||
-- Multicursor plugin
|
-- Multicursor plugin
|
||||||
require 'custom.plugins.multicursor',
|
require 'custom.plugins.multicursor',
|
||||||
|
|
||||||
|
-- Symbol usage plugin
|
||||||
|
require 'custom.plugins.symbol_usage',
|
||||||
|
|
||||||
-- Autoformat markdown tables
|
-- Autoformat markdown tables
|
||||||
{
|
{
|
||||||
'Kicamon/markdown-table-mode.nvim',
|
'Kicamon/markdown-table-mode.nvim',
|
||||||
|
|
39
nvim/lua/custom/plugins/symbol_usage.lua
Normal file
39
nvim/lua/custom/plugins/symbol_usage.lua
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
-- Symbol usage plugin
|
||||||
|
|
||||||
|
local SymbolKind = vim.lsp.protocol.SymbolKind
|
||||||
|
|
||||||
|
local function text_format(symbol)
|
||||||
|
local fragments = {}
|
||||||
|
|
||||||
|
-- Indicator that shows if there are any other symbols in the same line
|
||||||
|
local stacked_functions = symbol.stacked_count > 0 and (' | +%s'):format(symbol.stacked_count) or ''
|
||||||
|
|
||||||
|
if symbol.references then
|
||||||
|
local usage = symbol.references <= 1 and 'usage' or 'usages'
|
||||||
|
local num = symbol.references == 0 and 'no' or symbol.references
|
||||||
|
table.insert(fragments, ('%s %s'):format(num, usage))
|
||||||
|
end
|
||||||
|
|
||||||
|
if symbol.definition then
|
||||||
|
table.insert(fragments, symbol.definition .. ' defs')
|
||||||
|
end
|
||||||
|
|
||||||
|
if symbol.implementation then
|
||||||
|
table.insert(fragments, symbol.implementation .. ' impls')
|
||||||
|
end
|
||||||
|
|
||||||
|
return table.concat(fragments, ', ') .. stacked_functions
|
||||||
|
end
|
||||||
|
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
'Wansmer/symbol-usage.nvim',
|
||||||
|
event = 'LspAttach', -- need run before LspAttach if you use nvim 0.9. On 0.10 use 'LspAttach'
|
||||||
|
config = function()
|
||||||
|
require('symbol-usage').setup {
|
||||||
|
text_format = text_format,
|
||||||
|
kinds = { SymbolKind.Function, SymbolKind.Method, SymbolKind.Class, SymbolKind.Struct, SymbolKind.Variable, SymbolKind.Constant },
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue