Skip to content

Commit fb343ea

Browse files
committed
feat(new tool): nano cheatsheet
Fix CorentinTh#545
1 parent cb5b462 commit fb343ea

File tree

5 files changed

+154
-10
lines changed

5 files changed

+154
-10
lines changed

components.d.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -126,25 +126,18 @@ declare module '@vue/runtime-core' {
126126
MenuLayout: typeof import('./src/components/MenuLayout.vue')['default']
127127
MetaTagGenerator: typeof import('./src/tools/meta-tag-generator/meta-tag-generator.vue')['default']
128128
MimeTypes: typeof import('./src/tools/mime-types/mime-types.vue')['default']
129+
NanoMemo: typeof import('./src/tools/nano-memo/nano-memo.vue')['default']
130+
'NanoMemo.content': typeof import('./src/tools/nano-memo/nano-memo.content.md')['default']
129131
NavbarButtons: typeof import('./src/components/NavbarButtons.vue')['default']
130-
NCode: typeof import('naive-ui')['NCode']
131132
NCollapseTransition: typeof import('naive-ui')['NCollapseTransition']
132133
NConfigProvider: typeof import('naive-ui')['NConfigProvider']
133-
NDivider: typeof import('naive-ui')['NDivider']
134134
NEllipsis: typeof import('naive-ui')['NEllipsis']
135-
NFormItem: typeof import('naive-ui')['NFormItem']
136-
NGi: typeof import('naive-ui')['NGi']
137-
NGrid: typeof import('naive-ui')['NGrid']
138135
NH1: typeof import('naive-ui')['NH1']
139136
NH3: typeof import('naive-ui')['NH3']
140137
NIcon: typeof import('naive-ui')['NIcon']
141-
NInputNumber: typeof import('naive-ui')['NInputNumber']
142-
NLabel: typeof import('naive-ui')['NLabel']
143138
NLayout: typeof import('naive-ui')['NLayout']
144139
NLayoutSider: typeof import('naive-ui')['NLayoutSider']
145140
NMenu: typeof import('naive-ui')['NMenu']
146-
NScrollbar: typeof import('naive-ui')['NScrollbar']
147-
NSpin: typeof import('naive-ui')['NSpin']
148141
NumeronymGenerator: typeof import('./src/tools/numeronym-generator/numeronym-generator.vue')['default']
149142
OtpCodeGeneratorAndValidator: typeof import('./src/tools/otp-code-generator-and-validator/otp-code-generator-and-validator.vue')['default']
150143
PasswordStrengthAnalyser: typeof import('./src/tools/password-strength-analyser/password-strength-analyser.vue')['default']
@@ -159,6 +152,7 @@ declare module '@vue/runtime-core' {
159152
RouterLink: typeof import('vue-router')['RouterLink']
160153
RouterView: typeof import('vue-router')['RouterView']
161154
RsaKeyPairGenerator: typeof import('./src/tools/rsa-key-pair-generator/rsa-key-pair-generator.vue')['default']
155+
SafelinkDecoder: typeof import('./src/tools/safelink-decoder/safelink-decoder.vue')['default']
162156
SlugifyString: typeof import('./src/tools/slugify-string/slugify-string.vue')['default']
163157
SpanCopyable: typeof import('./src/components/SpanCopyable.vue')['default']
164158
SqlPrettify: typeof import('./src/tools/sql-prettify/sql-prettify.vue')['default']

src/tools/index.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { tool as asciiTextDrawer } from './ascii-text-drawer';
66

77
import { tool as textToUnicode } from './text-to-unicode';
88
import { tool as safelinkDecoder } from './safelink-decoder';
9+
import { tool as nanoMemo } from './nano-memo';
910
import { tool as pdfSignatureChecker } from './pdf-signature-checker';
1011
import { tool as numeronymGenerator } from './numeronym-generator';
1112
import { tool as macAddressGenerator } from './mac-address-generator';
@@ -137,7 +138,6 @@ export const toolsByCategory: ToolCategory[] = [
137138
{
138139
name: 'Development',
139140
components: [
140-
gitMemo,
141141
randomPortGenerator,
142142
crontabGenerator,
143143
jsonViewer,
@@ -150,6 +150,13 @@ export const toolsByCategory: ToolCategory[] = [
150150
yamlViewer,
151151
],
152152
},
153+
{
154+
name: 'CheatSheets',
155+
components: [
156+
gitMemo,
157+
nanoMemo,
158+
],
159+
},
153160
{
154161
name: 'Network',
155162
components: [ipv4SubnetCalculator, ipv4AddressConverter, ipv4RangeExpander, macAddressLookup, macAddressGenerator, ipv6UlaGenerator],

src/tools/nano-memo/index.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { FileText } from '@vicons/tabler';
2+
import { defineTool } from '../tool';
3+
4+
export const tool = defineTool({
5+
name: 'Nano CheatSheet',
6+
path: '/nano-memo',
7+
description: 'Nano Editor Cheatsheet',
8+
keywords: ['nano', 'memo', 'cheatsheet', 'sheet'],
9+
component: () => import('./nano-memo.vue'),
10+
icon: FileText,
11+
createdAt: new Date('2024-04-20'),
12+
});
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
Overview of nano's shortcuts      
2+
=====================================
3+
4+
# The editor's keystrokes and their functions         
5+
6+
## File handling**
7+
8+
| Shortcut | Description |
9+
|:--|:--|
10+
| Ctrl+S | Save current file |
11+
| Ctrl+O | Offer to write file ("Save as") |
12+
| Ctrl+R | Insert a file into current one |
13+
| Ctrl+X | Close buffer, exit from nano |
14+
15+
## **Editing**
16+
17+
| Shortcut | Description |
18+
|:--|:--|
19+
| Ctrl+K | Cut current line into cutbuffer |
20+
| Alt+6 | Copy current line into cutbuffer |
21+
| Ctrl+U | Paste contents of cutbuffer |
22+
| Alt+T | Cut until end of buffer |
23+
| Ctrl+\] | Complete current word |
24+
| Alt+3 | Comment/uncomment line/region |
25+
| Alt+U | Undo last action |
26+
| Alt+E | Redo last undone action |
27+
28+
## **Search and replace**
29+
30+
| Shortcut | Description |
31+
|:--|:--|
32+
| Ctrl+Q | Start backward search |
33+
| Ctrl+W | Start forward search |
34+
| Alt+Q | Find next occurrence backward |
35+
| Alt+W | Find next occurrence forward |
36+
| Alt+R | Start a replacing session |
37+
38+
## Deletion
39+
40+
| Shortcut | Description |
41+
|:--|:--|
42+
| Ctrl+H | Delete character before cursor |      
43+
| Ctrl+D | Delete character under cursor |
44+
| Alt+Bsp | Delete word to the left |
45+
| Ctrl+Del | Delete word to the right |
46+
| Alt+Del | Delete current line |
47+
48+
## Operations
49+
50+
| Shortcut | Description |
51+
|:--|:--|
52+
| Ctrl+T | Execute some command |
53+
| Ctrl+J | Justify paragraph or region |
54+
| Alt+J | Justify entire buffer |
55+
| Alt+B | Run a syntax check |
56+
| Alt+F | Run a formatter/fixer/arranger |
57+
| Alt+: | Start/stop recording of macro |
58+
| Alt+; | Replay macro |
59+
60+
## Moving around
61+
62+
| Shortcut | Description |
63+
|:--|:--|
64+
| Ctrl+B | One character backward |
65+
| Ctrl+F | One character forward |
66+
| Ctrl+**** | One word backward |
67+
| Ctrl+**** | One word forward |
68+
| Ctrl+A | To start of line |
69+
| Ctrl+E | To end of line |
70+
| Ctrl+P | One line up |
71+
| Ctrl+N | One line down |
72+
| Ctrl+**** | To previous block |
73+
| Ctrl+**** | To next block |
74+
| Ctrl+Y | One page up |
75+
| Ctrl+V | One page down |
76+
| Alt+\\ | To top of buffer |
77+
| Alt+/ | To end of buffer |
78+
79+
## Special movement
80+
81+
| Shortcut | Description |
82+
|:--|:--|
83+
| Alt+G | Go to specified line |
84+
| Alt+\] | Go to complementary bracket |
85+
| Alt+**** | Scroll viewport up |
86+
| Alt+**** | Scroll viewport down |
87+
| Alt+< | Switch to preceding buffer |
88+
| Alt+> | Switch to succeeding buffer |
89+
90+
## Information
91+
92+
| Shortcut | Description |
93+
|:--|:--|
94+
| Ctrl+C | Report cursor position |
95+
| Alt+D | Report line/word/character count |
96+
| Ctrl+G | Display help text |
97+
98+
## Various
99+
100+
| Shortcut | Description |
101+
|:--|:--|
102+
| Alt+A | Turn the mark on/off |
103+
| Tab | Indent marked region |
104+
| Shift+Tab | Unindent marked region |
105+
| Alt+V | Enter next keystroke verbatim |
106+
| Alt+N | Turn line numbers on/off |
107+
| Alt+P | Turn visible whitespace on/off |
108+
| Alt+X | Hide or unhide the help lines |
109+
| Ctrl+L | Refresh the screen |

src/tools/nano-memo/nano-memo.vue

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<script setup lang="ts">
2+
import { useThemeVars } from 'naive-ui';
3+
import Memo from './nano-memo.content.md';
4+
5+
const themeVars = useThemeVars();
6+
</script>
7+
8+
<template>
9+
<div>
10+
<Memo />
11+
</div>
12+
</template>
13+
14+
<style lang="less" scoped>
15+
::v-deep(pre) {
16+
margin: 0;
17+
padding: 15px 22px;
18+
background-color: v-bind('themeVars.cardColor');
19+
border-radius: 4px;
20+
overflow: auto;
21+
}
22+
</style>

0 commit comments

Comments
 (0)