8/8/2023 0 Comments Manpager![]() man sets MAN_PN to the manpage name ( man(1), for example).man doesn’t seem to ever provide a filename as an argument, irrespective of.I’d rather not specify set ft=man from the command line, keeping an eye onĪ bit of experimentation later, I found that:.I wanted to apply some of these settings to manpages irrespective of how they.c are run, so I can get it to run after the filetype has been set. I picked VimEnter since it runs after any commands specified using So, I created a ~/.vim/ftplugin/man.vim,įunction ! PrepManPager () if ! empty ($MAN_PN ) silent % ! col - b file $MAN_PNĮndif setlocal nomodified setlocal nomodifiable setlocal readonly setlocal nolist setlocal noswapfile endfunction Hence, they should really be in Vim’sįiletype settings for man. You don’t want swapfiles hanging around from manpages.Īs I pondered over this, I realised that these are settings I’d want to apply toĪ manpage no matter how I opened it.It would be convenient to see the name of the Stuff installed by package managers andĭifferences per distro are a fact of life and have to be handled, but I’d rather However, it created a problem: I use Git to manage my dotfiles. I tried the suggested solution (using a wrapper script), which worked fine. May take the file to display either as an argument or on Multiple commands if you need that, use a wrapper script, which The value may be a simple command name or a command withĪrguments, and may use shell quoting (backslashes, single Its value is used as the name of the program used to display the If $MANPAGER or $PAGER is set ($MANPAGER is used in preference), Why?īecause GNU man doesn’t support piped commands in $MANPAGER – BSD’s manĭoes (that’s +1 for you OSX folks). The post suggested setting $MANPAGER to a combination of col and vim:Įxport MANPAGER = "col -b | vim -c 'set ft=man nomod nolist ignorecase' -"įor decidedly non-obvious reasons, it’s not likely to work for you. ![]() It can browse to other manpages mentioned using tag navigation ( ,.The search is way better than anything less or your average Why did I submit myself to such cruel and unusual punishment? Old attempt at using Vim for reading manpages. Kicked up the dusty cobwebs in my decrepit memory module, and I remembered that While looking through the recent posts in Unix.SE, I cameĪcross this post which suggested using your editor as the pager. I’ve made a Git repo of my Vim files, taken baby steps in automating tasks I Of late, with Vim.SE for support, I’ve been customizing Vim more and more. Reading manpages more comfortable, with syntax colouring, navigation, etc. I’d stumbled upon it while trying to make It involved using some script which made vim behave like Long, long ago, in a hostel room far, far away, I once read about using Vim as
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |