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.
Related
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.
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
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.
Let's say you are about to type something that you know you want to kill-yank later. For example, say we need to repeat the following 10 times:
grid.addValue([some variable])
Currently, before I start typing, I can press C-<spc> C-<spc> to activate then deactivate the mark at the beginning of the text. Then, once I finish typing grid.addValue(), I can press C-x C-x twice to go back to the original mark, then back to the end of the text with the text highlighted.
My question: is there a way to set the mark and highlight as I type, so when I am done with the phrase I can immediately copy and yank it a bunch of times?
Just set the mark, type, and then copy/kill as normal.
The region (i.e. whatever is between point and mark) isn't highlighted, but it's still usable.
While trying to autocomplete a file (e.g. to open a file with C-x C-f) Emacs-helm shows a list of possible candidates.
If I then press Tab (which I would hope it would help me choose the first/closest match), I get the following in the minibuffer:
It looks like the minibuffer gets confused with escape characters, and it does not choose the file that I actually want to open (the top choice).
Helm requires this conceptual jump from the default Emacs completion, which is not so obvious:
You don't need to press a key to complete. The completion buffer refreshes
with new results after every input.
This is called "incremental" completion.
The normal tab functionality is not needed in "incremental"
completion. So tab was rebound to helm-select-action, which allows you to
choose an alternative action with the selection. But there is only one action
in read-file-name.
The error you're seeing could be clearer though, I've filed this issue on github.
Additionally, note Helm treats each space separated term as a filtering
regular expression. So, pressing space foo will filter
the current list down to those that contain foo in the name.