custom vim to the git
This commit is contained in:
		
							
								
								
									
										25
									
								
								lua/itsigo/init.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								lua/itsigo/init.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,25 @@ | ||||
| require("itsigo.remap") | ||||
| require("itsigo.set") | ||||
| require("itsigo.lazy") | ||||
|  | ||||
| local autocmd = vim.api.nvim_create_autocmd | ||||
|  | ||||
| function R(name) | ||||
|     require("plenary.reload").reload_module(name) | ||||
| end | ||||
|  | ||||
| autocmd({"BufWritePre"}, { | ||||
|     pattern = "*", | ||||
|     command = [[%s/\s\+$//e]], | ||||
| }) | ||||
|  | ||||
| autocmd('LspAttach', { | ||||
|     callback = function (e) | ||||
|         local opts = { buffer = e.buf } | ||||
|         vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts) | ||||
|         vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts) | ||||
|         vim.keymap.set("n", "<leader>vca", function() vim.lsp.buf.code_action() end, opts) | ||||
|         vim.keymap.set("n", "<leader>vrr", function() vim.lsp.buf.references() end, opts) | ||||
|         vim.keymap.set("n", "<leader>vrn", function() vim.lsp.buf.rename() end, opts) | ||||
|     end | ||||
| }) | ||||
							
								
								
									
										14
									
								
								lua/itsigo/lazy.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								lua/itsigo/lazy.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,14 @@ | ||||
| local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" | ||||
| if not (vim.uv or vim.loop).fs_stat(lazypath) then | ||||
|   vim.fn.system({ | ||||
|     "git", | ||||
|     "clone", | ||||
|     "--filter=blob:none", | ||||
|     "https://github.com/folke/lazy.nvim.git", | ||||
|     "--branch=stable", -- latest stable release | ||||
|     lazypath, | ||||
|   }) | ||||
| end | ||||
| vim.opt.rtp:prepend(lazypath) | ||||
|  | ||||
| require("lazy").setup("itsigo.plugins") | ||||
							
								
								
									
										26
									
								
								lua/itsigo/plugins/blankline.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								lua/itsigo/plugins/blankline.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,26 @@ | ||||
| return { | ||||
|     "lukas-reineke/indent-blankline.nvim", | ||||
|     opts = { | ||||
|         indent = { | ||||
|             char = "│", | ||||
|             tab_char = "│", | ||||
|         }, | ||||
|         scope = { enabled = false }, | ||||
|         exclude = { | ||||
|             filetypes = { | ||||
|                 "help", | ||||
|                 "alpha", | ||||
|                 "dashboard", | ||||
|               --   "neo-tree", | ||||
|                 "Trouble", | ||||
|                 "trouble", | ||||
|                 "lazy", | ||||
|                 "mason", | ||||
|                 "notify", | ||||
|                 "toggleterm", | ||||
|                 "lazyterm", | ||||
|             }, | ||||
|         }, | ||||
|     }, | ||||
|     main = "ibl", | ||||
| } | ||||
							
								
								
									
										8
									
								
								lua/itsigo/plugins/catppuccin.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								lua/itsigo/plugins/catppuccin.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,8 @@ | ||||
| return { | ||||
| 	"catppuccin/nvim", | ||||
| 	name = "catppuccin", | ||||
| 	priority = 999, | ||||
| 	config = function() | ||||
| 		vim.cmd.colorscheme "catppuccin-macchiato" | ||||
| 	end, | ||||
| } | ||||
							
								
								
									
										25
									
								
								lua/itsigo/plugins/harpoon.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								lua/itsigo/plugins/harpoon.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,25 @@ | ||||
| return { | ||||
|     "ThePrimeagen/harpoon", | ||||
|     branch = "harpoon2", | ||||
|     dependencies = { "nvim-lua/plenary.nvim" }, | ||||
|  | ||||
|     config = function() | ||||
|  | ||||
|         local harpoon = require("harpoon") | ||||
|         harpoon:setup() | ||||
|  | ||||
|         vim.keymap.set("n", "<leader>a", function() harpoon:list():add() end) | ||||
|         vim.keymap.set("n", "<C-e>", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end) | ||||
|  | ||||
|         vim.keymap.set("n", "<C-h>", function() harpoon:list():select(1) end) | ||||
|         vim.keymap.set("n", "<C-j>", function() harpoon:list():select(2) end) | ||||
|         vim.keymap.set("n", "<C-k>", function() harpoon:list():select(3) end) | ||||
|         vim.keymap.set("n", "<C-l>", function() harpoon:list():select(4) end) | ||||
|  | ||||
|         vim.keymap.set("n", "<leader><C-h>", function() harpoon:list():replace_at(1) end) | ||||
|         vim.keymap.set("n", "<leader><C-j>", function() harpoon:list():replace_at(2) end) | ||||
|         vim.keymap.set("n", "<leader><C-k>", function() harpoon:list():replace_at(3) end) | ||||
|         vim.keymap.set("n", "<leader><C-l>", function() harpoon:list():replace_at(4) end) | ||||
|     end, | ||||
|  | ||||
| } | ||||
							
								
								
									
										29
									
								
								lua/itsigo/plugins/indentscope.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								lua/itsigo/plugins/indentscope.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,29 @@ | ||||
| return { | ||||
|     "echasnovski/mini.indentscope", | ||||
|     version = false, -- wait till new 0.7.0 release to put it back on semver | ||||
|     opts = { | ||||
|         -- symbol = "▏", | ||||
|         symbol = "│", | ||||
|         options = { try_as_border = true }, | ||||
|     }, | ||||
|     init = function() | ||||
|         vim.api.nvim_create_autocmd("FileType", { | ||||
|             pattern = { | ||||
|                 "help", | ||||
|                 "alpha", | ||||
|                 "dashboard", | ||||
|                 "neo-tree", | ||||
|                 "Trouble", | ||||
|                 "trouble", | ||||
|                 "lazy", | ||||
|                 "mason", | ||||
|                 "notify", | ||||
|                 "toggleterm", | ||||
|                 "lazyterm", | ||||
|             }, | ||||
|             callback = function() | ||||
|                 vim.b.miniindentscope_disable = true | ||||
|             end, | ||||
|         }) | ||||
|     end, | ||||
| } | ||||
							
								
								
									
										4
									
								
								lua/itsigo/plugins/init.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								lua/itsigo/plugins/init.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,4 @@ | ||||
| return  { | ||||
|     "nvim-lua/plenary.nvim", | ||||
|     name = "plenary" | ||||
| } | ||||
							
								
								
									
										130
									
								
								lua/itsigo/plugins/lsp.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										130
									
								
								lua/itsigo/plugins/lsp.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,130 @@ | ||||
| return { | ||||
|     "neovim/nvim-lspconfig", | ||||
|     dependencies = { | ||||
|         "williamboman/mason.nvim", | ||||
|         "williamboman/mason-lspconfig.nvim", | ||||
|         "hrsh7th/cmp-nvim-lsp", | ||||
|         "hrsh7th/cmp-buffer", | ||||
|         "hrsh7th/cmp-path", | ||||
|         "hrsh7th/cmp-cmdline", | ||||
|         "hrsh7th/nvim-cmp", | ||||
|         "L3MON4D3/LuaSnip", | ||||
|         "saadparwaiz1/cmp_luasnip", | ||||
|         "j-hui/fidget.nvim", | ||||
|         "nvimtools/none-ls.nvim", | ||||
|     }, | ||||
|  | ||||
|     config = function() | ||||
|         local cmp = require('cmp') | ||||
|         local cmp_lsp = require("cmp_nvim_lsp") | ||||
|         local luasnip = require("luasnip") | ||||
|         local capabilities = vim.tbl_deep_extend( | ||||
|             "force", | ||||
|             {}, | ||||
|             vim.lsp.protocol.make_client_capabilities(), | ||||
|             cmp_lsp.default_capabilities()) | ||||
|  | ||||
|         require("fidget").setup({}) | ||||
|         require("mason").setup() | ||||
|         require("mason-lspconfig").setup({ | ||||
|             ensure_installed = { | ||||
|                 "lua_ls", | ||||
|                 -- "rust_analyzer", | ||||
|                 "gopls", | ||||
|             }, | ||||
|             handlers = { | ||||
|                 function(server_name) -- default handler (optional) | ||||
|  | ||||
|                     require("lspconfig")[server_name].setup { | ||||
|                         capabilities = capabilities | ||||
|                     } | ||||
|                 end, | ||||
|  | ||||
|                 ["lua_ls"] = function() | ||||
|                     local lspconfig = require("lspconfig") | ||||
|                     lspconfig.lua_ls.setup { | ||||
|                         capabilities = capabilities, | ||||
|                         settings = { | ||||
|                             Lua = { | ||||
|                                 runtime = { version = "Lua 5.1" }, | ||||
|                                 diagnostics = { | ||||
|                                     globals = { "vim", "it", "describe", "before_each", "after_each" }, | ||||
|                                 } | ||||
|                             } | ||||
|                         } | ||||
|                     } | ||||
|                 end, | ||||
|             } | ||||
|         }) | ||||
|  | ||||
|         local cmp_select = { behavior = cmp.SelectBehavior.Select } | ||||
|  | ||||
|         cmp.setup({ | ||||
|             snippet = { | ||||
|                 expand = function(args) | ||||
|                     require('luasnip').lsp_expand(args.body) -- For `luasnip` users. | ||||
|                 end, | ||||
|             }, | ||||
|             mapping = cmp.mapping.preset.insert({ | ||||
|                 ['<C-p>'] = cmp.mapping.select_prev_item(cmp_select), | ||||
|                 ['<C-n>'] = cmp.mapping.select_next_item(cmp_select), | ||||
|                 ['<C-y>'] = cmp.mapping.confirm({ select = true }), | ||||
|                 ["<C-Space>"] = cmp.mapping.complete(), | ||||
|  | ||||
|                ["<Tab>"] = cmp.mapping(function(fallback) | ||||
|                    --if cmp.visible() then | ||||
|                    --    cmp.select_next_item() | ||||
|                    if luasnip.locally_jumpable(1) then | ||||
|                        luasnip.jump(1) | ||||
|                    else | ||||
|                        fallback() | ||||
|                    end | ||||
|                end, { "i", "s"}), | ||||
|  | ||||
|             }), | ||||
|             sources = cmp.config.sources({ | ||||
|                 { name = 'luasnip' }, -- For luasnip users. | ||||
|                 { name = 'nvim_lsp' }, | ||||
|             }, { | ||||
|                     { name = 'buffer' }, | ||||
|                 }) | ||||
|         }) | ||||
|  | ||||
|         vim.diagnostic.config({ | ||||
|             -- update_in_insert = true, | ||||
|             float = { | ||||
|                 focusable = false, | ||||
|                 style = "minimal", | ||||
|                 border = "rounded", | ||||
|                 source = "always", | ||||
|                 header = "", | ||||
|                 prefix = "", | ||||
|             }, | ||||
|         }) | ||||
|  | ||||
|         local null_ls = require("null-ls") | ||||
|         local autogroup = vim.api.nvim_create_augroup("LspFormatting", {}) | ||||
|  | ||||
|         null_ls.setup({ | ||||
|             sources = { | ||||
|                 null_ls.builtins.formatting.gofumpt, | ||||
|                 null_ls.builtins.formatting.goimports, | ||||
|             }, | ||||
|             on_attach = function (client, bufnr) | ||||
|                 if client.supports_method("textDocument/formatting") then | ||||
|                     vim.api.nvim_clear_autocmds({ | ||||
|                         group = autogroup, | ||||
|                         buffer = bufnr, | ||||
|                     }) | ||||
|                     vim.api.nvim_create_autocmd("BufWritePre", { | ||||
|                         group = autogroup, | ||||
|                         buffer = bufnr, | ||||
|                         callback = function () | ||||
|                             vim.lsp.buf.format({ bufnr = bufnr }) | ||||
|                         end, | ||||
|                     }) | ||||
|                 end | ||||
|             end, | ||||
|         }) | ||||
|     end | ||||
| } | ||||
							
								
								
									
										6
									
								
								lua/itsigo/plugins/lualine.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								lua/itsigo/plugins/lualine.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,6 @@ | ||||
| return { | ||||
| 	"nvim-lualine/lualine.nvim", | ||||
| 	dependencies = { 'nvim-tree/nvim-web-devicons' }, | ||||
| 	opts = { | ||||
| 	}, | ||||
| } | ||||
							
								
								
									
										27
									
								
								lua/itsigo/plugins/luasnip.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								lua/itsigo/plugins/luasnip.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,27 @@ | ||||
| return { | ||||
|     "L3MON4D3/LuaSnip", | ||||
|     -- follow latest release. | ||||
|     version = "v2.*", -- Replace <CurrentMajor> by the latest released major (first number of latest release) | ||||
|     -- install jsregexp (optional!). | ||||
|     build = "make install_jsregexp", | ||||
|  | ||||
|     dependencies = { "rafamadriz/friendly-snippets" }, | ||||
|  | ||||
|     config = function() | ||||
|         local ls = require("luasnip") | ||||
|         require("luasnip.loaders.from_vscode").lazy_load() | ||||
|         ls.filetype_extend("javascript", { "jsdoc" }) | ||||
|  | ||||
|         --- TODO: What is expand? | ||||
|         vim.keymap.set({"i"}, "<C-s>e", function() ls.expand() end, {silent = true}) | ||||
|  | ||||
|         vim.keymap.set({"i", "s"}, "<C-s>;", function() ls.jump(1) end, {silent = true}) | ||||
|         vim.keymap.set({"i", "s"}, "<C-s>,", function() ls.jump(-1) end, {silent = true}) | ||||
|  | ||||
|         vim.keymap.set({"i", "s"}, "<C-E>", function() | ||||
|             if ls.choice_active() then | ||||
|                 ls.change_choice(1) | ||||
|             end | ||||
|         end, {silent = true}) | ||||
|     end, | ||||
| } | ||||
							
								
								
									
										11
									
								
								lua/itsigo/plugins/oil.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								lua/itsigo/plugins/oil.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| return { | ||||
|     'stevearc/oil.nvim', | ||||
|     opts = {}, | ||||
|     -- Optional dependencies | ||||
|     dependencies = { "nvim-tree/nvim-web-devicons" }, | ||||
|     config = function() | ||||
|         require("oil").setup({ | ||||
|             default_file_explorer = true, | ||||
|         }) | ||||
|     end | ||||
| } | ||||
							
								
								
									
										13
									
								
								lua/itsigo/plugins/telescope.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								lua/itsigo/plugins/telescope.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | ||||
| return { | ||||
| 	'nvim-telescope/telescope.nvim', | ||||
| 	dependencies = { 'nvim-lua/plenary.nvim' }, | ||||
|  | ||||
| 	keys = { | ||||
| 		{ "<leader>pf", function() require("telescope.builtin").find_files() end, desc="Find: Files" },	 | ||||
| 		{ "<C-p>", function() require("telescope.builtin").git_files() end, desc="Find: Git Files" },	 | ||||
| 		{ "<leader>ps", function() | ||||
| 			require("telescope.builtin").grep_string({search = vim.fn.input("Grep > ")})  | ||||
| 		end, desc="Find: Files" },	 | ||||
| 	}, | ||||
|  | ||||
| } | ||||
							
								
								
									
										11
									
								
								lua/itsigo/plugins/tmux-navigator.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								lua/itsigo/plugins/tmux-navigator.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| return { | ||||
|     "christoomey/vim-tmux-navigator", | ||||
|  | ||||
|     keys = { | ||||
|         { "<C-\\>", "<cmd>TmuxNavigatePrevious<cr>", desc = "Go to the previous pane" }, | ||||
|         { "<C-h>", "<cmd>TmuxNavigateLeft<cr>", desc = "Got to the left pane" }, | ||||
|         { "<C-j>", "<cmd>TmuxNavigateDown<cr>", desc = "Got to the down pane" }, | ||||
|         { "<C-k>", "<cmd>TmuxNavigateUp<cr>", desc = "Got to the up pane" }, | ||||
|         { "<C-l>", "<cmd>TmuxNavigateRight<cr>", desc = "Got to the right pane" }, | ||||
|     }, | ||||
| } | ||||
							
								
								
									
										15
									
								
								lua/itsigo/plugins/treesitter.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								lua/itsigo/plugins/treesitter.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,15 @@ | ||||
| return { | ||||
| 	"nvim-treesitter/nvim-treesitter", | ||||
| 	build = ":TSUpdate", | ||||
| 	config = function () | ||||
| 		local configs = require("nvim-treesitter.configs") | ||||
|  | ||||
| 		configs.setup({ | ||||
| 			ensure_installed = { "c", "lua", "vim", "vimdoc", "query", "elixir", "heex", "javascript", "html" }, | ||||
| 			sync_install = false, | ||||
| 			auto_install = true, | ||||
| 			highlight = { enable = true }, | ||||
| 			indent = { enable = true }, | ||||
| 		}) | ||||
| 	end | ||||
| } | ||||
							
								
								
									
										7
									
								
								lua/itsigo/remap.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								lua/itsigo/remap.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,7 @@ | ||||
| vim.g.mapleader = " " | ||||
|  | ||||
| -- open file explorer | ||||
| -- vim.keymap.set("n", "<leader>e", vim.cmd.Ex) | ||||
|  | ||||
| -- oil | ||||
| vim.keymap.set("n", "-", "<CMD>Oil<CR>", { desc = "Open parent directory" }) | ||||
							
								
								
									
										26
									
								
								lua/itsigo/set.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								lua/itsigo/set.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,26 @@ | ||||
| vim.opt.nu = true | ||||
| vim.opt.relativenumber = true | ||||
|  | ||||
| vim.opt.tabstop = 4 | ||||
| vim.opt.softtabstop = 4 | ||||
| vim.opt.shiftwidth = 4 | ||||
| vim.opt.expandtab = true | ||||
|  | ||||
| vim.opt.smartindent = true | ||||
|  | ||||
| vim.opt.wrap = false | ||||
|  | ||||
| vim.opt.swapfile = false | ||||
| vim.opt.backup = false | ||||
| vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir" | ||||
| vim.opt.undofile = true | ||||
|  | ||||
| vim.opt.hlsearch = false | ||||
| vim.opt.incsearch = true | ||||
|  | ||||
| vim.opt.termguicolors = true | ||||
|  | ||||
| vim.opt.signcolumn = "yes" | ||||
| vim.opt.isfname:append("@-@") | ||||
|  | ||||
| vim.opt.updatetime = 50 | ||||
		Reference in New Issue
	
	Block a user
	 Itsigo
					Itsigo