Include copilot chat and completions.
Refactor configuration into more modules
This commit is contained in:
parent
b6d0624e34
commit
05874830dd
4 changed files with 160 additions and 103 deletions
|
@ -12,6 +12,8 @@ vim.cmd("set shiftwidth=2")
|
||||||
|
|
||||||
-- Configure Editor Settings
|
-- Configure Editor Settings
|
||||||
vim.cmd("set number")
|
vim.cmd("set number")
|
||||||
|
vim.cmd("set splitbelow")
|
||||||
|
vim.cmd("set splitright")
|
||||||
vim.cmd("set spl=en_us spell")
|
vim.cmd("set spl=en_us spell")
|
||||||
vim.opt.guifont = "JetBrainsMonoNerdFontMono:14"
|
vim.opt.guifont = "JetBrainsMonoNerdFontMono:14"
|
||||||
-- Custom Key Binds
|
-- Custom Key Binds
|
||||||
|
@ -20,18 +22,28 @@ vim.g.mapleader = " "
|
||||||
-- Init Lazy Plugin Manager
|
-- Init Lazy Plugin Manager
|
||||||
require("config.lazy")
|
require("config.lazy")
|
||||||
|
|
||||||
|
-- Configure nvim Keymaps
|
||||||
|
vim.keymap.set("n", "<leader>r", ":source %<CR>", { desc = "Reload Config" })
|
||||||
|
|
||||||
-- Configure Telescope Keymaps
|
-- Configure Telescope Keymaps
|
||||||
local builtin = require("telescope.builtin")
|
local builtin = require("telescope.builtin")
|
||||||
vim.keymap.set("n", "<C-p>", builtin.find_files, {})
|
vim.keymap.set("n", "<leader>ff", builtin.find_files, { desc = "Find File"})
|
||||||
vim.keymap.set("n", "<leader>gg", builtin.live_grep, { desc = "Grep Files" })
|
vim.keymap.set("n", "<leader>fg", builtin.live_grep, { desc = "Grep Files" })
|
||||||
vim.keymap.set("n", "<leader>fb", builtin.buffers, { desc = "Open Editors" })
|
vim.keymap.set("n", "<leader>fb", builtin.buffers, { desc = "Open Editors" })
|
||||||
|
|
||||||
-- Init Treesitter Syntax Highlighting
|
-- Init Treesitter Syntax Highlighting
|
||||||
--require("config.treesitter")
|
--require("config.treesitter")
|
||||||
|
|
||||||
-- Configure NeoTree (FS View)
|
-- Configure NeoTree (FS View)
|
||||||
vim.keymap.set("n", "<leader>ft", ":Neotree filesystem reveal left<CR>")
|
vim.keymap.set("n", "<leader>ft", ":Neotree filesystem toggle left<CR>")
|
||||||
|
|
||||||
-- Configure Git
|
-- Configure Git
|
||||||
vim.keymap.set("n", "<leader>gd", ":Gitsigns preview_hunk<CR>", { desc = "Git Diff" })
|
vim.keymap.set("n", "<leader>gd", ":Gitsigns preview_hunk<CR>", { desc = "Git Diff" })
|
||||||
vim.keymap.set("n", "<leader>gb", ":Gitsigns toggle_current_line_blame<CR>", { desc = "Git Blame" })
|
vim.keymap.set("n", "<leader>gb", ":Gitsigns toggle_current_line_blame<CR>", { desc = "Git Blame" })
|
||||||
|
|
||||||
|
-- Configure Copilot
|
||||||
|
--vim.keymap.set("n", "<leader>cp", ":Copilot panel<CR>", { desc = "Open Copilot Panel" })
|
||||||
|
vim.keymap.set("n", "<leader>ce", ":Copilot enable<CR>", { desc = "Enable Copilot Completions" })
|
||||||
|
vim.keymap.set("n", "<leader>cd", ":Copilot disable<CR>", { desc = "Disable Copilot Completions" })
|
||||||
|
vim.keymap.set("n", "<leader>cc", ":CopilotChatToggle<CR>", { desc = "Toggle Copilot Chat" })
|
||||||
|
vim.keymap.set("n", "<leader>cx", ":CopilotChatReset<CR>", { desc = "Reset Copilot Chat" })
|
||||||
|
|
|
@ -1,102 +1,61 @@
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"mason-org/mason.nvim",
|
"mason-org/mason.nvim",
|
||||||
tag = "v1.11.0",
|
tag = "v1.11.0",
|
||||||
config = function()
|
config = function()
|
||||||
require("mason").setup({})
|
require("mason").setup({})
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"mason-org/mason-lspconfig.nvim",
|
"mason-org/mason-lspconfig.nvim",
|
||||||
tag = "v1.32.0",
|
tag = "v1.32.0",
|
||||||
config = function()
|
config = function()
|
||||||
require("mason-lspconfig").setup({
|
require("mason-lspconfig").setup({
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
"lua_ls",
|
"lua_ls",
|
||||||
"bashls",
|
"bashls",
|
||||||
"dockerls",
|
"dockerls",
|
||||||
--"gh-actions-language-server",
|
--"gh-actions-language-server",
|
||||||
"helm_ls",
|
"helm_ls",
|
||||||
"jsonls",
|
"jsonls",
|
||||||
"marksman",
|
"marksman",
|
||||||
"nginx_language_server",
|
"nginx_language_server",
|
||||||
"ruff",
|
"ruff",
|
||||||
"yamlls",
|
"yamlls",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"nvimtools/none-ls.nvim",
|
"nvimtools/none-ls.nvim",
|
||||||
config = function()
|
config = function()
|
||||||
local null_ls = require("null-ls")
|
local null_ls = require("null-ls")
|
||||||
null_ls.setup({
|
null_ls.setup({
|
||||||
sources = {
|
sources = {
|
||||||
null_ls.builtins.formatting.stylua,
|
null_ls.builtins.formatting.stylua,
|
||||||
null_ls.builtins.formatting.mdformat,
|
null_ls.builtins.formatting.mdformat,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
vim.keymap.set("n", "<leader>af", vim.lsp.buf.format, { desc = "Auto-Format File" })
|
vim.keymap.set("n", "<leader>af", vim.lsp.buf.format, { desc = "Auto-Format File" })
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
tag = "v1.8.0",
|
tag = "v1.8.0",
|
||||||
config = function()
|
config = function()
|
||||||
local lspconfig = require("lspconfig")
|
local lspconfig = require("lspconfig")
|
||||||
lspconfig.lua_ls.setup({})
|
lspconfig.lua_ls.setup({})
|
||||||
lspconfig.bashls.setup({})
|
lspconfig.bashls.setup({})
|
||||||
lspconfig.dockerls.setup({})
|
lspconfig.dockerls.setup({})
|
||||||
lspconfig.helm_ls.setup({})
|
lspconfig.helm_ls.setup({})
|
||||||
lspconfig.jsonls.setup({})
|
lspconfig.jsonls.setup({})
|
||||||
lspconfig.nginx_language_server.setup({})
|
lspconfig.nginx_language_server.setup({})
|
||||||
lspconfig.marksman.setup({})
|
lspconfig.marksman.setup({})
|
||||||
lspconfig.ruff.setup({})
|
lspconfig.ruff.setup({})
|
||||||
lspconfig.yamlls.setup({})
|
lspconfig.yamlls.setup({})
|
||||||
vim.keymap.set("n", "<leader>d", vim.lsp.buf.hover, { desc = "Show Docstring" })
|
vim.keymap.set("n", "<leader>d", vim.lsp.buf.hover, { desc = "Show Docstring" })
|
||||||
vim.keymap.set("n", "<leader>gt", vim.lsp.buf.definition, { desc = "Go To Definition" })
|
vim.keymap.set("n", "<leader>gt", vim.lsp.buf.definition, { desc = "Go To Definition" })
|
||||||
vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, { desc = "Show Code Actions" })
|
vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, { desc = "Show Code Actions" })
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"nvim-treesitter/nvim-treesitter",
|
|
||||||
config = function()
|
|
||||||
local config = require("nvim-treesitter.configs")
|
|
||||||
config.setup({
|
|
||||||
-- A list of parser names, or "all" (the listed parsers MUST always be installed)
|
|
||||||
ensure_installed = {
|
|
||||||
"lua",
|
|
||||||
"vim",
|
|
||||||
"vimdoc",
|
|
||||||
"query",
|
|
||||||
"markdown",
|
|
||||||
"markdown_inline",
|
|
||||||
"json",
|
|
||||||
"jsonc",
|
|
||||||
"python",
|
|
||||||
"yaml",
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
|
||||||
sync_install = false,
|
|
||||||
|
|
||||||
-- Automatically install missing parsers when entering buffer
|
|
||||||
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
|
|
||||||
auto_install = true,
|
|
||||||
|
|
||||||
-- List of parsers to ignore installing (or "all")
|
|
||||||
ignore_install = { "javascript" },
|
|
||||||
|
|
||||||
highlight = {
|
|
||||||
enable = true,
|
|
||||||
|
|
||||||
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
|
|
||||||
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
|
|
||||||
-- Using this option may slow down your editor, and you may see some duplicate highlights.
|
|
||||||
-- Instead of true it can also be a list of languages
|
|
||||||
additional_vim_regex_highlighting = false,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
31
.config/nvim/lua/plugins/llm.lua
Normal file
31
.config/nvim/lua/plugins/llm.lua
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"github/copilot.vim",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"CopilotC-Nvim/CopilotChat.nvim",
|
||||||
|
tag = "v3.4.0",
|
||||||
|
dependencies = {
|
||||||
|
{ "nvim-lua/plenary.nvim" },
|
||||||
|
{ "github/copilot.vim" },
|
||||||
|
},
|
||||||
|
build = "make tiktoken",
|
||||||
|
config = function()
|
||||||
|
require("CopilotChat").setup({
|
||||||
|
question_header = "",
|
||||||
|
answer_header = "",
|
||||||
|
separator = "",
|
||||||
|
error_header = "> [!ERROR] Error",
|
||||||
|
window = {
|
||||||
|
layout = "horizontal",
|
||||||
|
height = 0.3,
|
||||||
|
width = 0.25,
|
||||||
|
},
|
||||||
|
auto_insert_mode = false,
|
||||||
|
chat_autocomplete = false,
|
||||||
|
highlight_headers = false,
|
||||||
|
show_help = false,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
55
.config/nvim/lua/plugins/syntax_highlighting.lua
Normal file
55
.config/nvim/lua/plugins/syntax_highlighting.lua
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
config = function()
|
||||||
|
local config = require("nvim-treesitter.configs")
|
||||||
|
config.setup({
|
||||||
|
-- A list of parser names, or "all" (the listed parsers MUST always be installed)
|
||||||
|
ensure_installed = {
|
||||||
|
"lua",
|
||||||
|
"vim",
|
||||||
|
"vimdoc",
|
||||||
|
"query",
|
||||||
|
"markdown",
|
||||||
|
"markdown_inline",
|
||||||
|
"json",
|
||||||
|
"jsonc",
|
||||||
|
"python",
|
||||||
|
"yaml",
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||||
|
sync_install = false,
|
||||||
|
|
||||||
|
-- Automatically install missing parsers when entering buffer
|
||||||
|
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
|
||||||
|
auto_install = true,
|
||||||
|
|
||||||
|
-- List of parsers to ignore installing (or "all")
|
||||||
|
ignore_install = { "javascript" },
|
||||||
|
|
||||||
|
highlight = {
|
||||||
|
enable = true,
|
||||||
|
|
||||||
|
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
|
||||||
|
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
|
||||||
|
-- Using this option may slow down your editor, and you may see some duplicate highlights.
|
||||||
|
-- Instead of true it can also be a list of languages
|
||||||
|
additional_vim_regex_highlighting = false,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"MeanderingProgrammer/render-markdown.nvim",
|
||||||
|
dependencies = {
|
||||||
|
{ "nvim-treesitter/nvim-treesitter" },
|
||||||
|
{ "nvim-tree/nvim-web-devicons" },
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
require("render-markdown").setup({
|
||||||
|
file_types = { "markdown", "copilot-chat" },
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
Loading…
Reference in a new issue