Squash and merged lsp branch

Squashed commit of the following:

commit 6179a86a75
Author: Just Midi <storm89161@gmail.com>
Date:   Fri Aug 27 06:18:00 2021 +0000

    Removed && in zls install

    removed && in favor of scripts on separate lines

commit 4ca63a5884
Author: Just Midi <storm89161@gmail.com>
Date:   Thu Aug 26 07:15:27 2021 +0000

    True lazy loading, lsp installs, and nvim-compe

    Installation scripts for:
    + bashls
    + ccls
    + clangd
    + pylsp
    + pyright
    + sumneko
    + zls

    And adjusted a few keymaps

commit 052b4513c2
Author: Just Midi <storm89161@gmail.com>
Date:   Wed Aug 11 20:52:37 2021 +0000

    Base LSP

    + loads LSP server based on file type
    + imports native-lsp (our's) and lspconfig (foreign)
    + key mappings for lsp
This commit is contained in:
Just Midi 2021-08-27 06:21:53 +00:00
parent 14b563ff20
commit ce9bd490ee
12 changed files with 376 additions and 22 deletions

View file

@ -275,27 +275,28 @@ end
map('n', '<leader>p', ':lua pm_sync()<CR>', {noremap = true})
-- LSP
function lsp_shortcuts()
local lsp_commands = {
new = {'d','r','f','t','x','a','c','C','h','s','m'},
old = {
'#textDocument_definition', -- d
'#textDocument_rename', -- r
'#textDocument_formatting', -- f
'#textDocument_typeDefinition', -- t
'#textDocument_references', -- x
'_workspace_applyEdit', -- a
'#textDocument_completion', -- c
'#textDocument_codeAction', -- C
'#textDocument_hover', -- h
'_textDocument_documentSymbol', -- s
'_contextMenu' -- m
}
local lsp_commands = {
new = {'h','d','D','r','f','n','i','s','S','<','>','a'},
old = {
'buf.hover', -- h
'buf.definition', -- d
'buf.declaration', -- D
'buf.references', -- r
'buf.formatting', -- f
'buf.rename', -- n
'buf.implementation', -- i
'buf.document_symbol', -- s
'buf.signature_help', -- S
'diagnostic.goto_prev', -- <
'diagnostic.goto_next', -- >
'buf.code_action' -- a
}
for i = 1, #lspcommands.new do
for _,f in pairs(modes_map({'n'})) do
f('<Leader>l'..key_pair.new[i],
':call LanguageClient'..key_pair.old[i]..'()<CR>', {noremap = true})
end
}
for i = 1, #lsp_commands.new do
for _,f in pairs(modes_map({'n'})) do
f('<Leader>l'..lsp_commands.new[i],
'<cmd>lua vim.lsp.'..lsp_commands.old[i]..'()<CR>',
{noremap = true}
)
end
end