Lev Lvovsky wrote:
Can anyone suggest the best way to be able to highlight tabs (versus softtabs) selectively? meaning, at the push of a button I can have that feature turned on, and pressing it again turns it off - all the while not messing with my search buffer?

thanks!
-lev


Method I.
---------
/\t
        highlights all hard tabs in "Search" highlight
:noh
        clears
BUT: clobbers search register

Method II.
----------
:match Todo /\t/
:match none

Method III.
----------
:setlocal list listchars=tab:\|_,eol:¶
:setlocal nolist
        - local to window: setting can be different in parallel windows
- the first character position is different from the rest, allowing easier counting of hard tabs

In each case, you can map the "on" and "off" commands to a pair of "related" keys such as e.g. F6 and Shift-F6. Example for Method III:

        :map    <F6>      :setl list lcs=tab:\|_,eol:¶<CR>
        :map    <S-F6>    :setl nolist<CR>
        :imap   <F6>      <C-O>:setl list lcs=tab:\|_,eol:¶<CR>
        :imap   <S-F6>    <C-O>:setl nolist<CR>


Best regards,
Tony.

Reply via email to