From 56541bae23d62923ef0ff7ba3e6143958d44d01e Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 28 Jan 2025 17:23:00 +0800 Subject: [PATCH] nvim: update custom theme and generic config --- nvim/init.lua | 11 ++++++++++- nvim/lua/lush_theme/fds-theme.lua | 4 ++++ nvim/lua/settings.lua | 9 ++++++--- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/nvim/init.lua b/nvim/init.lua index fc575e2..e632555 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -3,7 +3,7 @@ -- Bootstrapping for the package manager local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not vim.loop.fs_stat(lazypath) then - vim.fn.system({ + local out = vim.fn.system({ "git", "clone", "--filter=blob:none", @@ -11,6 +11,15 @@ if not vim.loop.fs_stat(lazypath) then "--branch=stable", -- latest stable release lazypath, }) + if vim.v.shell_error ~= 0 then + vim.api.nvim_echo({ + { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, + { out, "WarningMsg" }, + { "\nPress any key to exit." }, + }, true, {}) + vim.fn.getchar() + os.exit(1) + end end vim.opt.rtp:prepend(lazypath) diff --git a/nvim/lua/lush_theme/fds-theme.lua b/nvim/lua/lush_theme/fds-theme.lua index 8884c0b..67c21f5 100644 --- a/nvim/lua/lush_theme/fds-theme.lua +++ b/nvim/lua/lush_theme/fds-theme.lua @@ -394,5 +394,9 @@ return lush(function() -- Indent-Blank-Lines IndentGuide({ fg = base01, bg = base05 }), + + -- snacks.nvim + SnacksIndentScope({ fg = base0C, gui = "bold" }), + SnacksIndentChunk({ fg = base0C, gui = "bold" }), } end) diff --git a/nvim/lua/settings.lua b/nvim/lua/settings.lua index 3a17c09..57aee37 100644 --- a/nvim/lua/settings.lua +++ b/nvim/lua/settings.lua @@ -17,7 +17,7 @@ function module.setup() vim.opt.tabstop = 4 vim.opt.conceallevel = 1 vim.opt.list = true - vim.opt.listchars = { tab = "↦ ", trail = "·" } + vim.opt.listchars = { tab = "↦ ", trail = "·" } vim.opt_local.spell = true vim.opt.smartindent = true @@ -28,10 +28,13 @@ function module.setup() vim.cmd("highlight clear SpellRare") vim.cmd("highlight Visual term=reverse cterm=reverse") - -- Keybindings + -- Basic keybindings vim.keymap.set("n", "bd", ":bd", {}) - vim.keymap.set("i", "jk", "", {}) + vim.keymap.set("i", "jk", "", { desc = "Escape" }) vim.keymap.set("n", "hr", "source $MYVIMRC", {}) + + vim.keymap.set("n", "x", ":.lua", { desc = "Execute Lua under cursor" }) + vim.keymap.set("v", "x", ":lua", { desc = "Execute Lua under cursor" }) end return module