Git Product home page Git Product logo

neoman.vim's Introduction

neoman

Read manpages faster than superman!

note: A much improved version of this plugin is included by default in neovim! see :h man.vim

neoman in action

Features

  • Smart manpage autocompletion
  • Open in a split/vsplit/tabe/current window
  • Control whether or not to jump to closest (above/left) neoman window
  • Open from inside a neovim terminal!
  • Jump to manpages in specific sections through the manpage links
  • Aware of modern manpages, e.g. sections are not just 1-8 anymore
  • zsh/bash/fish support
  • Can open paths to manpages!
  • Support for multiple languages!

Install

Any plugin manager should work fine.

Plug 'nhooyr/neoman.vim' "vim-plug

Usage

Command

The command is as follows:

Nman " display man page for <cWORD>
Nman [sect] page
Nman page[(sect)]
Nman path " if in current directory, start path with ./

Several ways to use it, probably easier to explain with a few examples.

:Nman printf
:Nman 3 printf
:Nman printf(3)
:Nman ./fzf.1 " open manpage in current directory

Nman without any arguments will use the WORD (it strips anything after ')') under the cursor as the page.

For splitting there are the following commands (exact same syntax as Nman)

:Snman 3 printf "horizontal split
:Vnman 3 printf "verical split
:Tnman 3 printf "in a new tab

Mappings

####Default Mappings <C-]> to jump to a manpage under the cursor.
<C-t> to jump back to the previous man page.
q to quit

Here is a global K mapping to take you to the manpage under the cursor.

nnoremap <silent> K :Nman<CR>

Here is a custom mapping for a vertical split man page with the word under the cursor.

nnoremap <silent> <leader>mv :Vnman<CR>

Or perhaps you want to give the name of the manpage?

nnoremap <leader>mv :Vnman<Space>

Command line integration

For vim (or neovim if you do not want terminal integration) you can simply set:

export MANPAGER="nvim -c 'set ft=neoman' -"

To use it with man.

If you want the super cool terminal integration, you will need nvr

Add the correct one to your .zshrc, w.bashrc or config.fish

source /somepath/neoman.vim/scripts/nman.zsh # or bash
source /somepath/neoman.vim/scripts/nman.fish

Now just use nman to open the manpages from within neovim!

Settings

g:neoman_find_window
If this option is set, neoman will first attempt to find the current neoman window before opening a new one. By default this is set.

g:neoman_tab_after
If set, :Tnman will open a tab just after the current one, instead of just before.

g:no_neoman_maps
If set, no mappings are made in neoman buffers. By default it is not set.

Contributing

I'm very open to new ideas, new features. Open up an issue, send me a PR or an email.

TODO:

neoman.vim's People

Contributors

kbsky avatar kdeal avatar lookforit avatar nhooyr avatar sunaku avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.