📢 Webサイト閉鎖と移転のお知らせ
このWebサイトは2026年9月に閉鎖いたします。
新しい記事は移転先で追加しております。(旧サイトでは記事を追加しておりません)
| 1行目: | 1行目: | ||
== 概要 == | == 概要 == | ||
Linuxにおけるデスクトップ向けのテキストエディタを記載する。<br> | Linuxにおけるデスクトップ向けのテキストエディタを記載する。<br> | ||
<br><br> | |||
== Nano == | |||
最新のNanoでは、保存は[Ctrl] + [S]キー、終了は[Ctrl] + [X]キーを使用している。<br> | |||
他にも多くのキーバインドがあり、キーバインドは、nanorcファイルで設定することができる。<br> | |||
<br> | |||
* スペルチェック機能 | |||
*: GNU Aspellパッケージをインストールして、スペルチェックオプションを有効にすることで、Nanoはスペルチェックを行う。 | |||
*: スペルチェックは、[F12]キーで起動する。 | |||
*: <br> | |||
* シンタックスハイライト機能 | |||
*: Nanoには、シンタックスハイライト用のファイルがインストールされている。 | |||
*: scopatz氏のGithubでは、さらに多くのファイルが公開されているので、必要なファイルをコピーして、/usr/share/nanoディレクトリに配置する。 | |||
*: <br> | |||
* Undo機能 | |||
*: [Alt] + [U]キーを押下することで、Undoすることができる。 | |||
<br> | |||
Nanoの設定ファイルは、/etc/.nanorcファイルである。<br> | |||
この設定を上書きするには、ユーザ固有の設定ファイルである~/.nanorcファイルを作成して、設定を記述する。<br> | |||
また、他のオプションについては、<code>man nanorc</code>を実行して参照すること。<br> | |||
<br> | |||
以下に、Nanoの設定例を示す。<br> | |||
# Non-default settings | |||
set atblanks # wrap line at blanks. | |||
set cutfromcursor # CTRL+K cuts from cursor position to end of line. | |||
set nohelp # Disable the help information (CTRL+G to view the help screen). | |||
set softwrap # Enable softwrap of lines. | |||
set suspend # Enables CTRL+Z to suspend nano. | |||
set tabsize 4 # Sets tab-to-spaces size to 4. | |||
set tabstospaces # Converts TAB key press to spaces. | |||
include "/usr/share/nano/*.nanorc" # Enables the syntax highlighting. | |||
set speller "aspell -x -c" # Sets what spelling utility to use. | |||
set constantshow # Displays useful information e.g. line number and position in the bottom bar. | |||
set linenumbers # Lines are numbered. | |||
set casesensitive # Case insensitive search. | |||
set historylog # Save the last 100 history searches for later use. | |||
set positionlog # Saves the cursor position between editing sessions. | |||
set zap # Allows you to highlight text (CTRL+SHIFT+ARROW) and delete it with backspace. | |||
set autoindent # A new line will have the same number of leading spaces as the previous one. | |||
# Enable and set a working backup directory | |||
#set backup # Creates backups of your current file. | |||
#set backupdir "~/.cache/nano/backups/" # The location of the backups. | |||
# Shortcut key bindings | |||
bind ^C copy main # CTRC+C - Copy | |||
bind ^V paste all # CTRL+V - Past | |||
bind ^F whereis all # CTRL+F - Find | |||
bind ^S savefile main # CTRL+S - Save | |||
<br><br> | <br><br> | ||