From d2bcf80b363c5d768fc97974dddd257ec6bae465 Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Sun, 24 Sep 2023 21:20:07 -0400 Subject: [PATCH] Cleanup lazy/revert to vim-zoom --- nvim/.config/nvim/after/plugin/config.lua | 28 +++++++++++++++-------- nvim/.config/nvim/init.lua | 2 +- nvim/.config/nvim/lazy-lock.json | 6 ++--- nvim/.config/nvim/lua/config.lua | 22 ++++++++---------- nvim/.config/nvim/lua/options.lua | 2 ++ nvim/.config/nvim/lua/plugins.lua | 2 +- 6 files changed, 35 insertions(+), 27 deletions(-) diff --git a/nvim/.config/nvim/after/plugin/config.lua b/nvim/.config/nvim/after/plugin/config.lua index 3279c52..73afec8 100644 --- a/nvim/.config/nvim/after/plugin/config.lua +++ b/nvim/.config/nvim/after/plugin/config.lua @@ -23,16 +23,6 @@ end) require("gitsigns").setup() vim.keymap.set("n", "gb", require("gitsigns").toggle_current_line_blame) ---- NeoZoom.lua -require("neo-zoom").setup({ - left_ratio = 0, - top_ratio = 0, - width_ratio = 1, - height_ratio = 1, - border = "none", -}) -vim.keymap.set("n", "z", require("neo-zoom").neo_zoom) - --- nvim-surround require("nvim-surround").setup() @@ -69,3 +59,21 @@ require("whitespace-nvim").setup({ vim.keymap.set("n", "fw", function() require("whitespace-nvim").trim() end, { silent = true }) + +--- vim-zoom +-- let g:zoom#statustext='Z' +vim.api.nvim_tabpage_set_var(0, "zoomed", 0) +vim.keymap.set("n", "", function() + local char = vim.fn.nr2char(vim.fn.getchar()) + + if vim.api.nvim_tabpage_get_var(0, "zoomed")== 1 then + if char == 'v' or char == 's' or char == '' or char == '' then + vim.notify("cannot split when zoomed", vim.log.levels.ERROR) + return "" + end + end + + return ""..char +end, {expr = true, replace_keycodes = true}) +vim.keymap.set("n", "z", "(zoom-toggle)") +vim.keymap.set("n", "", "(zoom-toggle)") diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua index de3c6ea..f5a013e 100644 --- a/nvim/.config/nvim/init.lua +++ b/nvim/.config/nvim/init.lua @@ -1,3 +1,3 @@ -require "plugins" require "options" +require "plugins" require "config" diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index 854e8ef..b499eae 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -1,14 +1,13 @@ { - "NeoZoom.lua": { "branch": "main", "commit": "1289b900bd478fd135dcc0faf4a43b3cf7524097" }, "bufdelete.nvim": { "branch": "master", "commit": "07d1f8ba79dec59d42b975a4df1c732b2e4e37b4" }, "editorconfig.nvim": { "branch": "master", "commit": "5b9e303e1d6f7abfe616ce4cc8d3fffc554790bf" }, "gitlinker.nvim": { "branch": "master", "commit": "cc59f732f3d043b626c8702cb725c82e54d35c25" }, - "gitsigns.nvim": { "branch": "main", "commit": "bce4576a9047085a528c479a7fe1e2f6b787b6c1" }, + "gitsigns.nvim": { "branch": "main", "commit": "bdeba1cec3faddd89146690c10b9a87949c0ee66" }, "gruvbox": { "branch": "master", "commit": "86c767ff91e2518da44ba8c78b3bc6c979cf5403" }, "lazy.nvim": { "branch": "main", "commit": "2a9354c7d2368d78cbd5575a51a2af5bd8a6ad01" }, "nvim-surround": { "branch": "main", "commit": "1c2ef599abeeb98e40706830bcd27e90e259367a" }, "plenary.nvim": { "branch": "master", "commit": "9ce85b0f7dcfe5358c0be937ad23e456907d410b" }, - "telescope.nvim": { "branch": "master", "commit": "40c8d2fc2b729dd442eda093cf8c9496d6e23732" }, + "telescope.nvim": { "branch": "master", "commit": "ed9574dd6dde143d009b2528ea6d79bd34bbe6c8" }, "typescript-vim": { "branch": "master", "commit": "31ede5ad905ce4159a5e285073a391daa3bf83fa" }, "vim-eunuch": { "branch": "master", "commit": "67f3dd32b4dcd1c427085f42ff5f29c7adc645c6" }, "vim-go": { "branch": "master", "commit": "a2e59981a2d965bed9f4052fa15a08d2ee2f8040" }, @@ -16,5 +15,6 @@ "vim-rails": { "branch": "master", "commit": "1ad9663ce31e8c08134849d04184cda94bb42aba" }, "vim-ruby": { "branch": "master", "commit": "88f29671b776fff56e5ee554becf34dd2ee1975c" }, "vim-terraform": { "branch": "master", "commit": "2bbc5f65a80c79a5110494a2ba1b869075fcf7a0" }, + "vim-zoom": { "branch": "master", "commit": "01c737005312c09e0449d6518decf8cedfee32c7" }, "whitespace.nvim": { "branch": "master", "commit": "fe9ca0ba3c6e6cc1dd14c0d6cbe49d97496700dd" } } \ No newline at end of file diff --git a/nvim/.config/nvim/lua/config.lua b/nvim/.config/nvim/lua/config.lua index 1b49b08..9e5f3e1 100644 --- a/nvim/.config/nvim/lua/config.lua +++ b/nvim/.config/nvim/lua/config.lua @@ -19,18 +19,18 @@ local reticle = vim.api.nvim_create_augroup("Reticle", { }) vim.api.nvim_create_autocmd({"VimEnter", "WinEnter", "BufWinEnter"}, { - group = reticle, - callback = function() - vim.opt_local.cursorline = true - vim.opt_local.cursorcolumn = true - end + group = reticle, + callback = function() + vim.opt_local.cursorline = true + vim.opt_local.cursorcolumn = true + end }) vim.api.nvim_create_autocmd({"WinLeave"}, { - group = reticle, - callback = function() - vim.opt_local.cursorline = false - vim.opt_local.cursorcolumn = false - end + group = reticle, + callback = function() + vim.opt_local.cursorline = false + vim.opt_local.cursorcolumn = false + end }) --- background matching terminal @@ -45,8 +45,6 @@ end ChangeBackground() -- LEADER CONFIGURATION -vim.g.mapleader = "," - vim.keymap.set("n", "sz", ":luafile ~/.config/nvim/init.lua") vim.keymap.set({ "n", "v" }, "cp", '"+y') diff --git a/nvim/.config/nvim/lua/options.lua b/nvim/.config/nvim/lua/options.lua index 971a79f..72a77c6 100644 --- a/nvim/.config/nvim/lua/options.lua +++ b/nvim/.config/nvim/lua/options.lua @@ -29,3 +29,5 @@ vim.opt.shiftround = true -- make >> go to next tab vim.opt.undolevels = 5000 vim.opt.undofile = true vim.opt.undodir = os.getenv("HOME") .. "/.config/nvim/undo" + +vim.g.mapleader = "," diff --git a/nvim/.config/nvim/lua/plugins.lua b/nvim/.config/nvim/lua/plugins.lua index 137d329..8674420 100644 --- a/nvim/.config/nvim/lua/plugins.lua +++ b/nvim/.config/nvim/lua/plugins.lua @@ -14,11 +14,11 @@ require("lazy").setup({ "nvim-lua/plenary.nvim", "nvim-telescope/telescope.nvim", "famiu/bufdelete.nvim", + "dhruvasagar/vim-zoom", "gpanders/editorconfig.nvim", "johnfrankmorgan/whitespace.nvim", "kylechui/nvim-surround", "lewis6991/gitsigns.nvim", - "nyngwang/NeoZoom.lua", -- TODO: Floating window background color "ruifm/gitlinker.nvim", "tpope/vim-eunuch",