changing vim's vertsplit character to │ - vim

This is, I assume, codepage related, but doesn't hurt asking.
How would one, on windows xp's cmd, gvim 7.2 change vertsplit character, so that instead of default | it is │ (so that it makes a full, and not an splitted line) ?
That character is usually changed with
set fillchars=vert:\|
and I can copy paste the ascii graphics line there, but it comes out as garbage. I suppose I would have to change vim's internal codepage for it to show correctly ?
Anyone knows how to do this ?

Ok, I'm really late to the party but this is what I do.
The way the characters are rendered depends on the font so you can get a continuous line using some fonts and not with others. I've found that using one of the following gives me an unbroken line.
Menlo
Monaco
Inconsolata
DejaVu Sans Mono
Consolas
Bitstream Vera Sans Mono
As far as settings go, the following is sufficient. Note that this is different from the | character commonly present on keyboards.
set fillchars=vert:\│

I've tried the following :
set enc=utf-8
set fillchars=vert:\│
And it worked, but the result weren't has good as you can hope, it's still not a full line (using the Consolas font, if you get a straight line with another font, I'd be interested to know which one).

This isn't exactly what you want, but I've set fillchars=\ and just use highlighting to color the blank space a different color. It's less elegant, but it looks fine to me.

Digging through the digraph table, I found that the "Box drawings light vertical" is perfect for this purpose. Vim's digraph table entry:
│ vv 2502 9474 BOX DRAWINGS LIGHT VERTICAL
To use it, press <c-k>vv in insert or command mode to get the character (see :h i_CTRL-K).
As pointed out by others, the setting is applied with set fillchars=vert:|

Related

Text showing misaligned in Vim vs Cat

I've been using vim for a few weeks, and so far I've downloaded a few plugins including airline, nerdtree, and a colorscheme. When I downloaded some files with wget, I noticed that they weren't properly aligned. Text in the code files are normally supposed to be aligned in columns, and there generally shjouldn't be issues with indentation. As an example, when I try running the command cat filename.extension, I get this:
This is how the file is supposed to look. Everything is aligned neatly into columns without any issues. However, if I try editing the file in Vim, it instead looks like this:
The text for whatever reason is not aligned properly, and so far I am not sure how to resolve it...
The file appears to be using tabulations for indentation and alignment.
The de-facto standard width of a tabulation is 8 characters.
cat respects that "standard" to the letter, without the possibility of changing the tabulation width.
Vim also respects it by default but it allows the user to change the tabulation width and you tell it to use a tabulation width of 4 characters.
The file looks different because the two programs have different tabulation settings.
Therefore, if you want the file to look the same in the two programs, use the same tabulation settings. Since they can't be changed in cat, you will have to revert Vim's to their default values.
You didn't show us your vimrc so we don't know exactly what you did and we can't really tell you how to go about it.

how to get the digraph key or unicode from a special character

I am configuring tmux & powerline. I would like to change the default separators in tmux status line. I managed to figure out where to do it, however I could not get the special character that I want.
I want to type, in Vim, a left/right pointing triangle that spans the whole line-height, but the only thing I could find is a small triangle (unicode : 25B6,25BA,25C0,25C4...)
There is a big right pointing triangle already in a powerline configuration file, which I could copy and paste, but I want to know its unicode and want a left one. Is there a way to get the unicode from the symbol in Vim or anywhere else?
You can get the codepoint value of a character in Vim by positioning the cursor on the character in question and typing either ga or :ascii.
You can either use ga in command mode or :ascii on the command line (even though it says ascii, it shows information for general encodings)
You may add a permanent preview of current character in your status line (see :h statusline), eg.:
:let &statusline = &statusline . "\ [%03b\ 0x%B]"

Make gvim markdown highlight ignore internal markers

I recently upgraded to gvim 7.3 and was pleased to find markdown highlighting. I also noticed that it treats "internal" _(underscore) as a marker. For example:
I want gvim to display emphasis here
but not_here
gvim actually displays the last line in my example as 'but not_here". It looks like SO's markdown interpretation is closer to what I want.
I do not say that gvim is "wrong" because I do not know what the correct markdown implementation is. However, is there a way to configure it so that the markers should be treated as normal text if they are surrounded by non-whitespace?
The runtime files (especially if you use the old Vim 7.3.000 / 046 installer found on vim.org) aren't updated frequently. Most plugin authors publish more recent releases elsewhere, and they are only occasionally picked up by Vim.
In Tim Pope's repository, you'll find a newer version (that you can install into your ~/.vim directory) that doesn't show the problem; instead, it even highlights the single underscore character as an error.
I have found a solution, which works in the things I have tested sofar.
Copy the %vim%/syntax/markdown.vim file into %/.vim/syntax/markdown.vim and change line 63 into:
syn region markdownItalic start="\s_\S\#=" end="\S\#<=_\|_\S\#=" keepend contains=markdownLineStart
Restart vim and it should match *this* and _this_ but not_this.
EDIT: Changed information, thanks to #ZyX
I had these issues when documenting code in markdown files.
The solution I used was to put the offending sections in a codeblock with four spaces or in a code span with surrounding back ticks (`).
Try to use Github flavor markdown: https://github.com/jtratner/vim-flavored-markdown

Plugin name for showing indentation guide in gVim

Anybody, any idea??
which plugin is showing the indentation guide in the image below. Downloaded from http://leetless.de/images/vim/pyte.png
.png
Thanks
A similar effect could be achieved with:
set list
set listchars+=tab:\│┈
Maybe with another filler character.
See :help 'list' and :help 'listchars'.
But…
As I was writing that answer it appeared to me that the answer was probably in the colorscheme's author's ~/.vimrc.
I think that you should really work on sharpening your deduction skills. It takes about 30 seconds to 1 minute to find that information by yourself:
Go to the site where you get that pic from: http://leetless.de
Look around for something Vim-related. The navigation is generally the first place to go and what do you find? "Vim themes" at http://leetless.de/vim.html
That image illustrates the first "theme" featured, that's a good sign. But let's read the introduction text (emphasis mine, typos his):
If you are curious what some other things are (like the indetation markers) and how they work, take a look at my .vimrc. Note that the encoding is broken with that file so the "set lcs" part is probably not copy-pasteable, follow the instructions in the comments above that line in order to find out how you can make your own unicode-lcs.
Wow! It looks like you are getting closer to the truth. Beware of the Cigarette Man!
Follow the link and do a search for lcs.
Done.
Not sure what you mean by "indentation guide", but I don't think any plugin is involved.
The first thing I see that you might be referring to is the characters at the beginning of lines indicating where there are tabs. That can be done by doing setting the listchars option to an appropriate value, turning the list option on, and selecting a color for the SpecialKey highlight group.
The other thing you might be referring to is highlighting of the column that currently contains the cursor. That can be done by turning on the cursorcolumn option. The color used for that can be set with the CursorColumn highlight group.
There's also a plugin, vim-indent-guides
Here's a nice plugin for vim: https://github.com/Yggdroot/indentLine

VIM: How to change the Showbreak Highlight color without using the NonText Color-element

I noted that the 'showbreak' symbol is highlighted with the highlight "NonText" color-element. NonText is also used for the EOL Characters.
I would like to keep the highlight-color for the EOL characters but want to change it for the showbreak symbol is that possible?
Another problem is that my showbreak symbol is not displayed.
I would like to use this symbol "↳" and put it in the linenumbers column (using set cpoptions+=n). I can't find out how to display the symbol and how to put a space after the showbreak symbol (between the text and the symbol).
Can anyone help me?
I don't think you're going to get highlighting to be different than the EOL character, at least I am not aware of a way to do that.
For the second part I can help with. I was able to get "↳ " to show up in my line number column with the following settings:
let &showbreak = '↳ '
set wrap
set cpo=n
Note that there is a space after the ↳. This lines up nice until you have > 9 lines in the file. If you wanted it to line up with the last character of the number column regardless of the number of lines I'm not sure what you're going to have to do.
Edit: I've recently written a proof-of-concept function for someone on IRC that highlights the first character on a line that has been wrapped with a different highlight group. It hasn't been tested much but it seems to work. Not exactly what you're looking for but maybe it's worth a look.
:help hl-NonText makes it pretty clear that you cannot have different colors for the 'showbreak' string and other non-text strings, of which eol is a member (see :help 'listchars'):
NonText
'~' and '#' at the end of the window, characters from 'showbreak' and
other characters that do not really exist in the text (e.g., ">"
displayed when a double-wide character doesn't fit at the end of the
line).
If you're willing to accept this limitation (#elliottcable) hi! link NonText LineNr will match the 'showbreak' string to the line number colors.
If you really wanted to get clever, as a compromise you could create a mapping or command to toggle between ':set list' and ':set nolist' that would also adjust the NonText highlight setting simultaneously.
If you use :set relativenumber (added in vim 7.3), :set showbreak=↳\ \ \ will reliably keep your 'showbreak' neatly lined up since the number width will not change as you navigate through the file. (This in addition to the :set cpo+=n and :set wrap #Randy Morris mentioned in his answer.)
You'll definitely need UTF-8 for the ↳ character, since it does not appear in other encodings. I'd strongly recommend you carefully document your encoding problems, with details about how to reproduce them along with your OS, its version, and the :version output of vim, and post them as separate questions. UTF-8 should be helping you wrangle multiple languages rather than being an impediment.

Resources