save
This commit is contained in:
@@ -1,4 +0,0 @@
|
||||
vim.g.colors_name = 'coolurs'
|
||||
|
||||
vim.cmd('hi Normal guibg=black guifg=#ffffff')
|
||||
vim.cmd('hi String guifg=#00ff00')
|
||||
@@ -1,8 +1,10 @@
|
||||
{
|
||||
"LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||
"cmp-cmdline": { "branch": "main", "commit": "d126061b624e0af6c3a556428712dd4d4194ec6d" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" },
|
||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||
"cmp-tw2css": { "branch": "main", "commit": "1abe0eebcb57fcbd5538d054f0db61f4e4a1302b" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
||||
"conform.nvim": { "branch": "master", "commit": "6dc21d4ce050c2e592d9635b7983d67baf216e3d" },
|
||||
"dressing.nvim": { "branch": "master", "commit": "3a45525bb182730fe462325c99395529308f431e" },
|
||||
@@ -19,9 +21,11 @@
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "aafa5c187a15701a7299a392b907ec15d9a7075f" },
|
||||
"oil.nvim": { "branch": "master", "commit": "09fa1d22f5edf0730824d2b222d726c8c81bbdc9" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "3707cdb1e43f5cea73afb6037e6494e7ce847a66" },
|
||||
"rose-pine": { "branch": "main", "commit": "6b9840790cc7acdfadde07f308d34b62dd9cc675" },
|
||||
"snacks.nvim": { "branch": "main", "commit": "706b1abc1697ca050314dc667e0900d53cad8aa4" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "dae2eac9d91464448b584c7949a31df8faefec56" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "415af52339215926d705cccc08145f3782c4d132" },
|
||||
"tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" },
|
||||
"trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" },
|
||||
"vim-fugitive": { "branch": "master", "commit": "174230d6a7f2df94705a7ffd8d5413e27ec10a80" },
|
||||
"vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" }
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
require("vxclutch.set")
|
||||
require("vxclutch.remap")
|
||||
require("vxclutch.lazy_init")
|
||||
|
||||
vim.cmd.colorscheme("coolurs")
|
||||
|
||||
33
nvim/.config/nvim/lua/vxclutch/lazy/colors.lua
Normal file
33
nvim/.config/nvim/lua/vxclutch/lazy/colors.lua
Normal file
@@ -0,0 +1,33 @@
|
||||
function ColorMyPencils(color)
|
||||
color = color or "rose-pine"
|
||||
vim.cmd.colorscheme(color)
|
||||
end
|
||||
|
||||
return {
|
||||
{
|
||||
"folke/tokyonight.nvim",
|
||||
config = function()
|
||||
require("tokyonight").setup({
|
||||
style = "storm",
|
||||
transparent = true,
|
||||
terminal_colors = true,
|
||||
styles = {
|
||||
comments = { italic = false },
|
||||
keywords = { italic = false },
|
||||
sidebars = "dark",
|
||||
floats = "dark",
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"rose-pine/neovim",
|
||||
name = "rose-pine",
|
||||
config = function()
|
||||
require("rose-pine").setup({ disable_background = true })
|
||||
|
||||
vim.cmd("colorscheme rose-pine")
|
||||
ColorMyPencils()
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -2,23 +2,40 @@ return {
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
"williamboman/mason.nvim",
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
{ "mason-org/mason.nvim", version = "^1.0.0" },
|
||||
{ "mason-org/mason-lspconfig.nvim", version = "^1.0.0" },
|
||||
"j-hui/fidget.nvim",
|
||||
"stevearc/conform.nvim",
|
||||
"hrsh7th/nvim-cmp",
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-buffer",
|
||||
"hrsh7th/cmp-path",
|
||||
"hrsh7th/cmp-cmdline",
|
||||
"jcha0713/cmp-tw2css",
|
||||
"L3MON4D3/LuaSnip",
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
},
|
||||
|
||||
config = function()
|
||||
vim.diagnostic.config({
|
||||
virtual_text = true,
|
||||
signs = true,
|
||||
underline = true,
|
||||
update_in_insert = false,
|
||||
severity_sort = true,
|
||||
float = { border = "rounded" },
|
||||
})
|
||||
|
||||
local cmp = require("cmp")
|
||||
local luasnip = require("luasnip")
|
||||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||
local cmp_lsp = require("cmp_nvim_lsp")
|
||||
local capabilities = vim.tbl_deep_extend(
|
||||
"force",
|
||||
vim.lsp.protocol.make_client_capabilities(),
|
||||
cmp_lsp.default_capabilities()
|
||||
)
|
||||
|
||||
vim.api.nvim_set_hl(0, "CmpNormal", {})
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
@@ -26,12 +43,32 @@ return {
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<C-n>"] = cmp.mapping.select_next_item(),
|
||||
["<C-p>"] = cmp.mapping.select_prev_item(),
|
||||
["<C-p>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Select }),
|
||||
["<C-n>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Select }),
|
||||
["<C-y>"] = cmp.mapping.confirm({ select = true }),
|
||||
["<C-e>"] = vim.NIL,
|
||||
}),
|
||||
window = {
|
||||
completion = {
|
||||
scrollbar = false,
|
||||
border = "rounded",
|
||||
winhighlight = "Normal:CmpNormal",
|
||||
},
|
||||
documentation = {
|
||||
scrollbar = false,
|
||||
border = "rounded",
|
||||
winhighlight = "Normal:CmpNormal",
|
||||
},
|
||||
},
|
||||
sources = cmp.config.sources({
|
||||
{ name = "nvim_lsp" },
|
||||
{
|
||||
name = "nvim_lsp",
|
||||
max_item_count = 5,
|
||||
entry_filter = function(entry, _)
|
||||
return cmp.lsp.CompletionItemKind.Snippet ~= entry:get_kind()
|
||||
end,
|
||||
},
|
||||
{ name = "cmp-tw2css" },
|
||||
{ name = "luasnip" },
|
||||
}, {
|
||||
{ name = "buffer" },
|
||||
@@ -47,10 +84,13 @@ return {
|
||||
require("mason").setup()
|
||||
|
||||
require("mason-lspconfig").setup({
|
||||
automatic_installation = false,
|
||||
ensure_installed = {
|
||||
"lua_ls",
|
||||
"clangd",
|
||||
"gopls",
|
||||
"rust_analyzer",
|
||||
"tinymist",
|
||||
},
|
||||
handlers = {
|
||||
function(server_name)
|
||||
@@ -79,15 +119,55 @@ return {
|
||||
cmd = { "clangd", "--header-insertion=iwyu" },
|
||||
})
|
||||
end,
|
||||
|
||||
["svelte"] = function()
|
||||
require("lspconfig").svelte.setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = function(client, bufnr)
|
||||
vim.api.nvim_create_autocmd("BufWritePost", {
|
||||
pattern = { "*.js", "*.ts" },
|
||||
callback = function(ctx)
|
||||
client.notify("$/onDidChangeTsOrJsFile", { uri = ctx.match })
|
||||
end,
|
||||
})
|
||||
end,
|
||||
})
|
||||
end,
|
||||
|
||||
["tinymist"] = function()
|
||||
require("lspconfig").tinymist.setup({
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
formatterMode = "typstyle",
|
||||
exportPdf = "never",
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
})
|
||||
|
||||
vim.diagnostic.config({
|
||||
virtual_text = true,
|
||||
signs = true,
|
||||
underline = true,
|
||||
update_in_insert = false,
|
||||
severity_sort = true,
|
||||
local l = vim.lsp
|
||||
l.handlers["textDocument/hover"] = function(_, result, ctx, config)
|
||||
config = config or { border = "rounded", focusable = true }
|
||||
config.focus_id = ctx.method
|
||||
if not (result and result.contents) then return end
|
||||
local markdown_lines = l.util.convert_input_to_markdown_lines(result.contents)
|
||||
markdown_lines = vim.tbl_filter(function(line) return line ~= "" end, markdown_lines)
|
||||
if vim.tbl_isempty(markdown_lines) then return end
|
||||
return l.util.open_floating_preview(markdown_lines, "markdown", config)
|
||||
end
|
||||
|
||||
local autocmd = vim.api.nvim_create_autocmd
|
||||
autocmd({ "BufEnter", "BufWinEnter" }, {
|
||||
pattern = { "*.vert", "*.frag" },
|
||||
callback = function() vim.cmd("set filetype=glsl") end,
|
||||
})
|
||||
|
||||
autocmd("LspAttach", {
|
||||
callback = function(e)
|
||||
local opts = { buffer = e.buf }
|
||||
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
@@ -11,12 +11,11 @@ end
|
||||
-- Remove search highlight --
|
||||
map("n", "<Esc>", ":nohlsearch<CR>")
|
||||
|
||||
-- Quickfix
|
||||
map("n", "<leader>h", vim.lsp.buf.code_action)
|
||||
|
||||
-- Move lines --
|
||||
map("v", "J", ":m '>+1<CR>gv=gv")
|
||||
map("v", "K", ":m '>-2<CR>gv=gv")
|
||||
map("n", "<A-j>", ":m .+1<CR>==")
|
||||
map("n", "<A-k>", ":m .-2<CR>==")
|
||||
map("v", "<A-j>", ":m '>+1<CR>gv=gv")
|
||||
map("v", "<A-k>", ":m '<-2<CR>gv=gv")
|
||||
|
||||
-- Scrolling --
|
||||
map("n", "<C-d>", "<C-d>zz")
|
||||
@@ -25,29 +24,9 @@ map("n", "<C-u>", "<C-u>zz")
|
||||
-- File navigation --
|
||||
map("n", "<leader>pv", ":Oil<CR>")
|
||||
|
||||
-- Terminal --
|
||||
map("t", "<C-k>", "<C-\\><C-n><C-w><C-k>")
|
||||
map("t", "<C-Space>", "<C-\\><C-n>:bd!<CR>")
|
||||
|
||||
-- Exec
|
||||
map("n", "<leader>x", ":.lua<CR>")
|
||||
map("n", "<leader><leader>x", ":source %<CR>")
|
||||
|
||||
-- LSP
|
||||
map("n", "gd", vim.lsp.buf.definition)
|
||||
map("n", "<leader>rn", vim.lsp.buf.rename, { noremap = true, silent = true })
|
||||
map('n', '<leader>h', function()
|
||||
local diag = vim.diagnostic.get(0) -- Get diagnostics for the current buffer
|
||||
if #diag > 0 then
|
||||
-- Try to resolve the first diagnostic (you can adjust logic for more advanced fixing)
|
||||
vim.lsp.buf.code_action({
|
||||
filter = function(action)
|
||||
return action.kind == "quickfix"
|
||||
end
|
||||
})
|
||||
end
|
||||
end, { desc = "LSP Quickfix for Current Diagnostic" })
|
||||
|
||||
|
||||
-- Window Controls
|
||||
map("n", "<C-h>", "<C-w><C-h>")
|
||||
|
||||
Reference in New Issue
Block a user