From 13b5f6c165c1be7d41cc0b66dc9192209d4ed6bc Mon Sep 17 00:00:00 2001 From: nadrad Date: Fri, 16 Sep 2022 14:31:09 +0200 Subject: [PATCH 01/12] removing del and control characters from the text --- h-m-m | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/h-m-m b/h-m-m index d2025bf..26b8ee8 100755 --- a/h-m-m +++ b/h-m-m @@ -315,11 +315,16 @@ function decode_tree($lines, $root_id, $start_id) foreach ($lines as $lid=>$line) { $lines[$lid] = - str_replace + mb_ereg_replace ( - [ "\t", "\n", "\r", BOM ] - ,[ " ", " ", " ", "" ] - ,$lines[$lid] + "[\000-\040\177".BOM."]" + ,'' + ,str_replace + ( + [ "\t", "\n", "\r" ] + ,[ " ", " ", " " ] + ,$lines[$lid] + ) ) ; @@ -1147,7 +1152,7 @@ function edit_node(&$mm, $rewrite = false) while(true) { - usleep(10000); + usleep(5000); $in = fread(STDIN, 9); if ($in != '') @@ -1278,15 +1283,15 @@ function edit_node(&$mm, $rewrite = false) $content = trim ( - str_replace + mb_ereg_replace ( - "\n", - " ", - str_replace + "[\000-\040\177".BOM."]" + ,'' + ,str_replace ( - "\t", - " ", - get_from_clipboard($mm) + ["\n", "\r", "\t"] + ,[" ", "", " " ] + ,get_from_clipboard($mm) ) ) ); @@ -1326,9 +1331,10 @@ function edit_node(&$mm, $rewrite = false) ( $title ,$cursor-1 - ); + ) + ; - $title = str_replace(BOM,'',$title); + $title = mb_ereg_replace("[\000-\040\177".BOM."]",'',$title); $cursor++; } From f65979bbd047cee71fe00259993dd7abed5dd63f Mon Sep 17 00:00:00 2001 From: nadrad Date: Fri, 16 Sep 2022 14:37:56 +0200 Subject: [PATCH 02/12] control character removal for the clipboard func --- h-m-m | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/h-m-m b/h-m-m index 26b8ee8..8fbc074 100755 --- a/h-m-m +++ b/h-m-m @@ -1283,16 +1283,11 @@ function edit_node(&$mm, $rewrite = false) $content = trim ( - mb_ereg_replace + str_replace ( - "[\000-\040\177".BOM."]" - ,'' - ,str_replace - ( - ["\n", "\r", "\t"] - ,[" ", "", " " ] - ,get_from_clipboard($mm) - ) + ["\n", "\r", "\t"] + ,[" ", "", " " ] + ,get_from_clipboard($mm) ) ); @@ -1987,7 +1982,15 @@ function encode_tree(&$mm, $id, $exclude_parent = false, $base = 0) function append(&$mm) { $mm['nodes'][ $mm['active_node'] ]['title'] .= - ' '. str_replace("\n",' ',str_replace("\t",' ',trim(get_from_clipboard($mm)))); + ' ' + .str_replace + ( + ["\n","\r","\t"] + ,[' ','', ' '] + ,trim(get_from_clipboard($mm)) + ) + ; + build_map($mm); display($mm); } @@ -2084,7 +2087,14 @@ function copy_to_clipboard(&$mm, $text) function get_from_clipboard(&$mm) { - return str_replace(BOM,'',shell_exec($mm['clipboard']['read'])); + return + mb_ereg_replace + ( + "[\000-\040\177".BOM."]" + ,'' + ,shell_exec($mm['clipboard']['read']) + ) + ; } From 979c02438da8960096ac3cf54e79d6f69d50e468 Mon Sep 17 00:00:00 2001 From: nadrad Date: Fri, 16 Sep 2022 14:47:47 +0200 Subject: [PATCH 03/12] fixed the no/display search issue --- h-m-m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/h-m-m b/h-m-m index 8fbc074..38557c1 100755 --- a/h-m-m +++ b/h-m-m @@ -1417,7 +1417,7 @@ function search(&$mm) system("stty sane"); $mm['query'] = readline('Search for: '); - system('stty cbreak -echo'); + system('stty cbreak -echo -crterase intr undef'); if (empty($mm['query'])) { @@ -1427,6 +1427,7 @@ function search(&$mm) if (!next_search_result($mm)) previous_search_result($mm); + } function previous_search_result(&$mm) @@ -1454,7 +1455,10 @@ function previous_search_result(&$mm) } if ($nid<0) + { + display($mm); return false; + } $mm['active_node'] = $nid; display($mm); From 9e0fd42e8f2ac1f0ba550ac821120b617b35b54a Mon Sep 17 00:00:00 2001 From: nadrad Date: Fri, 16 Sep 2022 14:51:50 +0200 Subject: [PATCH 04/12] space was mistakenly excluded as a control char --- h-m-m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/h-m-m b/h-m-m index 38557c1..c763aec 100755 --- a/h-m-m +++ b/h-m-m @@ -317,7 +317,7 @@ function decode_tree($lines, $root_id, $start_id) $lines[$lid] = mb_ereg_replace ( - "[\000-\040\177".BOM."]" + "[\000-\037\177".BOM."]" ,'' ,str_replace ( @@ -1329,7 +1329,7 @@ function edit_node(&$mm, $rewrite = false) ) ; - $title = mb_ereg_replace("[\000-\040\177".BOM."]",'',$title); + $title = mb_ereg_replace("[\000-\037\177".BOM."]",'',$title); $cursor++; } @@ -2094,7 +2094,7 @@ function get_from_clipboard(&$mm) return mb_ereg_replace ( - "[\000-\040\177".BOM."]" + "[\000-\037\177".BOM."]" ,'' ,shell_exec($mm['clipboard']['read']) ) From dd0880e755bf9aad8c62fffd3e59322a1e06b6aa Mon Sep 17 00:00:00 2001 From: nadrad Date: Fri, 16 Sep 2022 14:58:07 +0200 Subject: [PATCH 05/12] more key bindings for search --- h-m-m | 4 ++++ readme.md | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/h-m-m b/h-m-m index c763aec..6df92b5 100755 --- a/h-m-m +++ b/h-m-m @@ -125,6 +125,7 @@ const insert_child = 1; const ctrl_p = "\020"; const ctrl_c = "\003"; const ctrl_r = "\022"; +const ctrl_f = "\006"; const arr_down = "\033\133\102"; const arr_right = "\033\133\103"; @@ -2659,7 +2660,10 @@ function monitor_key_presses(&$mm) case '~': go_to_root($mm); break; case ' ': toggle($mm); break; + case '/': search($mm); break; + case '?': search($mm); break; + case ctrl_f: search($mm); break; case "\n": insert_node($mm, insert_sibling); break; case "\t": insert_node($mm, insert_child); break; diff --git a/readme.md b/readme.md index cfd174a..11d7de8 100644 --- a/readme.md +++ b/readme.md @@ -58,7 +58,7 @@ Collapsing and expanding: Search: -* `/` - searches for a phrase +* `/`, `?`, or `ctrl+f` - searches for a phrase * `n` - goes to the next search result * `N` - goes to the previous search result From 890e6cb45ff8145065f924be5d3f23337f471ed6 Mon Sep 17 00:00:00 2001 From: nadrad Date: Fri, 16 Sep 2022 19:33:55 +0200 Subject: [PATCH 06/12] setting a maximum for undo --- h-m-m | 27 +++++++++++++++++++-------- readme.md | 1 + 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/h-m-m b/h-m-m index 6df92b5..2a7795b 100755 --- a/h-m-m +++ b/h-m-m @@ -19,6 +19,7 @@ $mm['question_color'] = "\033[38;5;168m"; $mm['changes'] = []; $mm['change_active_node'] = []; $mm['change_index'] = 0; +$mm['change_max_steps'] = 24; mb_regex_encoding("UTF-8"); mb_internal_encoding("UTF-8"); @@ -49,6 +50,8 @@ function load_settings(&$mm) case 'line_spacing': $mm['line_spacing'] = max( round($value), 0 ); break; case 'initial_depth': $mm['initial_depth'] = max( round($value), 1 ); break; + case 'undo_steps': $mm['change_max_steps'] = max( round($value), 0 ); break; + case 'active_node_color': $mm['active_node_color'] = $value; break; case 'message_color': $mm['message_color'] = $value; break; @@ -1021,7 +1024,6 @@ function push_node_down(&$mm, $id) if ($id==0) return; push_change($mm); - $mm['modified'] = true; if (isset($mm['nodes'][$id+1])) @@ -1058,6 +1060,7 @@ function insert_node(&$mm, $type) if ($mm['active_node']==$mm['root']) $type=insert_child; + push_change($mm); $mm['modified'] = true; if ($type==insert_sibling) @@ -1140,8 +1143,6 @@ function show_line(&$mm, $title, $cursor, $shift) function edit_node(&$mm, $rewrite = false) { - push_change($mm); - $title = $rewrite ? '' : $mm['nodes'][ $mm['active_node'] ]['title']; if ($mm['active_node']==0 && $title=='root') $title=''; @@ -1272,7 +1273,10 @@ function edit_node(&$mm, $rewrite = false) $title = trim($title); $mm['nodes'][ $mm['active_node'] ]['title'] = $title; $original['nodes'][ $mm['active_node'] ]['title'] = $title; + + push_change($mm); $mm['modified'] = true; + build_map($mm); display($mm); return; @@ -1505,7 +1509,6 @@ function move_active_node_down(&$mm) if ($mm['active_node']==0) return; push_change($mm); - $mm['modified'] = true; $parent_id = $mm['nodes'][ $mm['active_node'] ]['parent']; @@ -1542,7 +1545,6 @@ function move_active_node_up(&$mm) if ($mm['active_node']==0) return; push_change($mm); - $mm['modified'] = true; $parent_id = $mm['nodes'][ $mm['active_node'] ]['parent']; @@ -1798,7 +1800,18 @@ function push_change(&$mm) { // flush any redo chain while(count($mm['changes']) > $mm['change_index']) + { array_pop($mm['changes']); + array_pop($mm['change_active_node']); + } + + // removing the old history if it's getting bigger than the maximum + if (count($mm['changes']) >= $mm['change_max_steps']) + { + array_shift($mm['changes']); + array_shift($mm['change_active_node']); + $mm['change_index']--; + } array_push($mm['changes'], $mm['nodes']); array_push($mm['change_active_node'], $mm['active_node']); @@ -2011,7 +2024,6 @@ function paste_sub_tree(&$mm, $as_sibling ) if ($as_sibling && $mm['active_node']==$mm['root']) return; push_change($mm); - $mm['modified'] = true; if ($as_sibling) @@ -2132,12 +2144,11 @@ function yank_node(&$mm, $exclude_parent = false ) function delete_node(&$mm, $exclude_parent = false ) { - push_change($mm); - if ($mm['active_node']==$mm['root']) $exclude_parent = true; copy_to_clipboard($mm, encode_tree($mm, $mm['active_node'], $exclude_parent) ); + push_change($mm); $mm['modified'] = true; delete_node_internal($mm, $mm['active_node'], $exclude_parent); diff --git a/readme.md b/readme.md index 11d7de8..3941313 100644 --- a/readme.md +++ b/readme.md @@ -84,6 +84,7 @@ You can create an `h-m-m.conf` file in the same directory as the application and message_color = "\033[38;5;0m\033[48;5;141m\033[1m" center_lock = false focus_lock = false + undo_steps = 24 The colors are ASCII escape codes. From 4bccfadb7659b23991bd21b5c7bb1b025a0c2365 Mon Sep 17 00:00:00 2001 From: nadrad Date: Fri, 16 Sep 2022 20:00:40 +0200 Subject: [PATCH 07/12] replaced 'readline' with 'magic_readline'! --- h-m-m | 135 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 68 insertions(+), 67 deletions(-) diff --git a/h-m-m b/h-m-m index 2a7795b..94d7f17 100755 --- a/h-m-m +++ b/h-m-m @@ -1108,44 +1108,10 @@ function insert_node(&$mm, $type) // }}} -// {{{ edit node +// {{{ magic readline! -function show_line(&$mm, $title, $cursor, $shift) +function magic_readline(&$mm, $title) { - $output = mb_substr($title,$shift,$mm['terminal_width']-1); - $output .= str_repeat( ' ' ,$mm['terminal_width'] - mb_strlen($output) ); - - // showing the cursor - $output = - mb_substr - ( - $output - ,0 - ,$cursor-$shift-1 - ) - .invert_on - .mb_substr - ( - $output - ,$cursor-$shift-1 - ,1 - ) - .invert_off - .mb_substr - ( - $output - ,$cursor-$shift - ); - - put(0,$mm['terminal_height'],$mm['active_node_color'].$output); -} - - -function edit_node(&$mm, $rewrite = false) -{ - $title = $rewrite ? '' : $mm['nodes'][ $mm['active_node'] ]['title']; - if ($mm['active_node']==0 && $title=='root') $title=''; - $in = ''; $cursor = mb_strlen($title)+1; $shift = max( 0, $cursor - $mm['terminal_width'] ); @@ -1164,7 +1130,7 @@ function edit_node(&$mm, $rewrite = false) { display($mm); message($mm, 'Editing cancelled'); - return; + return false; } // up arrow and home @@ -1269,18 +1235,7 @@ function edit_node(&$mm, $rewrite = false) // enter elseif ($in=="\012") - { - $title = trim($title); - $mm['nodes'][ $mm['active_node'] ]['title'] = $title; - $original['nodes'][ $mm['active_node'] ]['title'] = $title; - - push_change($mm); - $mm['modified'] = true; - - build_map($mm); - display($mm); - return; - } + return trim($title); // ctrl+v elseif ($in=="\026") @@ -1349,6 +1304,65 @@ function edit_node(&$mm, $rewrite = false) } +function show_line(&$mm, $title, $cursor, $shift) +{ + $output = mb_substr($title,$shift,$mm['terminal_width']-1); + $output .= str_repeat( ' ' ,$mm['terminal_width'] - mb_strlen($output) ); + + // showing the cursor + $output = + mb_substr + ( + $output + ,0 + ,$cursor-$shift-1 + ) + .invert_on + .mb_substr + ( + $output + ,$cursor-$shift-1 + ,1 + ) + .invert_off + .mb_substr + ( + $output + ,$cursor-$shift + ); + + put(0,$mm['terminal_height'],$mm['active_node_color'].$output); +} + + + +// }}} +// {{{ edit node + +function edit_node(&$mm, $rewrite = false) +{ + $title = $rewrite ? '' : $mm['nodes'][ $mm['active_node'] ]['title']; + if ($mm['active_node']==0 && $title=='root') $title=''; + + $output = magic_readline($mm, $title); + + if ($output === false) + { + display($mm); + message($mm, 'Editing cancelled'); + return; + } + + $mm['nodes'][ $mm['active_node'] ]['title'] = $output; + + push_change($mm); + $mm['modified'] = true; + + build_map($mm); + display($mm); +} + + // }}} // {{{ center active node @@ -1417,12 +1431,7 @@ function go_to_bottom(&$mm) function search(&$mm) { - put(0,$mm['terminal_height'],$mm['active_node_color'].str_repeat(' ',$mm['terminal_width'])); - move(0,$mm['terminal_height']); - - system("stty sane"); - $mm['query'] = readline('Search for: '); - system('stty cbreak -echo -crterase intr undef'); + $mm['query'] = magic_readline($mm,''); if (empty($mm['query'])) { @@ -1692,26 +1701,18 @@ function export_html_node(&$mm, $parent_id) function save(&$mm, $new_name = false) { - if (empty($mm['filename'])) - $new_name = true; - - if ($new_name) + if ($new_name || empty($mm['filename'])) { - $path = exec('pwd'); - put(0,$mm['terminal_height'],$mm['active_node_color'].str_repeat(' ',$mm['terminal_width'])); - put(0,$mm['terminal_height']," $path -- new path and file name: "); + $new_name = magic_readline($mm, empty($mm['filename']) ? exec('pwd') : $mm['filename']); - system("stty sane"); - $mm['filename'] = trim(readline()); - system('stty cbreak -echo'); - - if ($mm['filename']=='') + if ($new_name === false) { display($mm); message($mm, 'Saving cancelled'); return; } + $mm['filename'] = $new_name; $ext = mb_substr( $mm['filename'], mb_strrpos($mm['filename'],'.') + 1); if ($ext!='hmm') From c104792e6a5ae20fc241042a8d9adfd90b06e1bc Mon Sep 17 00:00:00 2001 From: nadrad Date: Fri, 16 Sep 2022 20:21:40 +0200 Subject: [PATCH 08/12] now ctrl+shift+v pastes in the editor --- h-m-m | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/h-m-m b/h-m-m index 94d7f17..558c7e3 100755 --- a/h-m-m +++ b/h-m-m @@ -129,6 +129,7 @@ const ctrl_p = "\020"; const ctrl_c = "\003"; const ctrl_r = "\022"; const ctrl_f = "\006"; +const ctrl_v = "\026"; const arr_down = "\033\133\102"; const arr_right = "\033\133\103"; @@ -1121,7 +1122,11 @@ function magic_readline(&$mm, $title) while(true) { usleep(5000); - $in = fread(STDIN, 9); + $in = fread(STDIN, 66666); + // normally, the longest sequence we have is 13 bytes, + // but if ctrl+shift+v is used, the whole text will be passed! + // In other words, we don't receive a ctrl+shift+v input, + // but the actual content. Was that a confusing behavior? Of course!!! if ($in != '') { @@ -1238,7 +1243,7 @@ function magic_readline(&$mm, $title) return trim($title); // ctrl+v - elseif ($in=="\026") + elseif ($in==ctrl_v) { $content = trim @@ -1290,7 +1295,9 @@ function magic_readline(&$mm, $title) ; $title = mb_ereg_replace("[\000-\037\177".BOM."]",'',$title); - $cursor++; + $cursor += mb_strlen($in); + // the input content can be longer than one character if + // the user uses ctrl+shift+v to paste. } // adjusting the position and shift From 9c0582889ea200d056a1c7593949d03720a748ac Mon Sep 17 00:00:00 2001 From: nadrad Date: Fri, 16 Sep 2022 20:53:04 +0200 Subject: [PATCH 09/12] excluded \t and \n from the text cleaner --- h-m-m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/h-m-m b/h-m-m index 558c7e3..0c3057e 100755 --- a/h-m-m +++ b/h-m-m @@ -322,7 +322,7 @@ function decode_tree($lines, $root_id, $start_id) $lines[$lid] = mb_ereg_replace ( - "[\000-\037\177".BOM."]" + "[\000-\010\013-\037\177".BOM."]" ,'' ,str_replace ( @@ -1294,7 +1294,7 @@ function magic_readline(&$mm, $title) ) ; - $title = mb_ereg_replace("[\000-\037\177".BOM."]",'',$title); + $title = mb_ereg_replace("[\000-\010\013-\037\177".BOM."]",'',$title); $cursor += mb_strlen($in); // the input content can be longer than one character if // the user uses ctrl+shift+v to paste. @@ -2115,7 +2115,7 @@ function get_from_clipboard(&$mm) return mb_ereg_replace ( - "[\000-\037\177".BOM."]" + "[\000-\010\013-\037\177".BOM."]" ,'' ,shell_exec($mm['clipboard']['read']) ) From 2b913c599fa1f45b5a089cbe5d93ba71ebd9975d Mon Sep 17 00:00:00 2001 From: nadrad Date: Fri, 16 Sep 2022 21:03:12 +0200 Subject: [PATCH 10/12] added 'del' --- h-m-m | 14 ++++++++++---- readme.md | 1 + 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/h-m-m b/h-m-m index 0c3057e..176ecfd 100755 --- a/h-m-m +++ b/h-m-m @@ -136,6 +136,8 @@ const arr_right = "\033\133\103"; const arr_up = "\033\133\101"; const arr_left = "\033\133\104"; +const del = "\033\133\063\176"; + const reset_page = "\033[2J\033[0;0f"; const reset_color = "\033[0m"; @@ -2150,11 +2152,13 @@ function yank_node(&$mm, $exclude_parent = false ) // }}} // {{{ delete -function delete_node(&$mm, $exclude_parent = false ) +function delete_node(&$mm, $exclude_parent = false, $dont_copy_to_clipboard = false ) { - if ($mm['active_node']==$mm['root']) $exclude_parent = true; + if ($mm['active_node']==$mm['root']) + $exclude_parent = true; - copy_to_clipboard($mm, encode_tree($mm, $mm['active_node'], $exclude_parent) ); + if (!$dont_copy_to_clipboard) + copy_to_clipboard($mm, encode_tree($mm, $mm['active_node'], $exclude_parent) ); push_change($mm); $mm['modified'] = true; @@ -2164,7 +2168,8 @@ function delete_node(&$mm, $exclude_parent = false ) build_map($mm); display($mm); - message($mm, 'Item(s) are cut and placed into the clipboard.'); + if (!$dont_copy_to_clipboard) + message($mm, 'Item(s) are cut and placed into the clipboard.'); } @@ -2600,6 +2605,7 @@ function monitor_key_presses(&$mm) case 'd': delete_node($mm); break; case 'D': delete_node($mm, true); break; + case del: delete_node($mm, false, true); break; case 'e': edit_node($mm); break; case 'E': edit_node($mm, true); break; diff --git a/readme.md b/readme.md index 3941313..ea3da71 100644 --- a/readme.md +++ b/readme.md @@ -16,6 +16,7 @@ Adding, removing, and editing nodes: * `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 From 5abf215403160f5cf6b7bc4e3dbc184b79dab6e5 Mon Sep 17 00:00:00 2001 From: nadrad Date: Fri, 16 Sep 2022 21:09:16 +0200 Subject: [PATCH 11/12] fixed the issue with pasting nothingness! --- h-m-m | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/h-m-m b/h-m-m index 176ecfd..99125e2 100755 --- a/h-m-m +++ b/h-m-m @@ -2033,9 +2033,6 @@ function paste_sub_tree(&$mm, $as_sibling ) if ($as_sibling && $mm['active_node']==$mm['root']) return; - push_change($mm); - $mm['modified'] = true; - if ($as_sibling) $parent_id = $mm['nodes'][ $mm['active_node'] ]['parent']; else @@ -2055,8 +2052,12 @@ function paste_sub_tree(&$mm, $as_sibling ) ) ; - $mm['nodes'] += $st; + if ($st==[]) return; + push_change($mm); + $mm['modified'] = true; + + $mm['nodes'] += $st; // doing it like this, in case the sub-tree has more than // one top-level element. From 7ffdffc6bf8aab06411a393dd548c58fae25a48f Mon Sep 17 00:00:00 2001 From: nadrad Date: Fri, 16 Sep 2022 21:41:53 +0200 Subject: [PATCH 12/12] key bindings for the text editor --- readme.md | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/readme.md b/readme.md index ea3da71..fe172af 100644 --- a/readme.md +++ b/readme.md @@ -10,20 +10,20 @@ Adding, removing, and editing nodes: -* `o` or `enter` - create a new sibling to the active node -* `O` or `tab` - create a new child for the active node +* `o` or `Enter` - create a new sibling to the active node +* `O` or `Tab` - 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 +* `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 +* `Ctrl+p` - appends the clipboard text at the end of the active node's title * `e`, `i`, or `a` - edits the active node * `E`, `I`, or `A` - edits the active node, ignoring the existing text * `u` - undo -* `ctrl+r` - redo +* `Ctrl+r` - redo Relative navigating and moving: @@ -48,7 +48,7 @@ Adjusting the view: Collapsing and expanding: -* `space` - toggles the active node +* `Space` - toggles the active node * `v` - collapses everything other than the first-level nodes * `b` - expands all nodes * `1` to `9` - collapse the nth level and expand those before @@ -59,7 +59,7 @@ Collapsing and expanding: Search: -* `/`, `?`, or `ctrl+f` - searches for a phrase +* `/`, `?`, or `Ctrl+f` - searches for a phrase * `n` - goes to the next search result * `N` - goes to the previous search result @@ -71,6 +71,21 @@ Save, export, and quit: * `q` - quits (if the changes were already saved) * `Q` - quits, ignoring the changes +In the text editor: + +* `↓` - move the cursor to the end of the line +* `↑` - move the cursor to the beginning of the line +* `←` or `Home` - move the cursor to the left +* `→` or `End` - move the cursor to the right +* `Ctrl+Left` or `Shift+Left` - move cursor to the previous word +* `Ctrl+Right` or `Shift+right` - move cursor to the next word +* `Delete` - delete character +* `Ctrl+Delete` - delete word +* `Backspace` - delete previous character +* `ctrl+Backspace` - delete previous word +* `Ctrl+v` or `Ctrl+Shift+v` - paste +* `Esc` - cancel editing +* `Enter` - wanna guess? ;) # Configuration