-
Notifications
You must be signed in to change notification settings - Fork 58
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
Add vim-tmux-navigator #27
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
result | ||
.config | ||
.direnv | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ | |
./telescope | ||
./git | ||
./plantuml | ||
./tmux | ||
]; | ||
|
||
pkgsModule = {config, ...}: { | ||
|
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,51 @@ | ||||||||||
{ | ||||||||||
pkgs, | ||||||||||
lib, | ||||||||||
config, | ||||||||||
... | ||||||||||
}: | ||||||||||
with lib; | ||||||||||
with builtins; let | ||||||||||
cfg = config.vim.tmux-navigator; | ||||||||||
in { | ||||||||||
options.vim = { | ||||||||||
tmux-navigator = { | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
enable = mkOption { | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use |
||||||||||
type = types.bool; | ||||||||||
default = false; | ||||||||||
description = "enable tmux-navigator, this plugin will only work together with tmuxPlugins.vim-tmux-navigator"; | ||||||||||
}; | ||||||||||
|
||||||||||
autosave-on-leave = mkOption { | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
type = types.enum ["disabled" "update" "wall"]; | ||||||||||
default = "disabled"; | ||||||||||
description = "enable autosave when navigating to tmux"; | ||||||||||
}; | ||||||||||
|
||||||||||
disable-when-zoomed = mkOption { | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
type = types.bool; | ||||||||||
default = false; | ||||||||||
description = "disable navigator when the tmux pane is zoomed"; | ||||||||||
}; | ||||||||||
|
||||||||||
preserve-zoom = mkOption { | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
type = types.bool; | ||||||||||
default = false; | ||||||||||
description = "preserve zoom when moving from "; | ||||||||||
}; | ||||||||||
}; | ||||||||||
}; | ||||||||||
|
||||||||||
config = mkIf cfg.enable { | ||||||||||
vim.startPlugins = [ | ||||||||||
"tmux-navigator" | ||||||||||
]; | ||||||||||
Comment on lines
+40
to
+42
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
|
||||||||||
vim.configRC.tmux-navigator = nvim.dag.entryAnywhere '' | ||||||||||
${optionalString (cfg.autosave-on-leave == "update") "let g:tmux_navigator_save_on_switch = 1"} | ||||||||||
${optionalString (cfg.autosave-on-leave == "wall") "let g:tmux_navigator_save_on_switch = 2"} | ||||||||||
${optionalString (cfg.disable-when-zoomed) "let g:tmux_navigator_disable_when_zoomed = 1"} | ||||||||||
${optionalString (cfg.preserve-zoom) "let g:tmux_navigator_preserve_zoom = 1"} | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
''; | ||||||||||
}; | ||||||||||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.