feat(new tool): nano cheatsheet

Fix #545
This commit is contained in:
sharevb 2024-05-01 14:34:27 +02:00 committed by ShareVB
parent cb5b462e11
commit fb343eacf7
5 changed files with 154 additions and 10 deletions

12
components.d.ts vendored
View file

@ -126,25 +126,18 @@ declare module '@vue/runtime-core' {
MenuLayout: typeof import('./src/components/MenuLayout.vue')['default']
MetaTagGenerator: typeof import('./src/tools/meta-tag-generator/meta-tag-generator.vue')['default']
MimeTypes: typeof import('./src/tools/mime-types/mime-types.vue')['default']
NanoMemo: typeof import('./src/tools/nano-memo/nano-memo.vue')['default']
'NanoMemo.content': typeof import('./src/tools/nano-memo/nano-memo.content.md')['default']
NavbarButtons: typeof import('./src/components/NavbarButtons.vue')['default']
NCode: typeof import('naive-ui')['NCode']
NCollapseTransition: typeof import('naive-ui')['NCollapseTransition']
NConfigProvider: typeof import('naive-ui')['NConfigProvider']
NDivider: typeof import('naive-ui')['NDivider']
NEllipsis: typeof import('naive-ui')['NEllipsis']
NFormItem: typeof import('naive-ui')['NFormItem']
NGi: typeof import('naive-ui')['NGi']
NGrid: typeof import('naive-ui')['NGrid']
NH1: typeof import('naive-ui')['NH1']
NH3: typeof import('naive-ui')['NH3']
NIcon: typeof import('naive-ui')['NIcon']
NInputNumber: typeof import('naive-ui')['NInputNumber']
NLabel: typeof import('naive-ui')['NLabel']
NLayout: typeof import('naive-ui')['NLayout']
NLayoutSider: typeof import('naive-ui')['NLayoutSider']
NMenu: typeof import('naive-ui')['NMenu']
NScrollbar: typeof import('naive-ui')['NScrollbar']
NSpin: typeof import('naive-ui')['NSpin']
NumeronymGenerator: typeof import('./src/tools/numeronym-generator/numeronym-generator.vue')['default']
OtpCodeGeneratorAndValidator: typeof import('./src/tools/otp-code-generator-and-validator/otp-code-generator-and-validator.vue')['default']
PasswordStrengthAnalyser: typeof import('./src/tools/password-strength-analyser/password-strength-analyser.vue')['default']
@ -159,6 +152,7 @@ declare module '@vue/runtime-core' {
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
RsaKeyPairGenerator: typeof import('./src/tools/rsa-key-pair-generator/rsa-key-pair-generator.vue')['default']
SafelinkDecoder: typeof import('./src/tools/safelink-decoder/safelink-decoder.vue')['default']
SlugifyString: typeof import('./src/tools/slugify-string/slugify-string.vue')['default']
SpanCopyable: typeof import('./src/components/SpanCopyable.vue')['default']
SqlPrettify: typeof import('./src/tools/sql-prettify/sql-prettify.vue')['default']

View file

@ -6,6 +6,7 @@ import { tool as asciiTextDrawer } from './ascii-text-drawer';
import { tool as textToUnicode } from './text-to-unicode';
import { tool as safelinkDecoder } from './safelink-decoder';
import { tool as nanoMemo } from './nano-memo';
import { tool as pdfSignatureChecker } from './pdf-signature-checker';
import { tool as numeronymGenerator } from './numeronym-generator';
import { tool as macAddressGenerator } from './mac-address-generator';
@ -137,7 +138,6 @@ export const toolsByCategory: ToolCategory[] = [
{
name: 'Development',
components: [
gitMemo,
randomPortGenerator,
crontabGenerator,
jsonViewer,
@ -150,6 +150,13 @@ export const toolsByCategory: ToolCategory[] = [
yamlViewer,
],
},
{
name: 'CheatSheets',
components: [
gitMemo,
nanoMemo,
],
},
{
name: 'Network',
components: [ipv4SubnetCalculator, ipv4AddressConverter, ipv4RangeExpander, macAddressLookup, macAddressGenerator, ipv6UlaGenerator],

View file

@ -0,0 +1,12 @@
import { FileText } from '@vicons/tabler';
import { defineTool } from '../tool';
export const tool = defineTool({
name: 'Nano CheatSheet',
path: '/nano-memo',
description: 'Nano Editor Cheatsheet',
keywords: ['nano', 'memo', 'cheatsheet', 'sheet'],
component: () => import('./nano-memo.vue'),
icon: FileText,
createdAt: new Date('2024-04-20'),
});

View file

@ -0,0 +1,109 @@
Overview of nano's shortcuts      
=====================================
# The editor's keystrokes and their functions         
## File handling**
| Shortcut | Description |
|:--|:--|
| Ctrl+S | Save current file |
| Ctrl+O | Offer to write file ("Save as") |
| Ctrl+R | Insert a file into current one |
| Ctrl+X | Close buffer, exit from nano |
## **Editing**
| Shortcut | Description |
|:--|:--|
| Ctrl+K | Cut current line into cutbuffer |
| Alt+6 | Copy current line into cutbuffer |
| Ctrl+U | Paste contents of cutbuffer |
| Alt+T | Cut until end of buffer |
| Ctrl+\] | Complete current word |
| Alt+3 | Comment/uncomment line/region |
| Alt+U | Undo last action |
| Alt+E | Redo last undone action |
## **Search and replace**
| Shortcut | Description |
|:--|:--|
| Ctrl+Q | Start backward search |
| Ctrl+W | Start forward search |
| Alt+Q | Find next occurrence backward |
| Alt+W | Find next occurrence forward |
| Alt+R | Start a replacing session |
## Deletion
| Shortcut | Description |
|:--|:--|
| Ctrl+H | Delete character before cursor |      
| Ctrl+D | Delete character under cursor |
| Alt+Bsp | Delete word to the left |
| Ctrl+Del | Delete word to the right |
| Alt+Del | Delete current line |
## Operations
| Shortcut | Description |
|:--|:--|
| Ctrl+T | Execute some command |
| Ctrl+J | Justify paragraph or region |
| Alt+J | Justify entire buffer |
| Alt+B | Run a syntax check |
| Alt+F | Run a formatter/fixer/arranger |
| Alt+: | Start/stop recording of macro |
| Alt+; | Replay macro |
## Moving around
| Shortcut | Description |
|:--|:--|
| Ctrl+B | One character backward |
| Ctrl+F | One character forward |
| Ctrl+**←** | One word backward |
| Ctrl+**→** | One word forward |
| Ctrl+A | To start of line |
| Ctrl+E | To end of line |
| Ctrl+P | One line up |
| Ctrl+N | One line down |
| Ctrl+**↑** | To previous block |
| Ctrl+**↓** | To next block |
| Ctrl+Y | One page up |
| Ctrl+V | One page down |
| Alt+\\ | To top of buffer |
| Alt+/ | To end of buffer |
## Special movement
| Shortcut | Description |
|:--|:--|
| Alt+G | Go to specified line |
| Alt+\] | Go to complementary bracket |
| Alt+**↑** | Scroll viewport up |
| Alt+**↓** | Scroll viewport down |
| Alt+< | Switch to preceding buffer |
| Alt+> | Switch to succeeding buffer |
## Information
| Shortcut | Description |
|:--|:--|
| Ctrl+C | Report cursor position |
| Alt+D | Report line/word/character count |
| Ctrl+G | Display help text |
## Various
| Shortcut | Description |
|:--|:--|
| Alt+A | Turn the mark on/off |
| Tab | Indent marked region |
| Shift+Tab | Unindent marked region |
| Alt+V | Enter next keystroke verbatim |
| Alt+N | Turn line numbers on/off |
| Alt+P | Turn visible whitespace on/off |
| Alt+X | Hide or unhide the help lines |
| Ctrl+L | Refresh the screen |

View file

@ -0,0 +1,22 @@
<script setup lang="ts">
import { useThemeVars } from 'naive-ui';
import Memo from './nano-memo.content.md';
const themeVars = useThemeVars();
</script>
<template>
<div>
<Memo />
</div>
</template>
<style lang="less" scoped>
::v-deep(pre) {
margin: 0;
padding: 15px 22px;
background-color: v-bind('themeVars.cardColor');
border-radius: 4px;
overflow: auto;
}
</style>