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

Added lazy.nvim config that uses keymap based lazy-loading to README.md #24

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,59 @@ end
}
```

You can also use Lazy's lazy-loading and load the plugin on-demand only when pressing the keys.
This will make your neovim startup time faster and also integrates with other tools like [Which Key](https://github.com/folke/which-key.nvim).

```lua
{
"alexghergh/nvim-tmux-navigation",
lazy = true,
cmd = {
"NvimTmuxNavigateLeft",
"NvimTmuxNavigateDown",
"NvimTmuxNavigateUp",
"NvimTmuxNavigateRight",
"NvimTmuxNavigateLastActive",
"NvimTmuxNavigateNext",
},
keys = {
{
"<C-h>",
"<cmd>NvimTmuxNavigateLeft<cr>",
desc = "Move one nvim/tmux pane to the left",
},
{
"<C-j>",
"<cmd>NvimTmuxNavigateDown<cr>",
desc = "Move one nvim/tmux pane down",
},
{
"<C-k>",
"<cmd>NvimTmuxNavigateUp<cr>",
desc = "Move one nvim/tmux pane up",
},
{
"<C-l>",
"<cmd>NvimTmuxNavigateRight<cr>",
desc = "Move one nvim/tmux pane to the right",
},
{
"<C-\\>",
"<cmd>NvimTmuxNavigateLastActive<cr>",
desc = "Move to the last active nvim/tmux pane",
},
{
"<C-Space>",
"<cmd>NvimTmuxNavigateNext<cr>"
desc = "Move to the next nvim/tmux pane",
},
},
config = function()
require("nvim-tmux-navigation").setup()
end,
}
```

## Usage

If you went through the [Configuration](#configuration), then congrats! You
Expand Down