GithubHelp home page GithubHelp logo

Comments (4)

otavioschwanck avatar otavioschwanck commented on June 27, 2024

Currently the s key toggles between adding and removing items from the list. The issue is that I often want to quickly add a bunch of different files without checking if they are already there and I end up removing them.

I see that the save

function M.save(filename)

function already exists. However:

  1. is it safe to use that exposed function?
  2. it would be nice to provide an 'on_attach' function where we can set local bindings to the arrow buffer instead of global ones

You can use safely:

vim.keymap.set("n", "<C-s>", require("arrow.persist").toggle)

from arrow.nvim.

jemag avatar jemag commented on June 27, 2024

Is there a way to set the keybind only for the arrow buffer though?

Basically I am trying to do either something like:

require("arrow").setup({
  on_attach = function()
	vim.keymap.set("n", "a", require("arrow.persist").save, { buffer = true})
  end,
})

or maybe

vim.api.nvim_create_autocmd("FileType", {
  pattern = "arrow",
  callback = function()
    vim.keymap.set("n", "a", require("arrow.persist").save, { buffer = true})
  end,
})

from arrow.nvim.

otavioschwanck avatar otavioschwanck commented on June 27, 2024

Is there a way to set the keybind only for the arrow buffer though?

Basically I am trying to do either something like:

require("arrow").setup({
  on_attach = function()
	vim.keymap.set("n", "a", require("arrow.persist").save, { buffer = true})
  end,
})

or maybe

vim.api.nvim_create_autocmd("FileType", {
  pattern = "arrow",
  callback = function()
    vim.keymap.set("n", "a", require("arrow.persist").save, { buffer = true})
  end,
})

There is no way to just save, just toggle. I will add an option to do that later on the day

from arrow.nvim.

otavioschwanck avatar otavioschwanck commented on June 27, 2024

Created an option to save / remove without toggle:

a302ceb

Just add to setup:

separate_save_and_remove = true,

from arrow.nvim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.