Skip to content

How can I set up <j> and <k> to navigate up and down, and make <i> to focus on the search? #1653

Answered by ibhagwan
wpsnapper asked this question in Q&A
Discussion options

You must be logged in to vote

FYI, after the latest commit 12ac915 you can do the below and keep your esc as double purpose to abort from "normal" mode, this also changes the prompt info (e.g. "Files") to be displayed in the title since we lose the prompt:

require('fzf-lua').setup({
  "default-title", -- Important as we lose the prompt
  keymap = {
    fzf = {
      true,
      ["h"] = "abort",
      ["j"] = "down",
      ["k"] = "up",
      ["l"] = "accept",
      ["i"] = "unbind(h)+unbind(j)+unbind(k)+unbind(l)+unbind(i)+change-prompt(> )",
      ["esc"] = 'transform:case "$FZF_PROMPT" in\n'
          .. '*NORMAL*) echo abort;;\n'
          .. '*) echo "change-prompt(NORMAL - PRESS \'I\' FOR INSERT MODE)'
          .. 

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
2 replies
@wpsnapper
Comment options

@ibhagwan
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by wpsnapper
Comment options

You must be logged in to vote
3 replies
@ibhagwan
Comment options

@MoulyT
Comment options

@ibhagwan
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants