h-m-m for neovim, with an infinite pannable canvas, colorschemes, file explorer etc.
Intended for use as standalone app, powered by NVIM_APPNAME
from neovim.
In other words, this requires no knowledge of vim, and does not mess with your current vim config.
It is intended as plug and play replacement for h-m-m, when it is ready.
Automatically installs needed dependencies ( i.e. plugins ) using lazy.nvim.
! Only difficult dependency: a proper nerdfont, set up the terminal with that font.
Thanks to neovim as backend, we get file explorer, find files, etc. for free.
Help is inbuilt.
Can support any neovim colorscheme.
⚠ This is still work in progress. The implementation is spaghetti.
It is indended as proof of concept of using neovim as TUI backend.
First install Neovim >= 0.9 ( which supports NVIM_APPNAME
) from here.
Install nerdfont of choice from nerdfont. Configure your terminal to use it.
For kitty terminal, with IBM Plex and FiraCode,
font_family Fira Code Regular Nerd Font Complete
italic_font Blex Mono Light Italic Nerd Font Complete
bold_font Blex Mono Bold Nerd Font Complete
bold_italic_font Blex Mono SemiBold Italic Nerd Font Complete
Then clone the repo, install and check out an example.
git clone https://github.com/manyids2/hmm.nvim
cd hmm.nvim
# Install hmm.nvim to `$XDG_CONFIG_DIR/nvim-apps/hmm.nvim`
# Installs shell script to `/usr/bin/hmm.nvim`, asks for sudo
make install
# Check out the main features
cd examples
hmm.nvim hello.hmm
- Pan canvas
- Open multiple files
- Many many colorschemes
- (planned) Mouse support
- (planned) Toggle each node between list, tree, and
text
views - (planned) Link to external maps, break off trees, render on infinite canvas, etc.
- Search for file
- Search within all files
- Change colorscheme dynamically
- Undo, redo across sessions
- Cross platform
- Blazing fast
- Bufferline has weird artifacts before changing colorscheme
- Cannot open without providing filename
- Reads and writes a lot - absolutely not performant
- Should save state to some different place
- Horrible code to check if node in view
- Opening file from telescope needs to press
<esc>
before interacting - Not checking recursion while pasting
- config, help as hmm files
- multiline text
- feature parity
- proper return from telescope
- more navigation, editing options
- list/tree state for each node
- save state somewhere else than in hmm file
- read write lines rather than whole file
- link node to another hmm file, render and save appropriately
- link node to md file, show on canvas, in float
- paste list as children, e.g. from ls or other bash commands
Checklist for feature parity with original.
Adding, removing, and editing nodes:
-
o
orEnter
- create a new sibling to the active node -
O
orTab
- create a new child for the active node -
y
- yanks (copies) the active node and its descendants -
Y
- yanks (copies) the descendants of the active node -
d
- deletes (cuts) the active node and its descendants -
D
- deletes (cuts) the descendants of the active node -
Delete
- deletes the active node and its descendants without putting them in the clipboard - [-]
p
- pastes as descendants of the active node - [-]
P
- pastes as siblings of the active node -
Ctrl+p
- appends the clipboard text at the end of the active node's title -
e
,i
, ora
- edits the active node -
E
,I
, orA
- edits the active node, ignoring the existing text -
u
- undo -
Ctrl+r
- redo
Marks:
-
t
- toggles '✓ ', '✗ ', and '' (or your custom symbols) at the beginning of the title -
#
- adds or removes sequential numbers at the beginning of the titles of a node and its siblings -
=
- increases the positive ranking -
+
- decreases the positive ranking -
-
- increases the negative ranking -
_
- decreases the negative ranking -
H
- toggles the hidden flag
Relative navigating and moving:
-
h
or←
- activates the parent of the previously active node -
l
or→
- activates the middle child of the previously active node - [-]
j
or↓
- activates the lower sibling (or the nearest lower node if there's no lower sibling) - [-]
k
or↑
- activates the higher sibling (or the nearest higher node if there's no higher sibling) -
J
- moves the current node down among its siblings -
K
- moves the current node up among its siblings -
T
- sorts the siblings of the active node
Adjusting the view:
-
c
- centers the active node on the screen -
C
- locks/unlocks active nodes on the center -
~
orm
- activate the root element -
g
- goes to the highest element -
G
- goes to the lowest element -
w
- increases the maximum node width -
W
- decreases the maximum node width -
z
- decreases line spacing -
Z
- increases line spacing - [-]
|
- enables/disables aligned levels -
ctrl+h
- hides/views hidden nodes
Collapsing and expanding:
-
Space
- toggles the active node -
v
- collapses everything other than the first-level nodes -
V
- collapses all the children of the active node -
b
- expands all nodes -
B
- collapses all nodes ( extra ) -
1
to9
- collapse the nth level and expand those before -
f
- focuses by collapsing all, but the ancestors and descendants of the active node -
F
- locks focus as the active node changes (try it with the center lock) -
r
- collapses all the first level items except for the one that contains the active node -
R
- collapses the children of the active node
Search:
- [-]
/
,?
, orCtrl+f
- searches for a phrase - [-]
n
- goes to the next search result - [-]
N
- goes to the previous search result
Save, export, quit, etc.:
- [o]
s
- saves with the previous file name (or asks for one if there's none) - [o]
S
- saves with a new file name -
x
- export as an HTML file -
X
- export as a text map into clipboard -
q
- quits (if the changes were already saved) - [o]
Q
- quits, ignoring the changes -
Ctrl+o
- open the active node as a file or URL using xdg-open
In the text editor:
( We can ignore, as we use noice
for input )
-
↓
- moves the cursor to the end of the line -
↑
- moves the cursor to the beginning of the line -
←
orHome
- moves the cursor to the left -
→
orEnd
- moves the cursor to the right -
Ctrl+Left
orShift+Left
- moves cursor to the previous word -
Ctrl+Right
orShift+right
- moves cursor to the next word -
Delete
- deletes character -
Ctrl+Delete
- deletes word -
Backspace
- deletes previous character -
ctrl+Backspace
- deletes previous word -
Ctrl+v
orCtrl+Shift+v
- paste -
Esc
- cancels editing -
Enter
- wanna guess? ;)
The following are the settings in h-m-m:
- [-] max_parent_node_width = 25
- [-] max_leaf_node_width = 55
- line_spacing = 1
- [-] align_levels = 0
- initial_depth = 1
- [-] center_lock = false
- focus_lock = false
- [o] max_undo_steps = 24