updates to integrate with code better
This commit is contained in:
parent
a637f87be0
commit
136d75b543
@ -1,2 +1,13 @@
|
||||
if not vim.g.vscode then
|
||||
require("lazyvim") -- my config based on folkes LazyVim starter
|
||||
-- require("chris") -- my config based on Christian Chiarullis work
|
||||
return
|
||||
end
|
||||
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
|
||||
-- Add some vscode specific keymaps
|
||||
vim.keymap.set("n", "<leader><space>", "<cmd>Find<cr>")
|
||||
vim.keymap.set("n", "<leader>/", [[<cmd>call VSCodeNotify('workbench.action.findInFiles')<cr>]])
|
||||
vim.keymap.set("n", "<leader>ss", [[<cmd>call VSCodeNotify('workbench.action.gotoSymbol')<cr>]])
|
||||
|
||||
@ -20,24 +20,10 @@ vim.opt.rtp:prepend(vim.env.LAZY or lazypath)
|
||||
|
||||
require("lazyvim.config").setup()
|
||||
|
||||
if not vim.g.vscode then
|
||||
require("lazy").setup({
|
||||
spec = "lazyvim.plugins",
|
||||
defaults = { lazy = true, version = false },
|
||||
checker = { enabled = true },
|
||||
})
|
||||
end
|
||||
|
||||
-- This might not be best, but it allows for easy resetting
|
||||
ColorMe = function()
|
||||
local colorscheme = "gruvbox-material"
|
||||
|
||||
local okay, _ = pcall(vim.cmd, "colorscheme " .. colorscheme)
|
||||
|
||||
if not okay then
|
||||
vim.notify("Colorscheme " .. colorscheme .. " not found!")
|
||||
vim.cmd("colorsheme habamax")
|
||||
end
|
||||
end
|
||||
|
||||
ColorMe()
|
||||
require("lazyvim.utils").setColorscheme()
|
||||
|
||||
@ -8,6 +8,22 @@ return {
|
||||
"hrsh7th/cmp-emoji",
|
||||
"hrsh7th/cmp-buffer",
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
{
|
||||
"zbirenbaum/copilot-cmp",
|
||||
dependencies = "copilot.lua",
|
||||
opts = {},
|
||||
config = function(_, opts)
|
||||
local copilot_cmp = require("copilot_cmp")
|
||||
copilot_cmp.setup(opts)
|
||||
-- attach cmp source whenever copilot attaches
|
||||
-- fixes lazy-loading issues with the copilot cmp source
|
||||
require("lazyvim.utils").on_attach(function(client)
|
||||
if client.name == "copilot" then
|
||||
copilot_cmp._on_insert_enter({})
|
||||
end
|
||||
end)
|
||||
end,
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
local cmp = require("cmp")
|
||||
@ -35,6 +51,7 @@ return {
|
||||
{ name = "path" },
|
||||
{ name = "emoji" },
|
||||
{ name = "buffer" },
|
||||
{ name = "copilot" },
|
||||
}),
|
||||
formatting = {
|
||||
format = function(_, item)
|
||||
@ -53,4 +70,20 @@ return {
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"zbirenbaum/copilot-cmp",
|
||||
dependencies = "copilot.lua",
|
||||
opts = {},
|
||||
config = function(_, opts)
|
||||
local copilot_cmp = require("copilot_cmp")
|
||||
copilot_cmp.setup(opts)
|
||||
-- attach cmp source whenever copilot attaches
|
||||
-- fixes lazy-loading issues with the copilot cmp source
|
||||
require("lazyvim.utils").on_attach(function(client)
|
||||
if client.name == "copilot" then
|
||||
copilot_cmp._on_insert_enter({})
|
||||
end
|
||||
end)
|
||||
end,
|
||||
}
|
||||
}
|
||||
|
||||
@ -70,11 +70,15 @@ return {
|
||||
t = { name = "+todo" },
|
||||
N = { name = "+noice" },
|
||||
|
||||
e = { "<cmd>NvimTreeToggle<cr>", "Explorer" },
|
||||
Z = { "<cmd>ZenMode<cr>", "Zen" },
|
||||
u = { "<cmd>UndotreeToggle<cr>", "Undo Tree" },
|
||||
["'"] = { "<cmd>close<CR>", "Close split" },
|
||||
|
||||
c = {
|
||||
name = "+copilot",
|
||||
c = { "<cmd>Copilot<cr>", "Start Copilot" },
|
||||
},
|
||||
|
||||
n = {
|
||||
name = "+neorg",
|
||||
n = { "<cmd>Neorg<cr>", "Open Neorg" },
|
||||
@ -106,8 +110,8 @@ return {
|
||||
q = { "<cmd>copen<cr>", "Open Quickfix List" },
|
||||
},
|
||||
|
||||
c = {
|
||||
name = "Compiler",
|
||||
C = {
|
||||
name = "+compiler",
|
||||
c = { "<cmd>w! | !compiler %<cr>", "Compile File" },
|
||||
b = { "<cmd>w! | !pandoc % -t beamer -o presentation.pdf<cr>", "Beamer Presentation" },
|
||||
p = { "<cmd>!opout %<cr><cr>", "Preview Document" },
|
||||
|
||||
@ -129,4 +129,16 @@ function M.telescope(builtin, opts)
|
||||
end
|
||||
end
|
||||
|
||||
-- This might not be best, but it allows for easy resetting
|
||||
function M.setColorscheme(scheme)
|
||||
local colorscheme = scheme or "gruvbox-material"
|
||||
|
||||
local okay, _ = pcall(vim.cmd, "colorscheme " .. colorscheme)
|
||||
|
||||
if not okay then
|
||||
vim.notify("Colorscheme " .. colorscheme .. " not found!")
|
||||
vim.cmd("colorsheme habamax")
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
|
||||
Loading…
Reference in New Issue
Block a user