Tuesday, June 1, 2010

Re: Formatting help files

Pablo Giménez wrote:
> Hi Brett.
> I am checking some text formatted with tftfmt in a terminal and for some
> colorschemes the characters used to format the test appear visible in the
> buffer.

Pablo,

The following section in the Txtfmt help gives a detailed explanation...

:help txtfmt-cterm-ignore-issue

...but the basic idea is this: for color terminals, when the background
color is not known to Vim, Vim must rely upon the special "Ignore"
highlight group to conceal the tokens. Note that the Ignore group was
actually created in Vim6 precisely to allow special characters in help
files to be hidden:

--From version6.txt--
"Ignore" highlight group: Text highlighted with this is made blank. It
is used to hide special characters in the help text.
---

For various reasons, however, some colorscheme authors have chosen to
make the "Ignore" group quite visible. (Note that this is never an issue
in the GUI where the background color is always known to Vim.) The
Txtfmt help presents at least 3 workarounds for a cterm...

:help txtfmt-cterm-ignore-workaround

> Also if you change your current colorscheme in gvim the "format chatacters"
> appears.
> Is there any way to ensure that "format" characters will stay hidden always?

After changing your colorscheme, you should run...

:Refresh

...to get Txtfmt back in synch. This command can also be used when you
have changed Txtfmt options and wish to have them take effect
immediately (i.e., without restarting Vim or reloading the buffer).

Let me know if any of this is unclear...

Thanks,
Brett Stahlman


...[snip]...

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Insert stdout of shell command on current line

On 06/01/2010 06:55 AM, Andre Majorel wrote:
> Execute the current line (minus the leading "#") as a shell
> command and insert its output at +1, keeping the current line in
> place.
>
> Yp:.!sed 's/^\#//' | sh
>
> Is there a simpler way to do that ? Like a built-in command ?

It's uncommon enough (especially the "minus the leading #" bit)
that it's certainly not built-in. However, it's easy enough to
map. I'd personally use ":t." instead of "Yp" just so I don't
tromp the contents of my scratch-register. I'd also just use vim
to strip the "#". You could try

:nnoremap <f4> :t.<bar>s/^#//e<bar>.! sh<cr>

which should have the same behavior. I might also tweak the
regexp to

s/^\s*#\+//e

just to catch a few odd edge cases that occur to me.

-tim

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Insert stdout of shell command on current line

Execute the current line (minus the leading "#") as a shell
command and insert its output at +1, keeping the current line in
place.

Yp:.!sed 's/^\#//' | sh

Is there a simpler way to do that ? Like a built-in command ?

--
André Majorel http://www.teaser.fr/~amajorel/

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Issue with Vim copy paste

Hi,

I am using facing issues while doing copy and paste from vim. I am
using cygwin xterm and then ssh to remote host and then opening vim.

The copy and paste from Vim to my local machine is not working
properly. Can somebody please give me checklist on what to enable in
default so that copy paste works between vim and any local windows
application.

Many thanks in advance,
Ajay.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Formatting help files

Hi Brett.
I am checking some text formatted with tftfmt in a terminal and for some colorschemes the characters used to format the test appear visible in the buffer.
Also if you change your current colorscheme in gvim the "format chatacters" appears.
Is there any way to ensure that "format" characters will stay hidden always?

2010/5/28 Stahlman Family <brettstahlman@comcast.net>
Pablo Giménez wrote:
Hi.
I have some help files along with my scripts and I wanto give them a better
formatting.
So far the text layout is not too  bad, but I am wondering is there is
anyway to make some letter to appear as bold or italic, like when you write
a wiki.
Is this possible with vim help files format????

Pablo,
You might have a look at the following plugin:

Txtfmt (The Vim Highlighter)
http://www.vim.org/scripts/script.php?script_id=2208

Txtfmt can be used either as a standalone filetype, or in conjunction with other filetypes (e.g., Vim "help"), to beautify your documents with word processor style highlighting. Txtfmt allows you to create arbitrary regions involving any combination of bold, underline, italic, etc..., as well as both foreground and background colors. The following site contains screenshots. (Note that there are multiple tabs in addition to "Home": the "ywchaos", "Jnl and Txtfmt" and "ywtxt" tabs show Txtfmt regions supplementing the statically-defined regions of other wiki/journal filetypes.)

http://www.txtfmt.webs.com/

To use Txtfmt within a Vim help file, you would need to set the filetype to help.txtfmt. One way to do this would be with the following modeline:

       vim:ft=help.txtfmt

If you decide to give it a try, there's a "Quick-Start Tutorial" on the download page that explains how to add the highlighting regions. Let me know if anything is unclear...

Sincerely,
Brett Stahlman



thanks


--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php



--
Un saludo
Best Regards
Pablo Giménez

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Formatting help files



2010/5/28 Stahlman Family <brettstahlman@comcast.net>
Pablo Giménez wrote:
Hi.
I have some help files along with my scripts and I wanto give them a better
formatting.
So far the text layout is not too  bad, but I am wondering is there is
anyway to make some letter to appear as bold or italic, like when you write
a wiki.
Is this possible with vim help files format????

Pablo,
You might have a look at the following plugin:

Txtfmt (The Vim Highlighter)
http://www.vim.org/scripts/script.php?script_id=2208
the plubing is really useful, thanks.
One question how I can use a foramting symbol just in the selected area in viasual mode.
For instance I select some text in visual mode and then I want to apply a  bold format only to this area. There is any mapping that will enter the prompt for format option apply them, and at the end of the selection add a nonformat character?
cheers

Txtfmt can be used either as a standalone filetype, or in conjunction with other filetypes (e.g., Vim "help"), to beautify your documents with word processor style highlighting. Txtfmt allows you to create arbitrary regions involving any combination of bold, underline, italic, etc..., as well as both foreground and background colors. The following site contains screenshots. (Note that there are multiple tabs in addition to "Home": the "ywchaos", "Jnl and Txtfmt" and "ywtxt" tabs show Txtfmt regions supplementing the statically-defined regions of other wiki/journal filetypes.)

http://www.txtfmt.webs.com/

To use Txtfmt within a Vim help file, you would need to set the filetype to help.txtfmt. One way to do this would be with the following modeline:

       vim:ft=help.txtfmt

If you decide to give it a try, there's a "Quick-Start Tutorial" on the download page that explains how to add the highlighting regions. Let me know if anything is unclear...

Sincerely,
Brett Stahlman



thanks


--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php



--
Un saludo
Best Regards
Pablo Giménez

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Formatting help files



El 28 de mayo de 2010 19:03, Tony Mechelynck <antoine.mechelynck@gmail.com> escribió:
On 28/05/10 12:48, Pablo Giménez wrote:
Hi.
I have some help files along with my scripts and I wanto give them a
better formatting.
So far the text layout is not too  bad, but I am wondering is there is
anyway to make some letter to appear as bold or italic, like when you
write a wiki.
Is this possible with vim help files format????
thanks

--
Un saludo
Best Regards
Pablo Giménez

If these help files are to be used by other Vim users (e.g. because you distribute them with one or more Vim scripts), then you should stick to "standard" help formatting. In that case you cannot make sure that any particular text will be in any _particular_ color, boldness, etc., because any user may have a different "preferred colorscheme", and colorschemes are allowed to set any coloring scheme. But you can make some parts of the text appear in a different color than the rest to any user who has set ":syntax on", by following the same rules as in the help files distributed with Vim, as follows:
Thanks  Tony.
I am already following these rules to format my help files.
But txtfmt plugin is really useful to make a more professional look to it.
So probably I will add this pluging along side with my one, which basically a compilation of plugins and scripts to offer a better help.

* Always put a modeline at the bottom, as Bram does with Vim's helpfiles. Never set a global option in such a modeline, that can have consequences undesired by whoever reads that help.

* Where you define a help tag, put its *help-tag-name* between asterisks. Then after the user runs |:helptags| or |:UseVimball| he will be able to use ":help help-tag-name" to go to it. The name should be distinctive and different from all help tags already used by Vim; ideally it should begin with the name of your plugin.

* To hotlink to an 'option', just put its name between single quotes, Vim is clever enough to highlight that the right way.

* To hotlink to a |help-tag-name| for something other than an option, put it between |bars| (q.v.)

* The words "Note" and "TODO" automagically receive distinctive highlighting.

* See also (e.g. by looking at some of the Vim helpfiles after setting ":syntax off", or by viewing them in some dumb editor such as Notepad) how the Vim help uses some character at the start or end of some lines to produce distintive highlighting. For instance the following have a meaning (I'm not sure I found them all):

       - a special key name expressed either in <> notation as in <PageDown>, or as a Ctrl character as in CTRL-X
       - anything between {braces}, e.g. {lhs} and {rhs}
       - a greater-than sign at the end of the line (maning: here comes a block of ex-commands)
       - a less-than sign as the first nonblank on a line (meaning: the line above was the last one of a block of ex-commands)
       - a line starting in column 1 also implicitly stops any block of ex-commands before it.
       - a tilde at the end of a line (to give this line a different colour, usually for a column heading)


Best regards,
Tony.
--
ARTHUR:  Bloody peasant!
DENNIS:  Oh, what a give away.  Did you hear that, did you hear that, eh?
        That's what I'm on about -- did you see him repressing me, you saw it
        didn't you?
                                 The Quest for the Holy Grail (Monty Python)



--
Un saludo
Best Regards
Pablo Giménez

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php