diff options
Diffstat (limited to 'configs/nvim/init.lua')
-rw-r--r-- | configs/nvim/init.lua | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/configs/nvim/init.lua b/configs/nvim/init.lua index e849071..0b423a1 100644 --- a/configs/nvim/init.lua +++ b/configs/nvim/init.lua @@ -5,10 +5,63 @@ vim.opt.fileformats = "unix,dos"; vim.opt.softtabstop = 4; vim.opt.shiftwidth = 4; vim.opt.expandtab = true; +vim.opt.wrap = false; if vim.g.neovide then + vim.opt.guifont = "FiraCodeNerdFont"; vim.g.neovide_transparency = 0.95; vim.g.neovide_input_ime = false; vim.g.neovide_cursor_vfx_mode = "railgun"; end +-- Init lazy.nvim +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.uv.fs_stat(lazypath) then + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", -- latest stable release + lazypath, + }) +end +vim.opt.rtp:prepend(lazypath) + +-- Use lazy.nvim +require("lazy").setup("plugins") + +-- setup nvim-cmp +local cmp = require("cmp") + +cmp.setup({ + snippet = { + expand = function(args) + require("luasnip").lsp_expand(args.body) + end, + }, + window = { + }, + mapping = cmp.mapping.preset.insert({ + ['<C-b>'] = cmp.mapping.scroll_docs(-4), + ['<C-f>'] = cmp.mapping.scroll_docs(4), + ['<C-Space>'] = cmp.mapping.complete(), + ['<C-e>'] = cmp.mapping.abort(), + ['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + }), + sources = cmp.config.sources({ + { name = 'nvim_lsp' }, + { name = 'luasnip' }, + }, { + { name = 'buffer' }, + }) +}) + +-- setup lsp +local capabilities = require("cmp_nvim_lsp").default_capabilities() +local lspconfig = require("lspconfig") + +lspconfig.clangd.setup { + capabilities = capabilites +} + |