Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: improve lazy install snippet #229

Merged
merged 1 commit into from
Mar 18, 2024

Conversation

joshmedeski
Copy link
Contributor

The lazy.nvim install snippets can be improved:

  1. opts = {} is all you need to setup the plugin, less code
  2. It's recommended to add cmd = "GitLink" for lazy loading, the plugin will only load when GitLink is executed
  3. keys offers an example (with ruifm's default keymapping) as an example. It will also lazy load the plugin if this keymap is triggered.

Regression Test

Platforms

  • windows
  • macOS
  • linux

Hosts

Functions

  • Use GitLink(!) to copy git link (or open in browser).
  • Use GitLink(!) blame to copy the /blame link (or open in browser).
  • Use GitLink(!) default_branch to open the /main//master link in browser (or open in browser).
  • Use GitLink(!) current_branch to open the current branch link in browser (or open in browser).
  • Copy git link in a symlink directory of git repo.
  • Copy git link in an un-pushed git branch, and receive an expected error.
  • Copy git link in a pushed git branch but edited file, and receive a warning says the git link could be wrong.

The lazy.nvim install snippets can be improved:
1. `opts = {}` is all you need to setup the plugin, less code
2. It's recommended to add `cmd = "GitLink"` for lazy loading, the plugin will only load when `GitLink` is executed
3. `keys` offers an example (with ruifm's default keymapping) as an example. It will also lazy load the plugin if this keymap is triggered.
@linrongbin16 linrongbin16 merged commit 46ec82f into linrongbin16:master Mar 18, 2024
2 checks passed
@linrongbin16
Copy link
Owner

thanks!

@joshmedeski joshmedeski deleted the patch-1 branch March 19, 2024 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants