Skip to content

Commit 87874c2

Browse files
Adding ability to scroll in tab bar & updating readme
1 parent cdf202a commit 87874c2

File tree

3 files changed

+68
-38
lines changed

3 files changed

+68
-38
lines changed

MicroOmni.lua

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,21 @@ local function OmniNewTabRight(bp)
188188
bp:TabMoveCmd({tostring(currentActiveIndex + 2)})
189189
end
190190

191+
local function OmniTabScrollRight(bp)
192+
-- local totalSize = micro.Tabs().TabWindow:TotalSize()
193+
-- micro.InfoBar():Message("totalSize:", totalSize)
194+
micro.Tabs().TabWindow:Scroll(25)
195+
-- w.hscroll = util.Clamp(w.hscroll, 0, s-w.Width)
196+
end
197+
198+
local function OmniTabScrollLeft(bp)
199+
-- local totalSize = micro.Tabs().TabWindow:TotalSize()
200+
-- micro.InfoBar():Message("totalSize:", totalSize)
201+
micro.Tabs().TabWindow:Scroll(-25)
202+
-- w.hscroll = util.Clamp(w.hscroll, 0, s-w.Width)
203+
end
204+
205+
191206
local function OmniNewTabLeft(bp)
192207
local currentActiveIndex = micro.Tabs():Active()
193208
bp:NewTabCmd({})
@@ -363,6 +378,9 @@ function init()
363378

364379
config.MakeCommand("OmniMinimap", Minimap.OmniMinimap, config.NoComplete)
365380

381+
config.MakeCommand("OmniTabScrollRight", OmniTabScrollRight, config.NoComplete)
382+
config.MakeCommand("OmniTabScrollLeft", OmniTabScrollLeft, config.NoComplete)
383+
366384
config.MakeCommand("OmniTest", OmniTest, TestCompleter)
367385
config.MakeCommand("OmniTest2", OmniTest2, config.NoComplete)
368386
config.MakeCommand("OmniTest3", OmniTest3, config.NoComplete)

README.md

Lines changed: 50 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@ List of features:
1212
- [📔 Global Cursor History](#-global-cursor-history)
1313
- [🔲 Centering Cursor To Viewport](#-centering-cursor-to-viewport)
1414
- [🦘 Jump Selection](#-jump-selection)
15+
- 📑 Tab Control:
16+
- [➕ Newtab Next To Current Tab](#-newtab-next-to-current-tab)
17+
- [↔️ Tab Bar Scrolling](#%EF%B8%8F-tab-bar-scrolling)
1518
- 📜 Buffer/Tab Actions:
16-
- [🗺️ Minimap](#%EF%B8%8F-minimap)
1719
- [🧦 Diff View](#-diff-view)
1820
- [🔦 Highlight Only (Before finding next)](#-highlight-only-before-finding-next)
19-
- [📑 Newtab Next To Current Tab](#-newtab-next-to-current-tab)
2021
- [📁 Copy Current File Path](#-copy-current-file-path)
22+
- [🗺️ Minimap](#%EF%B8%8F-minimap)
2123
- (WIP) Bracket jumping without on top of it
2224
- (WIP) Contect selection within brackets
2325
- (WIP) Resize split with keyboard <!-- Using https://github.com/zyedidia/micro/issues/1807#issuecomment-1907899274 -->
@@ -42,8 +44,8 @@ You can install MicroOmni using `micro -plugin install OmniMicro` by either
4244

4345
## 📐 Requirements
4446
- micro
45-
- micro [nightly](https://github.com/zyedidia/micro/releases/tag/nightly)
46-
- [Or from my branch (dev) github action artifacts](https://github.com/Neko-Box-Coder/micro-dev/actions))
47+
- micro [v2.0.14](https://github.com/zyedidia/micro/releases/tag/v2.0.14)
48+
- [My custom build of micro (dev)](https://github.com/Neko-Box-Coder/micro-dev/actions)
4749
- fzf
4850
- ripgrep
4951
- bat
@@ -256,34 +258,33 @@ This can be configured to use absolute line number. See settings.
256258
### ⚙️ Jump Selection Type Settings
257259
- `OmniSelectType`: Sets the jump selection type. Can either be `relative` (default) or `absolute`
258260

259-
## 🗺️ Minimap
260-
![Minimap Gif](./Resources/Minimap.gif)
261+
262+
## ➕ Newtab Next To Current Tab
263+
You can create a newtab either on the right or left of the current tab by launching
264+
`OmniNewTabRight` or `OmniNewTabLeft` command
265+
266+
![New Tab Gif](./Resources/NewTab.gif)
267+
261268
Recommended binding:
262269
```json
263270
{
264-
"Alt-M": "command:OmniMinimap",
265-
//Windows
266-
"Alt-Shift-M": "command:OmniMinimap",
271+
"Alt-t": "command:OmniNewTabRight"
267272
}
268273
```
269274

270-
To see an overview of the current file based on indentation, launch the `OmniMinimap` command.
271-
By default it will show neighboring lines as "context" if they have the same indentations
275+
## ↔️ Tab Bar Scrolling
276+
When you have too many tabs, you can scroll via them without switching by launching
277+
`OmniTabScrollLeft` or `OmniTabScrollLeft` command
272278

273-
### ⚙️ Minimap Settings
274-
- `OmniMinimapMaxIndent`: Max indent limit to be shown in the minimap
275-
- Defaults to 5
276-
- `OmniMinimapContextNumLines`: Max number of context lines
277-
- Defaults to 20
278-
- `OmniMinimapMinDistance`: Min skipping distance for the minimap
279-
- Defaults to 20
280-
- `OmniMinimapMaxColumns`: Max number of columns in minimap, and use "..." if doesn't fit
281-
- Defaults to 75
282-
- `OmniMinimapTargetNumLines`: Number of lines aiming to have for the minimap
283-
- Defaults to 100
284-
- `OmniMinimapScrollContent`: Automatically scroll the content buffer when navigating in the minimap
285-
- Defaults to true
279+
![Tab Scrolling Gif](./Resources/TabScroll.gif)
286280

281+
Recommended binding:
282+
```json
283+
{
284+
"Alt-PageUp": "command:OmniTabScrollLeft",
285+
"Alt-PageDown": "command:OmniTabScrollRight"
286+
}
287+
```
287288

288289
## 🧦 Diff View
289290
To compare the current buffer with another buffer of file, launch the `OmniDiff` command.
@@ -316,27 +317,38 @@ Recommended binding:
316317
}
317318
```
318319

320+
## 📁 Copy Current File Path
321+
You can copy the current file absolute or relative path with `OmniCopyRelativePath` and
322+
`OmniCopyAbsolutePath` command.
319323

320-
## 📑 Newtab Next To Current Tab
321-
You can create a newtab either on the right or left of the current tab by launching
322-
`OmniNewTabRight` or `OmniNewTabLeft` command
324+
Recommended binding:
323325

324-
![New Tab Gif](./Resources/NewTab.gif)
326+
None (Invoke it in command pane)
325327

328+
## 🗺️ Minimap
329+
![Minimap Gif](./Resources/Minimap.gif)
326330
Recommended binding:
327331
```json
328332
{
329-
"Alt-t": "command:OmniNewTabRight"
333+
"Alt-M": "command:OmniMinimap",
334+
//Windows
335+
"Alt-Shift-M": "command:OmniMinimap",
330336
}
331337
```
332338

339+
To see an overview of the current file based on indentation, launch the `OmniMinimap` command.
340+
By default it will show neighboring lines as "context" if they have the same indentations
333341

334-
## 📁 Copy Current File Path
335-
You can copy the current file absolute or relative path with `OmniCopyRelativePath` and
336-
`OmniCopyAbsolutePath` command.
337-
338-
Recommended binding:
339-
340-
None (Invoke it in command pane)
341-
342-
342+
### ⚙️ Minimap Settings
343+
- `OmniMinimapMaxIndent`: Max indent limit to be shown in the minimap
344+
- Defaults to 5
345+
- `OmniMinimapContextNumLines`: Max number of context lines
346+
- Defaults to 20
347+
- `OmniMinimapMinDistance`: Min skipping distance for the minimap
348+
- Defaults to 20
349+
- `OmniMinimapMaxColumns`: Max number of columns in minimap, and use "..." if doesn't fit
350+
- Defaults to 75
351+
- `OmniMinimapTargetNumLines`: Number of lines aiming to have for the minimap
352+
- Defaults to 100
353+
- `OmniMinimapScrollContent`: Automatically scroll the content buffer when navigating in the minimap
354+
- Defaults to true

Resources/TabScroll.gif

230 KB
Loading

0 commit comments

Comments
 (0)