colorscheme: improve selection of colorscheme

This commit is contained in:
David Senoner 2025-01-20 15:57:43 +01:00
parent 40fa8c3ade
commit 49015143c5
2 changed files with 28 additions and 1 deletions

View file

@ -4,6 +4,12 @@ return {
priority = 1000,
config = function ()
vim.cmd("colorscheme kanagawa-dragon")
local conf = require("kanagawa")
conf.setup({
theme = "dragon"
})
vim.cmd("colorscheme kanagawa")
end
}

View file

@ -1,3 +1,4 @@
vim.o.background = ""
vim.cmd("set number")
vim.cmd("set expandtab")
vim.cmd("set tabstop=2")
@ -11,3 +12,23 @@ vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, {})
vim.keymap.set("n", "J", function() vim.lsp.buf.type_definition() end, {})
vim.keymap.set("n", "C", function() vim.lsp.buf.code_action() end, {})
local prettier = function()
local clients = vim.lsp.get_active_clients()
for _, client in pairs(clients) do
if (client.name == "svelte") then
local path = vim.api.nvim_buf_get_name(0):gsub("%(", "\\("):gsub("%)", "\\)")
local command = "npx prettier --write " .. path
vim.system(vim.split(command, " ")):wait()
vim.cmd("e")
end
if (client.name == "texlab") then
local path = vim.api.nvim_buf_get_name(0):gsub("%(", "\\("):gsub("%)", "\\)")
local command = "pdflatex " .. path
vim.system(vim.split(command, " ")):wait()
print("Done")
end
end
end
vim.keymap.set("n", "<C-T>", function() prettier() end, {})