Skip to content

how to quick change directory in nvim? #1395

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

You must be logged in to vote

Search the issues and read the advanced Wiki and everything will be clear.
https://github.com/ibhagwan/fzf-lua/wiki/Advanced

What you're asking is very easy with the fzf_exec API, modify this to your liking (requires fd, change to find if you wish):

require("fzf-lua").fzf_exec("fd --type d . $HOME", {
  actions = {
    ["enter"] = {
      desc = "change-directory",
      fn = function(sel)
        vim.cmd("cd " .. sel[1])
      end
    }
  }
})

Replies: 2 comments 1 reply

Comment options

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

You must be logged in to vote
1 reply
@jackywu
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
2 participants