Highlight for preview

pull/25/head
ray-x 3 years ago
parent 72ecc85842
commit 713dd7eeab

@ -42,7 +42,8 @@ variable is
# Features:
- 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)
also enables you to handle workspace with mixed types of codes (e.g. Go + javascript + yml). A better default setup is
included for LSP clients.
- Out of box experience. 10 lines of minimum vimrc can turn your neovim into a full-featured LSP & Treesitter powered IDE
@ -260,7 +261,8 @@ require.'navigator'.setup({
| n | K | hover doc |
| n | ga | code action (when you see 💡 ) |
| v | ga | range code action (when you see 💡 ) |
| n | \<Leader\>re | rename|
| n | \<Leader\>re | rename (lsp default)|
| n | \<Space\>re | rename with floating window|
| n | \<Leader\>gi | incoming calls|
| n | \<Leader\>go | outgoing calls|
| n | gi | implementation |

@ -24,7 +24,7 @@ function M.add_highlight()
api.nvim_command("hi! link LspDiagnosticsUnderlineWarning SpellRare")
api.nvim_command("hi! link LspDiagnosticsUnderlineInformation SpellRare")
api.nvim_command("hi! link LspDiagnosticsUnderlineHint SpellRare")
api.nvim_command("hi def link DefinitionPreviewTitle Title")
api.nvim_command("hi def link NGPreviewTitle Title")
local colors = {
{'#aefe00', '#aede00', '#aebe00', '#4e7efe'}, {'#ff00e0', '#df00e0', '#af00e0', '#fedefe'},

@ -33,7 +33,7 @@ local key_maps = {
{key = "K", func = "hover({ popup_opts = { border = single }})"},
{key = "ga", mode = "n", func = "code_action()"},
{key = "ga", mode = "v", func = "range_code_action()"}, {key = "<Leader>re", func = "rename()"},
{key = "<Space>rn", func = "require('navigator.rename').rename()"},
{key = "<Space>re", func = "require('navigator.rename').rename()"},
{key = "<Leader>gi", func = "incoming_calls()"}, {key = "<Leader>go", func = "outgoing_calls()"},
{key = "gi", func = "implementation()"}, {key = "gt", func = "type_definition()"},
{key = "gL", func = "diagnostic.show_line_diagnostics({ popup_opts = { border = single }})"},

@ -8,11 +8,12 @@ M.rename = function()
local bufnr = vim.api.nvim_create_buf(false, true)
vim.api.nvim_buf_set_option(bufnr, "buftype", "prompt")
vim.api.nvim_buf_set_option(bufnr, "bufhidden", "wipe")
vim.api.nvim_buf_add_highlight(bufnr, -1, "RenamePrompt", 0, 0, #rename_prompt)
vim.api.nvim_buf_add_highlight(bufnr, -1, "NGPreviewTitle", 0, 0, #rename_prompt)
vim.fn.prompt_setprompt(bufnr, rename_prompt)
local width = #current_name + #rename_prompt + 10
local winnr = vim.api.nvim_open_win(bufnr, true, {
relative = "cursor",
width = 50,
width = width,
height = 1,
row = -3,
col = 1,
@ -38,6 +39,5 @@ M.callback = function()
params.newName = new_name
vim.lsp.buf_request(0, "textDocument/rename", params)
end
M.rename()
-- M.callback()
return M

Loading…
Cancel
Save