From c07c2c54779854eaa2c63c4ec33e92ef44441c68 Mon Sep 17 00:00:00 2001 From: Lucas Barbieri Date: Tue, 2 Jan 2024 16:41:51 -0300 Subject: [PATCH] anual lazy sync update --- lua/custom/plugins/cmp.lua | 4 ++ lua/custom/plugins/dap_go.lua | 5 ++ lua/custom/plugins/gopher.lua | 10 +++ lua/custom/plugins/md.lua | 7 +++ lua/custom/plugins/neosolarized.lua | 95 ++++++++++++++--------------- lua/custom/plugins/null-ls.lua | 5 +- lua/custom/plugins/zen.lua | 12 ++-- lua/jabuxas/remap.lua | 4 ++ lua/jabuxas/set.lua | 11 ++-- 9 files changed, 95 insertions(+), 58 deletions(-) create mode 100644 lua/custom/plugins/dap_go.lua create mode 100644 lua/custom/plugins/gopher.lua create mode 100644 lua/custom/plugins/md.lua diff --git a/lua/custom/plugins/cmp.lua b/lua/custom/plugins/cmp.lua index 65b5b72..df1cf75 100644 --- a/lua/custom/plugins/cmp.lua +++ b/lua/custom/plugins/cmp.lua @@ -60,6 +60,10 @@ return { luasnip.lsp_expand(args.body) end, }, + preselect = cmp.PreselectMode.None, + completion = { + completeopt = "noselect,menuone,menu" + }, sorting = { -- TODO: Would be cool to add stuff like "See variable names before method names" in rust, or something like that. comparators = { diff --git a/lua/custom/plugins/dap_go.lua b/lua/custom/plugins/dap_go.lua new file mode 100644 index 0000000..8f466a2 --- /dev/null +++ b/lua/custom/plugins/dap_go.lua @@ -0,0 +1,5 @@ +return { + "leoluz/nvim-dap-go", + main = "dap-go", + opts = {}, +} diff --git a/lua/custom/plugins/gopher.lua b/lua/custom/plugins/gopher.lua new file mode 100644 index 0000000..8e679ce --- /dev/null +++ b/lua/custom/plugins/gopher.lua @@ -0,0 +1,10 @@ +return { + "olexsmir/gopher.nvim", + ft = "go", + config = function(_, opts) + require("gopher").setup(opts) + end, + build = function() + vim.cmd [[silent! GoInstallDeps]] + end +} diff --git a/lua/custom/plugins/md.lua b/lua/custom/plugins/md.lua new file mode 100644 index 0000000..e7d12e4 --- /dev/null +++ b/lua/custom/plugins/md.lua @@ -0,0 +1,7 @@ +return { + "iamcco/markdown-preview.nvim", + cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, + ft = { "markdown" }, + build = function() vim.fn["mkdp#util#install"]() end, +} + diff --git a/lua/custom/plugins/neosolarized.lua b/lua/custom/plugins/neosolarized.lua index 822693d..b87a8a2 100644 --- a/lua/custom/plugins/neosolarized.lua +++ b/lua/custom/plugins/neosolarized.lua @@ -1,48 +1,47 @@ -return {} --- return { --- "svrana/neosolarized.nvim", --- priority = 1000, --- dependencies = { "tjdevries/colorbuddy.vim" }, --- config = function() --- local status, n = pcall(require, "neosolarized") --- if (not status) then return end --- --- vim.o.termguicolors = true --- --- n.setup({ --- comment_italics = true, --- }) --- --- local cb = require('colorbuddy.init') --- local Color = cb.Color --- local colors = cb.colors --- local Group = cb.Group --- local groups = cb.groups --- local styles = cb.styles --- --- Color.new('white', '#ffffff') --- Color.new('black', '#000000') --- Group.new('CursorLine', colors.none, colors.base03, styles.NONE, colors.base1) --- Group.new('CursorLineNr', colors.yellow, colors.black, styles.NONE, colors.base1) --- Group.new('Visual', colors.none, colors.base03, styles.reverse) --- --- local cError = groups.Error.fg --- local cInfo = groups.Information.fg --- local cWarn = groups.Warning.fg --- local cHint = groups.Hint.fg --- --- Group.new("DiagnosticVirtualTextError", cError, cError:dark():dark():dark():dark(), styles.NONE) --- Group.new("DiagnosticVirtualTextInfo", cInfo, cInfo:dark():dark():dark(), styles.NONE) --- Group.new("DiagnosticVirtualTextWarn", cWarn, cWarn:dark():dark():dark(), styles.NONE) --- Group.new("DiagnosticVirtualTextHint", cHint, cHint:dark():dark():dark(), styles.NONE) --- Group.new("DiagnosticUnderlineError", colors.none, colors.none, styles.undercurl, cError) --- Group.new("DiagnosticUnderlineWarn", colors.none, colors.none, styles.undercurl, cWarn) --- Group.new("DiagnosticUnderlineInfo", colors.none, colors.none, styles.undercurl, cInfo) --- Group.new("DiagnosticUnderlineHint", colors.none, colors.none, styles.undercurl, cHint) --- Group.new("Macro", groups.PreProc, colors.none, styles.italic + styles.bold) --- Group.link("Function", groups.Function, colors.none, styles.italic) --- Group.new("Conditional", groups.Statement, colors.none, styles.italic) --- Group.new("Boolean", groups.Constant, colors.none, styles.bold) --- Group.new("HoverBorder", colors.yellow, colors.none, styles.NONE) --- end --- } +return { + -- "svrana/neosolarized.nvim", + -- priority = 1000, + -- dependencies = { "tjdevries/colorbuddy.vim" }, + -- config = function() + -- local status, n = pcall(require, "neosolarized") + -- if (not status) then return end + -- + -- vim.o.termguicolors = true + -- + -- n.setup({ + -- comment_italics = true, + -- }) + -- + -- local cb = require('colorbuddy.init') + -- local Color = cb.Color + -- local colors = cb.colors + -- local Group = cb.Group + -- local groups = cb.groups + -- local styles = cb.styles + -- + -- Color.new('white', '#ffffff') + -- Color.new('black', '#000000') + -- Group.new('CursorLine', colors.none, colors.base03, styles.NONE, colors.base1) + -- Group.new('CursorLineNr', colors.yellow, colors.black, styles.NONE, colors.base1) + -- Group.new('Visual', colors.none, colors.base03, styles.reverse) + -- + -- local cError = groups.Error.fg + -- local cInfo = groups.Information.fg + -- local cWarn = groups.Warning.fg + -- local cHint = groups.Hint.fg + -- + -- Group.new("DiagnosticVirtualTextError", cError, cError:dark():dark():dark():dark(), styles.NONE) + -- Group.new("DiagnosticVirtualTextInfo", cInfo, cInfo:dark():dark():dark(), styles.NONE) + -- Group.new("DiagnosticVirtualTextWarn", cWarn, cWarn:dark():dark():dark(), styles.NONE) + -- Group.new("DiagnosticVirtualTextHint", cHint, cHint:dark():dark():dark(), styles.NONE) + -- Group.new("DiagnosticUnderlineError", colors.none, colors.none, styles.undercurl, cError) + -- Group.new("DiagnosticUnderlineWarn", colors.none, colors.none, styles.undercurl, cWarn) + -- Group.new("DiagnosticUnderlineInfo", colors.none, colors.none, styles.undercurl, cInfo) + -- Group.new("DiagnosticUnderlineHint", colors.none, colors.none, styles.undercurl, cHint) + -- Group.new("Macro", groups.PreProc, colors.none, styles.italic + styles.bold) + -- Group.link("Function", groups.Function, colors.none, styles.italic) + -- Group.new("Conditional", groups.Statement, colors.none, styles.italic) + -- Group.new("Boolean", groups.Constant, colors.none, styles.bold) + -- Group.new("HoverBorder", colors.yellow, colors.none, styles.NONE) + -- end +} diff --git a/lua/custom/plugins/null-ls.lua b/lua/custom/plugins/null-ls.lua index b5589f9..209f20b 100644 --- a/lua/custom/plugins/null-ls.lua +++ b/lua/custom/plugins/null-ls.lua @@ -6,7 +6,10 @@ return { require("null-ls").builtins.formatting.black.with({ extra_args = { "--line-length=80" } }), - require("null-ls").builtins.formatting.prettierd + require("null-ls").builtins.formatting.prettierd, + require("null-ls").builtins.formatting.gofumpt, + require("null-ls").builtins.formatting.goimports_reviser, + require("null-ls").builtins.formatting.golines, } } end diff --git a/lua/custom/plugins/zen.lua b/lua/custom/plugins/zen.lua index 5aea49d..6852a17 100644 --- a/lua/custom/plugins/zen.lua +++ b/lua/custom/plugins/zen.lua @@ -1,11 +1,13 @@ return { "folke/zen-mode.nvim", opts = { - tmux = { enabled = true }, - kitty = { - enabled = true, - font = "+5", - } + plugins = { + tmux = { enabled = true }, + kitty = { + enabled = true, + font = "+5", + } + }, }, config = function() vim.keymap.set("n", "z", "ZenMode", { silent = true }) diff --git a/lua/jabuxas/remap.lua b/lua/jabuxas/remap.lua index 6ff501c..cb1c00f 100644 --- a/lua/jabuxas/remap.lua +++ b/lua/jabuxas/remap.lua @@ -28,6 +28,7 @@ keymap.set("n", "j", "lprevzz") keymap.set("n", "rr", [[:%s/\<\>//gI]], { desc = "replace current word" }) keymap.set("n", "x", "!chmod +x %", { silent = true, desc = "chmod +x current file" }) +keymap.set("n", "q", "!go run %", { desc = "go run current file" }) keymap.set("t", "", [[]], { desc = "exit insert mode on builtin terminal" }) @@ -46,3 +47,6 @@ keymap.set("n", "", "<") keymap.set("n", "", ">") keymap.set("n", "", "+") keymap.set("n", "", "-") + +keymap.set("n", "gsj", "GoTagAdd json ", { desc = "Add json struct tags" }) +keymap.set("n", "gsy", "GoTagAdd yaml ", { desc = "Add yaml struct tags" }) diff --git a/lua/jabuxas/set.lua b/lua/jabuxas/set.lua index e72f923..d934653 100644 --- a/lua/jabuxas/set.lua +++ b/lua/jabuxas/set.lua @@ -5,9 +5,9 @@ vim.opt.nu = true vim.opt.relativenumber = true vim.opt.clipboard:append({ "unnamedplus" }) -vim.opt.tabstop = 2 -vim.opt.softtabstop = 2 -vim.opt.shiftwidth = 2 +vim.opt.tabstop = 4 +vim.opt.softtabstop = 4 +vim.opt.shiftwidth = 4 vim.opt.expandtab = true vim.opt.smartindent = true @@ -28,7 +28,10 @@ vim.opt.isfname:append("@-@") vim.opt.updatetime = 50 --- vim.opt.colorcolumn = "80" +vim.opt.colorcolumn = "80" +vim.cmd[[highlight ColorColumn ctermbg=235 guibg=#262626]] +vim.api.nvim_create_autocmd({"WinLeave"}, {pattern = "*", callback = function() vim.opt.colorcolumn = "0" end,}) +vim.api.nvim_create_autocmd({"WinEnter"}, {pattern = "*", callback = function() vim.opt.colorcolumn = "80" end,}) vim.g.mapleader = " "