Skip to content

Instantly share code, notes, and snippets.

@Julian

Julian/lean.lua Secret

Created October 5, 2021 18:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Julian/5ddb85a86f4295491546832b25fc2011 to your computer and use it in GitHub Desktop.
Save Julian/5ddb85a86f4295491546832b25fc2011 to your computer and use it in GitHub Desktop.
vim.opt.completeopt = { 'menuone', 'noselect' }
require'compe'.setup{
autocomplete = false,
source = {
nvim_lsp = { priority = 99 },
nvim_lua = { priority = 99 },
path = { priority = 99 },
}
}
-- You may want to reference the nvim-lspconfig documentation, found at:
-- https://github.com/neovim/nvim-lspconfig#keybindings-and-completion
-- The below is just a simple initial set of mappings.
local function on_attach(_, bufnr)
local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end
local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end
buf_set_keymap('n', 'gd', '<Cmd>lua vim.lsp.buf.definition()<CR>', {noremap = true})
buf_set_keymap('n', 'K', '<Cmd>lua vim.lsp.buf.hover()<CR>', {noremap = true})
buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')
end
require('lean').setup{
abbreviations = { builtin = true },
lsp = { on_attach = on_attach },
lsp3 = { on_attach = on_attach },
mappings = true,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment