I'm afraid asking this silly question but google looks like has no answer for this.
Every time I run VIM in terminal it automatically opens "help.txt" file with sp(split screen) mode.
It says "help.txt" "help.txt" [readonly] 217L, 8055C
Does anybody knows how to fix this problem?
in my case it was because I am using app called caffeine (prevents PC from sleeping) which is simulating pressing F15. After I change it status to inactive, it stopped opening vim help in terminal window.
Try running:
vim -u NONE
If this help file doesn't appear when doing that, then there's something in a vimrc file somewhere that is opening the help. Check in:
~/.vimrc
/usr/share/vim/vimrc
/etc/vimrc
...and anywhere else you might find a vimrc file on your system.
if you run
$ vim -u NONE
and the issue persists, maybe (like in my case) is some software simulating a key press to prevent the system from sleep.
try to change it for another key, like shift, and not f15.
good luck!
Related
I'm a Neovim user
and I want to move by page for fast movement.
I found these commands, but for me only ctrl-u(half-page up) is working
I reference this page
Ctrl-D move half-page down
Ctrl-U move half-page up
Ctrl-B page up
Ctrl-F page down
How can I figure out the problem?
The problem is except ctrl-U, nothing works
where can I check these default key map in my setting?
I suggest starting your vim with no configuration to know if the problem is on vim or in your config files:
nvim -u NONE -U NONE -N -i NONE
Now test your shortcuts, if everything goes well try analyzing your settings
I also suggest a second test, try opening your vim in another terminal emulator, this issue can also be caused by your terminal. (These final paragraph was also in the comments and helped figuring out the problem)
Seemingly randomly, when I press dw to delete a word, it will go into insert mode instead of staying in normal mode. I cannot figure out the logic behind this switch and it's getting real annoying
I first noticed this on the the VS Code Vim extension. I then went to Vim itself and found that it was also doing this anomaly. This also works with multiple keyboards and multiple computers.
Note that my installation of vanilla Vim is through Git for Windows, through cmder.
Is there a rhyme or reason to this? If so, what is it and why does it do that?
Edit: Turns out I was actually hitting cw instead of dw. Thanks to mMontu for helping me figure out my mental issues. lol
tl;dr: Nothings wrong, just a EBKAC error.
As noted in the comments, it is this is happening on completely different editors. My guess is that you (or your keyboard) are inserting some other command.
You could leave the recording turned on, and when you notice the issue again you can check what keys where sent to vim:
qa -> start recording on register a
<use vim until the issue happens>
q -> stop recording
:register a -> list the keys recorded
Another option is to save all the keys typed in a separated file (which may be better if it take a long time to reproduce the issue:
vim -w script file.txt ...
More details about this approach at :help -w and at the end of :help 26.4.
It is worth trying to reproduce the issue without any settings or plugins,
vim -u NONE -U NONE -N -i NONE
, as explained in :help faq-2.5. As you are on Windows, you will need to open a cmd.exe and enter something like <path to executable>/vim.exe -u NONE -U NONE -N -i NONE (or gVim.exe).
You also mentioned are installing Vim from Git. If everything else fails, check if it also happens with the binary available from Vim website.
I have recently noticed a side bar at vim terminal that scrolls all they way to the first command I ran to get vim started. Every time I open an file using NERDTree or close a file I am still working on the same terminal, but the previous snapshots of vim are saved in terminal history. I can scroll all they way to the top and look at every vim command I ran and what file was open during that command.
I have never seen this happen before? Can I turn it off? If I press :q the file that was currently in the terminal shifts up and the new files shows up at the bottom.
Thanks to FDinoff I found the problem. The "term" variable was set incorrectly. I went to my vimrc file and commented out the exact line with "term" and vim now works perfectly fine.
I had rather a lot of text on my clipboard whenever I accidentally right clicked inside Putty (with Vim open), and Vim has initiated a paste operation which has been going for around ten minutes now.
I don't want to lose my unsaved work, is there a way to instruct Vim to stop pasting text?
If you're in normal mode, Ctrl-C aborts the current command in progress. Then press u to undo anything that changed before you stopped it.
Depending os your vim configuration, there's chances that you have a swap file (backup) in .nameOfTheOpenedFile.swp (substitute nameOfTheOpenedFile with the name for your file).
To recover the file :
vim -r .nameOfTheOpenedFile.swp
I know this is really old but the top answer is not right and I was clearly having a similar issue to OP. (accidentally pasted like a million lines of json into vim)
Keep in mind this may not allow you to save your work (but you can probably salvage something from the .swp file)
All you need to do is open a new terminal window and enter pkill vim into the command line.
I've just added vim to my current Cygwin installation, and it doesn't work properly.
The problem is: when I type vim <Enter> it opens Vim with the help splash screen (in color) - OK.
I then try to exit with :q , and it sleeps a couple of seconds, then it exits but when I type a character at the command line it pre-pends a spurious string (6c6c). Other similar issues when I try to edit a file in vi instead of exiting right away.
I suppose it is a color/TERM issue, but I don't have much experience in that kind of stuff.
Thanks for any help.
What terminal are you launching vim from? I'd suggest using rxvt. This solves many issues with ncurses type programs.
Sometimes people change their TERM variable. Generally, you shouldn't do this, so long as your environment has the correct termcap installed, this isn't needed. If your use rvxt your TERM variable will default to 'rxvt-cygwin-native'.