Various fixes

This commit is contained in:
minhtrannhat
2022-01-24 10:37:58 -05:00
parent 7643436ad1
commit 06d488ab21
7 changed files with 63 additions and 24 deletions

View File

@@ -13,12 +13,11 @@ lvim.shell = "/bin/fish"
-- keymappings [view all the defaults by pressing <leader>Lk]
lvim.leader = "space"
lvim.builtin.dashboard.active = true
lvim.builtin.terminal.active = true
lvim.builtin.autopairs.active = true
lvim.builtin.gitsigns.active = true
lvim.builtin.dap.active = false
lvim.builtin.dap.active = true
vim.opt.relativenumber = true
lvim.builtin.nvimtree.side = "left"
@@ -67,16 +66,42 @@ lvim.plugins = {
end,
event = "InsertEnter",
},
{ "machakann/vim-sandwich" },
{ "tpope/vim-fugitive" },
{ "TimUntersberger/neogit", requires = "nvim-lua/plenary.nvim" },
}
-- Neogit - A emacs magit clone
local neogit = require("neogit")
-- Changes to clangd
vim.list_extend(lvim.lsp.override, { "clangd" })
neogit.setup({})
lvim.builtin.which_key.mappings["gg"] = {
"<cmd>Neogit kind=split<CR>",
"Neogit",
-- some settings can only passed as commandline flags `clangd --help`
local clangd_flags = {
"--all-scopes-completion",
"--suggest-missing-includes",
"--background-index",
"--pch-storage=disk",
"--cross-file-rename",
"--log=info",
"--completion-style=detailed",
"--enable-config", -- clangd 11+ supports reading from .clangd configuration file
"--clang-tidy",
"--offset-encoding=utf-16",
"--clang-tidy-checks=-*,llvm-*,clang-analyzer-*,modernize-*,-modernize-use-trailing-return-type",
"--fallback-style=Google",
-- "--header-insertion=never",
-- "--query-driver=<list-of-white-listed-complers>"
}
local clangd_bin = "clangd"
local custom_on_attach = function(client, bufnr)
require("lvim.lsp").common_on_attach(client, bufnr)
local opts = { noremap = true, silent = true }
vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>lh", "<Cmd>ClangdSwitchSourceHeader<CR>", opts)
end
local opts = {
cmd = { clangd_bin, unpack(clangd_flags) },
on_attach = custom_on_attach,
}
require("lvim.lsp.manager").setup("clangd", opts)