From 08651e104a4e2b5bf02d2a66f127f54cb1b3b8ab Mon Sep 17 00:00:00 2001 From: Saeed Afzal <37543494+saeedafzal@users.noreply.github.com> Date: Fri, 24 Nov 2023 21:57:40 +0000 Subject: [PATCH] Update lunar.lua --- lunar.lua | 90 +++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 71 insertions(+), 19 deletions(-) diff --git a/lunar.lua b/lunar.lua index 0a22ee2..97a718c 100644 --- a/lunar.lua +++ b/lunar.lua @@ -4,6 +4,7 @@ -- Discord: https://discord.com/invite/Xb9B4Ny local opt = vim.opt +local api = vim.api -- Indentation opt.smartindent = true @@ -16,6 +17,7 @@ opt.scrolloff = 8 lvim.plugins = { { "folke/todo-comments.nvim", + event = "BufRead", dependencies = "nvim-lua/plenary.nvim", config = true }, @@ -31,6 +33,54 @@ lvim.plugins = { { "nmac427/guess-indent.nvim", lazy = false, + config = true, + }, + { + "NvChad/nvim-colorizer.lua", + event = "BufEnter", + opts = { + filetypes = { + "*", + "!markdown", + }, + user_default_options = { + RRGGBBAA = true, + AARRGGBB = true, + rgb_fn = true, + hsl_fn = true, + css = true, + css_fn = true, + sass = { enable = true } + } + } + }, + { + "nvim-pack/nvim-spectre", + dependencies = "nvim-lua/plenary.nvim" + }, + { + "ellisonleao/glow.nvim", + cmd = "Glow", + config = true + }, + { + "f-person/git-blame.nvim", + cmd = "GitBlameToggle" + }, + { + "sindrets/diffview.nvim", + dependencies = "nvim-lua/plenary.nvim", + cmd = "DiffviewOpen", + config = true + }, + { + "ray-x/lsp_signature.nvim", + dependencies = "neovim/nvim-lspconfig", + config = true + }, + { + "simrat39/symbols-outline.nvim", + cmd = "SymbolsOutline", config = true } } @@ -39,27 +89,29 @@ lvim.plugins = { lvim.keys.normal_mode[""] = "BufferLineCycleNext" lvim.keys.normal_mode[""] = "BufferLineCyclePrev" lvim.keys.normal_mode[""] = "Telescope current_buffer_fuzzy_find" -lvim.keys.normal_mode[""] = "25" -lvim.keys.normal_mode[""] = "! make" -lvim.keys.normal_mode["K"] = "lua vim.lsp.buf.hover()" -lvim.keys.normal_mode["gd"] = "lua vim.lsp.buf.definition()" lvim.builtin.terminal.open_mapping = "" -lvim.builtin.which_key.mappings["bb"] = { - "BufferLineMovePrev", - "Buffer Move Next" -} -lvim.builtin.which_key.mappings["bn"] = { - "BufferLineMoveNext", - "Buffer Move Next" -} - -- Commands -vim.api.nvim_create_user_command("Tabs", function() - opt.expandtab = false -end, {}) +local function indent(n, expand) + local size = 4 + if n ~= "" then size = n end -vim.api.nvim_create_user_command("Spaces", function() - opt.expandtab = true -end, {}) + -- Number conversion + local num = tonumber(size) + if num then + size = num + end + + opt.expandtab = expand + opt.shiftwidth = size + opt.tabstop = size +end + +api.nvim_create_user_command("Tabs", function(v) + indent(v.args, false) +end, { nargs = "?" }) + +api.nvim_create_user_command("Spaces", function(v) + indent(v.args, true) +end, { nargs = "?" })