Skip to content

Avoid jumping into NvimTree buffer #26

Answered by cbochs
n3wborn asked this question in Q&A
Discussion options

You must be logged in to vote

Sure thing. You should be able to filter jumps by filtype:

During setup

Apply to all searches (edited for v0.5.0 release).

require("portal").setup({
  filter = function(v)
    return vim.api.nvim_buf_get_option(v.buffer, "filetype") ~= "{ft}"
  end
})

Function call

Apply to a single search.

require("portal.builtin").jumplist.tunnel_backward({
  filter = function(v)
    return vim.api.nvim_buf_get_option(v.buffer, "filetype") ~= "{ft}"
  end
})

I'm not certain what the filetype for nvim-tree so I've left that as {ft} in the examples above. If should be listed in their docs, or you can simply run the following command while focused on an nvim-tree buffer:

:lua =vim.api.nvim_buf_get_option(0…

Replies: 1 comment 2 replies

Comment options

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

@cbochs
Comment options

Answer selected by n3wborn
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