how to get rid of weird lines showing on my vim windows after omni completion - vim

Every time after using omnicomplete in vim it gives suggestions in a pop up after my cursor and when I'm done with it, it leaves a line along the pop up.. and it only goes away after scrolling the complete window once. It gets very annoying..
How do I get rid of this?

Maybe use CTRL-L? It should redraw the screen.
:h CTRL-L

Looks like a rendering bug.
Step 1: try downloading the latest Vim source code and compiling it
Step 2: see if the problem exists there
Step 3: if the problem still exists, report as a bug on the vim_dev mailing list ( http://www.vim.org/maillist.php#vim-dev ). Be sure to specify your Vim version, whether you're using terminal or GUI Vim, and on what OS.
Step 4: wait anywhere from a few days to a few years and maybe somebody will fix it

Related

vi not recognizing scrolling, scrolls terminal instead

I have an instance of vi on a remote server that is not behaving like it used to, and I'm not sure what made this happen.
On my local shell, (and the remote server before this started happening), if I scroll with my mouse/touchpad, it would navigate the cursor within vim. I have checked my .vimrc and there's nothing in it relating to the mouse, and I did not make any changes to it before this issue started.
The only thing I can think of is that a few weeks ago, I was trying to figure out how I could split two files in the same vi instance so I could yank from one file to another, and I tried some : commands that I didn't really understand (didn't get any productive results). And also, I ran tmux once, but I don't think there are any . files that are applying unwanted settings (not sure).
I can't find anything to check the vi settings being applied, but I know that my .vimrc is working, and it's not anything in there (if I comment everything out it still behaves this way).
I just want my vi to respond the same way.
Describing the problem more exactly:
If I scroll, the cursor doesn't move, instead it scrolls on the terminal window, and it shows the previous bash commands instead of scrolling the file being edited. If I navigate using vim keys, it still works.
Randomly, I discovered that it actually had to do with the a specific terminal instance that was causing the issue. Closed it, opened a new one, no issue now. If anyone has any insight on why this could've been, I'd love to know.
.vimrc applies to vim not vi, doesn't it ?
the problem of scrolling might come from your terminal emulator as well.
I usually use embedded terminal in VS code which is not ideal (since it's not made for administration ...) but it's practical with keybinds to jump from one window to another, copy paste ...
I know some colleagues who use, mobaXterm or mremoteNG on windows.
I know I should give a go to Terminator, but it's on linux only and I don't want to run a local vm just for that.

Sublime Text 3 - Double Tab Issue

I am using Sublime Text 3 and every time I press tab it will add an extra tab. My settings are to display tabs as an actual tab (not spaces) and is equivalent to 4 spaces. My issue causes a single tab to therefore create 2 tabs the length of 8 spaces.
For example, if I am trying to indent it will tab twice and I will have to delete one tab.
If I select a block of text it will indent it twice and result in the text being deleted and I have to undo it once to bring the text back.
Also, when using auto complete I normally hit tab to auto complete the first option. It will select the option and do a tab after it. I am not sure if this is an option or setting but its extremely annoying and I have not found a solution yet.
Sublime Text double tabs on tab key press
Sublime Text deletes/removes text on indentation / tab
Both problems are due to a popup (most often the SFTP free version popup for me) hiding in the background. If you make sure to close the popup windows every time they appear you will not get these issues. You could also pay for Sublime or the plugin to remove the popups.
In OSX you can't focus back on Sublime Text without clicking on the popup, so you will never have these problems.
I just had the same issue. I just restarted Sublime and it worked again, no need to reinstall or change any settings.
I just encountered this problem recently, and it appears to only happen on Windows. In my case, the pop-up "Hello! would you like to purchase sublime?" was open in the background, and that caused this issue for me. Once that pop-up is closed, everything works just fine.
Although the question is three months old at the time of writing, this might help people that are still looking for an answer. After having this issue for a while, it annoyed me so much that I traced back the issue.
The double tab issue only happened after a while, so I figured it was triggered by a certain key combination, being pressed wrongly. I've also noticed that the bug only occurred at Windows, not on Linux (Ubuntu).
After disabling all Sublime Text 3 plugins one by one, I've noticed that, for me, SFTP triggered the bug. This happened upon saving, SFTP started uploading, and displayed a evaluation notice. As I've purchased SFTP (and activated it), the double tab bug never occurred again. Even after enabling all other packages, the double tab never troubled again.
This is only one solution to the problem, your problem might originate from something else. Try to disable packages which might cause the problem and try to find the problem that way. It's a lot of work, but might get you the solution.
This solution worked for me on windows:
Just go to
View -> Layout -> Single

Visual Studio: Undo-redo of replace-action does not scroll editor window

I did some find-and-replace actions in my C++ code with visual studio:
only single find-and-replace actions (did not use “replace all”)
only one file affected (did not change multiple files at the same time)
thus, a very simple case!
Then I wanted to undo these changes. So I pressed ctrl-Z one time. This had the desired effect. The latest change (which was still visible in the current screen) was undone.
But I also wanted to undo the remaining changes. These changes where currently not visible on the screen. So I expected the editor to scroll there when pressing ctrl-Z.
But unfortunately the editor did not scroll to the position of the undo when I pressed ctrl-z.
The undo worked, however. I checked by scrolling to the position manually.
Then I tried it with redo. Same result: Redo worked, but the editor did not scroll to the position of the redo.
Finally I tried if this also happens when I undo-redo other types of changes (not made by the “find and replace” functionality).
Result: Undo-Redo worked correctly and also scrolled correctly!
Thus: It seems only changes by the “find and replace” functionality are affected by this problem.
Did you also have this problem and found a solution?
Please help me!
Regards Gerhard
I am having the same thing happen in Visual Studio Ultimate 2012 (Version 11.0.60610.01 Update 3).
It might sound like it's not that important, but it is really hurting the usability of this otherwise great IDE!
PS I've been using VS since the 90s, I still haven't found anything better. I wish MS would put macros back into VS, even if it's VBA (or Python)

In Vim, why doesn't my mouse work past the 220th column?

I tend to maximize a terminal to one screen, and vertically split several windows in Vim. Everything works fine for the first few windows on the left, but clicking past about the 220th column in the terminal doesn't work correctly. Any mouse clicks past column 220 seem to be wrapping around to column 1. I've tested in xterm, urxvt, and Gnome terminal with and without tmux/screen; always the same behavior. If I greatly increase the size of the font in Gnome terminal, I can click on the last column (although it is no longer past column #220).
If I run a command in a terminal that prints to standard output, I can click all the way to the right of the terminal. The problem does seem to be related to Vim.
I have set mouse=a in .vimrc. I'll post the entire file on request, but it doesn't seem to have anything else related to the mouse.
It's probably irrelevant, but I'm running Xmonad+Gnome. Thanks in advance.
This has been fixed in Vim 7.3.632. See :h sgr-mouse. Or just put this in your ~/.vimrc:
set ttymouse=sgr
If you want to be compatible with versions that don't have mouse_sgr compiled in, use:
if has("mouse_sgr")
set ttymouse=sgr
else
set ttymouse=xterm2
end
To see if your version of Vim has mouse_sgr, run vim --version from the command-line, or in Vim, enter :version, and look for +mouse_sgr.
If you're using older versions of screen, or terminal emulators that don't support SGR, you may need to upgrade or switch. These settings work with all new versions of screen, tmux, gnome-terminal, PuTTY/KiTTY, iTerm2, and Terminal.app, using TERM=xterm-256color or screen-256color.
Update: If you're using neovim, SGR support is enabled by default.
Edit:
I deleted the bug report, as that tracker was for the website, not the text editor.
In looking in the correct place for an existing bug report, I found this:
http://groups.google.com/group/vim_dev/browse_thread/thread/4c137e64d2032441/b3993eaa89589619?lnk=gst&q=mouse#b3993eaa89589619
To summarize, it was an xterm limitation that has been lifted. However, Vim does not yet support columns longer than 223.
Original:
This seems to be a bug, as supported by comments made by redstreet. I filed a bug report:
https://sourceforge.net/tracker/?func=detail&aid=3389331&group_id=27891&atid=391887
A few years later, the bug still seems to be present.
The solution I found is neovim: a modern refactor of vim. Among other features, this bug has been resolved.
I simply copied my .vimrc into .nvimrc, and my plugins just worked with nvim. Maybe I'll just keep using that.

Whack vim screen drawing errors

Something extremely weird is happening when I open files in vim, and I can't remember doing anything that would have caused it.
Weird behaviors include:
no text being visible until I highlight it in visual mode, at which point it is visible from thereon. ":redraw!" does not make anything visible.
line 1 missing
occasionally the cursor appears one line below where it is editing
statuses become permanent and scroll up from the bottom, rather than just redrawing at the bottom
the vim text not extending to the bottom of the vertically maximized window
I lack the reputation to post screenshots but I'll happily provide any other information that could help in a diagnosis.
ETA: Ah! My .vimrc specified a column/row size. I've removed that line, and so far things are behaving well. Thank you!
vim is terminal based, and errors like this happen when the terminal you are using does not match the terminal vim thinks you are using. Most people use vim with terminal emulators. This kind of thing can happen when you resize the emulator window and vim does not find out about it, or more rarely, when the terminal-identifying-string specified in the environment does not match the terminal emulator you are running.
Without more details about the platform on which you are running vim, it is hard to be more specific-- but as a tip: don't resize the emulator window after it is created but before running vim.
Terminal emulators are supposed to communicate size changes back to the program running within them, but this is not 100% foolproof, especially when you are logged in to a remote machine within the emulator.
If you're doing this from a UNIX (Linux et al), try running :!resize to force your terminal to re-adjust its size parameters. At the very least it'll tell you what the system thinks your window is sized to, which may not match its actual size.
I had a similar problem when using vim with bash. When I switched from bash to zsh, it gave redraw errors where, while I typed, the cursor or screen would appear to go down one row for every 10 characters I typed. Scrolling with arrow keys also caused major display problems along the same lines, but worse.
I had this line in my previous .vimrc, I believe it was to set the color for vim
set t_256
I changed it to set term=xterm=256color and the problem went away.

Resources