Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't mess with number and relative numbers if they both are disabled with ftplugin #5

Open
kutsan opened this issue Mar 21, 2018 · 0 comments

Comments

@kutsan
Copy link

kutsan commented Mar 21, 2018

My ~/.vim/ftplugin/markdown.vim file has,

setlocal nonumber
setlocal norelativenumber

and this plugin doesn't respect my own settings and overrides them. So, if user explicitly has set nonumber and norelativenumber this plugin shouldn't override them.

This also potentially will solve the problem with g:relativity_filetype_ignore variable. Instead of blacklisting common buffer names, check their number and relativenumber options first.

PS: I don't use this plugin, I just came to look your code and this is my friendly feedback.

I've been using something like this instead of this plugin, FYI.

augroup togglerelativelinenumbers
	autocmd!
	autocmd InsertEnter,BufLeave,WinLeave,FocusLost *
		\ if &l:number && empty(&buftype) |
			\ setlocal norelativenumber |
		\ endif
	autocmd InsertLeave,BufEnter,WinEnter,FocusGained *
		\ if &l:number && empty(&buftype) |
			\ setlocal relativenumber |
		\ endif
augroup end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant