From 17ab6018fb1840dfddd74830d643b1fd6f9554eb Mon Sep 17 00:00:00 2001 From: Saeed Afzal <37543494+saeedafzal@users.noreply.github.com> Date: Mon, 20 Mar 2023 17:50:45 +0000 Subject: [PATCH] Create lunar.lua --- lunar.lua | 109 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 lunar.lua diff --git a/lunar.lua b/lunar.lua new file mode 100644 index 0000000..9d39a7d --- /dev/null +++ b/lunar.lua @@ -0,0 +1,109 @@ +-- Custom additions to my lunarvim setup + +-- CUSTOM CONFIGURATION +local opt = vim.opt +opt.smartindent = true +opt.expandtab = true +opt.shiftwidth = 4 +opt.tabstop = 4 +opt.scrolloff = 8 + +-- PLUGINS +lvim.plugins = { + { + "folke/todo-comments.nvim", + requires = "nvim-lua/plenary.nvim", + config = function() + require("todo-comments").setup() + end + }, + { + "NvChad/nvim-colorizer.lua", + config = function() + require("colorizer").setup() + end + }, + { + "folke/trouble.nvim", + requires = "kyazdani42/nvim-web-devicons", + cmd = "TroubleToggle", + config = function() + require("trouble").setup() + end + }, + { + "weilbith/nvim-code-action-menu", + requires = "neovim/nvim-lspconfig", + cmd = "CodeActionMenu" + }, + { + "ellisonleao/glow.nvim", + config = function() + require("glow").setup() + end + }, + { + "CosmicNvim/cosmic-ui", + requires = { + "MunifTanjim/nui.nvim", + "nvim-lua/plenary.nvim" + }, + config = function() + require("cosmic-ui").setup() + end + }, + { + "leoluz/nvim-dap-go", + config = function() + require("dap-go").setup() + end + } +} + +lvim.builtin.dap.active = true + +-- KEYMAPS +lvim.builtin.which_key.mappings["t"] = { + name = "+Trouble", + t = { "TroubleToggle", "Trouble Toggle" }, + r = { "Trouble lsp_references", "References" }, + f = { "Trouble lsp_definitions", "Definitions" }, + d = { "Trouble document_diagnostics", "Diagnostics" }, + q = { "Trouble quickfix", "QuickFix" }, + l = { "Trouble loclist", "LocationList" }, + w = { "Trouble workspace_diagnostics", "Workspace Diagnostics" }, +} + +lvim.builtin.which_key.mappings["la"] = { + "CodeActionMenu", + "Code Action" +} + +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.builtin.which_key.mappings["lr"] = { + "lua require('cosmic-ui').rename()", + "Rename" +} +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, {}) + +vim.api.nvim_create_user_command("Spaces", function() + opt.expandtab = true +end, {})