Giter Club home page Giter Club logo

arrow.nvim's People

Contributors

chrisgrieser avatar hosaka avatar nfrid avatar oonamo avatar otavioschwanck avatar petersid2022 avatar pheon-dev avatar sqve avatar tingey21 avatar wolfecub avatar xzbdmw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

arrow.nvim's Issues

feature request: add a per buffer bookmark supprt

It will be cool to jump to buffer and then jump to bookmarks(narrowing scope to line) within this buffer in the same UI, mapped to a different toggle key, or just type ; and type any key to enter bookmark mode, since deleting, editing, and choosing bookmarks can have the same experience:)
If you are interested I can try to make a pr!

Feat: allow mapping `next` in the ui

I'd like to map ' to next from within the UI (so ;' goes to the next file), but this doesn't seem to be possible from the current implementation.

Bug: `persist.next` fails when not in root

persist.next opens the wrong file when used outside of the root (note: the UI doesn't have this issue)

Repo:

> mkdir repro
> cd repro
> git init # Using root_key = "git_root"!
> mkdir dir
> echo "dir/file" >| "dir/file"
> nvim
  1. :lua require("arrow.persist").clear()
  2. :lua require("arrow.persist").save("dir/file")
  3. :cd dir/ -- We're no longer under the root!
  4. Press leader_key then 1 - it works!
  5. :lua require('arrow.persist').next() -- it opens dir/dir/file

No support for directories?

Expected behavior

api . modules
api . development/eu-central-1
api . production/eu-central-1

Actual behavior

. modules/api
. development/eu-central-1/api
. production/eu-central-1/api

I'm guessing the name that matches is no name and then it puts the paths as qualifier for that.

Aside from the rendering issue it works fine with directories. (in my case paired with oil.nvim)

image

allow custom actions on buffers

It would be nice if we could have custom actions for the buffers in the buffer list. Maybe just a function that passes in the buffer number?

For example, I would love to be able to use https://github.com/s1n7ax/nvim-window-picker when splitting or opening a buffer, which I can do in both neo-tree and telescope. Example of what it looks like:
image
and code I use to make it work with telescope:

local pick_window = function(prompt_bufnr, direction)
  -- Use nvim-window-picker to choose the window by dynamically attaching a function
  local picker = action_state.get_current_picker(prompt_bufnr)
  picker.get_selection_window = function(pickr, _)
    local picked_window_id = require("window-picker").pick_window({ autoselect_one = true, include_current_win = true })
      or vim.api.nvim_get_current_win()
    -- Unbind after using so next instance of the picker acts normally
    pickr.get_selection_window = nil
    return picked_window_id
  end

  action_set.select(prompt_bufnr, direction)
  vim.cmd("stopinsert")
end

local pick_vertical = function(prompt_bufnr)
  pick_window(prompt_bufnr, "vertical")
end
local pick_horizontal = function(prompt_bufnr)
  pick_window(prompt_bufnr, "horizontal")
end
local pick_default = function(prompt_bufnr)
  pick_window(prompt_bufnr, "default")
end

Bug: Does not work when changing project during a session

When I start neovim in directory-a, and then change project (cd directory-b), then arrow still shows me the bookmarks from directory-a. If I quit and start in directory-b, arrow correctly shows me the bookmarks from directory-b.

It seems the bookmark-loading only happens one during initialization and does not monitor changes in the directory.

I think this could be fixed by triggering bookmark-loading via the DirChanged event.

Possible performance issue?

I noticed a gradual slowdown when changing buffers over time while using arrow.nvim. Although I haven't thoroughly investigated the issue, a quick workaround of commenting out these lines seems to alleviate the problem. Could you please take a look?

Steps to reproduce

  • Save some bookmarks using arrow.nvim.
  • Open a session with multiple buffers.
  • Use arrow.nvim to navigate very quickly between buffers. For example, I have set leader_key='r', rapidly spam something like the following sequence: r1r1r1r2r2r2r2r3r3r3r3r3r1r1r1r1.
  • Change to a different buffer. The buffer change becomes noticeably slower compared to when started. The slowdown becomes more apparent as you continue to navigate and change.

Please let me know if you need any further information or clarification to investigate this issue. Thanks!

Inconsistency in UI Display for Subdirectories in Different Projects

Hey,

I wanted to say thanks for the awesome plugin! I've got a question about the UI. In one of my projects, the UI displays the subdirectory along with the file, which is exactly what I want.
Screenshot 2024-03-20 at 2 31 34 AM

But in some other projects, also Go projects, it doesn't show anything related to the subdirectory.

Screenshot 2024-03-20 at 2 31 49 AM

I'm a bit confused about why this is inconsistent. Thanks for any help you can offer!

thank you

Feature request: save bookmarks based on git root

Hey, ๐Ÿ‘‹

I have a feature request that would immensely improve my workflow. I primarily work in large monorepos and often open subdirectories within a repository to make things easier to find. However, this is a bit awkward when using arrow.nvim, as it doesn't resolve my bookmarks based on the git repository but rather on the current working directory.

It would be great if we could be provided with an option on how we want to resolve the working directory that arrow will associate the bookmarks with. That way, I could execute a command like git rev-parse --show-toplevel to get the path of the git repository.

๐Ÿป

Feature: Toggle betwen recent files

Description

Arrow.nvim is great for navigating a list of bookmarks, but I often find myself switching back and forth between two recently used files. This requires navigating the full arrow.nvim interface or invoking the next and previous keymaps multiple times.

Proposed solution

Implement a dedicated function to toggle between the currently active file and the previously active file. The function could be called something like require('arrow.persist').toggle_recent.

Example

Mark four files:

  1. file-1
  2. file-2
  3. file-3
  4. file-4

Open file-1, then open file-3. Executing toggle_recent() should switch from file-3 to file-1. Executing toggle_recent() again should switch from file-1 back to file-3.

Note: I love this plugin. It's better than harpoon in my opinion!

Bug: not working with mini.sessions

Hello, I just installed this plugin and it looks great. However, when I started it I got the following error.

E5108: Error executing lua: .../.local/share/nvim/lazy/arrow.nvim/lua/arrow/ui.lua:50: bad argument #1 to 'ipairs' (table expected, got number)
stack traceback:
        [C]: in function 'ipairs'
        .../.local/share/nvim/lazy/arrow.nvim/lua/arrow/ui.lua:50: in function 'format_file_names'
        .../.local/share/nvim/lazy/arrow.nvim/lua/arrow/ui.lua:300: in function <.../.local/share/nvim/lazy/arrow.nvim/lua/arrow/ui.lua:285>

After wondering a while, I realized that it opens the UI normally and works as expected if I open a file directly from command line and I do not load a session with mini.sessions.

I was doing a little bit of research myself, and it seems that the parameter to function format_file_names seems to be 0 in my case. And it seems to come from file persist.lua function load_cache_file, though I am not exactly sure.

The `separate_by_branch = true` option does not separate

Hey, ๐Ÿ‘‹

Most importantly, thank you for you an excellent plugin! โค๏ธ

I'm trying to separate my bookmarks between branches, and having troubles getting it to work. Setting the separate_by_branch option to either false or true does nothing.

๐Ÿป

Typo on the statusline helper?

One of the statusline helper function name has a typo. I'm not sure which was the intended name between is_on_arrow_file in the README OR in_on_arrow_file in the actual code.

Provide action to add buffer to list without toggling/improve mapping configuration

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

Handbook hint cut off

First of all: Loving the plugin and it replaced harpoon for me <3.

I just noticed that the handbook hint is cut off for my setup.
Wanted to ask whether it is something I have in my setup or whether this could be a known problem:
image

Config is pretty default:

{
  "otavioschwanck/arrow.nvim",
  opts = {
    show_icons = true,
    leader_key = ";",
  },
},

Using most recent master:
"arrow.nvim": { "branch": "master", "commit": "79527117368995b81aa1a77714b49d0d7535274b" },

FR: add option for global bookmarks

Adding an option to make all bookmarks global or make specific bookmarks global would be really useful as I tend to work in multiple multiple directories.

Feat: allow save_key to be a function

I'd like to assign a function that returns the root to save_key.
This would allow me to use LSP to return the root instead of only cwd and git_root.
The new type of save_key would be

---@type string|fun(): string?

if the function returns nil, use the CWD as the root, else use the returned value

Using 'd' as index key introduces a delay

Hello,

First of all thank you for this plugin. It is amazing! ๐Ÿ™‚

I want to use the keys "asdfjkl;" as index keys as this is my habit when using marks too but the key 'd' introduces a delay before finally moving to the file. I assume this is because the action for 'd' as delete is active in the 'arrow' window and it is waiting for a text object. Is there a way to disable this for the arrow buffer so I can use it?

feature request: git branch scoped marks

Harpoon has a similar option, that the marks are scoped to the current git branch. I love this feature personally. Would it be possible to bring this to this great little plugin? Otherwise I love arrow.nvim. ๐Ÿ˜Š

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.