From 26cdc53c1d74527d075d9a35a03ad97fc6b5f926 Mon Sep 17 00:00:00 2001 From: Tbsnhld Date: Mon, 15 Apr 2024 18:03:36 +0200 Subject: [PATCH 1/2] lazy.nvim instruction for custom keymaps --- README.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/README.md b/README.md index 69a68ce..73d5dc3 100644 --- a/README.md +++ b/README.md @@ -151,6 +151,38 @@ noremap {Previous-Mapping} :TmuxNavigatePrevious in the above code with the desired mapping. Ie, the mapping for `` => Left would be created with `noremap :TmuxNavigateLeft`. +#### lazy.nvim + +To change your keymaps in lazy.nvim with lua change the configuration as following + +```lua +{ + "christoomey/vim-tmux-navigator", + cmd = { + "TmuxNavigateLeft", + "TmuxNavigateDown", + "TmuxNavigateUp", + "TmuxNavigateRight", + "TmuxNavigatePrevious", + }, + keys = { + { "{Left-Mapping}", "TmuxNavigateLeft" }, + { "{Down-Mapping}", "TmuxNavigateDown" }, + { "{Up-Mapping}", "TmuxNavigateUp" }, + { "{Right-Mapping}", "TmuxNavigateRight" }, + { "{Previous-Mapping}", "TmuxNavigatePrevious" }, + }, + config = function() + vim.g.tmux_navigator_no_mappings = 1 + end, +} +``` +*Note* Each instance of `{Left-Mapping}` or `{Down-Mapping}` must be replaced +in the above code with the desired mapping. The mapping for `` => +Left would be created by adding `{ "", "TmuxNavigateLeft" }`. +And adding the config function where you set the global variable. Last one is +important so the initial mappings aren't still active. + ##### Autosave on leave You can configure the plugin to write the current buffer, or all buffers, when From c1ad14e2ad36352eba267f051dcf14c36104e10b Mon Sep 17 00:00:00 2001 From: Tbsnhld Date: Sun, 21 Apr 2024 23:36:06 +0200 Subject: [PATCH 2/2] README updated, added instruction to the lazy.nvim configuration --- README.md | 36 ++++-------------------------------- 1 file changed, 4 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 73d5dc3..29b5060 100644 --- a/README.md +++ b/README.md @@ -74,10 +74,14 @@ If you are using [lazy.nvim](https://github.com/folke/lazy.nvim). Add the follow { "", "TmuxNavigateRight" }, { "", "TmuxNavigatePrevious" }, }, + config = function() + vim.g.tmux_navigator_no_mappings = 1 + end, } ``` Then, restart Neovim and lazy.nvim will automatically install the plugin and configure the keybindings. +To change the keymaps you only have to replace the corresponding keymaps. ### tmux @@ -151,38 +155,6 @@ noremap {Previous-Mapping} :TmuxNavigatePrevious in the above code with the desired mapping. Ie, the mapping for `` => Left would be created with `noremap :TmuxNavigateLeft`. -#### lazy.nvim - -To change your keymaps in lazy.nvim with lua change the configuration as following - -```lua -{ - "christoomey/vim-tmux-navigator", - cmd = { - "TmuxNavigateLeft", - "TmuxNavigateDown", - "TmuxNavigateUp", - "TmuxNavigateRight", - "TmuxNavigatePrevious", - }, - keys = { - { "{Left-Mapping}", "TmuxNavigateLeft" }, - { "{Down-Mapping}", "TmuxNavigateDown" }, - { "{Up-Mapping}", "TmuxNavigateUp" }, - { "{Right-Mapping}", "TmuxNavigateRight" }, - { "{Previous-Mapping}", "TmuxNavigatePrevious" }, - }, - config = function() - vim.g.tmux_navigator_no_mappings = 1 - end, -} -``` -*Note* Each instance of `{Left-Mapping}` or `{Down-Mapping}` must be replaced -in the above code with the desired mapping. The mapping for `` => -Left would be created by adding `{ "", "TmuxNavigateLeft" }`. -And adding the config function where you set the global variable. Last one is -important so the initial mappings aren't still active. - ##### Autosave on leave You can configure the plugin to write the current buffer, or all buffers, when