Vim autocomplete not working using the key combo - vim

i am trying to use the auto-complete feature in Vim. When i tyr to use it using the key combo crtl + n
i end up with character ^N on the screen. Apart from that i am also missing various features like search highlight it does'nt show.I am not sure of what is the reason for this pleas find the image,which i am trying to do autocomplete in a file
click here for the snapshot

Please share your ~/.vimrc or ~/.config/nvim/init.vim so then we can see if you have any problem with them.
I started my neovim with nvim -u NONE -U NONE -N -i NONE and the key combo Ctrln worked nicelly.
You can also run a command to check your key combination:
:verbose map <c-n>
This will show if you have any plugin or function set to this shortcut.

Related

How to move page and half-page in neovim (default key is not working for me)

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)

How do I map <CTRL-R> to be used by vim in Pycharm

I have a simple but annoying problem. I want to be able to use the CTRL-R vim command in Pycharm with the IdeaVim plugin. However, Pycharm uses that to do its own run command.
So I tried removing the mapping for Pycharm for CTRL-R, now I want to map it to Vim but when I go to keymap I cannot see any mapping available
Anyone have any solution, maybe remapping to another key combination?
EDIT
As per #Andrey's suggestion, I checked the vim emulation settings and no option, please see the screenshot below. Could this perhaps be done in the .ideavimrc file like remap to another key combination
PYCHARM SCREENSHOT
IdeaVim doesn't use "Settings | Keymap". It tries to install its own key handlers for Vim shortcuts. If there are any conflicts between the IDE keymap and the IdeaVim keymap, they are shown in "Settings | Other | Vim Emulation". For any shortctut there you can choose either the IDE handler or the Vim handler.

How to disable wrapping pasted text in search line

I got "additional" functionality either from vim or some plugin. Recently I updated vim to 8.0.216 and updated all my plugins. The "additional" functionality I get is when I search for string in a file with / and paste, for example "term", the resulted pasted text become <PasteStart>term<PasteEnd>.
How can I disable this annoying functionality?
I tried to disable all my plugins and removed .vimrc completely, but the wrapping is still there. Is this something new build to vim?
Edit:
I use iTerm2. Tried in buit-in terminal - its the same.
I saw somewhere this is related with tmux. Removed tmux and loaded fresh console. Same.
I am using oh-my-zsh if this could be related.
Edit2
I use shortcut commands for both copy and paste.
I have found three possible workarounds:
1, Use iTerm's Paste special and uncheck the Bracketed paste mode. Unfortunately, that's 3 extra clicks.
2, Use the Bracketed paste plugin, or add the relevant commands to your .vimrc:
execute "set <f28>=\<Esc>[200~"
execute "set <f29>=\<Esc>[201~"
cmap <f28> <nop>
cmap <f29> <nop
3, Create an alternate shortcut to paste with Bracketed paste mode disable:
Go to prefs>keys
Click the +
Select the keyboard shortcut field and press ⌘⌥v
For Action, select Paste…
Select the desired options. E.g. Disable Bracketed paste mode.
Press ok
Source of alternative shorcut.
NOTE: You could simply re-bind the Command + V.
The answer is: update your Vim.
Apparently it's a bug and updating Vim (to 8.0.0237) has solved it for me.

jumping with Ctrl-] in vim does not work

I am working with vim on debian.
When I press ctrl-] vim beeps, inserts a new line and goes to "visual block". It does not jump to tag. The same happens with :ctrl-]. Even in insert-mode with ctrl-] vim exits from insert-mode, insert new line and goes to 'visual block'.
But when I use such lines in .vimrc
nnoremap <F3> <c-]>
vnoremap <F3> <c-]>
jumping with F3 works.
Command :verbose map c-] returns No mapping found
update:
As we have discovered in insert mode we can see how vim is interpreting <c-]>. In insert mode after <c-V><c-]> the correct output should be ^] . But my output is
t
^C
Screenshots: after <c-v> I get
And after <c-v><c-]> .
So vim isn't receiving the keystrokes properly. How to check what changes input?
try running vim -u NONE to check if that's happening without any configuration, that way you can be sure it's not a mapping or misconfiguration.
if that solves the issue, check your vim configuration!
Also try doing it in gvim and gvim -u NONE to narrow down the issue to what it's very likely to be. If that works it's a shell or terminal misconfiguration.
if it still fails in the windowed GUI of vim, that means this is X that is wrong, try using xev to see what your key outputs, and xmodmap to printout the values assigned to all your keys on your keyboard layout.
Try using another terminal (like urxvt, gnome-terminal, xterm or the raw linux console), to determine whether it's a terminal emulator misconfiguration of your keys or if it's your shell.
if it's your terminal emulator, then get through the configuration or reset its configuration, there's something setup that shouldn't have been.
Try changing shell to see if that improves (by I doubt it will)… And add the following configuration files in your home directory:
.inputrc
Tab: complete
set meta-flag on
set input-meta on
set output-meta on
set convert-meta off
If that's not enough, you might want to check as well you stty settings for your current shell as well.
If none of that helps, then… take a big hammer and hit very hard your keyboard and your computer, that won't solve your situation, but you'll feel better!
HTH

How to map Menu key ("Application key") to Escape key in vim?

I think that using Menu key to quit vim's insert mode would be a great thing. It would be also nice to use Super key for that, but I'm not sure if it possible since Super key is a modifier.
Anyway, I couldn't find anything related to this. Looking for your help and thanks in advance!
I don't think there's any way you can configure Vim to pay attention to the Menu key as such,
but depending on your system there are various ways to turn the Menu key into an Escape key.
If you're using X11 on Linux:
The command xmodmap -e 'keycode 135 = Escape' will turn your Menu key into an Escape key for the current session, but is not permanent. To make it permanent under Gnome, you might try adding it under System → Preferences → Startup Applications.
The xkeycaps program will give you a GUI for similar remappings.
For more information:
http://46dogs.blogspot.com/2008/05/remap-keys-in-ubuntu-804-hardy-heron.html
http://ubuntuforums.org/archive/index.php/t-106209.html
I haven't found a way to map it in gVim yet, but I was able to successfully map the Menu key in a urxvt+screen+vim stack by the following method:
In a terminal, type Ctrl+v and press Menu. This is mapped to the quoted-insert function in Zsh and in Readline-based tools like Bash.
It will generate an escape sequence like ^[[29~ at the prompt. (The initial ^[ must be translated to <Esc> for use in .vimrc.)
Open up .vimrc and add a line like this:
imap <Esc>[29~ <Esc>
(or imap <Esc>[29~ <Esc><Esc> if you don't want it to wait for further input like the Escape key does.)
Note that not all keys return something usable from Ctrl+v. This is a limitation of terminal emulators and can be remedied by remapping the key. You may be able to do that at the level of the terminal emulator rather than for all X apps.
For example, for urxvt, I had to add the following lines to ~/.Xresources and run xrdb -merge ~/.Xresources to apply them:
! Unbreak zsh keys in URxvt
URxvt*keysym.Home: \033[1~
URxvt*keysym.End: \033[4~
(\033 is <Esc> in ~/.Xresources syntax.)
Just try using ctrl+[ instead of binding another key. This combination is a standard one in vim, btw.
This is even easier when having rebound capslock into an additional ctrl.

Resources