initial commit
This commit is contained in:
6
chadrc.lua
Normal file
6
chadrc.lua
Normal file
@@ -0,0 +1,6 @@
|
||||
---@type ChadrcConfig
|
||||
local M = {}
|
||||
M.ui = { theme = 'catppuccin' }
|
||||
M.plugins = "custom.plugins"
|
||||
M.mappings = require("custom.mappings")
|
||||
return M
|
||||
11
configs/lspconfig.lua
Normal file
11
configs/lspconfig.lua
Normal file
@@ -0,0 +1,11 @@
|
||||
local base = require("plugins.configs.lspconfig")
|
||||
local on_attach = base.on_attach
|
||||
local capabilities = base.capabilities
|
||||
|
||||
local lspconfig = require("lspconfig")
|
||||
lspconfig.clangd.setup {
|
||||
on_attach = function(client, bufnr)
|
||||
client.server_capabilities.signatureHelpProvider = false
|
||||
on_attach(client, bufnr)
|
||||
end,
|
||||
}
|
||||
25
configs/null-ls.lua
Normal file
25
configs/null-ls.lua
Normal file
@@ -0,0 +1,25 @@
|
||||
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
|
||||
local null_ls = require("null-ls")
|
||||
|
||||
local opts = {
|
||||
sources = {
|
||||
null_ls.builtins.formatting.clang_format,
|
||||
},
|
||||
on_attach = function(client, bufnr)
|
||||
if client.supports_method("textDocument/formatting") then
|
||||
vim.api.nvim_clear_autocmds({
|
||||
group = augroup,
|
||||
buffer = bufnr,
|
||||
})
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
group = augroup,
|
||||
buffer = bufnr,
|
||||
callback = function()
|
||||
vim.lsp.buf.format({ bufnr = bufnr })
|
||||
end,
|
||||
})
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
||||
return opts
|
||||
29
mappings.lua
Normal file
29
mappings.lua
Normal file
@@ -0,0 +1,29 @@
|
||||
local M = {}
|
||||
|
||||
M.dap = {
|
||||
plugin = true,
|
||||
n = {
|
||||
["<leader>db"] = {
|
||||
"<cmd> DapToggleBreakpoint <CR>",
|
||||
"Add breakpoint at line",
|
||||
},
|
||||
["<leader>dr"] = {
|
||||
"<cmd> DapContinue <CR>",
|
||||
"Start or continue the debugger",
|
||||
},
|
||||
["<leader>pf"] = {
|
||||
"<cmd>Telescope find_files<CR>",
|
||||
"Open Telescope",
|
||||
},
|
||||
["<leader>lc"] = {
|
||||
"<cmd> VimtexComile <CR>",
|
||||
"Start latex compiler and preview",
|
||||
},
|
||||
["<leader>ls"] = {
|
||||
"<cmd> VimtexStop <CR>",
|
||||
"Stop latex compiler",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
return M
|
||||
85
plugins.lua
Normal file
85
plugins.lua
Normal file
@@ -0,0 +1,85 @@
|
||||
local plugins = {
|
||||
{
|
||||
'KDE/okular'
|
||||
},
|
||||
{
|
||||
'lervag/vimtex',
|
||||
opt = true,
|
||||
config = function ()
|
||||
vim.g.vimtex_view_general_viewer = 'okular'
|
||||
--vim.g.vimtex_compiler_latexmk_engines = {
|
||||
-- _ = 'latexmk'
|
||||
--}
|
||||
vim.g.tex_comment_nospell = 1
|
||||
--vim.g.vimtex_compiler_progname = 'nvr'
|
||||
vim.g.vimtex_view_general_options = [[--unique file:@pdf\#src:@line@tex]]
|
||||
--vim.g.vimtex_compiler_method = 'latexmk'
|
||||
--vim.g.vimtex_view_general_options_latexmk = '--unique'
|
||||
end,
|
||||
ft = 'tex'
|
||||
},
|
||||
{
|
||||
"simrat39/rust-tools.nvim",
|
||||
},
|
||||
{
|
||||
"rcarriga/nvim-dap-ui",
|
||||
event = "VeryLazy",
|
||||
dependencies = "mfussenegger/nvim-dap",
|
||||
config = function()
|
||||
local dap = require("dap")
|
||||
local dapui = require("dapui")
|
||||
dapui.setup()
|
||||
dap.listeners.after.event_initialized["dapui_config"] = function()
|
||||
dapui.open()
|
||||
end
|
||||
dap.listeners.before.event_terminated["dapui_config"] = function()
|
||||
dapui.close()
|
||||
end
|
||||
dap.listeners.before.event_exited["dapui_config"] = function()
|
||||
dapui.close()
|
||||
end
|
||||
end
|
||||
},
|
||||
{
|
||||
"jay-babu/mason-nvim-dap.nvim",
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
"williamboman/mason.nvim",
|
||||
"mfussenegger/nvim-dap",
|
||||
},
|
||||
opts = {
|
||||
handlers = {}
|
||||
},
|
||||
},
|
||||
{
|
||||
"mfussenegger/nvim-dap",
|
||||
config = function(_, _)
|
||||
require("core.utils").load_mappings("dap")
|
||||
end
|
||||
},
|
||||
{
|
||||
"jose-elias-alvarez/null-ls.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = function()
|
||||
return require "custom.configs.null-ls"
|
||||
end,
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
config = function()
|
||||
require "plugins.configs.lspconfig"
|
||||
require "custom.configs.lspconfig"
|
||||
end,
|
||||
},
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"clangd",
|
||||
"clang-format",
|
||||
"codelldb",
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return plugins
|
||||
Reference in New Issue
Block a user