Git Product home page Git Product logo

Comments (5)

joelim-work avatar joelim-work commented on September 16, 2024 1

lf already has a jump list, is this what you are looking for? https://github.com/gokcehan/lf/blob/master/doc.md#jump-next-default--jump-prev-default-

from lf.

og900aero avatar og900aero commented on September 16, 2024 1

I made a simple solution for tab management:

cmd tab-search ${{
    res="$(cat ~/.local/share/lf/tabs | fzf --reverse --header='Jump to location' --exact --color=fg:#f8f8f2,hl:#bd93f9 --color=fg+:#f8f8f2,bg+:#44475a,hl+:#bd93f9 --color=info:#ffb86c,prompt:#50fa7b,pointer:#ff79c6 --color=marker:#ff79c6,spinner:#ffb86c,header:#6272a4 --preview 'tree {}' || true)"
    lf -remote "send $id cd \"$res\""
}}

cmd on-quit :{{
    $cat /dev/null > ~/.local/share/lf/tabs
}}

map ts tab-search
map tt &echo "$PWD" >> ~/.local/share/lf/tabs
map <a-1> &lf -remote "send $id cd \"$(cat ~/.local/share/lf/tabs | sed -n '1,1p')\""
map <a-2> &lf -remote "send $id cd \"$(cat ~/.local/share/lf/tabs | sed -n '2,2p')\""
map <a-3> &lf -remote "send $id cd \"$(cat ~/.local/share/lf/tabs | sed -n '3,3p')\""

Press tt to save actual directory.
Press ts to search saved tabs (required fzf and tree command under linux)
Press Alt+1 to jump the first tab
Press Alt+2 to jump the second tab
Press Alt+3 to jump the fthird tab
When quit from lf, then tabs erased.

As you can see, it is possible to switch between 3 tabs by default, but you can add an extra row at any time that changes.

Of course, this is not a complete solution, as you cannot visually see how many tabs exist and which tab is active, but it is good for not having to open another lf and waste space on the monitor, or to open the fixed window for another lf - and thus walk half the size. This is how I use it, and this solution is also perfect for me, for example to copy or do anything else, and to be able to quickly jump back and forth many "tabs".

from lf.

og900aero avatar og900aero commented on September 16, 2024

Well, yes. This is exactly why I miss the tab function too.

from lf.

highsanburger avatar highsanburger commented on September 16, 2024

lf already has a jump list, is this what you are looking for? https://github.com/gokcehan/lf/blob/master/doc.md#jump-next-default--jump-prev-default-

Yup this is exactly what I was looking for. Thanks for pointing it out.

from lf.

highsanburger avatar highsanburger commented on September 16, 2024

I made a simple solution for tab management:

cmd tab-search ${{
    res="$(cat ~/.local/share/lf/tabs | fzf --reverse --header='Jump to location' --exact --color=fg:#f8f8f2,hl:#bd93f9 --color=fg+:#f8f8f2,bg+:#44475a,hl+:#bd93f9 --color=info:#ffb86c,prompt:#50fa7b,pointer:#ff79c6 --color=marker:#ff79c6,spinner:#ffb86c,header:#6272a4 --preview 'tree {}' || true)"
    lf -remote "send $id cd \"$res\""
}}

cmd on-quit :{{
    $cat /dev/null > ~/.local/share/lf/tabs
}}

map ts tab-search
map tt &echo "$PWD" >> ~/.local/share/lf/tabs
map <a-1> &lf -remote "send $id cd \"$(cat ~/.local/share/lf/tabs | sed -n '1,1p')\""
map <a-2> &lf -remote "send $id cd \"$(cat ~/.local/share/lf/tabs | sed -n '2,2p')\""
map <a-3> &lf -remote "send $id cd \"$(cat ~/.local/share/lf/tabs | sed -n '3,3p')\""

Press tt to save actual directory.
Press ts to search saved tabs (required fzf and tree command under linux)
Press Alt+1 to jump the first tab
Press Alt+2 to jump the second tab
Press Alt+3 to jump the fthird tab
When quit from lf, then tabs erased.

As you can see, it is possible to switch between 3 tabs by default, but you can add an extra row at any time that changes.

Of course, this is not a complete solution, as you cannot visually see how many tabs exist and which tab is active, but it is good for not having to open another lf and waste space on the monitor, or to open the fixed window for another lf - and thus walk half the size. This is how I use it, and this solution is also perfect for me, for example to copy or do anything else, and to be able to quickly jump back and forth many "tabs".

Kind of hacky but works. Thanks for sharing!

from lf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.