Browse Source

Bring back symbols outline

pull/14/head
Leslie Kerman 2 years ago
parent
commit
c64fb3f85a
  1. 94
      lua/configs/symbols_outline.lua
  2. 2
      lua/configs/terminal.lua
  3. 1
      lua/core/init.lua
  4. 2
      lua/core/keymaps.lua
  5. 2
      lua/core/plugins.lua
  6. 2
      lua/core/theme.lua

94
lua/configs/symbols_outline.lua

@ -0,0 +1,94 @@
local M = {}
function M.config()
require("symbols-outline").setup {
highlight_hovered_item = true,
show_guides = true,
auto_preview = true,
position = 'right',
relative_width = true,
width = 20,
auto_close = false,
show_numbers = false,
show_relative_numbers = false,
show_symbol_details = true,
preview_bg_highlight = 'Pmenu',
autofold_depth = nil,
auto_unfold_hover = true,
fold_markers = { '', '' },
keymaps = { -- These keymaps can be a string or a table for multiple keys
close = { "<Esc>", "q" },
goto_location = "<Cr>",
focus_location = "o",
hover_symbol = "<C-space>",
toggle_preview = "K",
rename_symbol = "r",
code_actions = { "<f12>", "a" },
fold = "h",
unfold = "l",
fold_all = "H",
unfold_all = "L",
fold_reset = "R",
},
lsp_blacklist = {},
symbol_blacklist = {},
--String xxx ctermfg=107 guifg=#a0c980
--Constant xxx ctermfg=179 guifg=#deb974
--Character xxx ctermfg=107 guifg=#a0c980
--Number xxx ctermfg=107 guifg=#a0c980
--Boolean xxx ctermfg=107 guifg=#a0c980
--Float xxx ctermfg=107 guifg=#a0c980
--Function xxx ctermfg=110 guifg=#6cb6eb
--Identifier xxx ctermfg=72 guifg=#5dbbc1
--Conditional xxx ctermfg=176 guifg=#d38aea
--Statement xxx ctermfg=176 guifg=#d38aea
--Repeat xxx ctermfg=176 guifg=#d38aea
--Label xxx ctermfg=179 guifg=#deb974
--Operator xxx ctermfg=176 guifg=#d38aea
--Keyword xxx ctermfg=176 guifg=#d38aea
--Exception xxx ctermfg=176 guifg=#d38aea
--Include xxx ctermfg=176 guifg=#d38aea
--PreProc xxx ctermfg=176 guifg=#d38aea
--Define xxx ctermfg=176 guifg=#d38aea
--Macro xxx ctermfg=179 guifg=#deb974
--PreCondit xxx ctermfg=176 guifg=#d38aea
--StorageClass xxx ctermfg=203 guifg=#ec7279
--Type xxx ctermfg=203 guifg=#ec7279
--Structure xxx ctermfg=203 guifg=#ec7279
--Typedef xxx ctermfg=176 guifg=#d38aea
--Tag xxx ctermfg=179 guifg=#deb974
--Special xxx ctermfg=179 guifg=#deb974
--SpecialChar xxx ctermfg=179 guifg=#deb974
--Delimiter xxx ctermfg=250 guifg=#c5cdd9
--SpecialComment xxx cterm=italic ctermfg=246 gui=italic guifg=#758094
symbols = {
File = { icon = "", hl = "Special" },
Module = { icon = "", hl = "Special" },
Namespace = { icon = "", hl = "Special" },
Package = { icon = "", hl = "Special" },
Class = { icon = "𝓒", hl = "Structure" },
Method = { icon = "ƒ", hl = "Function" },
Property = { icon = "", hl = "Identifier" },
Field = { icon = "", hl = "Identifier" },
Constructor = { icon = "", hl = "Function" },
Enum = { icon = "", hl = "Structure" },
Interface = { icon = "", hl = "Structure" },
Function = { icon = "", hl = "Function" },
Variable = { icon = "", hl = "Identifier" },
Constant = { icon = "", hl = "Identifier" },
String = { icon = "𝓐", hl = "String" },
Number = { icon = "#", hl = "Number" },
Boolean = { icon = "", hl = "Boolean" },
Array = { icon = "", hl = "Structure" },
Object = { icon = "⦿", hl = "Structure" },
Key = { icon = "", hl = "Keyword" },
Null = { icon = "NULL", hl = "Normal" },
EnumMember = { icon = "", hl = "Variable" },
Struct = { icon = "𝓢", hl = "Structure" },
Event = { icon = "", hl = "Special" },
Operator = { icon = "+", hl = "Operator" },
TypeParameter = { icon = "𝙏", hl = "Type" }
}
}
end
return M

2
lua/configs/terminal.lua

@ -32,7 +32,7 @@ function M.config()
-- see :h nvim_open_win for details on borders however -- see :h nvim_open_win for details on borders however
-- the 'curved' border is a custom border type -- the 'curved' border is a custom border type
-- not natively supported but implemented in this plugin. -- not natively supported but implemented in this plugin.
border = 'shadow', border = 'single',
-- like `size`, width and height can be a number or function which is passed the current terminal -- like `size`, width and height can be a number or function which is passed the current terminal
width = 140, width = 140,
height = 50, height = 50,

1
lua/core/init.lua

@ -50,6 +50,7 @@ require('image').setup {
require("impatient") require("impatient")
require("configs.autocomplete").config() require("configs.autocomplete").config()
require("configs.symbols_outline").config()
require("configs.statusline").config() require("configs.statusline").config()
require("configs.filetree").config() require("configs.filetree").config()
require("configs.treesitter").config() require("configs.treesitter").config()

2
lua/core/keymaps.lua

@ -67,7 +67,7 @@ vim.keymap.set('n', '<leader>lr', ':Lspsaga rename<cr>')
vim.keymap.set('n', '<leader>lh', vim.lsp.buf.signature_help) vim.keymap.set('n', '<leader>lh', vim.lsp.buf.signature_help)
vim.keymap.set('n', '<leader>la', vim.lsp.buf.code_action) vim.keymap.set('n', '<leader>la', vim.lsp.buf.code_action)
vim.keymap.set('n', '<leader>lf', vim.lsp.buf.formatting) vim.keymap.set('n', '<leader>lf', vim.lsp.buf.formatting)
vim.keymap.set('n', '<leader>lb', ':LSoutlineToggle<cr>') vim.keymap.set('n', '<leader>lb', ':SymbolsOutline<cr>')
vim.keymap.set('n', '<leader>la', ':Lspsaga code_action<cr>') vim.keymap.set('n', '<leader>la', ':Lspsaga code_action<cr>')
vim.keymap.set('n', '<leader>lu', ':Lspsaga lsp_finder<cr>') vim.keymap.set('n', '<leader>lu', ':Lspsaga lsp_finder<cr>')
vim.keymap.set('n', '<F12>', ':Lspsaga code_action<cr>') vim.keymap.set('n', '<F12>', ':Lspsaga code_action<cr>')

2
lua/core/plugins.lua

@ -29,6 +29,7 @@ return require('packer').startup(function()
use 'liuchengxu/space-vim-dark' use 'liuchengxu/space-vim-dark'
use 'sainnhe/edge' use 'sainnhe/edge'
use 'B4mbus/oxocarbon-lua.nvim' use 'B4mbus/oxocarbon-lua.nvim'
use 'Th3Whit3Wolf/one-nvim'
-- file tree -- file tree
use { use {
@ -47,6 +48,7 @@ return require('packer').startup(function()
use 'L3MON4D3/LuaSnip' use 'L3MON4D3/LuaSnip'
use 'nvim-treesitter/nvim-treesitter' use 'nvim-treesitter/nvim-treesitter'
use 'simrat39/rust-tools.nvim' use 'simrat39/rust-tools.nvim'
use 'simrat39/symbols-outline.nvim'
-- git -- git
use { use {

2
lua/core/theme.lua

@ -53,4 +53,4 @@ vim.cmd("colorscheme edge")
-- github -- github
-- vim.cmd("colorscheme github_dark") -- vim.cmd("colorscheme github_dark")
vim.cmd("set background=light") vim.cmd("set background=dark")

Loading…
Cancel
Save