junegunn / junegunn/goyo.vim

Line numbers in "padding" buffers

Open
#191 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
Vim Script
Stars
4.7k
Forks
118
PR merge metrics
No merged PRs in 30d

Description

I couldn't find any reference to this issue elsewhere so I decided to make one.

I've recently installed Goyo in nvim 0.3.1 and I love it but I cannot seem to figure out how to disable line numbering in the "padding" buffers that are created around the active buffer.
![screenshot_20190123_105203](https://user-images.githubusercontent.com/9826865/51629616-f30fc680-1efc-11e9-8436-6086b4a3e356.png)

This is the relevant configuration from my `init.vim` file:
```vim
" GOYO + Limelight Config
"-----------------------------------------------------------------
let g:goyo_width = 140
let g:goyo_linenr=0
function! s:goyo_enter()
call s:disable_autonumber()
set nocursorcolumn nocursorline
set nonumber
let g:undotree_CustomUndotreeCmd = 'leftabove vertical 32 new'
let g:undotree_CustomDiffpanelCmd = 'belowright 12 new'
Limelight
endfunction
function! s:goyo_leave()
call s:enable_autonumber()
set cursorcolumn cursorline
set number
unlet g:undotree_CustomUndotreeCmd
unlet g:undotree_CustomDiffpanelCmd
Limelight!
endfunction
augroup rn_distraction_free
au!
autocmd! User GoyoEnter nested call goyo_enter()
autocmd! User GoyoLeave nested call goyo_leave()
augroup END

" hybrid (auto-switching) line numbers - see https://jeffkreeftmeijer.com/vim-number/
function! s:disable_autonumber()
au! rn_autonumber
endfunction
function! s:enable_autonumber()
augroup rn_autonumber
au!
au BufEnter,FocusGained,InsertLeave * set norelativenumber
au BufLeave,FocusLost,InsertEnter * set relativenumber
augroup END
endfunction
set number
call s:enable_autonumber()
```
Does anybody have any idea how I can resolve (i.e. disable all line numbers when in :Goyo mode)?

Contributor guide

No contributing guide indexed for this repository

Research direction

No source file or test is named. Reproduce the report with the supplied init.vim configuration and inspect Goyo's handling of the padding buffers and Vim line-number options. Done means entering :Goyo leaves line numbers disabled in all padding buffers while preserving the expected behavior in the active buffer.

Written by the indexing model from the issue text.

Assessment

Tech stack
vim
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.