-
-
Notifications
You must be signed in to change notification settings - Fork 64
Open
Description
Everytime I run rename I get this error message:
Error executing vim.schedule lua callback: vim/keymap.lua:0: rhs: expected string|function, got nil
stack traceback:
[C]: in function 'error'
vim/shared.lua: in function 'validate'
vim/keymap.lua: in function 'set'
[string ":lua"]:53: in function ''
vim/_editor.lua: in function <vim/_editor.lua:0>
FWIW ignoring the error and continuing seems to work just fine.
Here's my config that I think is relevant:
local lspconfig = require('lspconfig')
local lsp_defaults = lspconfig.util.default_config
local lsp_capabilities = vim.tbl_deep_extend('force', lsp_defaults.capabilities, require('cmp_nvim_lsp').default_capabilities())
local lsp_attach = function(client, bufnr)
local opts = { buffer = bufnr }
require("navigator.dochighlight").documentHighlight(bufnr)
require("navigator.lspclient.highlight").add_highlight()
require("navigator.lspclient.highlight").diagnositc_config_sign() -- [sic]
require('navigator.lspclient.lspkind').init()
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
-- Setup navigator for lsp client
require("navigator.lspclient.mapping").setup({
client = client,
bufnr = bufnr,
})
-- call to show code actions as floating text and gutter icon
local prompt_code_action = function()
require('navigator.codeAction').code_action_prompt(bufnr)
end
-- ray-x/navigator
-- ref: https://github.com/ray-x/navigator.lua/tree/master#default-keymaps
-- ref: https://github.com/ray-x/navigator.lua/blob/master/lua/navigator/lspclient/mapping.lua
-- must override all default mappings for any of them to work
local keymaps = {
{ mode = 'n', key = 'gr', func = require('navigator.reference').async_ref }, -- show references and context (async)
{ mode = 'n', key = '<c-]>', func = require('navigator.definition').definition }, -- goto definition
{ mode = 'n', key = 'gd', func = require('navigator.definition').definition }, -- goto definition
{ mode = 'n', key = 'gD', func = vim.lsp.buf.declaration }, -- goto declaration
{ mode = 'n', key = '<leader>/', func = require('navigator.workspace').workspace_symbol_live }, -- workspace fzf
{ mode = 'n', key = '<C-S-F>', func = require('navigator.workspace').workspace_symbol_live }, -- workspace fzf
{ mode = 'n', key = 'g0', func = require('navigator.symbols').document_symbols }, -- document's symbols
{ mode = 'n', key = '<leader>d', func = vim.lsp.buf.hover }, -- hover window
{ mode = 'n', key = 'K', func = vim.lsp.buf.hover }, -- hover window
{ mode = 'n', key = 'gi', func = vim.lsp.buf.implementation }, -- goto implementation (doesn't always work?)
{ mode = 'n', key = '<Leader>gi', func = vim.lsp.buf.incoming_calls }, -- incoming calls
{ mode = 'n', key = '<Leader>go', func = vim.lsp.buf.outgoing_calls }, -- outgoing calls
{ mode = 'n', key = 'gt', func = vim.lsp.buf.type_definition }, -- goto type definition
{ mode = 'n', key = 'gp', func = require('navigator.definition').definition_preview }, -- hover definition preview
{ mode = 'n', key = 'gP', func = require('navigator.definition').type_definition_preview }, -- hover type definition preview
-- messes up ctrl-hjkl for moving windows
-- { mode = 'n', key = '<c-k>', func = vim.lsp.buf.signature_help }, -- sig help
-- { mode = 'n', key = '<C-S-K>', func = toggle_lsp_signature }, -- sig help
-- { mode = 'i', key = '<C-S-K>', func = toggle_lsp_signature }, -- sig help
{ mode = 'n', key = '<leader>ca', func = vim.lsp.buf.code_action }, -- code action
{ mode = 'n', key = '<leader>cl', func = require('navigator.codelens').run_action }, -- codelens action
{ mode = 'n', key = '<leader>la', func = require('navigator.codelens').run_action }, -- codelens action
{ mode = 'n', key = '<leader>rn', func = require('navigator.rename').rename }, -- rename
{ mode = 'n', key = '<leader>gt', func = require('navigator.treesitter').buf_ts }, -- fzf treesitter symbols
{ mode = 'n', key = '<leader>ts', func = require('navigator.treesitter').buf_ts }, -- fzf treesitter symbols
{ mode = 'n', key = '<leader>ct', func = require('navigator.ctags').ctags }, -- fzf ctags
{ mode = 'n', key = '<leader>ca', func = require('navigator.codeAction').code_action }, -- code action
{ mode = 'v', key = '<leader>ca', func = require('navigator.codeAction').range_code_action }, -- code action
{ mode = 'n', key = '<C-S-C>', func = prompt_code_action }, -- prompt for possible code actions
{ mode = 'v', key = '<C-S-C>', func = prompt_code_action }, -- prompt for possible code actions
{ mode = 'n', key = 'gG', func = require('navigator.diagnostics').show_buf_diagnostics }, -- diagnostics
{ mode = 'n', key = '<leader>G', func = require('navigator.diagnostics').show_buf_diagnostics }, -- diagnostics
{ mode = 'n', key = 'gL', func = require('navigator.diagnostics').show_diagnostics }, -- diagnostics
{ mode = 'n', key = '<leader>L', func = require('navigator.diagnostics').show_diagnostics }, -- diagnostics
-- doesn't work yet in 0.10 nightly, and I don't use these anyways
-- { mode = 'n', key = '<leader>cf', func = vim.lsp.buf.format }, -- format code
-- { mode = 'v', key = '<leader>cf', func = vim.lsp.buf.range_formatting }, -- format code (visual range)
-- { mode = 'n', key = '<leader>fc', func = vim.lsp.buf.format }, -- format code
-- { mode = 'v', key = '<leader>fc', func = vim.lsp.buf.range_formatting }, -- format code (visual range)
}
for _, km in pairs(keymaps) do
vim.keymap.set(km.mode, km.key, km.func, opts)
end
end
Metadata
Metadata
Assignees
Labels
No labels