Raúl Núñez de Arenas Coronado wrote:
> Saluton Patrick :)
> 
> Patrick Gen-Paul  <[email protected]> skribis:
>> Matt Wozniski wrote:
>>> Are you aware of the 'listchars' option?  You might find that
>>> displaying trailing spaces using a special character (which isn't
>>> highlighted with the NonText group) suits your needs better than
>>> displaying the $ (which is highlighted with the NonText group).
>> Yes, I read about the listchars option several times and yet, I did
>> not see anything that would help regarding this issue. This probably
>> means that I missed something important. I will review in the morning
>> and get back to you if I can't figure it out.
> 
> It's easy: you want to get rid of the "~" (just like me) but still be
> aware of any trailing whitespace, right?
> 
> Then, set "NonText" to an invisible color and use "listchars" to see if
> there are trailing whitespace at the end of lines when needed. I've set
> a mapping to enable/disable listchars showing:
> 
> " Toggle visibility of special chars
> nmap <silent> <Leader>+ :set invlist<CR>
> imap <silent> <Leader>+ x<BS><C-\><C-O><Leader>+
> 
> Anyway, although I don't like the "~" at all, I've learnt to live with
> them. When I started using Vim I patched the sources to use a space and
> not a tilde, but it was not worth the maintenance effort when upgrading
> Vim. Right now, I barely notice them at all. In fact, I thought I had
> them highlighted in an invisible colour, but that's not true!

Thanks to all who have responded.

I eventually managed to understand the "listchars=trail:" solution. I 
read your (and Matt Wozniski's) explanation about ten times and really 
could not figure it out.

Even though I already had the following in my .vimrc:

:set lcs=tab:>-,trail:˘,eol:$,nbsp:○,extends:→,precedes:←

[You need an UTF-8 capable environment to correctly display the above]

In other words, I had already solved this without realizing..

Maybe the problem was that the files I was looking at didn't have any 
trailing spaces..? :-)

Anyway, I got that working.

I pursued another option, and after a whirlwind tour of vimscript via 
vim-script-intro and studying the examples you and others kindly 
provided, I came up with the following toggle and mappings:

"-------------------------------------------------

function Sl()
   let w:zobi = exists('w:zobi') ? !w:zobi : 1
   if w:zobi"
     hi Nontext ctermfg=58
     set list
   else
     hi NonText ctermfg=0
     set nolist
     unlet w:zobi
   endif
endfun

:nm <silent> <F7> :call Sl()<CR>
:im <silent> <F7> <C-O> :call Sl()<CR>

"-------------------------------------------------

I'm sure there are more elegant ways to implement the above [and 
probably coding standards that I merrily ignored] but it appears to do 
the job.

If anyone has a 256-color terminal, I cannot resist the temptation of 
attaching my finalized "nightowl" color scheme.

Let me know if it works in your setup.

Gen-Paul.


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

" vim: tw=0 ts=2 sw=2
" Vim color file
"
" Creator: Patrick Gen-Paul     - <[email protected]>
"
" Credits: Ryan Philips         - loosely derived from golden.vim
"          Charles Campbell     - "hicolors" plugin for tweaks
"          <[email protected]>    - for their unrelenting patience :-)
"
" Notes:   This color scheme makes the 'end of buffer' mark '~'
"          invisible by specifying:
"
"          "hi NonText ctermfg=Black ctermbg=Black" 
"
"          In other words, a black foreground on a black background.
"
"          This could become a problem when using ":set list" because 
"          it also makes the EOL character '$' invisible when issuing
"          a ":set list" command. 
"
"          One possible solution is to ask vim to display trailing
"          spaces instead, by adding something like the following 
"          to your ~/.vimrc: 
"
"          ":set listchars+=trail:˘"
"
"          This will reveal trailing spaces rather than EOL marks,
"          basically serving the same purpose.
"
"          Naturally, the user can choose to replace the ˘ with any 
"          other character that he finds suitable. I only chose ˘ 
"          because it is quite readable with the font that I use.
"
"          If you don't mind displaying the 'end of buffer' marks and 
"          want to visualize the EOL marks, just swap the two "Nontext" 
"          highlight definitions on lines 71 & 72.
"
"          Also, this color scheme is strictly for a 256-color terminal
"          and will not work for the gui or less capable terminals.
"
hi clear
set background=dark
if exists("syntax_on")
  syntax reset
endif
let g:colors_name = "nightowl9"

hi AltAltUnique                                 ctermfg=239
hi Comment                                      ctermfg=101
hi Constant               cterm=bold            ctermfg=94
hi Cursor                                       ctermfg=232         ctermbg=202
hi CursorColumn                                 ctermfg=234         ctermbg=242
hi CursorLine             cterm=underline 
hi DiffAdd                                      ctermfg=100         ctermbg=232
hi DiffChange                                   ctermfg=94          ctermbg=232
hi DiffDelete                                   ctermfg=236         ctermbg=232
hi DiffText               cterm=bold            ctermfg=223         ctermbg=232
hi Directory              cterm=bold            ctermfg=223
hi Error                                        ctermfg=9           ctermbg=0
hi ErrorMsg               cterm=bold            ctermfg=214         ctermbg=52
hi FoldColumn                                   ctermfg=242         ctermbg=0
hi Folded                                       ctermfg=214         ctermbg=234
hi Identifier             cterm=bold            ctermfg=186
hi Ignore                                       ctermfg=0
hi IncSearch              cterm=reverse
hi LineNr                                       ctermfg=101
hi MatchParen                                   ctermfg=232         ctermbg=187
hi Menu                                         ctermfg=223         ctermbg=0
hi ModeMsg                cterm=bold            ctermfg=232         ctermbg=178
hi MoreMsg                cterm=bold            ctermfg=178
hi NonText                                      ctermfg=0           ctermbg=0
" hi NonText                                      ctermfg=58 
hi Normal                                       ctermfg=240         ctermbg=0
hi Pmenu                                        ctermfg=234         ctermbg=13
hi PmenuSbar                                    ctermbg=248
hi PmenuSel                                     ctermbg=233
hi PmenuThumb             cterm=reverse         ctermfg=243
hi PreProc                                      ctermfg=223
hi Question                                     ctermfg=223
hi Scrollbar                                    ctermfg=178         ctermbg=0
hi Search                                       ctermfg=248         ctermbg=234
hi SignColumn                                   ctermfg=14          ctermbg=233
hi Special                                      ctermfg=214
hi SpecialKey                                   ctermfg=223
hi SpellBad                                     ctermfg=16          ctermbg=245
hi SpellCap                                     ctermfg=234         ctermbg=103
hi SpellErrors                                  ctermfg=0           ctermbg=172
hi SpellLocal                                   ctermfg=236         ctermbg=225
hi SpellRare                                    ctermbg=13
hi Statement                                    ctermfg=227
hi StatusLine             cterm=bold            ctermfg=232         ctermbg=248
hi StatusLineNC           cterm=bold            ctermfg=250         ctermbg=233
hi TabLine                cterm=underline       ctermfg=242         ctermbg=0
hi TabLineFill            cterm=underline       ctermfg=242         ctermbg=0
hi TabLineSel             cterm=underline       ctermfg=186         ctermbg=0
hi Title                  cterm=bold            ctermfg=186
hi Todo                                         ctermfg=221         ctermbg=233
hi Type                   cterm=bold            ctermfg=221
hi Underlined             cterm=underline       ctermfg=166
hi VertSplit              cterm=reverse         ctermfg=232         ctermbg=238
hi Visual                                       ctermfg=15          ctermbg=235
hi VisualNOS              cterm=bold,underline
hi WarningMsg             cterm=bold            ctermfg=9
hi WildMenu                                     ctermfg=0           ctermbg=208
hi format                                       ctermfg=54
hi pinfoColorBlack                              ctermfg=0
hi pinfoColorBlink        cterm=reverse
hi pinfoColorBlue                               ctermfg=4
hi pinfoColorBold         cterm=bold
hi pinfoColorCyan                               ctermfg=6
hi pinfoColorGreen                              ctermfg=2
hi pinfoColorMagenta                            ctermfg=5
hi pinfoColorRed                                ctermfg=1
hi pinfoColorWhite                              ctermfg=7
hi pinfoColorYellow                             ctermfg=130

Reply via email to