Re: Visible Spaces

2006-07-21 Thread panshizhu
This is what I'd thinked about.

IMO, Consider use the Underlined group, The underlined is not a character,
but it looks like a character.

I guess this suit Johnson's need better.

HTH
--
Sincerely, Pan, Shi Zhu. ext: 2606


Benji Fisher [EMAIL PROTECTED] wrote on 2006.07.21 13:56:55:

  Would you be satisfied with changing the background color for
 spaces?  Step 1:

 :hi

 and look for a pleasing color.  I am not using the GUI right now, and it
 looks as though my choices are limited.  (Many groups change the
 foreground color but not the background, at least in the default color
 scheme with my terminal.)  I will choose DiffChange .  Second step:

 :match DiffChange / /

 Ahh!  That looks awful, so

 :match NONE

 will get me back to normal.

 HTH   --Benji Fisher

 P.S.  I think that :match NONE only works with vim 7.0, but I think the
 rest works with vim 6.x.

 On Fri, Jul 21, 2006 at 11:48:45AM +0800, Stewart Johnson wrote:
  Thanks guys!
 
  Intermediate spaces were what I was looking for, oh well. :-/
 
 
  On 7/21/06, Steve Hall [EMAIL PROTECTED] wrote:
  On Fri, 2006-07-21 at 11:19 +0800, Stewart Johnson wrote:
  
   Is there a vim option to represent space characters in a file as a
   dot or something else not blank?
  
  Vim can only represent trailing spaces, not any intermediate ones.
  (Per the previously mentioned listchars option.)
  
  
  --
  Steve Hall  [ digitect dancingpaper com ]
  
  
  



Re: Visible Spaces

2006-07-21 Thread Pádraig Brady
Steve Hall wrote:
 On Fri, 2006-07-21 at 11:19 +0800, Stewart Johnson wrote:
 
Is there a vim option to represent space characters in a file as a
dot or something else not blank?
 
 
 Vim can only represent trailing spaces, not any intermediate ones.
 (Per the previously mentioned listchars option.)

Note I don't find this an issue as vim does highlight intermediate tabs,
I use the following settings ~/.vimrc for visible whitespace:

flag problematic whitespace (trailing and spaces before tabs)
Note you get the same by doing let c_space_errors=1 but
this rule really applys to everything.
highlight RedundantSpaces term=standout ctermbg=red guibg=red
match RedundantSpaces /\s\+$\| \+\ze\t/
use :set list! to toggle visible whitespace on/off
set listchars=tab:-,trail:.,extends:

Pádraig.


RE: Visible Spaces

2006-07-21 Thread Gene Kwiecinski
 Would you be satisfied with changing the background color for
spaces?  Step 1:

Ah, that's an idea.  Just /  to search for spaces (assumes
highlighting's turned on), and they'll all be highlighted.  He wants to
turn off highlighting, just /qqq or something.


Else maybe tweak the font to change space to middot; or something.
Thing is, change the font to something else, and that goes away, and
he'd have to tweak the font for that as well.

Eg, if he's using Lucida console 10pt, make a copy of the font, rename
to something else (Lucidaspace or whatever), edit the font to change
the space char, then when you want visispaces, just font your way to
that.  Want invisispaces again, change back to the normal Lucida font.


Re: Visible Spaces

2006-07-21 Thread @ Rocteur CC

On 21 Jul 2006, at 05:19, Stewart Johnson wrote:


Hi All -

Sorry if this obvious but I couldn't find anything in :help or google.

Is there a vim option to represent space characters in a file as a dot
or something else not blank?

Thanks,
Stewart


:set hls
/

That is slash then a space

;-)

Jerry


RE: Visible Spaces

2006-07-21 Thread Jason Weber
 Would you be satisfied with changing the background color for
spaces?  Step 1:

 Ah, that's an idea.  Just /  to search for spaces (assumes
 highlighting's turned on), and they'll all be highlighted.  He wants to
 turn off highlighting, just /qqq or something.


 Else maybe tweak the font to change space to middot; or something.
 Thing is, change the font to something else, and that goes away, and
 he'd have to tweak the font for that as well.

 Eg, if he's using Lucida console 10pt, make a copy of the font, rename
 to something else (Lucidaspace or whatever), edit the font to change
 the space char, then when you want visispaces, just font your way to
 that.  Want invisispaces again, change back to the normal Lucida font.


I prefer /;; to turn off highlighting. the keys are right next to each
other and never happen in any languages I use.

For spaces, maybe not exactly the same thing, but I have a .vim to color
every three out of four leading spaces as magenta underline (in a
non-expandtab file).  The file also points out a lot of other spacing issues.

Activate this anywhere that doesn't have a strict real-tab rule and
you'll see all the inconsistancies light up.  The blue underlines
between words are ok and just there to help line up widely spaced tables.
I should probably add something to ignore the two spaces between
sentences in prose.

odd_space.vim:

syn match   newtab  [\t]\+$ containedin=ALL
syn match   spacereturn [ ]$ containedin=ALL
syn match   spacetab[ ]\tme=e-1 containedin=ALL
syn match   tabspace\t[ ]\+lc=1 containedin=ALL
syn match   tabtab  [ -'*-Z^-z|~]\t\t\t*[ 
-'*-.0-Z^-z|~]lc=1,me=e-1
containedin=ALLBUT,cComment
syn match   leadspace   [ ][ ]lc=1 contained
syn match   pairspace   [ ][ ]hs=s+1 contained 
nextgroup=pairspace,leadspace
syn match   quadspace   [ ][ ][ ][ ]hs=s+1 contained
nextgroup=quadspace,pairspace,leadspace
syn match   pairstart   ^[ ][ ]hs=s+1 
nextgroup=quadspace,pairspace,leadspace
syn match   quadstart   ^[ ][ ][ ][ ]hs=s+1
nextgroup=quadspace,pairspace,leadspace
syn match   spaces  [^ ][ ]\{2,}lc=1

hi spacetab ctermfg=Red guifg=red   
gui=underline   cterm=underline
hi tabspace ctermfg=Red guifg=red   
gui=underline   cterm=underline
hi spacereturn  ctermfg=Red guifg=red   
gui=underline   cterm=underline
hi newtab   ctermfg=Blueguifg=#FF   gui=underline   
cterm=underline
hi tabtab   ctermfg=Blueguifg=#88   gui=underline   
cterm=underline

if expandtab == 0
hi quadspacectermfg=Magenta guifg=#440044   gui=underline   
cterm=underline
else
hi link quadspace   Normal
endif
hi  linkpairstart   pairspace
hi  linkquadstart   quadspace

hi spaces   ctermfg=DarkRed guifg=#55   gui=underline   
cterm=underline

hi pairspacectermfg=Yellow  guifg=#00   gui=underline   
cterm=underline
hi link leadspace   pairspace

-- 
  _
 ( \  _  \/_ /  _ _  Jason Weber  Glendale, CA
  \|(\/)()))  \/\/(-/_)(-/(  http://www.imonk.com/baboon  [EMAIL PROTECTED]
  //  [EMAIL PROTECTED]
 (/



Re: Visible Spaces

2006-07-21 Thread A.J.Mechelynck

Jason Weber wrote:

Would you be satisfied with changing the background color for
spaces?  Step 1:

Ah, that's an idea.  Just /  to search for spaces (assumes
highlighting's turned on), and they'll all be highlighted.  He wants to
turn off highlighting, just /qqq or something.


Else maybe tweak the font to change space to middot; or something.
Thing is, change the font to something else, and that goes away, and
he'd have to tweak the font for that as well.

Eg, if he's using Lucida console 10pt, make a copy of the font, rename
to something else (Lucidaspace or whatever), edit the font to change
the space char, then when you want visispaces, just font your way to
that.  Want invisispaces again, change back to the normal Lucida font.



I prefer /;; to turn off highlighting. the keys are right next to each
other and never happen in any languages I use.

[...]

To turn off highlighting until next search, vim has the :noh[lsearch] 
command. You may want to use something like :map ;; :nohCR if :noh 
(4 keys including Enter) is too long for you.




Best regards,
Tony.


Re: Visible Spaces

2006-07-21 Thread Bill McCarthy
On Fri 21-Jul-06 12:51pm -0600, Jason Weber wrote:

 Ah, that's an idea.  Just /  to search for spaces (assumes
 highlighting's turned on), and they'll all be highlighted.  He wants to
 turn off highlighting, just /qqq or something.

 I prefer /;; to turn off highlighting. the keys are right next to each
 other and never happen in any languages I use.

I clear the last search pattern often enough that I use a
mapping:

  map leader\ :let @/=barecho Search pattern clearedcr

-- 
Best regards,
Bill



Re: Visible Spaces

2006-07-21 Thread Steve Hall
From: Bill McCarthy, Jul 21, 2006 2:14 PM

 I clear the last search pattern often enough that I use a
 mapping:

 map leader\ :let @/=barecho Search pattern clearedcr

Which does the same as:

  :noh


-- 
Steve Hall  [ digitect dancingpaper com ]





Re: Visible Spaces

2006-07-21 Thread Bill McCarthy
On Fri 21-Jul-06 1:36pm -0600, Steve Hall wrote:


 From: Bill McCarthy, Jul 21, 2006 2:14 PM

 I clear the last search pattern often enough that I use a
 mapping:

 map leader\ :let @/=barecho Search pattern clearedcr

 Which does the same as:

   :noh

They do produce the same immediate visual affect.  They are
not the same.  :noh leaves the search pattern active.  After
':noh' try 'n' to see the highlighting back on.

let @/=

replaces the last search pattern with an empty string.
Typing 'n' will produce this message:

E35: No previous regular expression

-- 
Best regards,
Bill



Re: Visible Spaces

2006-07-20 Thread A.J.Mechelynck

Steve Hall wrote:

On Fri, 2006-07-21 at 11:19 +0800, Stewart Johnson wrote:

Is there a vim option to represent space characters in a file as a
dot or something else not blank?


Vim can only represent trailing spaces, not any intermediate ones.
(Per the previously mentioned listchars option.)




True. It can represent hard tabs anywhere, and spaces at end-of-line. It 
can also add a special character after the end of the line to mark its 
length. Depending on what you 'really' want to do, this may or may not 
be OK for you.


Or you might want to use

:1,$s/ /./

to replace all spaces by dots, then (immediately after)

u

for undo.


Best regards,
Tony.


Re: Visible Spaces

2006-07-20 Thread Georg Dahn

Hi!


Or you might want to use

:1,$s/ /./

to replace all spaces by dots, then (immediately after)

u

for undo.


To replace _all_ spaces by dots, you should better use

:%s/ /./g

because your command replaces the first space character of each
line only. With 'g' at the end, all space characters are replaced.

Best wishes,
Georg








___ 
Try the all-new Yahoo! Mail. The New Version is radically easier to use – The Wall Street Journal 
http://uk.docs.yahoo.com/nowyoucan.html


Re: Visible Spaces

2006-07-20 Thread Benji Fisher
 Would you be satisfied with changing the background color for
spaces?  Step 1:

:hi

and look for a pleasing color.  I am not using the GUI right now, and it
looks as though my choices are limited.  (Many groups change the
foreground color but not the background, at least in the default color
scheme with my terminal.)  I will choose DiffChange .  Second step:

:match DiffChange / /

Ahh!  That looks awful, so

:match NONE

will get me back to normal.

HTH --Benji Fisher

P.S.  I think that :match NONE only works with vim 7.0, but I think the
rest works with vim 6.x.

On Fri, Jul 21, 2006 at 11:48:45AM +0800, Stewart Johnson wrote:
 Thanks guys!
 
 Intermediate spaces were what I was looking for, oh well. :-/
 
 
 On 7/21/06, Steve Hall [EMAIL PROTECTED] wrote:
 On Fri, 2006-07-21 at 11:19 +0800, Stewart Johnson wrote:
 
  Is there a vim option to represent space characters in a file as a
  dot or something else not blank?
 
 Vim can only represent trailing spaces, not any intermediate ones.
 (Per the previously mentioned listchars option.)
 
 
 --
 Steve Hall  [ digitect dancingpaper com ]