Files
dotfiles/nvim/after/plugin/goyo.lua
2022-08-10 11:03:55 +02:00

31 lines
789 B
Lua
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
-- Goyo https://github.com/junegunn/goyo.vim
local keymap = vim.api.nvim_set_keymap
local opts = { noremap = true, silent = true }
vim.cmd([[
function! s:goyo_enter()
if executable('tmux') && strlen($TMUX)
silent !tmux set status off
silent !tmux list-panes -F '\#F' | grep -q Z || tmux resize-pane -Z
endif
set noshowmode
set noshowcmd
set scrolloff=999
Gitsigns toggle_signs
endfunction
function! s:goyo_leave()
if executable('tmux') && strlen($TMUX)
silent !tmux set status on
silent !tmux list-panes -F '\#F' | grep -q Z && tmux resize-pane -Z
endif
set showmode
set showcmd
set scrolloff=8
Gitsigns toggle_signs
endfunction
autocmd! User GoyoEnter nested call <SID>goyo_enter()
autocmd! User GoyoLeave nested call <SID>goyo_leave()
]])