1. 23
  1.  

  2. 10

    This ends up being less useful than just opening a file with $PAGER.

    If I want to “peek” at files, I would use the preview feature of fzf.

    1. 3

      The idea is you can still see your buffer while peeking. fzf is also much more complex than what I’ve shown.

      1. 2

        Right, but I’m not sure why that’s useful. I don’t expect the filesystem to change while I’m looking at it.

        1. 2

          Let’s say you have run some command line programs that give some output. Now you need to compare this output with some content in a file.

          This lets you still view this output while viewing a file.

          You can use any program to view…The purpose of the repository is to show you can have simple “peek” functionality with a very small command.

          1. 2

            Well, whether I find this useful or not, I’ll at least say I appreciate you sharing this. This may be useful for people to see, to help them realise that there isn’t so much magic in the terminal, and they can piece together their own workflows in a similar fashion.

    2. 3

      I don’t get it. Why not use less or head?

      1. 3

        The idea is you can still see your buffer while peeking.

      2. 3

        what file is so important you’re just dying to look at it, but not important enough that you can run less file and get back to your buffer later

        1. 3

          The idea is you can still see your buffer while peeking.

        2. 1

          What if the $EDITOR path has spaces in it? Shouldn’t it be tmux split-window -p 33 "$EDITOR" $@?

          1. 2

            Yes it should be that. Keep in mind I also expect people to modify this as they need :)

          2. 1

            So what does it do? I guess, looking at the syntax, it splits your terminal with a new file to look at in your editor?

            1. 10

              Splits if run in tmux. I’d use this to run less instead, as only reading is more of a peek and $EDITOR can be invoked if needed by hitting v.

              1. 4

                and $EDITOR can be invoked if needed by hitting v

                How in the world did I not know this until now?!