diff --git a/init.lua b/init.lua index d91c1c0d..4c4c4376 100644 --- a/init.lua +++ b/init.lua @@ -128,17 +128,15 @@ require('lazy').setup({ end, }, }, - - { - -- Theme inspired by Atom - 'navarasu/onedark.nvim', - priority = 1000, - config = function() - vim.cmd.colorscheme 'onedark' - end, - }, - - { + { + -- Theme inspired by Atom + 'navarasu/onedark.nvim', + priority = 1000, + config = function() + vim.cmd.colorscheme 'onedark' + end, + }, + { -- Set lualine as statusline 'nvim-lualine/lualine.nvim', -- See `:help lualine.txt` @@ -481,7 +479,7 @@ cmp.setup { [''] = cmp.mapping.select_prev_item(), [''] = cmp.mapping.scroll_docs(-4), [''] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping.complete {}, + [''] = cmp.mapping.complete {}, [''] = cmp.mapping.confirm { behavior = cmp.ConfirmBehavior.Replace, select = true, diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index 33a1cd5e..ea3103d6 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -71,5 +71,38 @@ vim.keymap.set("n", "s", [[:%s/\<\>//gI< -- Make current file executable vim.keymap.set("n", "x", "!chmod +x %", { silent = true, desc = "Make current file execuable"}) +local format_sync_grp = vim.api.nvim_create_augroup("GoFormat", {}) +vim.api.nvim_create_autocmd("BufWritePre", { + pattern = "*.go", + callback = function() + require('go.format').goimport() + end, + group = format_sync_grp, +}) + return { + { + "ray-x/go.nvim", + dependencies = { -- optional packages + "ray-x/guihua.lua", + "neovim/nvim-lspconfig", + "nvim-treesitter/nvim-treesitter", + }, + config = function() + require("go").setup() + end, + event = {"CmdlineEnter"}, + ft = {"go", 'gomod'}, + build = ':lua require("go.install").update_all_sync()' -- if you need to install/update all binaries + }, + { + 's1n7ax/nvim-window-picker', + name = 'window-picker', + event = 'VeryLazy', + version = '2.*', + config = function() + require'window-picker'.setup() + end, + } } + diff --git a/lua/custom/plugins/toggleterm.lua b/lua/custom/plugins/toggleterm.lua index daaa1d98..c67fb41f 100644 --- a/lua/custom/plugins/toggleterm.lua +++ b/lua/custom/plugins/toggleterm.lua @@ -8,10 +8,10 @@ return { config = function() -- Lazygit local Terminal = require('toggleterm.terminal').Terminal - local defaultTerm = Terminal:new({ cmd = "zsh", hidden = true, orientation = "float" }) - local lazygit = Terminal:new({ cmd = "lazygit", hidden = true }) - local pythonREPL = Terminal:new({ cmd = "python3", hidden = true }) - local haskellREPL = Terminal:new({ cmd = "ghci", hidden = true }) + local defaultTerm = Terminal:new({ cmd = "zsh", hidden = true, direction = "float" }) + local lazygit = Terminal:new({ cmd = "lazygit", hidden = true, direction = "float" }) + local pythonREPL = Terminal:new({ cmd = "python3", hidden = true, direction = "float" }) + local haskellREPL = Terminal:new({ cmd = "ghci", hidden = true, direction = "float" }) function _defaultterm_toggle() defaultTerm:toggle() @@ -45,7 +45,7 @@ return { direction = "float", float_opts = { border = "curved", - highlights = { border = "Normal", background = "Normal" }, + highlights = { border = "Normal", background = "Dark" }, }, }, },