> I have no idea what the "much more" refers to.

all the things i can do with vim are very useful while reading a man
page.

* a file is mentionned ? use gf to jump in it
* a command is provided? edit it so it fit your system and run it with
  !!
* want to add something to your notes? ranges to the rescue:
    .,'aw >> ~/notes
* and so on ...

actually the more i know vim, the less i use the shell because i never
had to copy/paste anymore.

an example: to understand the tagging functionality,
i wanted to read the man page from my clone of the openbsd repo.

i have a command L defined like this:

command -range L <line1>,<line2>!xargs locate

so i typed this on a line

    *openbsd*less.1

then i use command :L to get

/home/mc/src/vendor/openbsd/usr.bin/less/less.1

so i typed !!xargs man<cr>

and i get the content.

this is the kind of shortcuts i use all the time.

> The main effect is to lose tagging functionality.
> default pager, you cannot use the :t functionality to move to the
> place where a word is defined.

vim has a very good support of file navigation using ctags. however
i don't know what to ctag on and what should be the usage from man.
is this the ability to navigate into the manpages?

> Yikes. I had no idea what either of these are doing and had to
> try them out.  vi(1) contains so much bloat that is never really
> needed and doesn't belong in a text editor at all.

i really consider vim as a multipurpose interactive tui, not an editor.
i understand your concern about bloated softwares but i come from a
world where colleagues are editing java and python code using ms code
(editor based on an html render) to create web applications. so vim
is not that bloated.

also: reading/writing from/to pipes/buffer gave me a lot of power and
spare me the time to find, test and learn new tools to achieve the same.

i have only one multipurpose tui i learned and tuned since the last millenium
that helps me to edit mails (with spelling), code (with quickfix mode
and so on) and some macros i wrote 20 years ago still serves me today.

> > feature in openbsd vi. the linux version
> > 
> >     map K yw:E /tmp/vi.keyword.$$p!!xargs man
> 
> You don't say what that is supposed to do.

sorry.

    map K yw:E /tmp/vi.keyword.$$p!!xargs man

should be read:

    map K                 # whenever i press K in normal mode
    yw                    # yank the word
    :E /tmp/vi.keyword.$$ # edit /tmp/vi.keyword.$$ in a new window
    p                     # put the word you just pasted in the buffer
    !!xargs man           # filter the current line with xargs man

    as a result: if the cursor is on the r of the word rctrl and i press
    K, the manual appears in a new window

> Under Debian Jessie, if i start "vim", then type
>   :map K yw:E /tmp/vi.keyword.$$p!!xargs man   <ENTER>
>   als   <ESC>
>   K   <ENTER>

>   E132: Function call depth is higher than 'maxfuncdepth'
>   Press ENTER or type command to continue

you can call a map from a map and it seems something like this happens
in your case. vim mappings can avoid recursions: use noremap instead of
map.

however: K is built-in in vim and is much more powerful than my poor
macro:

* it relies on the 'isk' variable so you can set which chars can be a
  part of a command
* it relies on 'kp' so you can choose an alternative to man to open
  the doc (perldoc is useful when editing perl code)
* the cursor don't need to be on the very first char of the command:
  anywhere on the command is fine.

> I also tried the same with OpenBSD vi(1) and it resulted in
> 
>   Usage: e[dit][!] [+cmd] [file].
> 
> So, no idea what you are trying to do.

you have to be on the first letter of the command so instead of

    als   <ESC>
    K   <ENTER>

try

    als   <ESC>
    b
    K   <ENTER>


> In 2014, i already wrote a patch to do that because the question
> came up repeatedly.  But demand wasn't that high after all, so i
> never committed it.  Now, i updated the patch to -current, see
> below.

i'll try to read this code as soon as possible.

> On the one hand, the UNIX phlosophy is to have each tool do one
> thing well, then use pipes to connect tools as needed.
> arguably, you maybe shouldn't need another tool to just revert
> something that the first tool does.
> Why would *not* adding backspace
> formatting require a pipe to another program, rather than not adding
> it in the first place?

can't reply on that: out of my skillset :)

anyway: thank you very much for taking time help me.
regards
marc

Reply via email to