vim powerline in windows 7 - windows

I am trying to install VIM Powerline on window, I found a comment which supposed to fix how it looks in Windows, but encoding of the comment is broken by itself...
The link to the blog post.
I had the same problem on windows. As an alternative to editing “vim-powerline-develop\autoload\Powerline\Functions.vim”, you can also add this to your vimrc:
let g:Powerline_mode_V=”V·LINE
let g:Powerline_mode_cv=”V·BLOCK”
let g:Powerline_mode_S=”S·LINE”
let g:Powerline_mode_cs=”S·BLOCK”
I don't know how to type the cdot operator in my keyboard (sorry for the name, I guess I am too much into Latex ...).
So, what am I supposed to do to make VIM behave under windows?

To get the middle dot, the easiest and pragmatic way would be just pasting it from the clipboard.
For direct text entry, you can enter by the character encoding's numerical value: <C-v>183, see :help i_CTRL-V_digit. On Windows, you often need to use <C-q> instead of <C-v>.
Vim also has a feature called digraphs for quick entry of special characters. The middle dot would be <C-k>.M.
For any of these to work, your text encoding must support the non-ASCII character. Best use a value of
:set encoding=utf-8
and ensure that your ~/.vimrc is UTF-8 encoded.

Related

How to use vim as less -R? [duplicate]

Recently I've discovered a wonderful terminal multiplexing tool called gnu-screen.
I'm satisfied with it completely. But I've encountered one inconvenience I'd like to improve.
'C-a H' command makes screen log everything to a log file called named 'screenlog.*'.
But encodes control characters in a weird way. For example if you open the log file with 'less' you might see some cryptic characters and the log file is unreadable. You have to run 'less -r' or 'less --raw-control-chars' which helps to encode those control characters correctly.
So far so good. But if you want to edit the log or read it with vim then you encounter the same problem with control characters.
I've googled this problem and looked up at SO but I've been overwhelmed because there's so much info about vim and screen. Unfortunately I haven't found the solution yet.
Perhaps you know the solution for this problem or some workaround.
UPD
Thanks to Frédéric Hamidi's comment I discovered those characters are the terminal escape sequences of font color, etc. Vim as an editor sees them and by default edits them. The plugin Frédéric suggested tells vim to interpret them.
To provide an answer here and finally mark this fixed: The AnsiEsc plugin adds syntax highlighting for ANSI color sequences. So instead of seeing ^[[30m; the following text will be highlighting in the corresponding color, just like when using less --raw-control-chars.

Im using vim to check man page, and there is some weird character,how to make it normal?

I'm trying using
man ascii | vi -
to check ascii manual with vim,
then there are some weird character like '^H'
weird character in vim
how to make it normal?
EDIT:
i think this is due to some wrong config of my vim, or terminal,
because i tried some other machine,and it works fine,any body help?
What you're seeing here is the man page convention for typesetting bold and underlined characters.
The ^H character is the "backspace" or BS character, which you can find in ascii(7) as ASCII 8.
Displaying as ^H is a convention to indicate "Control-H", the caret being a symbol for the "Control" key, since that's a key combination that generate this control character (note that "H" is the eighth letter, also it's on the same row as BS in the ASCII chart at the man page.)
Also note that ^H here is a single character and not the separate ^ and H characters. If you move along that line with l motion repeatedly, you'll see Vim skips the Hs. Vim might also display them in a different color to make it clear they're special characters.
The effect you're seeing here is called overstruck characters and it comes from the days when computers would be connected to line printers rather than screens. Man pages were created early in the Unix days and are typeset with a program named nroff (which has roots that predate even Unix) that uses these sequences to encode its text decorations, even to this day.
So one way to make text bold (or, print it stronger) was to print a letter, back out one space, then print it again. In your example, N^HNA^HAM^HME^HE is being used to print the word NAME in bold.
Typically, you'll use a man pager program that knows how to handle those sequences. For instance, less has specific support for overstruck text and is able to recognize those sequences using backspace (or carriage return, also possible to use it for that) and convert into bold or underline text using terminal escape sequences which actually achieve those effects in a terminal.
If you're using a different pager, often you'll use col -b to strip your text from those sequences. (See col(1) for details.) Note that col -b doesn't produce terminal escape sequences around overstruck text, it simply removes all overstriking, leaves the text plain, so any text reader can display it.
(In that sense, man ascii | col -b | vi - is one possible way around your issue, but not the best one.)
Vim doesn't support overstruck text or terminal escape sequences in text it receives as input. So the approach used to use Vim as a man pager is to strip all overstriking (same as col -b does) and then use Vim's syntax highlighting feature to mark man page sections etc. (So instead of seeing the original markings typeset into the man pages, those are all being stripped and you're actually seeing Vim syntax configuration for man pages.)
This is accomplished by the manpager.vim script, which is shipped by default with Vim and which registers a :MANPAGER command that you can access as vim +MANPAGER -.
You'll see that part of what that does is to remove overstriking, same as col -b does. It also sets the file type correctly and enables syntax highlighting, setting up Vim as a suitable viewer for man pages.
I think this is due to some wrong config of my vim, or terminal, because I tried it in some other machine and it works fine there.
I'd say this is most likely due to the man pages being typeset differently between the two systems.
Man pages themselves and the pipelines used to generate them from the source code are not very uniform and you'll find differences across operating systems or even Linux distributions.
It's possible that on your other system all man pages get stripped using col -b at creation time, or that man will strip them when piping them to something that's not what's set in $MANPAGER, or even that they don't have anything marked as bold or underline in their sources.
Hard to tell exactly which (your reference to working fine on another machine lacks details to tell), but this would be my bet.
In short: To use Vim as a pager for man pages, instead of piping them to Vim, set it up so that man will run vim as a pager itself.
In Vim, see :help manpager.vim which has instructions on how to set this up.
In short, all you need is to add this line to your ~/.bash_profile:
export MANPAGER="vim -M +MANPAGER -"
After setting that up and logging in again, all you need is:
$ man ascii
And man will launch vim in the right mode for you.

How to enable OS X cmd+ctrl+space character menu in Sublime Text 2?

In most OS X apps, even the Terminal which otherwise seems to lack features, cmd+ctrl+space brings up a character menu, where you can type in the name and look for special characters (e.g. greek alphabet). In Sublime Text 2 this does not come up; I just get the bell sound. I tried the trick described Unmap ctrl+space in Sublime Text 3 of mapping the key to the empty command, but that did nothing. Anyone have an idea of how to enable the menu?
The default shortcut for this in ST2, of course, is alt+super+t, but I assume you are wanting to remap this, right?
If so, I looked pretty hard on this one, unfortunately, I couldn't find much to help. It is not a default command, and even if you look inside Packages/Default/Main.sublime-menu, right where the "Special Characters..." line should appear, it is conspicuously absent. Logging all commands in the console using sublime.log_commands(True) shows nothing when I open the special characters window this way.

Is there a way to change the keyboard layout in Vim on Windows?

I am working on several documents where I have to type [ ] { and the like (which is much easier with with an american keyboard layout (and to which I am used much more)) but where I also have to type Umlauts such as ä, ö and ü.
Usually, I go be setting up the (what I believe to be a standard) Windows Shortcut Alt+Shift to switch between these layouts.
This is unpractical, because at times I am not sure if I am already in the german layout when I need the german layout (and vice versa).
So, is there a better way to change the keyboard layout in Vim on *OS-level"?
I guess it could be solved with changed :map and :imap but I'd rather not use these for such porposes unless really forced to.
I don't think there is such an option - even though vim can even make pancake for you!
It'd be highly unlikely for any program to allow changing the keyboard layout of regular keys since basically any OS already supports it.
I am not sure if I am already in the german layout when I need the german layout
Do you have the language bar enabled? It should have an icon that represents your current settings.
Microsoft Knowledgebase article: HOW TO: Use the Language Bar in Windows XP
If the only thing that you need is to add umlauts easily, Vim has built-in support for adding these characters:
Method 1. In insert mode type: CTRL-K a: to give ä.
Method 2. If you use :set digraph you can enter a<BS>: to give the same result.
These methods will work with any character that needs umlauts, just use CTRL+K o: or CTRL+K u: respectively.
Source: http://vim.wikia.com/wiki/Entering_special_characters
Maybe you could be interested in some Dvorak layouts (mine is bépo, maybe it could suit you?)

Visual Studio stack trace in notepad++

This is probably just a setting I'm not seeing, but when I get a stack trace out of Visual Studio's exception helper dialog, it has \r\n after each "line" in the call stack. When I copy this and paste it into Notepad++, it shows up as literally \r\n, visible in the document. Of course I'd like these to be interpreted as CR LF, so everything's on a different line.
Anyone know how to do this?
I know this question is old, but maybe someone will find the solution helpful.
Open find and replace, and
go to the replace tab
In the find box type \\r\\n
In the replace box type \r\n (both without quotes)
Make sure the Extended search mode is selected in the bottom left.
Finally, hit replace all.
.
It took me a while the first time to find the setting. It's View >> Show Symbol >> Show All Characters.
This sounds like a Notepad++ bug. I can paste into regular Notepad and UltraEdit without the side effects you describe.
Like Cerebrus says, you can workaround it on the Notepad++ side by using its search/replace facility.

Resources