A swiss army knife plugin that super charges ⚡️ your micro text editor
List of features:
- ⚓️ Project Navigations:
- 🖱️ Cursor Control:
- 📜 Buffer/Tab Actions:
- (WIP) Bracket jumping without on top of it
- (WIP) Contect selection within brackets
- (WIP) Resize split with keyboard
You can install MicroOmni using micro -plugin install OmniMicro
by either
- Add it to
"pluginrepos"
insettings.json
, like
"pluginrepos": [
"https://raw.githubusercontent.com/Neko-Box-Coder/MicroOmni/master/repo.json"
]
- Or using the unofficial-plugin-channel, like
"pluginchannels": [
"https://raw.githubusercontent.com/Neko-Box-Coder/unofficial-plugin-channel/main/channel.json"
]
- Alternatively, you can
git clone https://github.com/Neko-Box-Coder/MicroOmni
to your microplug
directory
- micro
- fzf
- ripgrep
- bat
- diff (Windows)
All of these are available for Unix and Windows
Windows link to requirements
https://github.com/junegunn/fzf/releases
https://github.com/BurntSushi/ripgrep/releases
Alternatively, you can get all the required executables you need for Windows in Release
Note
On Windows, the directory that has the required executables must be added to the PATH environment variable
Recommended binding:
{
"Alt-F": "command:OmniGlobalSearch",
//Windows
"Alt-Shift-F": "command:OmniGlobalSearch"
}
To find a with keyword(s), launch command OmniGlobalSearch
which is bindable to a key.
{fileDir}
can be used to substitute the directory path of the current file.- If successful, a fzf window will be launched. Here are the keybindings by default:
- up/down: Navigate results
- alt-up / alt-down: Navigate half page of results
- page-up / page-down: Scroll up and down for the preview window
- alt-f: Search again with text in the input field (Non fuzzy but case insensitive)
OmniFzfCmd
: Thefzf
location.- Defaults to
"fzf"
- Defaults to
OmniNewFileMethod
: How to open the new file. Available options are:smart_newtab
: (Default) Opens the new file in newtab if not opened alreadythispane
: Opens in current panenewtab
: Opens in new tabvsplit
: Opens in new pane as vertical splithsplit
: Opens in new pane as horizontal split
OmniGlobalSearchArgs
: Argument to be passed to fzf. It defaults to the following:
OmniContentArgs = "--bind 'alt-f:reload:rg -i -F -uu -n {q}' "..
"--delimiter : -i --reverse "..
"--bind page-up:preview-half-page-up,page-down:preview-half-page-down,"..
"alt-up:half-page-up,alt-down:half-page-down "..
"--preview-window 'down,+{2}-/2' "..
"--preview 'bat -f -n --highlight-line {2} {1}'"
Recommended binding:
{
"Alt-f": "command:OmniLocalSearch"
}
Similar to "Fuzzy Search For Text Globally", this do a fuzzy search for the current file.
This is achieved by bat
the file on disk to fzf
, therefore you should save before searching.
The default control is the same as "Fuzzy Search For Text Globally".
To search, simply launch the OmniLocalSearch
command.
OmniLocalSearchArgs
: Argument to be passed to fzf with{filePath}
substitute with the current file path. It defaults to the following:
OmniLocalSearchArgs = "--bind 'start:reload:bat -n --decorations always {filePath}' "..
"-i --reverse "..
"--bind page-up:preview-half-page-up,page-down:preview-half-page-down,"..
"alt-up:half-page-up,alt-down:half-page-down "..
"--preview-window 'down,+{1}-/2' "..
"--preview 'bat -f -n --highlight-line {1} {filePath}'"
Recommended binding:
{
"Alt-G": "command:OmniGotoFile"
//Windows
"Alt-Shift-G": "command:OmniGotoFile"
}
Similar to "Fuzzy Search For Files Recursively", this do a fuzzy search for all the files The default control is the same as "Fuzzy Search For Files Recursively".
To search, simply launch the OmniGotoFile
command.
OmniNewFileMethod
: Same as previousOmniGotoFileArgs
: Argument to be passed to fzf. It defaults to the following:
OmniGotoFileArgs = "-i --reverse "..
"--bind page-up:preview-half-page-up,page-down:preview-half-page-down,"..
"alt-up:half-page-up,alt-down:half-page-down "..
"--preview-window 'down' "..
"--preview 'bat -f -n {}'"
To jump to a word anywhere on the screen, launch the OmniJump
command WITH a keybinding
Recommended binding:
{
"Alt-j": "command:OmniJump"
}
When you are editing multiple files or jumping between different functions,
a history of the cursor location is stored. You can go to previous or next cursor position
by launching the OmniPreviousHistory
and OmniNextHistory
commands.
This is similar to the navigate back and forward commands in VSCode
Recommended binding:
{
"Alt-{": "command:OmniPreviousHistory",
"Alt-}": "command:OmniNextHistory",
//Windows
"Alt-Shift-{": "command:OmniPreviousHistory",
"Alt-Shift-}": "command:OmniNextHistory"
}
OmniNewFileMethod
: Same as previousOmniHistoryLineDiff
: Sets how many line difference count as new cursor history. Defaults to 5
It centers your cursor to the middle of your viewport.
{
"Alt-m": "command:OmniCenter"
}
Recommended binding:
{
"Alt-J": "command-edit:OmniJumpSelect ",
//Windows
"Alt-Shift-J": "command-edit:OmniJumpSelect "
}
To select a section based on line number, launch the OmniJumpSelect
command with
the line number specified.
By default it uses relative line numbers, so 5 is 5 lines down and -5 is 5 lines up. This can be configured to use absolute line number. See settings.
OmniSelectType
: Sets the jump selection type. Can either berelative
(default) orabsolute
{
"Alt-M": "command:OmniMinimap",
//Windows
"Alt-Shift-M": "command:OmniMinimap",
}
To see an overview of the current file based on indentation, launch the OmniMinimap
command.
By default it will show neighboring lines as "context" if they have the same indentations
OmniMinimapMaxIndent
: Max indent limit to be shown in the minimap- Defaults to 5
OmniMinimapContextNumLines
: Max number of context lines- Defaults to 20
OmniMinimapMinDistance
: Min skipping distance for the minimap- Defaults to 20
OmniMinimapMaxColumns
: Max number of columns in minimap, and use "..." if doesn't fit- Defaults to 75
OmniMinimapTargetNumLines
: Number of lines aiming to have for the minimap- Defaults to 100
OmniMinimapScrollContent
: Automatically scroll the content buffer when navigating in the minimap- Defaults to true
To compare the current buffer with another buffer of file, launch the OmniDiff
command.
Buffers are not required to be saved in order to perform the diff.
When being asked on what to diff, you can either specify a filename or a tab
The syntax for diffing a tab is as follow
tab:[+/-]<tab index>[:<split index>]
With +
or -
means it will be relative tab index, or absolute otherwise, similar to tabmove
.
The split index can be used to specify which split to be diff against
Recommended binding:
None (Invoke it in command pane)
To highlight anything without going to it, launch the OmniHighlightOnly
command.
Recommended binding:
{
"Alt-h": "command:OmniHighlightOnly"
}
You can create a newtab either on the right or left of the current tab by launching
OmniNewTabRight
or OmniNewTabLeft
command
Recommended binding:
{
"Alt-t": "command:OmniNewTabRight"
}
You can copy the current file absolute or relative path with OmniCopyRelativePath
and
OmniCopyAbsolutePath
command.
Recommended binding:
None (Invoke it in command pane)