Monday, July 2, 2012

Re: How to set USERNAME in RHS of "set" command

On Jun 27, 1:38 am, John Little <John.B.Lit...@gmail.com> wrote:
> Before googling, vim's help is usually the first place to go, and
> then the vim FAQhttp://vimhelp.appspot.com/vim_faq.txt.htmland the
> Vim tips wikihttp://vim.wikia.com/wiki/Vim_Tips_Wiki.

I find the vim help and vim-specific FAQs/wikis helpful if I now the
right words. Google helps me find the right words, and often points
me to relevant pages.

> In particular, you should read
>
> :help file-formats
>
> if you haven't already.

Thanks. That was quite helpful.

>> ... You tend to lose track of the fact that
>> you're writing text files or source code using filetype=unix.
>
> I have an expression in my status line option
>
> %1*%{&ff=~'u'?'':&ff}%*
>
> which shows me the file format if it's not my usual unix, in a
> different colour to the rest of the status line (which I always have
> on with :set ls=2).

It never ceases to amaze me how deep the vim coding can be for
seemingly simple things that the casual user takes for granted. In
trying to understand the help for the statusline option, a few helpful
pages I found were:

http://vim.wikia.com/wiki/Showing_syntax_highlight_group_in_statusline
http://got-ravings.blogspot.ca/2008/10/vim-pr0n-conditional-stl-highlighting.html
http://www.vim.org/scripts/script.php?script_id=3383
http://vim.runpaint.org/display/changing-status-line

Currently, I use only the simplest concepts from the 2nd last link:

highlight StatusLineNC guibg=tan
highlight StatusLine guibg=white

The first link is great for illustrating the curly brace expression
evaluation that you use.

My brain started to disconbobulate when reading about highlight group
1 in "%1*", but I get the idea. Different suites of highlight
colours.

Anyway, I think the use of cautionary colours to bring attention to
the fileformat is a great idea, especially since I often use a scratch
file for manipulating text that is meant for others as well as for
piping to bash. However, I like the items shown on the default
statusbar, so I'll look into cobbling together a statusline that
incorporates this feature along with the standard items. It's a bit
of a longer term to-do.

I also confirmed that there is no special escaping needed to pipe text
through dos2unix prior to bash. For example, to execute everything
from the mark 'a to . (current insertion point), I would do:

:w !dos2unix|bash

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

No comments:

Post a Comment