nvim: change <Leader> to <Space>

This commit is contained in:
tastytea 2022-08-10 16:36:41 +02:00
parent 4a317170e0
commit f29f0dc217
Signed by: tastytea
SSH Key Fingerprint: SHA256:FBkvrOlhq5use1XEttyUGT4bUTDVA1ar9SgIc9P03cM
2 changed files with 7 additions and 12 deletions

View File

@ -2,9 +2,7 @@ function map(mode, shortcut, command)
vim.keymap.set(mode, shortcut, command, { noremap = true, silent = true })
end
map('n', '<space>', '<nop>')
vim.g.mapleader = ','
vim.g.mapleader = ' '
-- buffers
map('n', '<Leader>b', ':buffers<CR>:buffer<Space>')

View File

@ -5,10 +5,8 @@ packer.use {
'https://github.com/neovim/nvim-lspconfig',
requires = 'https://github.com/L3MON4D3/LuaSnip',
config = function()
map('n', '<space>e', vim.diagnostic.open_float)
map('n', '<f5>', vim.diagnostic.goto_prev)
map('n', '<f6>', vim.diagnostic.goto_next)
map('n', '<space>q', vim.diagnostic.setloclist)
-- Only map the following keys after the language server attaches to the
-- current buffer
@ -23,16 +21,15 @@ packer.use {
maplsp('n', 'K', vim.lsp.buf.hover)
maplsp('n', 'gi', vim.lsp.buf.implementation)
maplsp('n', '<C-k>', vim.lsp.buf.signature_help)
maplsp('n', '<space>wa', vim.lsp.buf.add_workspace_folder)
maplsp('n', '<space>wr', vim.lsp.buf.remove_workspace_folder)
maplsp('n', '<space>wl', function()
maplsp('n', '<Leader>wa', vim.lsp.buf.add_workspace_folder)
maplsp('n', '<Leader>wr', vim.lsp.buf.remove_workspace_folder)
maplsp('n', '<Leader>wl', function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end)
maplsp('n', '<space>D', vim.lsp.buf.type_definition)
maplsp('n', '<space>rn', vim.lsp.buf.rename)
maplsp('n', '<space>ca', vim.lsp.buf.code_action)
maplsp('n', '<Leader>rn', vim.lsp.buf.rename)
maplsp('n', '<Leader>ca', vim.lsp.buf.code_action)
maplsp('n', 'gr', vim.lsp.buf.references)
maplsp('n', '<space>f', vim.lsp.buf.formatting)
maplsp('n', '<Leader>f', vim.lsp.buf.formatting)
-- highlight symbol under cursor
if client.resolved_capabilities.document_highlight then