the listchars feature is helpful for the intended purpose; however it is problematic to use with copy/paste, well because of how it works, generally we would not want listchars included when we copy text.
would it be possible to use a colored reverse space, a background color as a listchar symbol? that way, we see the function of lischars but we don't pickup the listchars when we copy text.
as an alternative I ":set nolist" but I find myself needing to do it a lot...
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
You can do that already:
:set listchars=tab:\ \
" pick some nice colors, probably depends on your colorscheme
hi NonText guibg=#3e3e3e
Also, you may want to check how to copy without visually selecting the buffer content with a mouse, so that you do not select the listchars (e.g. copying to system clipboard using :yank +
in a clipboard enabled vim)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
Are you using gvim or Console Vim? If the former, with which GUI, if the latter, in which terminal?
In gvim with GTK3, I use
set list listchars=eol:¶,tab:\|_,extends:>,precedes:<,conceal:*,nbsp:·
(with a backslash to escape the vertical bar in the :set
argument)
yet when pasting to another program (using "+y$
at the start of a line then Ctrl-V in that other program) all those characters (and in particular the vertical bars and underscores for hard tabs) are not carried over.
If you are using Console Vim, my guess is that you are using the terminal's copy function. In that case, try using gvim instead.
Best regards,
Tony.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
Hi all, thanks for the careful and quick feedback!
Indeed, I use Apple Terminal, or iTerm2, no xterm, or gvim options right now.
I've tried this before, and left out an important nuance in my request, your feedback gave me quick focus on the issue. Here is a development of the request, per suggestions. My initial relevant configuration:
set expandtab
set tabstop=4
set listchars=tab:<->,multispace:~,lead:-,leadmultispace:\ \ =\ \ \ +\ \ \ -\ ,trail:^,extends:\\,precedes:\/,conceal:<,nbsp:%
set lbr list autoindent breakindent showbreak=\ \ \ \ \ \
hi NonText cterm=none ctermfg=23 term=none
I use listchars, especially leadmultispace, and "vim yank" lines without issue, however when I mouse copy, I pickup the listchars too (undesireable). For reasons I cannot explain, highlight NonText does not color my listchars, but SpecialKey does. Indeed I am able to use :hi SpecialKey cterm=reverse
for the reverse effect.
hi SpecialKey cterm=reverse ctermfg=52
that reverses all of my listchars, but does not solve a more careful issue restatement: I need multiple colors within the listchars env, so for example, reverse space characters are intermingled with regular space characters in leadmultispace, to facilitate column counting, tab and multispace may be distinguished by different color reverse spaces, likewise for the other types.
I have used up my User1 - User9 color presets already, the feature I am looking for is akin to:
set listchars=tab:1,multispace:2,lead:3,leadmultispace:\ \ 4\ \ \ 5\ \ \ 6\ ,trail:7,extends:\\,precedes:\/,conceal:<,nbsp:8
where the numerals represent separate distinctive reverse space colors.
Not a trivial ask, I'm sure, but it is my only lingering vim wish, so I thought I'd inquire if it is possible today, or for the feature queue?
@chrisbra your suggestion regarding
+clipboard, +xterm_clipboard and +X11 features enabled, and has "mouse=a" and "clipboard=unnamed,autoselect,exclude:cons\|linux"
might work on personal systems, I will need a rebuild to try, but +X11 etc is not usually available.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.