-
Notifications
You must be signed in to change notification settings - Fork 335
Tutorial
-
Download the binary at: https://github.com/gokcehan/lf/releases
For system with go installed:
go get -u github.com/gokcehan/lf
-
Download the example setting file with command such as:
wget https://raw.githubusercontent.com/gokcehan/lf/master/etc/lfrc.example
Alternatively, just download or clone the repository, and then copy the lfrc.example file:
git clone https://github.com/gokcehan/lf
`mkdir -p ~/.config/lf/ && cp lfrc.example ~/.config/lf/lfrc`
The example lfrc. example is already very nice, it would be nice to add some more commonly used mappings, so that it will be easier/as well as instrumental.
- move up/down in current folder:
j/k
- move to upper level/lower level of folder:
h/l
- Show/hide hidden files:
zh
- run shell command:
<enter>
- select files/toggle:
<space>
- remove command:
:remove
- Remove the selected files with confirmation prompt. - If using the default/example lfrc file: you can add the line in lfrc file, as
map D trash
, then,D
key will trash the selected files.
One useful feature of ranger is to have multiple 'tabs' on different folders/path. This feature allows operations such as copying/pasting from one folder to another much easier.
lf doesn't have tabs, but instead, we can use programs such as screen to achieve the same function. If you haven't used screen before, it's highly recommended as it's so POWERFUL: https://www.youtube.com/watch?v=hB6Y72DK8mc
To use lf with screen (or other terminal multiplexer):
- Launch screen
- Start lf in the folder of your interests. (lf will start a 'server' in the background)
- Switch to another terminal with screen, such as using 'Ctrl-A c' to create another terminal.
- Navigate to the other folder of interest, start lf (or start lf, and navigate to the folder)
- Once we have screen running and lf running within the two different screen terminal, we can copy/paste files around similarly as in ranger.
To summarize, the multiple tabs functionality of ranger, can be mimicked with lf + screen. The lf server started in the background for the first instance of lf, can serve the communication (such as copying and pasting) between the different screen terminals.