ideas
ideas copied to clipboard
move cursor to character for tmux (a la ace-jump/easymotion)
Project description
This project creates a tmux plugin that uses a character hinting mechanism to jump to a position in the buffer, like one would with acejump (video ) or easymotion
A kludge-y attempt might save the current buffer to a file with tmux. colorized text with matches, get the desired match from the user, and use the matching position to move the tmux cursor.
# partial implementation. no tmux movement. screen is spammed, not useful. Term::ReadKey must be fetched from CPAN.
lookfor="a"
tmux capture-pane -J \; save-buffer "test"
perl -MTerm::ReadKey -ne "
BEGIN{ \$replace='a';}
\$h{\$replace++}=qq/\$. \$-[0]/ while s,$lookfor,$(tput setaf 1)\$replace$(tput sgr0),;
print qq/\$_\n/;
END{
ReadMode 4;
\$b=ReadKey(-1) while(not defined \$b);
ReadMode 0;
print \$h{\$b}
}" test
Relevant Technology
- tmux, tpm
- shell
- ncursers (to display colorzed matches without changing the position of text)
Who is this for
An intermediate shell user or scripting language beginner will be able to complete a hacky version. A robust solution might require modification to tmux's source code (advanced).
Complexity and required time
Complexity
-
[ ]
Beginner - This project requires no or little prior knowledge of the technolog(y|ies) specified to contribute to the project -
[x]
Intermediate - The user should have some prior knowledge of the technolog(y|ies) to the point where they know how to use it, but not necessarily all the nooks and crannies of the technology -
[ ]
Advanced - The project requires the user to have a good understanding of all components of the project to contribute
Required time (ETA)
-
[x]
Little work - A couple of days -
[ ]
Medium work - A week or two -
[ ]
Much work - The project will take more than a couple of weeks and serious planning is required
https://github.com/hchbaw/zce.zsh ?
not 100% stable, but i'm using this for the last months https://github.com/schasse/tmux-easymotion
https://github.com/Morantron/tmux-fingers https://github.com/fcsonline/tmux-thumbs
Cool idea!
Could you please follow the format of the template next time?
EDIT: Ah never mind, thought this was a new project! :)
Btw, I improved my plugin, renamed it and me and some friends are using it for quite a while. Check it out and tell me what you guys think. https://github.com/schasse/tmux-jump
Just started using it yesterday. Good job, @schasse! I'll be sure to make a PR/issue if something looks weird
Thanks. And sure, if you have a problem, just open an issue and I'll look into it!
Another port of easy-motion for tmux: IngoMeyer441/tmux-easy-motion. In the meantime, several easy-motion / jump-mode implementations exist, but most of them only implement a seek or find motion. Therefore, I have started my own implementation which adds more Vim motions (b
, B
, w
, W
, e
, E
, ge
, gE
, j
, J
, k
, K
f
, F
, t
, T
, c
(camelCase)). It also uses the same grouping algorithm as the Vim plugin to look and feel like the original.
Demo: