From 07b00af99e47d3a35e17e669cfbdde7906275437 Mon Sep 17 00:00:00 2001 From: Erik Cowley Date: Sun, 8 Oct 2023 22:47:11 -0400 Subject: [PATCH] Add c++ lsp --- init.lua | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/init.lua b/init.lua index e84b2e0..54771aa 100644 --- a/init.lua +++ b/init.lua @@ -45,18 +45,18 @@ require("lazy").setup({ "neovim/nvim-lspconfig", --"kien/ctrlp.vim", { - "ray-x/go.nvim", - dependencies = { -- optional packages - "ray-x/guihua.lua", - "neovim/nvim-lspconfig", - "nvim-treesitter/nvim-treesitter", - }, - config = function() - require("go").setup() - end, - event = {"CmdlineEnter"}, - ft = {"go", 'gomod'}, - build = ':lua require("go.install").update_all_sync()' -- if you need to install/update all binaries + "ray-x/go.nvim", + dependencies = { -- optional packages + "ray-x/guihua.lua", + "neovim/nvim-lspconfig", + "nvim-treesitter/nvim-treesitter", + }, + config = function() + require("go").setup() + end, + event = {"CmdlineEnter"}, + ft = {"go", 'gomod'}, + build = ':lua require("go.install").update_all_sync()' -- if you need to install/update all binaries }, --"navarasu/onedark.nvim", "tpope/vim-surround", @@ -172,6 +172,8 @@ vim.api.nvim_create_autocmd("BufWritePre", { require("go").setup{} require("lspconfig").gopls.setup{} +require("lspconfig").ccls.setup{} + -- Global mappings. -- See `:help vim.diagnostic.*` for documentation on any of the below functions @@ -240,6 +242,7 @@ set.ignorecase = true set.smartcase = true -- avoid frustrations set.autoread = true +set.scrolloff = 6 -- autoindent works weirdly sometimes -- set.autoindent = true vim.keymap.set("n", "gtl", ":tabn") @@ -252,6 +255,7 @@ vim.keymap.set("n", "gtH", ":execute 'silent! tabmove ' . (tabpagenr()-2)") vim.keymap.set("n", "gtn", ":tabedit") -- previous tab vim.keymap.set("n", "gb", ":bprevious") +vim.keymap.set("n", "gn", ":bnext") -- switch windows using g rather than vim.keymap.set("n", "gwh", "h") vim.keymap.set("n", "gwl", "l")