tmux-plugins / tmux-copycat

A plugin that enhances tmux search
MIT License
1.11k stars 63 forks source link

Customization docs plus some minor changes #37

Closed soli closed 10 years ago

soli commented 10 years ago

A few minor changes, mostly the docs part.

I changed the M-> to M-< for emacs copy mode to be coherent with vi. However, to avoid unnecessary visual glitches, I'd prefer to have send-keys L before adding padding instead of needing to scroll back and forth to the beginning. Unfortunately L does not seem to have any emacs counterpart, nor any command name :(

bruno- commented 10 years ago

Thanks for the contributions :+1: They're merged via the command line - so don't worry when you see this pull request just got closed, the commits are in.

As for the 'emacs' copy mode update, I left it out because it seems it's not working. This line for vi copy-mode goes to the bottom of the scrollback buffer, not top.

soli commented 10 years ago

About the emacs mode stuff, precisely, from the man page (I never use emacs mode) M-< is the same as G not M->… but no problem, I'm still looking for a way to avoid that jumping completely (on my laptop it is cleary visible, i.e. the buffer is redrawn after G and then again after jumping to the proper line…

bruno- commented 10 years ago

Yep, the plugin is not perfect. I also get small "flicker" when jumping over the results. It's more noticable in emacs copy mode because it's slower.

Frankly, I think the only foolproof solution would be enabling regex search in tmux itself. If we had that, it would be easy to script everything else on top.

soli commented 10 years ago

TBH, I currently run the plugin without the G line, but with:

if [ "$TMUX_COPY_MODE" == "vi" ]; then
    # vi copy mode, put cursor at bottom of the window
    tmux send-keys L
fi

at the end of _copycat_go_to_line_with_jump and I do notice less flicker. But I still have no idea how to do that for emacs :-/

bruno- commented 10 years ago

That's cool if L works for you.

I remember going back and forth about having G, see removing it here, then reverting the previous commit.

Unfortunately I didn't document the revert properly. I think the issue was that some jumps (n and N) were inconsistent and doing wrong highlights when there were no G. This goes back to tmux not handling jumps with : in copy mode properly (read buggy as hell).

I had all sorts of bugs like this, mostly in tmux, but in OS X versions of grep and awk tools too when working on the plugin.

Feel free to communicate if you have any code improvement in mind! I'd love to accept pull requests, but it would be a pity if you worked on something while not knowing about one of those bugs.

And kudos for getting into the code base. I thought no one ever will have the guts to dive into it.

soli commented 10 years ago

Yeah, I indeed ran into all sorts of weird things when first removing G completely. However L seems stable for now, I'll keep you posted.

Thanks for writing that code base in the first place :wink:

bruno- commented 10 years ago

Hi, I just want to notify you about the mistake I made with git - I had to rewrite the history. In case you'll hack on the project, this might mess your local git repo..

The explanation and a proposed solution is described here. I just wanted to personally let you know this since you showed interest in the project.

soli commented 10 years ago

Hehe, no big deal, as they say "git happens" ;) I was a bit puzzled about the clone time too, so it's probably a good idea to have removed the video.