Created
October 9, 2023 12:53
-
-
Save soyuka/cce8910180b43230e0ef0c8bf2ec68d5 to your computer and use it in GitHub Desktop.
No distraction mode neovim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local NoDistraction = { enabled = 0 } | |
NoDistraction.enable = function() | |
NoDistraction.enabled = 1 | |
vim.cmd([[ | |
set noshowmode | |
set noruler | |
set laststatus=0 | |
set noshowcmd | |
set nonumber | |
set showtabline=0 | |
]]) | |
end | |
NoDistraction.disable = function() | |
NoDistraction.enabled = 0 | |
vim.cmd([[ | |
set showmode | |
set ruler | |
set laststatus=2 | |
set showcmd | |
set number | |
set showtabline=2 | |
]]) | |
end | |
NoDistraction.toggle = function() | |
if NoDistraction.enabled == 0 then | |
NoDistraction.enable() | |
else | |
NoDistraction.disable() | |
end | |
end | |
vim.keymap.set('n', '<Leader>F', function() | |
NoDistraction.toggle() | |
end) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment