Linuxののnanoエディタのショートカット

Last Updated:2023年07月16日| , | 2のコメント

Linuxで編集することがあれば、私は主にnanoを使用する方です。 長い時間前にViエディタに関する本を購入して使用を身につけたことがあるがLinuxをしばらく使用しないようになるから(実際には正常に使用したことは一度もありませんが)頭の中に残っていることが何もないですね。

以下はnanoエディタを使用するときに参考できる便利なショートカットのリストです。 (出典:http://staffwww.fullcoll.edu/sedwards/Nano/UsefulNanoKeyCommands.html)

詳しい使い方をご希望の場合nanoが実行された状態で、 Ctrl + gをクリックすると、ヘルプが表示されます。

Linuxののnanoエディタのショートカット3
nanoヘルプ画面

nanoのヘルプ画面では、全体のコマンド/ショートカットのリストを確認することができます。

すべてのショートカットキー(英語)

フルキーボードショートカットは、次を参照ください:

^ = Ctrl キー M = Alt キー

^G      (F1)            Display this help text
^X      (F2)            Close the current file buffer / Exit from nano
^O      (F3)            Write the current file to disk
^J      (F4)            Justify the current paragraph

^R      (F5)            Insert another file into the current one
^W      (F6)            Search for a string or a regular expression
^Y      (F7)            Move to the previous screen
^V      (F8)            Move to the next screen

^K      (F9)            Cut the current line and store it in the cutbuffer
^U      (F10)           Uncut from the cutbuffer into the current line
^C      (F11)           Display the position of the cursor
^T      (F12)           Invoke the spell checker, if available

^_      (F13)   (M-G)   Go to line and column number
^\      (F14)   (M-R)   Replace a string or a regular expression
^^      (F15)   (M-A)   Mark text at the cursor position
        (F16)   (M-W)   Repeat last search

M-^             (M-6)   Copy the current line and store it in the cutbuffer
M-}                     Indent the current line
M-{                     Unindent the current line

^F                      Move forward one character
^B                      Move back one character
^Space                  Move forward one word
M-Space                 Move back one word
^P                      Move to the previous line
^N                      Move to the next line

^A                      Move to the beginning of the current line
^E                      Move to the end of the current line
M-(             (M-9)   Move to the beginning of the current paragraph
M-)             (M-0)   Move to the end of the current paragraph
M-\             (M-|)   Move to the first line of the file
M-/             (M-?)   Move to the last line of the file

M-]                     Move to the matching bracket
M--             (M-_)   Scroll up one line without scrolling the cursor
M-+             (M-=)   Scroll down one line without scrolling the cursor

M-<             (M-,)   Switch to the previous file buffer
M->             (M-.)   Switch to the next file buffer

M-V                     Insert the next keystroke verbatim
^I                      Insert a tab at the cursor position
^M                      Insert a newline at the cursor position
^D                      Delete the character under the cursor
^H                      Delete the character to the left of the cursor
M-T                     Cut from the cursor position to the end of the file

M-J                     Justify the entire file
M-D                     Count the number of words, lines, and characters
^L                      Refresh (redraw) the current screen

M-X                     Help mode enable/disable
M-C                     Constant cursor position display enable/disable
M-O                     Use of one more line for editing enable/disable
M-S                     Smooth scrolling enable/disable
M-P                     Whitespace display enable/disable
M-Y                     Color syntax highlighting enable/disable

M-H                     Smart home key enable/disable
M-I                     Auto indent enable/disable
M-K                     Cut to end enable/disable
M-L                     Long line wrapping enable/disable
M-Q                     Conversion of typed tabs to spaces enable/disable

M-B                     Backup files enable/disable
M-F                     Multiple file buffers enable/disable
M-M                     Mouse support enable/disable
M-N                     No conversion from DOS/Mac format enable/disable
M-Z                     Suspension enable/disable

nanoショートカット(ハングル)

ファイル管理

作業 ショートカットキー/コマンド
nano内のファイルを開く Ctrl + r

このコマンドを入力すると、画面の下に新しいメニュー項目が表示されます。 たとえば、Ctrl + Tを押すと、ファイルシステムを参照して、ファイルを検索して開くことができます。

次のファイルのバッファを表示 lt +>
以前のファイルのバッファを表示 Alt +
現在のファイルをディスクに保存 Ctrl + o
現在のファイルのバッファを終了 Ctrl + x

ファイルが保存されていない場合保存するかを尋ねます。 ファイルのバッファがXNUMXつしか開いている場合は、ファイルのバッファを終了すると、nanoから出ています。

コピーと貼り付け

作業 ショートカットキー/コマンド

トリミングまたは貼り付け作業を行う領域を選択

Alt + a

Alt + aにマークを設定した後、カーソルを移動させて領域を指定します。 カーソルを移動したときのハイライトされます。 また、領域指定を解除するには、[Alt] + aを再度押します。

強調表示された領域をクリップボードにコピー Alt + ^
強調表示された領域を切ってクリップボードに保存 Ctrl + k

行を削除(正確にはトリミング)する際にも使用

クリップボードの内容を現在のカーソル位置に貼り付け Ctrl + u
現在のカーソル位置から行の終わり(EOL)までトリミング Ctrl + k

このコマンドは、領域を強調表示する必要がありません。

コードナビゲーション

作業 ショートカットキー/コマンド
ファイルの先頭に移動 Alt + \
ファイルの末尾に移動 Alt + /

画面前方に移動(下に移動)

Ctrlキー+ V
画面戻る(上に移動) Ctrl + y
対象行番号に移動(ライン番号を入力して、すぐに移動) Alt + g
ペアをなす開かれた/閉じた記号ですぐに移動 Alt +]

一致していない括弧(brace)コンパイラエラーを検出すると、非常に便利

ウィンドウのスクロール Alt + = 下にスクロール

Alt + - 上にスクロール

ブロックのインデント/インデント

Alt + a を使用してブロックを選択し、

  • Alt +} 選択されたブロックのインデント
  • Alt + { 選択したブロックインデント

検索と置換

作業 ショートカットキー/コマンド

対象の文字列を検索

Ctrl + W

このコマンドを入力すると、画面下部に新しいメニュー項目が表示されます。 例:Alt + Bを押すと、逆検索の切り替え、Ctrl + R:検索文字列を別の文字列に置換

最後の検索の繰り返し Alt + w
次の検索の方向切り替え(切り替え) Ctrl + Wをクリックし、 Ctrl + b
探して置換 Alt + r

 

指定されたキーに対応するコマンド

作業 ショートカットキー/コマンド

ホーム

Ctrl + a
終わり Ctrl + e
ページアップ Ctrl + y
ページを下に Ctrlキー+ V
矢印キー Ctrl + f (右),
Ctrl + b
(左),
Ctrl + n
(下),
Ctrl + p
(上)
タブ Ctrl + i
バックスペース Ctrl + h
削除 Ctrl + d
返品 Ctrl + m

参照

nanoが実行された状態で、 Ctrl + gをクリックすると、ヘルプが表示されます。

nanoで行番号を表示するには、ファイルを開くとき -cを追加します。

nano -c filename

または、 / etc / nanorcから #set constを探してコメント記号を削除すると、常にカーソル位置の行番号が表示されます。

Linuxののnanoエディタのショートカット4

しかし、左側に行番号を表示する機能はないです。


2のコメント

コメント

  1. 以前にヘキントシ初期に使うときのブートローダーの調整途中カーネルパニック後のプロンプトを起動してnanoにファイルの変更していた時と考えますね

    今はヘキントシブートローダラングEFIローダーが完全に分離されて、そのアプリケーションにおいて同じシャベルはしなくてもしますが、要ふふふ

    応答
    • Linuxの文を見れば大体のVimエディタを基準にたくさん説明することです。

      ハッキングトッシュも時間になれば一度挑戦してみたいけど、厳しくなりませんね。 以前は、ハッキングトッシュに関する記事もたくさん検索して興味を持っていました...ㅎㅎ

      応答