Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rlychrisg/truncateline.nvim
Show the start of long lines when scrolling way off to the right.
https://github.com/rlychrisg/truncateline.nvim
neovim neovim-plugin
Last synced: 6 days ago
JSON representation
Show the start of long lines when scrolling way off to the right.
- Host: GitHub
- URL: https://github.com/rlychrisg/truncateline.nvim
- Owner: rlychrisg
- License: mit
- Created: 2024-08-18T04:14:37.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-09-30T08:32:01.000Z (about 2 months ago)
- Last Synced: 2024-10-29T23:13:23.929Z (20 days ago)
- Topics: neovim, neovim-plugin
- Language: Lua
- Homepage:
- Size: 173 KB
- Stars: 16
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- my-neovim-pluginlist - rlychrisg/truncateline.nvim - commit/rlychrisg/truncateline.nvim) ![](https://img.shields.io/github/commit-activity/y/rlychrisg/truncateline.nvim) (View / Wrap line)
README
# ✂️ truncateline.nvim
A customisable way to avoid getting lost by truncating long lines.
https://github.com/user-attachments/assets/0ae6a88e-0ae5-47f5-90d0-b2455b652938
## ✨ Features
+ Have the option to turn it on or off at startup.
+ A toggle function, a key can also be bound to temporarily toggle between on and off.
+ Character count, truncation string, temporary toggle duration and highlight groups can also be configured.## 📦 Installation
For a default configuration:
```lua
{
"rlychrisg/truncateline.nvim",
-- NOTE: these keybinds are not set by default and will need to be set
-- either here, or wherever you set your keybinds.
keys = {
{
"l", ":TemporaryToggle",
{ noremap = true, silent = true, desc = "TruncateLine temporary toggle" },
},{
"sl", ":ToggleTruncate",
{ noremap = true, silent = true, desc = "TruncateLine toggle" },
},
},
opts = {
enabled_on_start = true,-- this will be appended to the virtual text to distinguish it from the actual text
-- to disable this behaviour, set truncate_str to ""
truncate_str = "...",-- how many characters from the start of the line should be displayed
-- Note: you might want the total of this setting,
-- along with truncate_str, to be less than your sidescrolloff
-- setting, to prevent obscuring text.
line_start_length = 8,-- time for in ms for a temporary toggle
temporary_toggle_dur = 2000,-- which highlight group should be used for virtual text.
-- "Comment", or "Normal" are good choices, but anything in
-- :highlight can be used. you can also create your own and
-- set the colour in your colour scheme's config.
hilight_group = "Comment",
},
},
```> [!NOTE]
> Contributions and suggestions are welcome but I'm a bit of a beginner in both Lua and Git, so please be patient and err on the side of patronising when explaining stuff.