Cycle through autocomplete menu using tab Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?Is there a way to disable the foldexpr during autocomplete?Can I make <leader> key modifier, or is there anyway I can get more custom modifier key?Is there an autocmd event while triggering the insert mode completion popup menu?<Tab> in insert mode brings up completionMapping to execute python file only works on first bufferautocompletion in command line/searchMap autocomplete word in normal mode?Separate C-m and EnterHow to disable insert-mode popup-menu mappings?Integrating autocomplete and snippets
Bright yellow or light yellow?
Was there ever a LEGO store in Miami International Airport?
Where can I find how to tex symbols for different fonts?
Why isPrototypeOf() returns false?
Simulate round-robin tournament draw
How would it unbalance gameplay to rule that Weapon Master allows for picking a fighting style?
Are there existing rules/lore for MTG planeswalkers?
Putting Ant-Man on house arrest
When does Bran Stark remember Jamie pushing him?
Why is arima in R one time step off?
Is there a verb for listening stealthily?
What is the term for extremely loose Latin word order?
Are these square matrices always diagonalisable?
Suing a Police Officer Instead of the Police Department
How long can a nation maintain a technological edge over the rest of the world?
How can I wire a 9-position switch so that each position turns on one more LED than the one before?
/bin/ls sorts differently than just ls
Has a Nobel Peace laureate ever been accused of war crimes?
Could a cockatrice have parasitic embryos?
using NDEigensystem to solve the Mathieu equation
Did war bonds have better investment alternatives during WWII?
Why does the Cisco show run command not show the full version, while the show version command does?
RIP Packet Format
Marquee sign letters
Cycle through autocomplete menu using tab
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?Is there a way to disable the foldexpr during autocomplete?Can I make <leader> key modifier, or is there anyway I can get more custom modifier key?Is there an autocmd event while triggering the insert mode completion popup menu?<Tab> in insert mode brings up completionMapping to execute python file only works on first bufferautocompletion in command line/searchMap autocomplete word in normal mode?Separate C-m and EnterHow to disable insert-mode popup-menu mappings?Integrating autocomplete and snippets
I am activating my autocomplete menu in vim using:
inoremap <C-@> <C-n>
and after it opened and only when it opened I would like to use the "tab" key to cycle through the menu. But when it isn't open I would still like to use the "tab" key to write normal "tabs". Is this possible?
Thank you very much in advance.
key-bindings autocompletion
New contributor
add a comment |
I am activating my autocomplete menu in vim using:
inoremap <C-@> <C-n>
and after it opened and only when it opened I would like to use the "tab" key to cycle through the menu. But when it isn't open I would still like to use the "tab" key to write normal "tabs". Is this possible?
Thank you very much in advance.
key-bindings autocompletion
New contributor
add a comment |
I am activating my autocomplete menu in vim using:
inoremap <C-@> <C-n>
and after it opened and only when it opened I would like to use the "tab" key to cycle through the menu. But when it isn't open I would still like to use the "tab" key to write normal "tabs". Is this possible?
Thank you very much in advance.
key-bindings autocompletion
New contributor
I am activating my autocomplete menu in vim using:
inoremap <C-@> <C-n>
and after it opened and only when it opened I would like to use the "tab" key to cycle through the menu. But when it isn't open I would still like to use the "tab" key to write normal "tabs". Is this possible?
Thank you very much in advance.
key-bindings autocompletion
key-bindings autocompletion
New contributor
New contributor
edited 2 days ago
Martin Tournoij♦
36k14111186
36k14111186
New contributor
asked 2 days ago
Silence and ISilence and I
134
134
New contributor
New contributor
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Put the following insert-mode mapping (see :h mapmode-i
) in your vimrc
:
inoremap <expr> <TAB> pumvisible() ? "<C-n>" : "<TAB>"
inoremap <expr> <S-TAB> pumvisible() ? "<C-p>" : "<TAB>"
:h pumvisible()
returns non-zero when popupmenu is visible and zero otherwise. :h :map-<expr>
maps the key to the expression returned by the right hand side. And the whole expression is based on a ternary operator which ultimately states, map <Tab>
to expression <C-n>
if popup-menu is visible and to expression <Tab>
otherwise.
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "599"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Silence and I is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fvi.stackexchange.com%2fquestions%2f19675%2fcycle-through-autocomplete-menu-using-tab%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Put the following insert-mode mapping (see :h mapmode-i
) in your vimrc
:
inoremap <expr> <TAB> pumvisible() ? "<C-n>" : "<TAB>"
inoremap <expr> <S-TAB> pumvisible() ? "<C-p>" : "<TAB>"
:h pumvisible()
returns non-zero when popupmenu is visible and zero otherwise. :h :map-<expr>
maps the key to the expression returned by the right hand side. And the whole expression is based on a ternary operator which ultimately states, map <Tab>
to expression <C-n>
if popup-menu is visible and to expression <Tab>
otherwise.
add a comment |
Put the following insert-mode mapping (see :h mapmode-i
) in your vimrc
:
inoremap <expr> <TAB> pumvisible() ? "<C-n>" : "<TAB>"
inoremap <expr> <S-TAB> pumvisible() ? "<C-p>" : "<TAB>"
:h pumvisible()
returns non-zero when popupmenu is visible and zero otherwise. :h :map-<expr>
maps the key to the expression returned by the right hand side. And the whole expression is based on a ternary operator which ultimately states, map <Tab>
to expression <C-n>
if popup-menu is visible and to expression <Tab>
otherwise.
add a comment |
Put the following insert-mode mapping (see :h mapmode-i
) in your vimrc
:
inoremap <expr> <TAB> pumvisible() ? "<C-n>" : "<TAB>"
inoremap <expr> <S-TAB> pumvisible() ? "<C-p>" : "<TAB>"
:h pumvisible()
returns non-zero when popupmenu is visible and zero otherwise. :h :map-<expr>
maps the key to the expression returned by the right hand side. And the whole expression is based on a ternary operator which ultimately states, map <Tab>
to expression <C-n>
if popup-menu is visible and to expression <Tab>
otherwise.
Put the following insert-mode mapping (see :h mapmode-i
) in your vimrc
:
inoremap <expr> <TAB> pumvisible() ? "<C-n>" : "<TAB>"
inoremap <expr> <S-TAB> pumvisible() ? "<C-p>" : "<TAB>"
:h pumvisible()
returns non-zero when popupmenu is visible and zero otherwise. :h :map-<expr>
maps the key to the expression returned by the right hand side. And the whole expression is based on a ternary operator which ultimately states, map <Tab>
to expression <C-n>
if popup-menu is visible and to expression <Tab>
otherwise.
edited 2 days ago
answered 2 days ago
klausklaus
1,556220
1,556220
add a comment |
add a comment |
Silence and I is a new contributor. Be nice, and check out our Code of Conduct.
Silence and I is a new contributor. Be nice, and check out our Code of Conduct.
Silence and I is a new contributor. Be nice, and check out our Code of Conduct.
Silence and I is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Vi and Vim Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fvi.stackexchange.com%2fquestions%2f19675%2fcycle-through-autocomplete-menu-using-tab%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown