lambdalisue / vim-manpager

Use Vim as a MANPAGER program
MIT License
62 stars 5 forks source link

only load ftplugin/man.vim if used as $MANPAGER #3

Closed Konfekt closed 8 years ago

Konfekt commented 8 years ago

With this plugin, editing a file of ft=man is no longer possible. How about only loading it if Vim is used as manpager by checking for $MAN_PN ?

See http://www.cse.iitb.ac.in/~murukesh/2015/08/28/vim-for-man.html

lambdalisue commented 8 years ago

What do you mean with "editing a file of ft=man is no longer possible." I cannot reproduce the issue. The setl nomodifiable, which make the buffer no-modifiable, is called only when you use :MANPAGER or :Man command and you are allowed to modify a file with ft=man which is might be set by Vim or yourself.

:Man call setl nomodifiable on purpose while you use this command to see the manpage. :MANPAGER also call setl nomodifiable on purpose while this is called when you want to use Vim as a manpager. ftplugin/man.vim does not touch modifiable or readonly options.

So I think the behavior is correct.

lambdalisue commented 8 years ago

Let me know the minimum procedure if you still think this is a bug/issue. Actually I don't know what kind of file is detected as ft=man so I just tried

  1. Open a file
  2. Call :set ft=man
  3. Hit ijjjjjj and I could edit the file.
Konfekt commented 8 years ago

I am sorry, I overlooked the -c MANPAGER part. Now I don't see any advantage in using $MAN_PN instead of calling MANPAGER directly, so your implentation is just fine..

Thanks for your very useful plugin!

lambdalisue commented 8 years ago

:-)