From 4d6b1b804f0a0d0aee1de9d38b00bc0d3a2ee4e5 Mon Sep 17 00:00:00 2001 From: Harrison Katz Date: Fri, 20 Oct 2023 19:44:04 -0400 Subject: [PATCH] Add docs for icons (#289) --- README.md | 31 +++++++++++++------------ lua/navigator.lua | 58 +++++++++++++++++++++++++++++------------------ 2 files changed, 52 insertions(+), 37 deletions(-) diff --git a/README.md b/README.md index 80ef26a..ac1f4ed 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ - 12 require('nvim-autopairs').setup{ + 12 require('nvim-autopairs').setup{ - Source code analysis and navigate tool @@ -55,10 +55,10 @@ variable is: - LSP easy setup. Support the most commonly used lsp clients setup. Dynamic lsp activation based on buffer type. This also enables you to handle workspace with mixed types of codes (e.g. Go + javascript + yml). A better LSP default enables - * autocompletion *(e.g. nvim-cmp), + * autocompletion *(e.g. nvim-cmp), * codelens * lsp folding - * go implementation + * go implementation * incoming/outgoing call and ccls call hierarchy * range formatting @@ -275,25 +275,26 @@ require'navigator'.setup({ lsp_signature_help = true, -- if you would like to hook ray-x/lsp_signature plugin in navigator -- setup here. if it is nil, navigator will not init signature help signature_help_cfg = nil, -- if you would like to init ray-x/lsp_signature plugin in navigator, and pass in your own config to signature help - icons = { + icons = { -- refer to lua/navigator.lua for more icons config + -- requires nerd fonts or nvim-web-devicons + icons = true, -- Code action code_action_icon = "🏏", -- note: need terminal support, for those not support unicode, might crash -- Diagnostics diagnostic_head = 'πŸ›', diagnostic_head_severity_1 = "🈲", - -- refer to lua/navigator.lua for more icons setups }, mason = false, -- set to true if you would like use the lsp installed by williamboman/mason lsp = { - enable = true, -- skip lsp setup, and only use treesitter in navigator. - -- Use this if you are not using LSP servers, and only want to enable treesitter support. - -- If you only want to prevent navigator from touching your LSP server configs, - -- use `disable_lsp = "all"` instead. + enable = true, -- skip lsp setup, and only use treesitter in navigator. + -- Use this if you are not using LSP servers, and only want to enable treesitter support. + -- If you only want to prevent navigator from touching your LSP server configs, + -- use `disable_lsp = "all"` instead. -- If disabled, make sure add require('navigator.lspclient.mapping').setup({bufnr=bufnr, client=client}) in your -- own on_attach code_action = {enable = true, sign = true, sign_priority = 40, virtual_text = true}, code_lens_action = {enable = true, sign = true, sign_priority = 40, virtual_text = true}, - document_highlight = true, -- LSP reference highlight, + document_highlight = true, -- LSP reference highlight, -- it might already supported by you setup, e.g. LunarVim format_on_save = true, -- {true|false} set to false to disasble lsp code format on save (if you are using prettier/efm/formater etc) -- table: {enable = {'lua', 'go'}, disable = {'javascript', 'typescript'}} to enable/disable specific language @@ -304,10 +305,10 @@ require'navigator'.setup({ disable_format_cap = {"sqlls", "lua_ls", "gopls"}, -- a list of lsp disable format capacity (e.g. if you using efm or vim-codeformat etc), empty {} by default -- If you using null-ls and want null-ls format your code -- you should disable all other lsp and allow only null-ls. - -- disable_lsp = {'pylsd', 'sqlls'}, -- prevents navigator from setting up this list of servers. - -- if you use your own LSP setup, and don't want navigator to setup + -- disable_lsp = {'pylsd', 'sqlls'}, -- prevents navigator from setting up this list of servers. + -- if you use your own LSP setup, and don't want navigator to setup -- any LSP server for you, use `disable_lsp = "all"`. - -- you may need to add this to your own on_attach hook: + -- you may need to add this to your own on_attach hook: -- require('navigator.lspclient.mapping').setup({bufnr=bufnr, client=client}) -- for e.g. denols and tsserver you may want to enable one lsp server at a time. -- default value: {} @@ -366,7 +367,7 @@ require'navigator'.setup({ gopls = {gofumpt = false} -- disable gofumpt etc, } }, - -- the lsp setup can be a function, .e.g + -- the lsp setup can be a function, .e.g gopls = function() local go = pcall(require, "go") if go then @@ -677,7 +678,7 @@ There are lots of plugins provides lsp support * setup with neodev ```lua -use {"folke/neodev.nvim", +use {"folke/neodev.nvim", ft = 'lua', config = function() require'neodev'.setup{} diff --git a/lua/navigator.lua b/lua/navigator.lua index 2648be8..fbc2abc 100644 --- a/lua/navigator.lua +++ b/lua/navigator.lua @@ -160,27 +160,35 @@ _NgConfigValues = { mason = false, -- set to true if you would like use the lsp installed by williamboman/mason mason_disabled_for = {}, -- disable mason for specified lspclients icons = { + -- requires Nerd Font or nvim-web-devicons pre-installed icons = true, -- set to false to use system default ( if you using a terminal does not have nerd/icon) - -- Code action + + -- Code Action (gutter, floating window) code_action_icon = '🏏', - -- code lens + + -- Code Lens (gutter, floating window) code_lens_action_icon = 'πŸ‘“', - -- Diagnostics - diagnostic_head = 'πŸ›', + + -- Diagnostics (gutter) + diagnostic_head = 'πŸ›', -- prefix for other diagnostic_* icons diagnostic_err = 'πŸ“›', diagnostic_warn = 'πŸ‘Ž', diagnostic_info = [[πŸ‘©]], diagnostic_hint = [[πŸ’]], + -- Diagnostics (floating window) diagnostic_head_severity_1 = '🈲', diagnostic_head_severity_2 = '☣️', diagnostic_head_severity_3 = 'πŸ‘Ž', - diagnostic_head_description = 'πŸ‘Ή', - diagnostic_virtual_text = '🦊', - diagnostic_file = 'πŸš‘', - -- Values - value_changed = 'πŸ“', - value_definition = '🐢🍑', -- it is easier to see than πŸ¦• + diagnostic_head_description = 'πŸ‘Ή', -- suffix for severities + diagnostic_virtual_text = '🦊', -- floating text preview (set to empty to disable) + diagnostic_file = 'πŸš‘', -- icon in floating window, indicates the file contains diagnostics + + -- Values (floating window) + value_definition = '🐢🍑', -- identifier defined + value_changed = 'πŸ“', -- identifier modified + + -- Formatting for Side Panel side_panel = { section_separator = 'σ°‡œ', line_num_left = 'ξ‚²', @@ -190,21 +198,27 @@ _NgConfigValues = { bracket_left = 'βŸͺ', bracket_right = '⟫', }, + -- Treesitter + -- Note: many more node.type or kind may be available match_kinds = { - var = 'ξž› ', -- "πŸ‘Ή", -- Vampaire - method = 'Ζ’ ', -- "πŸ”", -- mac - ['function'] = 'σ°‘± ', -- "🀣", -- Fun - parameter = 'ο‹… ', -- Pi - associated = '🀝', - namespace = 'πŸš€', - type = 'σ°‰Ώ', - field = '🏈', - module = 'πŸ“¦', - flag = '🎏', + var = 'ξž› ', -- variable -- "πŸ‘Ή", -- Vampaire + const = '󱀍 ', + method = 'Ζ’ ', -- method -- "πŸ”", -- mac + -- function is a keyword so wrap in ['key'] syntax + ['function'] = 'σ°‘± ', -- function -- "🀣", -- Fun + parameter = 'ο‹… ', -- param/arg -- Pi + parameters = 'ο‹… ', -- param/arg -- Pi + required_parameter = 'ο‹… ', -- param/arg -- Pi + associated = '🀝', -- linked/related + namespace = 'πŸš€', -- namespace + type = 'σ°‰Ώ', -- type definition + field = '🏈', -- field definition + module = 'πŸ“¦', -- module + flag = '🎏', -- flag }, - treesitter_defult = '🌲', - doc_symbols = 'ξœ–', + treesitter_defult = '🌲', -- default symbol when unknown node.type or kind + doc_symbols = 'ξœ–', -- document }, }