mirror of
https://github.com/sadan4/nvim.git
synced 2025-06-08 04:43:03 -04:00
a
This commit is contained in:
parent
e649c257a1
commit
671a7efdb9
6 changed files with 833 additions and 3 deletions
|
@ -42,3 +42,5 @@ vim.keymap.set({ "i", "n" }, "<C-\\>", vim.cmd.vsplit, {})
|
|||
-- vscode fold and unfold
|
||||
vim.keymap.set("n", "<C-[>", "zc", {})
|
||||
vim.keymap.set("n", "<C-]>", "zo", {})
|
||||
-- clangd switch source/header
|
||||
vim.keymap.set({ "i", "n" }, "<A-o>", vim.cmd.ClangdSwitchSourceHeader, { silent = true })
|
||||
|
|
|
@ -11,6 +11,9 @@ local plugins = {
|
|||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
},
|
||||
{
|
||||
"p00f/clangd_extensions.nvim",
|
||||
},
|
||||
{
|
||||
"folke/trouble.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
|
|
82
lua/setupclangdext.lua
Normal file
82
lua/setupclangdext.lua
Normal file
|
@ -0,0 +1,82 @@
|
|||
require("clangd_extensions").setup({
|
||||
inlay_hints = {
|
||||
inline = vim.fn.has("nvim-0.10") == 1,
|
||||
-- Options other than `highlight' and `priority' only work
|
||||
-- if `inline' is disabled
|
||||
-- Only show inlay hints for the current line
|
||||
only_current_line = false,
|
||||
-- Event which triggers a refresh of the inlay hints.
|
||||
-- You can make this { "CursorMoved" } or { "CursorMoved,CursorMovedI" } but
|
||||
-- not that this may cause higher CPU usage.
|
||||
-- This option is only respected when only_current_line and
|
||||
-- autoSetHints both are true.
|
||||
only_current_line_autocmd = { "CursorHold" },
|
||||
-- whether to show parameter hints with the inlay hints or not
|
||||
show_parameter_hints = true,
|
||||
-- prefix for parameter hints
|
||||
parameter_hints_prefix = "<- ",
|
||||
-- prefix for all the other hints (type, chaining)
|
||||
other_hints_prefix = "=> ",
|
||||
-- whether to align to the length of the longest line in the file
|
||||
max_len_align = false,
|
||||
-- padding from the left if max_len_align is true
|
||||
max_len_align_padding = 1,
|
||||
-- whether to align to the extreme right or not
|
||||
right_align = false,
|
||||
-- padding from the right if right_align is true
|
||||
right_align_padding = 7,
|
||||
-- The color of the hints
|
||||
highlight = "Comment",
|
||||
-- The highlight group priority for extmark
|
||||
priority = 100,
|
||||
},
|
||||
ast = {
|
||||
-- These are unicode, should be available in any font
|
||||
role_icons = {
|
||||
type = "🄣",
|
||||
declaration = "🄓",
|
||||
expression = "🄔",
|
||||
statement = ";",
|
||||
specifier = "🄢",
|
||||
["template argument"] = "🆃",
|
||||
},
|
||||
kind_icons = {
|
||||
Compound = "🄲",
|
||||
Recovery = "🅁",
|
||||
TranslationUnit = "🅄",
|
||||
PackExpansion = "🄿",
|
||||
TemplateTypeParm = "🅃",
|
||||
TemplateTemplateParm = "🅃",
|
||||
TemplateParamObject = "🅃",
|
||||
},
|
||||
--[[ These require codicons (https://github.com/microsoft/vscode-codicons)
|
||||
role_icons = {
|
||||
type = "",
|
||||
declaration = "",
|
||||
expression = "",
|
||||
specifier = "",
|
||||
statement = "",
|
||||
["template argument"] = "",
|
||||
},
|
||||
|
||||
kind_icons = {
|
||||
Compound = "",
|
||||
Recovery = "",
|
||||
TranslationUnit = "",
|
||||
PackExpansion = "",
|
||||
TemplateTypeParm = "",
|
||||
TemplateTemplateParm = "",
|
||||
TemplateParamObject = "",
|
||||
}, ]]
|
||||
|
||||
highlights = {
|
||||
detail = "Comment",
|
||||
},
|
||||
},
|
||||
memory_usage = {
|
||||
border = "none",
|
||||
},
|
||||
symbol_info = {
|
||||
border = "none",
|
||||
},
|
||||
})
|
|
@ -11,12 +11,46 @@ require("formatter").setup({
|
|||
log_level = vim.log.levels.WARN,
|
||||
-- All formatter configurations are opt-in
|
||||
filetype = {
|
||||
yaml = {
|
||||
require("formatter.filetypes.yaml").yamlfmt,
|
||||
function()
|
||||
return {
|
||||
exe = "yamlfmt",
|
||||
args = { "-in" },
|
||||
stdin = true,
|
||||
}
|
||||
end,
|
||||
},
|
||||
-- Formatter configurations for filetype "lua" go here
|
||||
-- and will be executed in order
|
||||
typescript = {
|
||||
require("formatter.filetypes.typescript").eslint_d,
|
||||
util.copyf(defaults.eslint_d),
|
||||
},
|
||||
cpp = {
|
||||
require("formatter.filetypes.c").clangformat,
|
||||
function()
|
||||
return {
|
||||
util.copyf(defaults.clangformat),
|
||||
}
|
||||
end,
|
||||
},
|
||||
h = {
|
||||
require("formatter.filetypes.c").clangformat,
|
||||
function()
|
||||
return {
|
||||
util.copyf(defaults.clangformat),
|
||||
}
|
||||
end,
|
||||
},
|
||||
c = {
|
||||
require("formatter.filetypes.c").clangformat,
|
||||
function()
|
||||
return {
|
||||
util.copyf(defaults.clangformat),
|
||||
}
|
||||
end,
|
||||
},
|
||||
kotlin = {
|
||||
require("formatter.filetypes.kotlin").ktlint,
|
||||
function()
|
||||
|
|
|
@ -5,6 +5,24 @@ capabilities.textDocument.foldingRange = {
|
|||
dynamicRegistration = false,
|
||||
lineFoldingOnly = true,
|
||||
}
|
||||
|
||||
require("lspconfig").yamlls.setup({
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
yaml = {
|
||||
schemas = {
|
||||
["/home/meyer/.config/nvim/clangdschema.json"] = "/.clangd",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
require("lspconfig").clangd.setup({
|
||||
capabilities = capabilities,
|
||||
cmd = {
|
||||
"clangd",
|
||||
"--header-insertion=iwyu"
|
||||
}
|
||||
})
|
||||
require("lspconfig").pyright.setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
|
@ -48,9 +66,6 @@ require("lspconfig").lua_ls.setup({
|
|||
},
|
||||
})
|
||||
end,
|
||||
settings = {
|
||||
Lua = {},
|
||||
},
|
||||
})
|
||||
|
||||
local luasnip = require("luasnip")
|
||||
|
@ -97,3 +112,4 @@ cmp.setup({
|
|||
},
|
||||
})
|
||||
cmp.event:on("confirm_done", pairs.on_confirm_done())
|
||||
require("setupclangdext")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue