
* feat: init lazy.nvim * refactor: easy plugin init * feat: user defined plugins * refactor: clean up user config * refactor: clean up lsp plugins * fix: lsp signature * fix: null ls user config * feat: replace commands * feat: optimize lazy loading * fix: lsp_signature working * fix: documentation hover/sig help * fix: autopairs * feat: clean up luasnips * fix auto complete * moar laziness * feat: add markdown_inline to ensured_installed for TS * clean up * clean up auto-session
35 lines
869 B
Lua
35 lines
869 B
Lua
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
|
local M = {}
|
|
|
|
function M.on_attach(client, bufnr)
|
|
local function buf_set_option(...)
|
|
vim.api.nvim_buf_set_option(bufnr, ...)
|
|
end
|
|
|
|
-- Enable completion triggered by <c-x><c-o>
|
|
buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')
|
|
|
|
require('cosmic.lsp.mappings').init(client, bufnr)
|
|
end
|
|
|
|
M.flags = {
|
|
debounce_text_changes = 150,
|
|
}
|
|
|
|
M.capabilities = capabilities
|
|
|
|
M.root_dir = function(fname)
|
|
local util = require('lspconfig').util
|
|
return util.root_pattern('.git')(fname)
|
|
or util.root_pattern('tsconfig.base.json')(fname)
|
|
or util.root_pattern('package.json')(fname)
|
|
or util.root_pattern('.eslintrc.js')(fname)
|
|
or util.root_pattern('.eslintrc.json')(fname)
|
|
or util.root_pattern('tsconfig.json')(fname)
|
|
end
|
|
|
|
M.autostart = true
|
|
|
|
M.single_file_support = true
|
|
|
|
return M
|