How to release the Content Completion menu in nvim without pressing Esc? - neovim

I'm using hrsh7th/nvim-cmp and some related packages to achieve content completion in nvim
However, in some cases which happen enough times, it becomes very cumbersome to use. Not sure if there's a proper way of doing this or not:
Assume you just typed a word/keyword in your favorite language and you're ready to press ENTER to start a new line. At this time, nvim shows you a dropdown of your choices. I don't want any of those! I'm happy with what I typed.
How can I start my new line without selecting anything from the dropdown menu?
Currently, I have to do either of these two:
press ESC to get rid of the menu. This works but removes me from the Editing mode. Then I have to press o to open a new line and start typing again
press ENTER selecting one of the items in the context menu. Then press ESC to exit editing mode. press X repeatedly to delete what was pasted. Then press o to start a new line!

Here's how I did it:
- ["<CR>"] = cmp.mapping.confirm { select = true },
+ ["<CR>"] = cmp.mapping.confirm { select = false },
So now the default item won't be selected by me pressing Enter. If I wanted the top item I'd be doing a Tab prior to pressing Enter.

Related

Auto-insert and cycle through completions in Emacs company mode

I want to implement the following behavior:
I type the beginning of a word, say "pr"
I press TAB
It autocompletes to the first available completion, say "print" - without any popups
I don't move my caret and I press TAB again, and it selects the second completion on "pr" - not on "print", which is already present on my current caret position
Basically, I want to be able to cycle through completions for a symbol with immediate insertion of the completion - without the popup. How would you do that with company-mode?
Try enabling company-tng-mode and removing company-pseudo-tooltip-unless-just-one-frontend from company-frontends, at the same time.

In Visual Studio Code, can I change multiple keyboard shortcuts at once?

I want to change all default keyboard shortcuts starting with 'Ctrl + K' to something else (say 'Alt + K'). Is there any way in Visual Studio Code to do that at once?
I know that it can be done by selecting one Keyboard shortcut at a time, but is there a way to do this all at once, something similar to Find/Replace of keyboard shortcuts?
This might help:
f1 -> open keyboard shortcuts.
Press brackets button on top right.
Cut all of your preferences and save them in another file without the first and last square brackets.
First step again.
Search for ctrl k.
Select the first one - press and hold delete -> Delete all of them (This is easy!).
On the top right click on the brackets button. (Open keyboard shortcuts(json)).
Deleted shortcuts have been added to this file with a - behind them on the command value. Each have an opening bracket, key value, command value, and closing bracket.
Select one of the opening brackts, then press and hold ctrl+d.
Double press down arrow, then home button.
Delete the first - from all of the command values with this trick.
Then go to the key values and change them all to what you want. Please note that some of them may be in ctrl+k+... form, but some others in ctrl+alt+k+... or ctrl+shift+k+... form. You can't change them with this trick!

how to avoid creating a new line when hitting return in auto complete mode

auto-complete in my emacs works great. But there is one annoyance. If I have finished a word correctly like "abc", but in the mean time there is another matching word called "abcd". The menu showed two options with the first one "abc" selected as default. At this time, if I hit RET, it will select "abc" as well as creating a new line. This is annoying. I want it to be just complete the selection when I hit RET. And create a new line only if I hit RET again. Is there a way to set up auto-complete to behave like that

How can I search through fish completions?

I've noticed that sometimes, when there are multiple completion options, I get something like an input field, beneath the command line, where I can type and filter the completions. I'm not sure how I triggered it. Is there a key combination that I can press so that I have it available on demand?
To enter search mode directly, you can press shift-tab. You can also press tab until the highlight is in the pager, and then just start typing: that triggers searching too.
Update March 2020: This changed in fish 3.0 here. There's now two ways to reveal the completion search:
Press ctrl s to toggle the search field while the pager is active
Press shift tab instead of tab to trigger completions with the search field shown immediately
These correspond to pager-toggle-search and complete-and-search key bindings.

Sublime Text - Shortcut to move cursor to "found" text?

Does anyone know a keyboard shortcut to move your cursor position to highlighted "found" text?
Ex: I press Ctrl+F and type "foo", this will bring me to the first instance of foo in the document.
Now I want a keyboard command to place my cursor next to this instance of foo so I can edit the text that is next to it.
I think I don't get your problem, but that's really much the default behaviour.
Anyway, I recommend incremental find (default keybinding is ctrl+i).
It searches from the current position and the panel is closed afterwards (which is what I want all of the time).
If you press escape in the search bar, the cursor does not move. If you press enter it jumps right to the next occurence.
If you want to put a cursor at each instance of found text in Sublime Text 3
CMD + F to search for text
click the Find All button on the right side of the find bar (bottom right of window)
You should then have an active cursor at the end of each found string of text
On the mac it's command G.Windows, maybe ctrl G?