Skip to content

Navigate from a file in neovim to the Bitbucket Server URL

License

Notifications You must be signed in to change notification settings

Speiser/bitbucket-url.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

bitbucket-url.nvim

Navigate from a file in neovim to the Bitbucket Server URL

I hate manually navigating through Bitbucket Server to find the URL of a file I want to share with a colleague. That's why I wrote this plugin. When you call open_current_in_bitbucket on an open file, it opens the corresponding Bitbucket Server URL in your browser.

How It Works:

  1. Retrieves the current remote origin URL (https://<your_bitbucket_host>/scm/<project_key>/<repo_name>.git) for the repository where your file is.
  2. Combines the origin URL, file path, and branch to create the complete Bitbucket URL: https://<your_bitbucket_host>/projects/<project_key>/repos/<repo_name>/browse<file_path>?at=refs/heads/<branch_name>

Setup Example (using lazy.nvim):

{
    "Speiser/bitbucket-url.nvim",
    config = function()
        local bitbucket = require("bitbucket-url")
        vim.keymap.set("n", "<leader>bb", bitbucket.open_current_in_bitbucket, {})
    end,
}

About

Navigate from a file in neovim to the Bitbucket Server URL

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages