summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authorDavid Luevano Alvarado <david@luevano.xyz>2023-06-04 01:23:39 -0600
committerDavid Luevano Alvarado <david@luevano.xyz>2023-06-04 01:23:39 -0600
commit7697c03eba943b8512e8e24583c0c17f9ef02aa9 (patch)
tree9372e7e792249a77a439e72898bca07b560039ca /init.lua
parent87354704f0eefa327f676d38fc3fdf9eb2bcfb9c (diff)
finish separating up the plugins, in general
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua48
1 files changed, 1 insertions, 47 deletions
diff --git a/init.lua b/init.lua
index 7296e77..d0c9eab 100644
--- a/init.lua
+++ b/init.lua
@@ -17,6 +17,7 @@ if not vim.loop.fs_stat(lazypath) then
end
vim.opt.rtp:prepend(lazypath)
+-- Start plugin manager lazy.nvim, super important
require('lazy').setup('plugins', {})
-- [[ Setting options ]]
@@ -81,50 +82,3 @@ vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous dia
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnostic message' })
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' })
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' })
-
--- [[ Configure nvim-cmp ]]
-local cmp = require 'cmp'
-local luasnip = require 'luasnip'
-require('luasnip.loaders.from_vscode').lazy_load()
-luasnip.config.setup {}
-
-cmp.setup {
- snippet = {
- expand = function(args)
- luasnip.lsp_expand(args.body)
- end,
- },
- mapping = cmp.mapping.preset.insert {
- ['<C-n>'] = cmp.mapping.select_next_item(),
- ['<C-p>'] = cmp.mapping.select_prev_item(),
- ['<C-d>'] = cmp.mapping.scroll_docs(-4),
- ['<C-f>'] = cmp.mapping.scroll_docs(4),
- ['<C-Space>'] = cmp.mapping.complete {},
- ['<CR>'] = cmp.mapping.confirm {
- behavior = cmp.ConfirmBehavior.Replace,
- select = true,
- },
- ['<Tab>'] = cmp.mapping(function(fallback)
- if cmp.visible() then
- cmp.select_next_item()
- elseif luasnip.expand_or_locally_jumpable() then
- luasnip.expand_or_jump()
- else
- fallback()
- end
- end, { 'i', 's' }),
- ['<S-Tab>'] = cmp.mapping(function(fallback)
- if cmp.visible() then
- cmp.select_prev_item()
- elseif luasnip.locally_jumpable(-1) then
- luasnip.jump(-1)
- else
- fallback()
- end
- end, { 'i', 's' }),
- },
- sources = {
- { name = 'nvim_lsp' },
- { name = 'luasnip' },
- },
-}