From df62ad5823fd75b618cadccf3f2b8bd996b084b0 Mon Sep 17 00:00:00 2001 From: Juliano Barbosa Date: Wed, 14 Aug 2024 15:21:52 -0300 Subject: [PATCH] chore(init.lua): added cycle --- init.lua | 39 ++++++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/init.lua b/init.lua index a21446e6..23d6b80b 100644 --- a/init.lua +++ b/init.lua @@ -102,7 +102,7 @@ vim.g.have_nerd_font = false vim.opt.number = true -- You can also add relative line numbers, to help with jumping. -- Experiment for yourself to see if you like it! --- vim.opt.relativenumber = true +vim.opt.relativenumber = true -- Enable mouse mode, can be useful for resizing splits for example! vim.opt.mouse = 'a' @@ -204,6 +204,23 @@ vim.api.nvim_create_autocmd('TextYankPost', { end, }) +-- [[ JMB Begin ]] + +-- Save all buffer +vim.keymap.set('n', 'wa', ':wall', { noremap = true, desc = '[W]rite [A]ll' }) +vim.keymap.set('n', 'wf', ':w', { noremap = true, desc = '[W]rite [F]ile' }) + +-- Create command do save with qw +vim.api.nvim_command 'cmap qw wq' +vim.api.nvim_command 'cmap WQ wq' +vim.api.nvim_command 'cmap QW wq' + +-- Navigate buffers +vim.keymap.set('n', '', ':bp', { noremap = true, desc = '[G]oto [P]previous Buffer' }) +vim.keymap.set('n', '', ':bn', { noremap = true, desc = '[G]oto [N]ext Buffer' }) + +-- [[ JMB End ]] + -- [[ Install `lazy.nvim` plugin manager ]] -- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' @@ -231,6 +248,10 @@ require('lazy').setup({ -- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link). 'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically + -- Git related plugins + 'tpope/vim-fugitive', + 'tpope/vim-rhubarb', + -- NOTE: Plugins can also be added by using a table, -- with the first argument being the link and the following -- keys can be used to configure plugin behavior/loading/etc. @@ -687,10 +708,10 @@ require('lazy').setup({ formatters_by_ft = { lua = { 'stylua' }, -- Conform can also run multiple formatters sequentially - -- python = { "isort", "black" }, + python = { 'isort', 'black' }, -- -- You can use 'stop_after_first' to run the first available formatter from the list - -- javascript = { "prettierd", "prettier", stop_after_first = true }, + javascript = { 'prettierd', 'prettier', stop_after_first = true }, }, }, }, @@ -909,12 +930,12 @@ require('lazy').setup({ -- Here are some example plugins that I've included in the Kickstart repository. -- Uncomment any of the lines below to enable them (you will need to restart nvim). -- - -- require 'kickstart.plugins.debug', - -- require 'kickstart.plugins.indent_line', - -- require 'kickstart.plugins.lint', - -- require 'kickstart.plugins.autopairs', - -- require 'kickstart.plugins.neo-tree', - -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps + require 'kickstart.plugins.debug', + require 'kickstart.plugins.indent_line', + require 'kickstart.plugins.lint', + require 'kickstart.plugins.autopairs', + require 'kickstart.plugins.neo-tree', + require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` -- This is the easiest way to modularize your config.