Fix indentation in init.vim.
This commit is contained in:
parent
62a6d5c8b3
commit
83b9a13f9e
|
@ -26,73 +26,73 @@ call plug#end()
|
||||||
|
|
||||||
""" LSP SETTINGS
|
""" LSP SETTINGS
|
||||||
lua << EOF
|
lua << EOF
|
||||||
local lsp_installer = require("nvim-lsp-installer")
|
local lsp_installer = require("nvim-lsp-installer")
|
||||||
|
|
||||||
-- Register a handler that will be called for all installed servers.
|
-- Register a handler that will be called for all installed servers.
|
||||||
-- Alternatively, you may also register handlers on specific server instances instead (see example below).
|
-- Alternatively, you may also register handlers on specific server instances instead (see example below).
|
||||||
lsp_installer.on_server_ready(function(server)
|
lsp_installer.on_server_ready(function(server)
|
||||||
local opts = {}
|
local opts = {}
|
||||||
|
|
||||||
-- (optional) Customize the options passed to the server
|
-- (optional) Customize the options passed to the server
|
||||||
-- if server.name == "tsserver" then
|
-- if server.name == "tsserver" then
|
||||||
-- opts.root_dir = function() ... end
|
-- opts.root_dir = function() ... end
|
||||||
-- end
|
-- end
|
||||||
|
|
||||||
-- This setup() function is exactly the same as lspconfig's setup function.
|
-- This setup() function is exactly the same as lspconfig's setup function.
|
||||||
-- Refer to https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
|
-- Refer to https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
|
||||||
server:setup(opts)
|
server:setup(opts)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- Setup nvim-cmp.
|
-- Setup nvim-cmp.
|
||||||
local cmp = require'cmp'
|
local cmp = require'cmp'
|
||||||
|
|
||||||
cmp.setup({
|
cmp.setup({
|
||||||
snippet = {
|
snippet = {
|
||||||
-- REQUIRED - you must specify a snippet engine
|
-- REQUIRED - you must specify a snippet engine
|
||||||
expand = function(args)
|
expand = function(args)
|
||||||
vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
|
vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
|
||||||
-- require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
|
-- require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
|
||||||
-- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
|
-- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
|
||||||
-- require'snippy'.expand_snippet(args.body) -- For `snippy` users.
|
-- require'snippy'.expand_snippet(args.body) -- For `snippy` users.
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
mapping = {
|
mapping = {
|
||||||
['<C-b>'] = cmp.mapping(cmp.mapping.scroll_docs(-4), { 'i', 'c' }),
|
['<C-b>'] = cmp.mapping(cmp.mapping.scroll_docs(-4), { 'i', 'c' }),
|
||||||
['<C-f>'] = cmp.mapping(cmp.mapping.scroll_docs(4), { 'i', 'c' }),
|
['<C-f>'] = cmp.mapping(cmp.mapping.scroll_docs(4), { 'i', 'c' }),
|
||||||
['<C-Space>'] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }),
|
['<C-Space>'] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }),
|
||||||
['<C-y>'] = cmp.config.disable, -- Specify `cmp.config.disable` if you want to remove the default `<C-y>` mapping.
|
['<C-y>'] = cmp.config.disable, -- Specify `cmp.config.disable` if you want to remove the default `<C-y>` mapping.
|
||||||
['<C-e>'] = cmp.mapping({
|
['<C-e>'] = cmp.mapping({
|
||||||
i = cmp.mapping.abort(),
|
i = cmp.mapping.abort(),
|
||||||
c = cmp.mapping.close(),
|
c = cmp.mapping.close(),
|
||||||
}),
|
}),
|
||||||
['<CR>'] = cmp.mapping.confirm({ select = true }),
|
['<CR>'] = cmp.mapping.confirm({ select = true }),
|
||||||
},
|
},
|
||||||
sources = cmp.config.sources({
|
sources = cmp.config.sources({
|
||||||
{ name = 'nvim_lsp' },
|
{ name = 'nvim_lsp' },
|
||||||
{ name = 'vsnip' }, -- For vsnip users.
|
{ name = 'vsnip' }, -- For vsnip users.
|
||||||
-- { name = 'luasnip' }, -- For luasnip users.
|
-- { name = 'luasnip' }, -- For luasnip users.
|
||||||
-- { name = 'ultisnips' }, -- For ultisnips users.
|
-- { name = 'ultisnips' }, -- For ultisnips users.
|
||||||
-- { name = 'snippy' }, -- For snippy users.
|
-- { name = 'snippy' }, -- For snippy users.
|
||||||
}, {
|
}, {
|
||||||
{ name = 'buffer' },
|
{ name = 'buffer' },
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
})
|
||||||
|
|
||||||
-- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore).
|
-- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore).
|
||||||
cmp.setup.cmdline('/', {
|
cmp.setup.cmdline('/', {
|
||||||
sources = {
|
sources = {
|
||||||
{ name = 'buffer' }
|
{ name = 'buffer' }
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
|
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
|
||||||
cmp.setup.cmdline(':', {
|
cmp.setup.cmdline(':', {
|
||||||
sources = cmp.config.sources({
|
sources = cmp.config.sources({
|
||||||
{ name = 'path' }
|
{ name = 'path' }
|
||||||
}, {
|
}, {
|
||||||
{ name = 'cmdline' }
|
{ name = 'cmdline' }
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
})
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue