diff --git a/init.lua b/init.lua index 344450b0..b106b852 100644 --- a/init.lua +++ b/init.lua @@ -18,7 +18,7 @@ if not vim.loop.fs_stat(lazypath) then 'clone', '--filter=blob:none', 'https://github.com/folke/lazy.nvim.git', - '--branch=stable', -- latest stable release + '--branch=stable', -- latest stable release lazypath, } end @@ -45,7 +45,7 @@ require('lazy').setup({ 'williamboman/mason-lspconfig.nvim', -- Useful status updates for LSP - 'folke/neodev.nvim', + 'folke/neodev.nvim', }, }, @@ -66,7 +66,7 @@ require('lazy').setup({ }, -- Useful plugin to show you pending keybinds. - { 'folke/which-key.nvim', opts = {} }, + { 'folke/which-key.nvim', opts = {} }, { -- Adds git related signs to the gutter, as well as utilities for managing changes 'lewis6991/gitsigns.nvim', @@ -80,23 +80,24 @@ require('lazy').setup({ changedelete = { text = '~' }, }, on_attach = function(bufnr) - vim.keymap.set('n', 'hp', require('gitsigns').preview_hunk, { buffer = bufnr, desc = 'Preview git hunk' }) + vim.keymap.set('n', 'hp', require('gitsigns').preview_hunk, + { buffer = bufnr, desc = 'Preview git hunk' }) -- don't override the built-in and fugitive keymaps local gs = package.loaded.gitsigns - vim.keymap.set({'n', 'v'}, ']c', function() + vim.keymap.set({ 'n', 'v' }, ']c', function() if vim.wo.diff then return ']c' end vim.schedule(function() gs.next_hunk() end) return '' - end, {expr=true, buffer = bufnr, desc = "Jump to next hunk"}) - vim.keymap.set({'n', 'v'}, '[c', function() + end, { expr = true, buffer = bufnr, desc = "Jump to next hunk" }) + vim.keymap.set({ 'n', 'v' }, '[c', function() if vim.wo.diff then return '[c' end vim.schedule(function() gs.prev_hunk() end) return '' - end, {expr=true, buffer = bufnr, desc = "Jump to previous hunk"}) + end, { expr = true, buffer = bufnr, desc = "Jump to previous hunk" }) end, - current_line_blame = true, - current_line_blame_opts = { delay = 1000, virtual_text_pos = "eol" }, + current_line_blame = true, + current_line_blame_opts = { delay = 1000, virtual_text_pos = "eol" }, }, }, @@ -115,9 +116,10 @@ require('lazy').setup({ { -- Add indentation guides even on blank lines - 'lukas-reineke/indent-blankline.nvim', main = "ibl", + 'lukas-reineke/indent-blankline.nvim', + main = "ibl", -- Enable `lukas-reineke/indent-blankline.nvim` - -- See `:help indent_blankline.txt` + -- See `:help indent_blankline.txt` }, -- "gc" to comment visual regions/lines @@ -187,7 +189,7 @@ vim.o.hlsearch = false vim.wo.relativenumber = true vim.wo.number = true -local columns = {80, 120} -- Coloque os números das colunas limite desejadas aqui +local columns = { 80, 120 } -- Coloque os números das colunas limite desejadas aqui -- Define as colunas de limite vim.wo.colorcolumn = table.concat(columns, ',') @@ -314,7 +316,7 @@ require('nvim-treesitter.configs').setup { textobjects = { select = { enable = true, - lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim + lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim keymaps = { -- You can use the capture groups defined in textobjects.scm ['aa'] = '@parameter.outer', @@ -327,7 +329,7 @@ require('nvim-treesitter.configs').setup { }, move = { enable = true, - set_jumps = true, -- whether to set jumps in the jumplist + set_jumps = true, -- whether to set jumps in the jumplist goto_next_start = { [']m'] = '@function.outer', [']]'] = '@class.outer', @@ -465,7 +467,7 @@ require('luasnip.loaders.from_vscode').lazy_load() luasnip.config.setup {} cmp.setup { - snippet ={ + snippet = { expand = function(args) luasnip.lsp_expand(args.body) end, @@ -531,7 +533,7 @@ require("neoscroll").setup() -- vim.cmd.colorscheme "catppuccin" require("nvim-tree").setup({ - filters = { + filters = { dotfiles = false, exclude = { vim.fn.stdpath "config" .. "/lua/custom" }, }, @@ -610,21 +612,15 @@ require("nvim-tree").setup({ vim.keymap.set('n', 'n', 'NvimTreeToggle', { desc = '[space|n] open explorer file menu' }) -- vim.keymap.set('n', '', 'NvimTreeToggle', { desc = '[C|n] open explorer file menu' }) -vim.keymap.set("n", "", "h", { desc = "window: Focus left" }) -vim.keymap.set("n", "", "l", { desc = "window: Focus right" }) -vim.keymap.set("n", "", "j", { desc = "window: Focus down" }) -vim.keymap.set("n", "", "k", { desc = "window: Focus up" }) +vim.keymap.set("n", "", "h", { desc = "window: Focus left" }) +vim.keymap.set("n", "", "l", { desc = "window: Focus right" }) +vim.keymap.set("n", "", "j", { desc = "window: Focus down" }) +vim.keymap.set("n", "", "k", { desc = "window: Focus up" }) -vim.keymap.set("t", "", "wincmd h", { desc = "window: Focus left" }) -vim.keymap.set("t", "", "wincmd l", { desc = "window: Focus right" }) -vim.keymap.set("t", "", "wincmd j", { desc = "window: Focus down" }) -vim.keymap.set("t", "", "wincmd k", { desc = "window: Focus up" }) - --- Visual mode --- vim.keymap.set("v", "", ":m '<-2gv=gv", { desc = "edit: Move this line up" }) --- vim.keymap.set("v", "", ":m '>+1gv=gv", { desc = "edit: Move this line down" }) --- vim.keymap.set("v", "<<>", ">", ">gv", { desc = "edit: Increase indent" }) +vim.keymap.set("t", "", "h", { desc = "window: Focus left" }) +vim.keymap.set("t", "", "l", { desc = "window: Focus right" }) +vim.keymap.set("t", "", "j", { desc = "window: Focus down" }) +vim.keymap.set("t", "", "k", { desc = "window: Focus up" }) require("toggleterm").setup({ open_mapping = [[]], @@ -648,109 +644,109 @@ require('nvim_comment').setup({ }) require('go').setup({ - -- notify: use nvim-notify - notify = false, - -- auto commands - auto_format = true, - auto_lint = true, - -- linters: revive, errcheck, staticcheck, golangci-lint - linter = 'golangci-lint', - -- linter_flags: e.g., {revive = {'-config', '/path/to/config.yml'}} - linter_flags = {}, - -- lint_prompt_style: qf (quickfix), vt (virtual text) - lint_prompt_style = 'vt', - -- formatter: goimports, gofmt, gofumpt, lsp - formatter = 'goimports', - -- maintain cursor position after formatting loaded buffer - maintain_cursor_pos = false, - -- test flags: -count=1 will disable cache - test_flags = {'-v'}, - test_timeout = '30s', - test_env = {}, - -- show test result with popup window - test_popup = true, - test_popup_auto_leave = false, - test_popup_width = 80, - test_popup_height = 10, - -- test open - test_open_cmd = 'edit', - -- struct tags - tags_name = 'json', - tags_options = {'json=omitempty'}, - tags_transform = 'snakecase', - tags_flags = {'-skip-unexported'}, - -- quick type - quick_type_flags = {'--just-types'}, + -- notify: use nvim-notify + notify = false, + -- auto commands + auto_format = true, + auto_lint = true, + -- linters: revive, errcheck, staticcheck, golangci-lint + linter = 'golangci-lint', + -- linter_flags: e.g., {revive = {'-config', '/path/to/config.yml'}} + linter_flags = {}, + -- lint_prompt_style: qf (quickfix), vt (virtual text) + lint_prompt_style = 'vt', + -- formatter: goimports, gofmt, gofumpt, lsp + formatter = 'goimports', + -- maintain cursor position after formatting loaded buffer + maintain_cursor_pos = false, + -- test flags: -count=1 will disable cache + test_flags = { '-v' }, + test_timeout = '30s', + test_env = {}, + -- show test result with popup window + test_popup = true, + test_popup_auto_leave = false, + test_popup_width = 80, + test_popup_height = 10, + -- test open + test_open_cmd = 'edit', + -- struct tags + tags_name = 'json', + tags_options = { 'json=omitempty' }, + tags_transform = 'snakecase', + tags_flags = { '-skip-unexported' }, + -- quick type + quick_type_flags = { '--just-types' }, }) require("ibl").setup { - indent = { char = '┊' }, + indent = { char = '┊' }, } -- The setup config table shows all available config options with their default values: require("presence").setup({ - -- General options - auto_update = true, -- Update activity based on autocmd events (if `false`, map or manually execute `:lua package.loaded.presence:update()`) - neovim_image_text = "The One True Text Editor", -- Text displayed when hovered over the Neovim image - main_image = "neovim", -- Main image display (either "neovim" or "file") - client_id = "793271441293967371", -- Use your own Discord application client id (not recommended) - log_level = nil, -- Log messages at or above this level (one of the following: "debug", "info", "warn", "error") - debounce_timeout = 10, -- Number of seconds to debounce events (or calls to `:lua package.loaded.presence:update(, true)`) - enable_line_number = false, -- Displays the current line number instead of the current project - blacklist = {}, -- A list of strings or Lua patterns that disable Rich Presence if the current file name, path, or workspace matches - buttons = true, -- Configure Rich Presence button(s), either a boolean to enable/disable, a static table (`{{ label = "