From 3ffaf8ca1560ea8d651ba4d72ab0b511a31f1520 Mon Sep 17 00:00:00 2001 From: Juni Kim Date: Sat, 4 Feb 2023 13:09:22 -0500 Subject: [PATCH] zen mode --- after/plugin/zenmode.lua | 19 +++++++++++++++++++ lua/junikim/options.lua | 3 +++ lua/junikim/packer.lua | 8 ++++++++ 3 files changed, 30 insertions(+) create mode 100644 after/plugin/zenmode.lua diff --git a/after/plugin/zenmode.lua b/after/plugin/zenmode.lua new file mode 100644 index 0000000..3ea3140 --- /dev/null +++ b/after/plugin/zenmode.lua @@ -0,0 +1,19 @@ +require("zen-mode").setup { + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below +} + +vim.keymap.set("n", "z", function() + require("zen-mode").toggle({ + window = { + width = .85 -- width will be 85% of the editor width + }, + on_open = function(win) + vim.wo.relativenumber = false + end, + -- callback where you can add custom code when the Zen window closes + on_close = function() + end, + }) +end) diff --git a/lua/junikim/options.lua b/lua/junikim/options.lua index 99151ed..4dc348c 100644 --- a/lua/junikim/options.lua +++ b/lua/junikim/options.lua @@ -13,6 +13,9 @@ vim.opt.colorcolumn = "80" vim.opt.list = true vim.opt.wrap = false +vim.opt.splitbelow = true +vim.opt.splitright = true + vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir" vim.opt.undofile = true vim.opt.hlsearch = false diff --git a/lua/junikim/packer.lua b/lua/junikim/packer.lua index 7eb1a1d..92b7148 100644 --- a/lua/junikim/packer.lua +++ b/lua/junikim/packer.lua @@ -59,4 +59,12 @@ return require('packer').startup(function(use) } use 'ethanholz/nvim-lastplace' + -- zen mode + use { + "folke/zen-mode.nvim", + requires = { + { 'folke/twilight.nvim' } + } + } + end)