add clangd_extension.nvim
This commit is contained in:
parent
fd1b35e4b7
commit
8d150c6d75
|
|
@ -331,7 +331,7 @@ M.lspconfig = {
|
||||||
M.rust = {
|
M.rust = {
|
||||||
plugin = true,
|
plugin = true,
|
||||||
n = {
|
n = {
|
||||||
["<leader>rr"] = { "<cmd> RustRunnables <CR>", "RustRunnables" },
|
["<leader>rr"] = { "<cmd> RustRun<CR>", "RustRun" },
|
||||||
["<leader>rd"] = { "<cmd> RustDebuggables <CR>", "RustDebuggables" },
|
["<leader>rd"] = { "<cmd> RustDebuggables <CR>", "RustDebuggables" },
|
||||||
["<leader>ra"] = { "<cmd> RustHoverActions <CR>", "RustHoverActions" },
|
["<leader>ra"] = { "<cmd> RustHoverActions <CR>", "RustHoverActions" },
|
||||||
["<leader>roc"] = { "<cmd> RustOpenCargo <CR>", "RustOpenCargo" },
|
["<leader>roc"] = { "<cmd> RustOpenCargo <CR>", "RustOpenCargo" },
|
||||||
|
|
|
||||||
|
|
@ -127,20 +127,20 @@ lspconfig.lua_ls.setup {
|
||||||
-- }
|
-- }
|
||||||
-- }
|
-- }
|
||||||
|
|
||||||
lspconfig.clangd.setup {
|
-- lspconfig.clangd.setup {
|
||||||
filetypes = { "c", "cpp", "objc", "objcpp", "cuda", "proto" },
|
-- filetypes = { "c", "cpp", "objc", "objcpp", "cuda", "proto" },
|
||||||
single_file_support = true,
|
-- single_file_support = true,
|
||||||
on_attach = M.on_attach,
|
-- on_attach = M.on_attach,
|
||||||
capabilities = M.capabilities,
|
-- capabilities = M.capabilities,
|
||||||
root_dir = vim.loop.cwd,
|
-- root_dir = vim.loop.cwd,
|
||||||
-- init_option = { fallbackFlags = { "-std=c++2a" } }
|
-- -- init_option = { fallbackFlags = { "-std=c++2a" } }
|
||||||
}
|
-- }
|
||||||
|
|
||||||
lspconfig.html.setup {
|
lspconfig.html.setup {
|
||||||
on_attach = M.on_attach,
|
on_attach = M.on_attach,
|
||||||
capabilities = M.capabilities,
|
capabilities = M.capabilities,
|
||||||
init_option = { provideFormatter = true },
|
init_option = { provideFormatter = true },
|
||||||
filetypes = { "htmldjango", "html"},
|
filetypes = { "htmldjango", "html" },
|
||||||
}
|
}
|
||||||
|
|
||||||
local servers = {
|
local servers = {
|
||||||
|
|
|
||||||
|
|
@ -19,9 +19,17 @@ M.luasnip = function()
|
||||||
}
|
}
|
||||||
|
|
||||||
require("luasnip").config.set_config(options)
|
require("luasnip").config.set_config(options)
|
||||||
require("luasnip.loaders.from_vscode").lazy_load { paths = vim.g.luasnippets_path or "" }
|
-- vscode format
|
||||||
require("luasnip.loaders.from_vscode").lazy_load()
|
require("luasnip.loaders.from_vscode").lazy_load()
|
||||||
|
require("luasnip.loaders.from_vscode").lazy_load { paths = vim.g.vscode_snippets_path or "" }
|
||||||
|
|
||||||
|
-- snipmate format
|
||||||
|
require("luasnip.loaders.from_snipmate").load()
|
||||||
|
require("luasnip.loaders.from_snipmate").lazy_load { paths = vim.g.snipmate_snippets_path or "" }
|
||||||
|
|
||||||
|
-- lua format
|
||||||
|
require("luasnip.loaders.from_lua").load()
|
||||||
|
require("luasnip.loaders.from_lua").lazy_load { paths = vim.g.lua_snippets_path or "" }
|
||||||
vim.api.nvim_create_autocmd("InsertLeave", {
|
vim.api.nvim_create_autocmd("InsertLeave", {
|
||||||
callback = function()
|
callback = function()
|
||||||
if require("luasnip").session.current_nodes[vim.api.nvim_get_current_buf()]
|
if require("luasnip").session.current_nodes[vim.api.nvim_get_current_buf()]
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,8 @@ local plugins = {
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
{ "lewis6991/gitsigns.nvim",
|
{
|
||||||
|
"lewis6991/gitsigns.nvim",
|
||||||
ft = "gitcommit",
|
ft = "gitcommit",
|
||||||
init = function()
|
init = function()
|
||||||
-- load gitsigns only when a git file is opened
|
-- load gitsigns only when a git file is opened
|
||||||
|
|
@ -52,14 +53,16 @@ local plugins = {
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
{ "tpope/vim-fugitive",
|
{
|
||||||
|
"tpope/vim-fugitive",
|
||||||
cmd = "Git",
|
cmd = "Git",
|
||||||
init = function ()
|
init = function()
|
||||||
require("core.utils").load_mappings "fugitive"
|
require("core.utils").load_mappings "fugitive"
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
|
|
||||||
{ "nvim-telescope/telescope.nvim",
|
{
|
||||||
|
"nvim-telescope/telescope.nvim",
|
||||||
cmd = "Telescope",
|
cmd = "Telescope",
|
||||||
config = function()
|
config = function()
|
||||||
require "plugins.configs.telescope"
|
require "plugins.configs.telescope"
|
||||||
|
|
@ -69,22 +72,25 @@ local plugins = {
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
{ "ThePrimeagen/harpoon",
|
{
|
||||||
init = function ()
|
"ThePrimeagen/harpoon",
|
||||||
|
init = function()
|
||||||
require("core.utils").load_mappings "harpoon"
|
require("core.utils").load_mappings "harpoon"
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
|
|
||||||
-- lsp stuff
|
-- lsp stuff
|
||||||
|
|
||||||
{ "williamboman/mason.nvim",
|
{
|
||||||
|
"williamboman/mason.nvim",
|
||||||
cmd = { "Mason", "MasonInstall", "MasonInstallAll", "MasonUninstall", "MasonUninstallAll", "MasonLog" },
|
cmd = { "Mason", "MasonInstall", "MasonInstallAll", "MasonUninstall", "MasonUninstallAll", "MasonLog" },
|
||||||
config = function()
|
config = function()
|
||||||
require "plugins.configs.mason"
|
require "plugins.configs.mason"
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
{ "neovim/nvim-lspconfig",
|
{
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
init = function()
|
init = function()
|
||||||
require("core.utils").lazy_load "nvim-lspconfig"
|
require("core.utils").lazy_load "nvim-lspconfig"
|
||||||
end,
|
end,
|
||||||
|
|
@ -93,7 +99,8 @@ local plugins = {
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
{ "simrat39/rust-tools.nvim",
|
{
|
||||||
|
"simrat39/rust-tools.nvim",
|
||||||
-- after = "nvim-lspconfig",
|
-- after = "nvim-lspconfig",
|
||||||
-- event = "BufEnter *.rs",
|
-- event = "BufEnter *.rs",
|
||||||
ft = { "rust" },
|
ft = { "rust" },
|
||||||
|
|
@ -105,7 +112,8 @@ local plugins = {
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
{ "Saecki/crates.nvim",
|
{
|
||||||
|
"Saecki/crates.nvim",
|
||||||
event = { "BufRead Cargo.toml" },
|
event = { "BufRead Cargo.toml" },
|
||||||
config = function()
|
config = function()
|
||||||
require("crates").setup()
|
require("crates").setup()
|
||||||
|
|
@ -114,9 +122,20 @@ local plugins = {
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
"p00f/clangd_extensions.nvim",
|
||||||
|
ft = { "c", "cpp", "objc", "objcpp", "cuda", "proto" },
|
||||||
|
dependencies = "neovim/nvim-lspconfig",
|
||||||
|
config = function()
|
||||||
|
require("plugins.configs.clangd")
|
||||||
|
end
|
||||||
|
},
|
||||||
|
|
||||||
-- load luasnips + cmp related in insert mode only
|
-- load luasnips + cmp related in insert mode only
|
||||||
|
|
||||||
{ "hrsh7th/nvim-cmp",
|
{
|
||||||
|
"hrsh7th/nvim-cmp",
|
||||||
event = "InsertEnter",
|
event = "InsertEnter",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
{
|
{
|
||||||
|
|
@ -152,7 +171,8 @@ local plugins = {
|
||||||
},
|
},
|
||||||
-- misc
|
-- misc
|
||||||
|
|
||||||
{ 'vimwiki/vimwiki',
|
{
|
||||||
|
'vimwiki/vimwiki',
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
init = function()
|
init = function()
|
||||||
vim.g.vimwiki_list = {
|
vim.g.vimwiki_list = {
|
||||||
|
|
@ -165,7 +185,8 @@ local plugins = {
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
{ "numToStr/Comment.nvim",
|
{
|
||||||
|
"numToStr/Comment.nvim",
|
||||||
-- keys = { "gc", "gb" },
|
-- keys = { "gc", "gb" },
|
||||||
config = function()
|
config = function()
|
||||||
require("Comment").setup()
|
require("Comment").setup()
|
||||||
|
|
@ -175,14 +196,16 @@ local plugins = {
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
{ "mbbill/undotree",
|
{
|
||||||
|
"mbbill/undotree",
|
||||||
cmd = "UndotreeToggle",
|
cmd = "UndotreeToggle",
|
||||||
init = function()
|
init = function()
|
||||||
require("core.utils").load_mappings "undotree"
|
require("core.utils").load_mappings "undotree"
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
{ "krolyxon/kterm",
|
{
|
||||||
|
"krolyxon/kterm",
|
||||||
config = function()
|
config = function()
|
||||||
require "plugins.configs.kterm"
|
require "plugins.configs.kterm"
|
||||||
end,
|
end,
|
||||||
|
|
@ -193,7 +216,8 @@ local plugins = {
|
||||||
|
|
||||||
-- UI stuff
|
-- UI stuff
|
||||||
|
|
||||||
{ "lukas-reineke/indent-blankline.nvim",
|
{
|
||||||
|
"lukas-reineke/indent-blankline.nvim",
|
||||||
event = "BufRead",
|
event = "BufRead",
|
||||||
config = function()
|
config = function()
|
||||||
require("plugins.configs.others").blankline()
|
require("plugins.configs.others").blankline()
|
||||||
|
|
@ -204,7 +228,8 @@ local plugins = {
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
{ "nvchad/nvim-colorizer.lua",
|
{
|
||||||
|
"nvchad/nvim-colorizer.lua",
|
||||||
init = function()
|
init = function()
|
||||||
require("core.utils").lazy_load "nvim-colorizer.lua"
|
require("core.utils").lazy_load "nvim-colorizer.lua"
|
||||||
end,
|
end,
|
||||||
|
|
@ -213,7 +238,8 @@ local plugins = {
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
{ "nvim-lualine/lualine.nvim",
|
{
|
||||||
|
"nvim-lualine/lualine.nvim",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
config = function()
|
config = function()
|
||||||
require("plugins.configs.statusline")
|
require("plugins.configs.statusline")
|
||||||
|
|
@ -221,7 +247,8 @@ local plugins = {
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Only load whichkey after all the gui
|
-- Only load whichkey after all the gui
|
||||||
{ "folke/which-key.nvim",
|
{
|
||||||
|
"folke/which-key.nvim",
|
||||||
enabled = true,
|
enabled = true,
|
||||||
keys = { "<leader>", "\"", "'", "`", "c", "v" },
|
keys = { "<leader>", "\"", "'", "`", "c", "v" },
|
||||||
config = function()
|
config = function()
|
||||||
|
|
|
||||||
Reference in New Issue