From 696bda73c7eac2339b2fc7123e5422ac26b33594 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Thu, 20 Jan 2022 03:16:39 -0800 Subject: [PATCH] nvim: configure zenmode --- .config/nvim/lua/blake/other.lua | 48 ++++++++++++++++++++++++++++++ .config/nvim/lua/blake/plugins.lua | 3 +- 2 files changed, 49 insertions(+), 2 deletions(-) diff --git a/.config/nvim/lua/blake/other.lua b/.config/nvim/lua/blake/other.lua index 2c97bb3..04e2aa8 100644 --- a/.config/nvim/lua/blake/other.lua +++ b/.config/nvim/lua/blake/other.lua @@ -169,6 +169,54 @@ M.neoscroll = function() end -- <<< +-- ZenMode >>> +M.zenmode = function() + -- map :ZM to :ZenMode + vim.cmd 'command! ZM ZenMode' + require("zen-mode").setup { + window = { + backdrop = 0.95, -- shade the backdrop of the Zen window. Set to 1 to keep the same as Normal + -- height and width can be: + -- * an absolute number of cells when > 1 + -- * a percentage of the width / height of the editor when <= 1 + -- * a function that returns the width or the height + width = 120, -- width of the Zen window + height = 0.95, -- height of the Zen window + -- by default, no options are changed for the Zen window + -- uncomment any of the options below, or add other vim.wo options you want to apply + options = { -- uncomment to do what the sign says + -- signcolumn = "no", -- signcolumn + number = false, -- number column + -- relativenumber = false, -- relative numbers + -- cursorline = false, -- cursorline + cursorcolumn = false, -- cursor column + -- foldcolumn = "0", -- fold column + -- list = false, -- whitespace characters + }, + }, + plugins = { + -- disable some global vim options (vim.o...) + -- comment the lines to not apply the options + options = { + enabled = true, + ruler = false, -- disables the ruler text in the cmd line area + showcmd = false, -- disables the command in the last line of the screen + }, + twilight = { enabled = true }, -- enable to start Twilight when zen mode opens + gitsigns = { enabled = true }, -- disables git signs + tmux = { enabled = false }, -- disables the tmux statusline + }, + -- Functions I could write but I'm probably not going to use + -- -- callback where you can add custom code when the Zen window opens + -- on_open = function(win) + -- end, + -- -- callback where you can add custom code when the Zen window closes + -- on_close = function() + -- end, + } +end +-- <<< + -- Autosession >>> M.autosession = function() local opts = { diff --git a/.config/nvim/lua/blake/plugins.lua b/.config/nvim/lua/blake/plugins.lua index 16d2a67..284586a 100644 --- a/.config/nvim/lua/blake/plugins.lua +++ b/.config/nvim/lua/blake/plugins.lua @@ -206,8 +206,7 @@ return require('packer').startup({function() use { -- Zen mode (:ZenMode or :ZM) "folke/zen-mode.nvim", config = function() - vim.cmd 'command! ZM ZenMode' - require("zen-mode").setup() + require('blake.other').zenmode() end, } use { -- dim text outside paragraph or function