Vim Ctrl v column selection issue on macOS Sierra - vim

I am trying to use vim (Vi IMproved 8.0) on macOS Sierra for the first time and I noticed that a column selection in visual mode does not work properly.
Typing Ctrl+V toggles visual mode on, and by moving left or right I can make a horizontal selection as usual.
For example, here I selected 'no play' on the second line
However moving cursor down, instead of selecting a column, selects the current second line until the end and the next line is selected from the beginning to the cursor position.
I am guessing that this issue might be associated with the Terminal setting, rather than with bad settings in .vimrc since removing .vimrc does not change this behavior.
Moreover, I can ssh into a remote computer and still experience the same issue, even though vim on that remote computer works fine if I use a different computer to ssh into it.
I would appreciate any suggestions or tips on how to address or understand this issue.

Related

Avoiding paste content to be executed in normal mode in Neovim/WSL/ConEmu

I've started using Neovim on Windows/WSL through ConEmu. It all works pretty amazingly except one pretty major flaw:
When I paste content into Neovim and forget to enter insert mode before, Neovim will register the input as keyboard strokes and execute them as commands. Needlessly to say, this can get pretty ugly, pretty fast.
A contrived example for clarity: I need to copy some text from my browser. The text in question is "sp" (yes, this is completely stupid, but bear with me). As I paste this into ConEmu (CTRL-V), the terminal transfers the input to Neovim that parses it as commands because it's in normal mode. In this example Neovim will replace whatever character is at the cursor at the time with p.
Vim for Windows has this solved and will paste the content without changing mode (how does a pure Linux environment handle this?). The problem with that solution is that it is dependent on the Windows file system which is a lot harder to tweak/maintain compared to apt-get/Ubuntu/WSL as well other annoyances.
So, initially I thought I'd try to make Neovim detect if the input was directly from the keyboard and not any other source, if it was, switch to insert mode and handle it from there. But I'm frankly not sure if this is even possible (especially though WSL). I also tried to add a shortcut that makes Neovim enter insert mode on CTRL-V in the hopes that is would trigger first and then correctly paste the content.
Maybe I need another terminal than ConEmu?
Anyway, I'm out of ideas, hope you guys can help.
ConEmu shall not detect any "internal" modes of the application you run in the terminal. Actually, when you "paste" something, terminal does almost the same thing if you press same keys manually.
Well, except one major difference: ConEmu uses "bracketed paste mode", so the console application may determine if user paste something or press keys manually.
So, it's the question to Neovim how to process/configure bracketed paste mode inside it.
In ConEmu settings, Keys & Marco -> Paste
There is an option:
Multi-line paste: avoid unexpected command execution by < Enter >
keypress
That's what you need.

Vim not updating lines in quickfix windows under under Cygwin

I have Vim 7.4 and it has a strange issue in a quickfix window when using Vim in Cygwin.
When moving downwards, everything if fine. When moving upwards, however, once my cursor is on the top of the window (not the top row), from then on every movement upward only updates the row one row below my cursor gets updated; the rest don't.
By pressing Ctrl+L and refreshing, the rest of the file gets updated properly. But the fix doesn't stay.
What is causing this and how could I fix it?
Facts:
TERM is xterm-256color
Mouse support works. This isn't quite relevant except it should demonstrate that vim, tmux and my terminal emulator are all configured fairly well in general.
This happens even with an empty .vimrc
The terminal emulator I am using is MinTTY
Trying to reproduce it doesn't work. It happens in my Tmux session with 10 tabs open. But when I try to open another MinTTY with Tmux, the issue doesn't happen
When trying to record the issue with Asciinema, the issue still comes up, but when looking at the recording, the issue is not seen there.
One of the symtoms are that while using Vim, sometimes the contents of the lowest row (tmux tabs) are copied to vim's lower statusline row until the next full redraw of the screen.

Somehow toggled relative-only numbering from hybrid numbering in Vim

Well, I was messing about in Vim experimenting with new (to me) commands, as I'm just learning my way around, and when I was using gtand gT to bounce between tabs, I somehow did something to switch my line numbering. I've been using hybrid line numbering, with the current line's absolute number showing and all others relative, but now (on just the one tab, mind) it's all relative, with a '0' on the current line. Also, using gt or gT on just that one tab seems to hang up unless I hit ESC.
Any ideas on what I did and how to fix it would be appreciated!

centos vim: how to make it better?

Hey I have a centos installation, but I found the vim within it is quite worse than the one in ubuntu. I don't know why. I have copied the configurations from ubuntu but the behavior is still not the same, the difference:
I can't use arrow keys in insert mode, when I press "UP", the 'A' will be inserted into the content, and vice versa for all the other arrow keys, what should I set to make arrow keys working right in insert mode? (In view mode it's ok).
I can't copy a line using 'yy' and then close it and then open another file and then 'p' paste to the opened file. Looks like no clipboard suppored across multiple files.
I can't use history feature(I can't go the the line number that I visited last time, the cursor will always go into the first line when I open the last opened file)
I appreciate the helps!
Try this:
in the ubuntu machine, open a file with vim
and do
:mksession ubuntu.vim
put the file ubuntu.vim in the second machine, where you would type the following:
vim -S ubuntu.vim
if you now have the same behavior you just need to check what you need to add in
your .vimrc from the file ubuntu.vim.
If you don't have the same behavior maybe you will have some errors while loading the file...

vim -- copy to system clipboard in OpenSuSE

I've tried the methods mentioned at Vim: copy selection to OS X clipboard, but neither the * or + register seem to be working for me. I'm on OpenSuSE 11.3, and have vim and vim-data installed (there is no vim-full package as mentioned in the link in SuSE). I've tried with Klipper enabled and disabled. (edit) I've also tried pasting with ctrl+v and middle click.
Thanks in advance.
See if you have something called vimx, an X enabled version of vim. You can alias vim to that, and then use * register.
This is a superuser question.
I presume that you are running VIM in terminal and talk about VIM's visual selection, not selection with the mouse in terminal window.
Since in your case VIM isn't aware of the X, it obviously cannot communicate your selection to the X Window System. If you select something in terminal window with mouse, then you are selecting not in VIM, but in the terminal emulator which is aware of the X and communicates properly the current selection to X's clipboard.
You can try to play around with xsel tool which allows one to access the X clipboard from command line. You would need to override the usual clipboard shortcuts to not only put the content of the visual selection into the usual VIM register(s), but also to pipe it to the xsel so that it becomes the new X selection. (Strangely enough, I do not have the xsel installed on the SLES10 system I have right now at hand.) That obviously would only work if (1) the terminal is running locally or (2) remote server you are connected to allows the X forwarding. If the X forwarding is disabled on the server where you edit the files, then you have no chance to do in VIM: only selecting with mouse in terminal window would work.
Check synchronize contents of the clipboard and the selection in the clipper configuration.
Highlight text with the mouse (will not work with vim key selections).
Your selection is in the clipper.

Resources