1
1
mirror of https://github.com/jarun/nnn.git synced 2024-10-26 14:28:31 +03:00

Updated icon instructions now that nerdfont is supported

Dave Snider 2020-09-13 20:20:46 -07:00
parent 6dceb75907
commit 728b635beb

@ -1,11 +1,25 @@
## File icons
`nnn` supports [icons-in-terminal](https://github.com/sebastiencs/icons-in-terminal). Icons are not compiled-in by default to avoid shipping third-party resources.
`nnn` supports mutliple ways to show icons. They are turned off by default and are not provided in the default distribution to avoid shipping third party resources. Currently we support [icons-in-terminal](https://github.com/sebastiencs/icons-in-terminal) for those wishing to use icons alongside a normal code font. Alternatively, you can utilize Nerdfont's patched fonts to add icons to the font itself. The later is more common for Vim users who need fonts for various powerline plugins. Regardless of the method, each method will produce similar experiences within nnn. You will need to recompile nnn rather than use the default release in both cases.
To enable file icons follow the steps below:
### To enable icons-in-terminal icons
- [Install](https://github.com/sebastiencs/icons-in-terminal#installation) icons-in-terminal
- Compile `nnn` with the make option `O_ICONS=1`
- Clone the nnn repo
- Edit `src/icons.h` and make sure to include the `icons-in-terminal.h` file at the top
- Compile `nnn` with `make O_ICONS=1` from the root
### To enable Nerdfont icons
- [Download and install](https://www.nerdfonts.com/) a patched Nerdfont.
- Apply that font as your terminal emulator's font. This will vary from emulator to emulator, but usually involves editing a config file or changing a setting within a GUI menu system.
- Edit `src/icons.h` and make sure to include the `icons-nerdfont.h` file at the top
- Compile `nnn` with `make O_ICONS=1` from the root
### Move the newly compiled nnn to where your programs normally go
Once compiled, you'll notice an `nnn` executable is now in your root. Copy this file to wherever such programs are normally stored. A good way to check is to do a `which nnn` on where the packaged release was installed. Simply replacing that file should be enough.
## Custom keybinds