How to change neovim command-line popup to horizontal, or change direction key's behaviour? - popup

In neovim, popup of command-mode complete is vertical, but using left right to selete.
Can I change popup to horizontal? or use up down to select? How?
this is neovim popup
this is what I want
or using up down to select

See :h 'wildoptions'
For the desired behaviour type :set wildoptions= in neovim.

Found a way to use <down> and <up> mappings for wildoptions=pum
from https://github.com/neovim/neovim/issues/9953
if &wildoptions =~# "pum"
cnoremap <expr> <up> pumvisible() ? '<left>' : '<up>'
cnoremap <expr> <down> pumvisible() ? '<right>' : '<down>'
endif

Related

How to remap <cr> to go to line number in VSCodeVim

In vim I used to map the enter key <cr> to go to line number instead of the letter G using the following settings
nnoremap <expr> <cr> v:count == 0 ? "\<cr>" : "G"
I tried to achieve the same result in vim for VSCode but I couldn't.
Is there a way that manage me from doing so without enabling the experimental feature neovim integration inside VSCode

How do you use <TAB> to cycle through completion suggestions with ALE?

When using Ale, I'd like to use the Tab key to cycle through completion suggestions. By default, the arrow keys do it. What are the various configuration options for cycling through the suggestions as well as selecting the correct completion?
Could do something like this:
inoremap <silent><expr> <Tab>
\ pumvisible() ? "\<C-n>" : "\<TAB>"
Essentially, when you hit tab in insert mode, check whether the popup is visible, and if it is then send Ctrl-n (to go to the next match), otherwise send a tab.

Emacs-like line navigation in gedit

I have been using Emacs for the past few months and I like its line navigation feature a lot as it doesn't need you to use arrow keys.
Emacs Line Navigation:
C-p : go to previous line
C-n : go to next line
C-f : go forward one character
C-b : go backward one character
Is there anyway I can use this in gedit text editor 3 also? Is there any plugin or option for this functionality?

Use Alt key as Meta in emacs

Somehow the emacs I'm using doesn't treat Alt as Meta. It only uses ESC for it. If I press Alt+x it will tell me "A-X" undefined. I tried to figure out how to map it to meta but got no luck on the web because in most of results from my search people take Alt as Meta by default. I guess something like this should work:
global-set-key Alt(?) 'meta
but I'm not sure how to represent Alt in lisp.. any help? Thanks!
Most solutions will tell you to change keymap at the X11 level. The wiki suffers from the problem of too much information. If you just want a solution that works only at the emacs level (quite useful for VNC/remote desktop), then add the below line to your emacs init file
;; Map Alt key to Meta
(setq x-alt-keysym 'meta)
I had the same problem and by putting this in ~/.emacs helped me.
(set-keyboard-coding-system nil)
Refer to this, if you need more help
http://www.emacswiki.org/emacs/MetaKeyProblems#toc15
Entering this command in a shell (even M-x shell) works for me.
xmodmap -e "clear mod4"
This works when the problem is that the output of xmodmap includes a line showing that Meta_L is set to mod4:
mod4 Meta_L (0x73)
Emacs thinks your keyboard has a Meta key, so it's not interpreting Alt as Meta. The above command tells X that you don't have a Meta key, so Emacs will interpret Alt the way that we're used to.
I learned this from https://www.emacswiki.org/emacs/MetaKeyProblems.

C-Tab cannot be recognized in terminal?

I want to bind company-mode-map to C-tab, but it seems doesn't work. And I typed C-h k C-tab, it just said that I typed TAB but not C-Tab. It works in Xwindows, is there any way to fix the problem in terminal mode?
I found these directions, which are targeted at using GNU screen, but they work for me in regular terminal mode. After adding:
*vt100.translations: #override \n\
Ctrl ~Shift <Key>Tab: string(0x1b) string("[27;5;9~") \n \
Ctrl Shift <Key>Tab: string(0x1b) string("[27;6;9~") \n
to my .Xresources file, C-tab is recognized in my terminal, and the binding found by Emacs.