Windowsのキーバインドに似せたnanoの設定

パピーを名犬にするための技、テクニック

モデレータ: 暇人, YoN, nyu

返信する
ssnys
記事: 64
登録日時: 14/02/19(水) 17:50

Windowsのキーバインドに似せたnanoの設定

投稿記事 by ssnys »

Puppy Linux(Precise-571JP)ではGeanyや、LeafpadなどのGUIテキストエディターがあり、nanoはあまり利用されていないかもしれませんが、viともEmacsとも違う直感的な操作ができるスクリーンエディタのため、利用してみるとそれなりに便利です。ただnanoのキーバインディングは特殊なため、`~/.nanorc`の設定を変更しWindowsに似せてみました。各種言語のシンタックスハイライトも有効にしています。

コード: 全て選択

## Sample initialization file for GNU nano.
##
## Please note that you must have configured nano with --enable-nanorc
## for this file to be read!  Also note that this file should not be in
## DOS or Mac format, and that characters specially interpreted by the
## shell should not be escaped here.
##
## To make sure a value is disabled, use "unset <option>".
##
## For the options that take parameters, the default value is given.
## Other options are unset by default.
##
## Quotes inside string parameters don't have to be escaped with
## backslashes.  The last double quote in the string will be treated as
## its end.  For example, for the "brackets" option, ""')>]}" will match
## ", ', ), >, ], and }.

## Use auto-indentation.
set autoindent

## Backup files to filename~.
set backup

## The directory to put unique backup files in.
set backupdir "/tmp"

## Do backwards searches by default.
# set backwards

## Use bold text instead of reverse video text.
# set boldtext

## The characters treated as closing brackets when justifying
## paragraphs.  They cannot contain blank characters.  Only closing
## punctuation, optionally followed by closing brackets, can end
## sentences.
##
# set brackets ""')>]}"

## Do case sensitive searches by default.
# set casesensitive

## Constantly display the cursor position in the statusbar.  Note that
## this overrides "quickblank".
set const

## Use cut to end of line by default.
# set cut

## Set the line length for wrapping text and justifying paragraphs.
## If fill is 0 or less, the line length will be the screen width less
## this number.
##
# set fill -8

## Enable ~/.nano_history for saving and reading search/replace strings.
set historylog

## The opening and closing brackets that can be found by bracket
## searches.  They cannot contain blank characters.  The former set must
## come before the latter set, and both must be in the same order.
##
# set matchbrackets "(<[{)>]}"

## Use the blank line below the titlebar as extra editing space.
set morespace

## Enable mouse support, if available for your system.  When enabled,
## mouse clicks can be used to place the cursor, set the mark (with a
## double click), and execute shortcuts.  The mouse will work in the X
## Window System, and on the console when gpm is running.
##
# set mouse

## Allow multiple file buffers (inserting a file will put it into a
## separate buffer).  You must have configured with --enable-multibuffer
## for this to work.
##
set multibuffer

## Don't convert files from DOS/Mac format.
# set noconvert

## Don't follow symlinks when writing files.
# set nofollow

## Don't display the helpful shortcut lists at the bottom of the screen.
set nohelp

## Don't add newlines to the ends of files.
set nonewlines

## Don't wrap text at all.
set nowrap

## Set operating directory.  nano will not read or write files outside
## this directory and its subdirectories.  Also, the current directory
## is changed to here, so any files are inserted from this dir.  A blank
## string means the operating directory feature is turned off.
##
# set operatingdir ""

## Preserve the XON and XOFF keys (^Q and ^S).
# set preserve

## The characters treated as closing punctuation when justifying
## paragraphs.  They cannot contain blank characters.  Only closing
## punctuation, optionally followed by closing brackets, can end
## sentences.
##
# set punct "!.?"

## Do quick statusbar blanking.  Statusbar messages will disappear after
## 1 keystroke instead of 26.  Note that "const" overrides this.
##
# set quickblank

## The email-quote string, used to justify email-quoted paragraphs.
## This is an extended regular expression if your system supports them,
## otherwise a literal string.  Default:
# set quotestr "^([ 	]*[#:>\|}])+"
## if you have extended regular expression support, otherwise:
# set quotestr "> "

## Fix Backspace/Delete confusion problem.
# set rebinddelete

## Fix numeric keypad key confusion problem.
# set rebindkeypad

## Do extended regular expression searches by default.
# set regexp

## Make the Home key smarter.  When Home is pressed anywhere but at the
## very beginning of non-whitespace characters on a line, the cursor
## will jump to that beginning (either forwards or backwards).  If the
## cursor is already at that position, it will jump to the true
## beginning of the line.
# set smarthome

## Use smooth scrolling as the default.
set smooth

## Enable soft line wrapping (AKA full line display).
# set softwrap

## Use this spelling checker instead of the internal one.  This option
## does not properly have a default value.
##
# set speller "aspell -x -c"

## Allow nano to be suspended.
set suspend

## Use this tab size instead of the default; it must be greater than 0.
set tabsize 2

## Convert typed tabs to spaces.
# set tabstospaces

## Save automatically on exit, don't prompt.
# set tempfile

## Enable the new (EXPERIMENTAL) generic undo code, not just for line
## cuts.
set undo

## Disallow file modification.  Why would you want this in an rcfile? ;)
# set view

## The two single-column characters used to display the first characters
## of tabs and spaces.  187 in ISO 8859-1 (0000BB in Unicode) and 183 in
## ISO-8859-1 (0000B7 in Unicode) seem to be good values for these.
# set whitespace "  "

## Detect word boundaries more accurately by treating punctuation
## characters as parts of words.
# set wordbounds


## Color setup
##
## Format:
##
## syntax "short description" ["filename regex" ...]
##
## The "none" syntax is reserved; specifying it on the command line is
## the same as not having a syntax at all.  The "default" syntax is
## special: it takes no filename regexes, and applies to files that
## don't match any other syntax's filename regexes.
##
## color foreground,background "regex" ["regex"...]
## or
## icolor foreground,background "regex" ["regex"...]
##
## "color" will do case sensitive matches, while "icolor" will do case
## insensitive matches.
##
## Valid colors: white, black, red, blue, green, yellow, magenta, cyan.
## For foreground colors, you may use the prefix "bright" to get a
## stronger highlight.
##
## To use multi-line regexes, use the start="regex" end="regex"
## [start="regex" end="regex"...] format.
##
## If your system supports transparency, not specifying a background
## color will use a transparent color.  If you don't want this, be sure
## to set the background color to black or white.
##
## If you wish, you may put your syntaxes in separate files.  You can
## make use of such files (which can only include "syntax", "color", and
## "icolor" commands) as follows:
##
## include "/path/to/syntax_file.nanorc"
##
## Unless otherwise noted, the name of the syntax file (without the
## ".nanorc" extension) should be the same as the "short description"
## name inside that file.  These names are kept fairly short to make
## them easier to remember and faster to type using nano's -Y option.
##
## All regexes should be extended regular expressions.

## Key bindings
## Please see nanorc(5) for more details on this
##
## Here are some samples to get you going
##
# bind M-W nowrap main
# bind M-A casesens search
# bind ^S research main

## Set this if your backspace key sends delete most of the time (2.1.3+)
# bind kdel backspace all

bind ^W exit all
bind F4 exit all
bind ^S writeout all
bind ^O insert all
bind ^R refresh all
bind F5 refresh all
bind M-D suspend all

bind M-A firstline main
bind M-E lastline main
bind M-F nextword main
bind M-B prevword main
bind ^A home main
bind ^E end main

bind ^J justify main
bind ^X cut main
bind ^V uncut main
bind M-Space mark main
bind ^C copytext main

bind ^L gotoline all
bind ^F whereis all
bind ^G searchagain all
bind F3 searchagain all
bind ^H replace all

bind ^Z undo main
bind ^Y redo main

bind ^I indent main
bind ^U unindent main

bind ^R regexp search
bind ^R regexp replace
bind ^I casesens search
bind ^I casesens replace

bind M-A firstfile browser
bind M-E lastfile browser

bind M-H nohelp all
上記の設定はnano 2.2.6のものです。

最近はnanoの開発が活発で最新版は2.9.8となっています。

ちなみにnanoと同様、直感的な操作が可能なスクリーンエディタには以下のようなものがあります。触ってみましたが、どれも非常に優れたエディタです。
💻Lenovo G550(CPU: Intel Celeron 900 @ 2.20GHz, RAM: 971MB, HDD: 149.05GiB) + Precise-571JP
🖥HITACHI FLORA 310 DL7(CPU: Intel Pentium III 700 MHz, RAM: 384MB) + Precise-571JP
アバター
ルビー
記事: 1240
登録日時: 14/11/24(月) 12:12

Re: Windowsのキーバインドに似せたnanoの設定

投稿記事 by ルビー »

ssnys さんが書きました:Puppy Linux(Precise-571JP)ではGeanyや、LeafpadなどのGUIテキストエディターがあり、nanoはあまり利用されていないかもしれませんが、viともEmacsとも違う直感的な操作ができるスクリーンエディタのため、利用してみるとそれなりに便利です。
DOSのエディタを思い出して、懐かしいとは思ったけど、UTF-8のみでCP932も読めないのに、Windowsライクのキーバインドにしても、ありがたみがないです。

エディタに求める物は、人それぞれだと思うけど、非GUI環境ならばともかく、パピーのGUI環境で、あえてGeanyやLeafpadを押しのけて、端末で使うnanoを勧める理由を教えてください。

Xから降りたコンソールで使えれば便利かと思ったけど、コマンド操作の表示が文字化けして、使い物になりませんでした。
ssnys
記事: 64
登録日時: 14/02/19(水) 17:50

Re: Windowsのキーバインドに似せたnanoの設定

投稿記事 by ssnys »

ルビーさん、返信頂きまして誠にありがとうございます。 :D

まず最初に、改めてひとつ前の当方の投稿をつぶさに読み返してみましたところ、言葉足らずや手違い故、一部誤解を招きかねない表現や内容の不足などがございました。 :cry:
ssnys さんが書きました: Puppy Linux(Precise-571JP)ではGeanyや、LeafpadなどのGUIテキストエディターがあり、nanoはあまり利用されていないかもしれませんが、viともEmacsとも違う直感的な操作ができるスクリーンエディタのため、利用してみるとそれなりに便利です。
前述の投稿ではテキストエディターnanoを紹介するにあたり、GeanyやLeafpadを引き合いに出した表現を用いていますが、これはnanoがGeanyやLeafpadより優れているという意味ではありませんし、またGeanyやLeafpadはnanoより劣っているという意味でもありません。前述と投稿ではviやEmacsも引き合いに出していますが、これもまた同様でございます。

総じて、テキストエディターの優劣について述べたものではないと、ご理解頂ければ幸いでございます。
ssnys さんが書きました: 各種言語のシンタックスハイライトも有効にしています。
各種言語のシンタックスハイライトも有効にしているとの記述にも関わらず、設定ファイルの内容にはシンタックスハイライトを有効にする記述が含まれていませんでした。本来の~/.nanorcの内容は以下のような記述になります。

コード: 全て選択

## Sample initialization file for GNU nano.
##
## Please note that you must have configured nano with --enable-nanorc
## for this file to be read!  Also note that this file should not be in
## DOS or Mac format, and that characters specially interpreted by the
## shell should not be escaped here.
##
## To make sure a value is disabled, use "unset <option>".
##
## For the options that take parameters, the default value is given.
## Other options are unset by default.
##
## Quotes inside string parameters don't have to be escaped with
## backslashes.  The last double quote in the string will be treated as
## its end.  For example, for the "brackets" option, ""')>]}" will match
## ", ', ), >, ], and }.

## Use auto-indentation.
set autoindent

## Backup files to filename~.
set backup

## The directory to put unique backup files in.
set backupdir "/tmp"

## Do backwards searches by default.
# set backwards

## Use bold text instead of reverse video text.
# set boldtext

## The characters treated as closing brackets when justifying
## paragraphs.  They cannot contain blank characters.  Only closing
## punctuation, optionally followed by closing brackets, can end
## sentences.
##
# set brackets ""')>]}"

## Do case sensitive searches by default.
# set casesensitive

## Constantly display the cursor position in the statusbar.  Note that
## this overrides "quickblank".
set const

## Use cut to end of line by default.
# set cut

## Set the line length for wrapping text and justifying paragraphs.
## If fill is 0 or less, the line length will be the screen width less
## this number.
##
# set fill -8

## Enable ~/.nano_history for saving and reading search/replace strings.
set historylog

## The opening and closing brackets that can be found by bracket
## searches.  They cannot contain blank characters.  The former set must
## come before the latter set, and both must be in the same order.
##
# set matchbrackets "(<[{)>]}"

## Use the blank line below the titlebar as extra editing space.
set morespace

## Enable mouse support, if available for your system.  When enabled,
## mouse clicks can be used to place the cursor, set the mark (with a
## double click), and execute shortcuts.  The mouse will work in the X
## Window System, and on the console when gpm is running.
##
# set mouse

## Allow multiple file buffers (inserting a file will put it into a
## separate buffer).  You must have configured with --enable-multibuffer
## for this to work.
##
set multibuffer

## Don't convert files from DOS/Mac format.
# set noconvert

## Don't follow symlinks when writing files.
# set nofollow

## Don't display the helpful shortcut lists at the bottom of the screen.
set nohelp

## Don't add newlines to the ends of files.
set nonewlines

## Don't wrap text at all.
set nowrap

## Set operating directory.  nano will not read or write files outside
## this directory and its subdirectories.  Also, the current directory
## is changed to here, so any files are inserted from this dir.  A blank
## string means the operating directory feature is turned off.
##
# set operatingdir ""

## Preserve the XON and XOFF keys (^Q and ^S).
# set preserve

## The characters treated as closing punctuation when justifying
## paragraphs.  They cannot contain blank characters.  Only closing
## punctuation, optionally followed by closing brackets, can end
## sentences.
##
# set punct "!.?"

## Do quick statusbar blanking.  Statusbar messages will disappear after
## 1 keystroke instead of 26.  Note that "const" overrides this.
##
# set quickblank

## The email-quote string, used to justify email-quoted paragraphs.
## This is an extended regular expression if your system supports them,
## otherwise a literal string.  Default:
# set quotestr "^([ 	]*[#:>\|}])+"
## if you have extended regular expression support, otherwise:
# set quotestr "> "

## Fix Backspace/Delete confusion problem.
# set rebinddelete

## Fix numeric keypad key confusion problem.
# set rebindkeypad

## Do extended regular expression searches by default.
# set regexp

## Make the Home key smarter.  When Home is pressed anywhere but at the
## very beginning of non-whitespace characters on a line, the cursor
## will jump to that beginning (either forwards or backwards).  If the
## cursor is already at that position, it will jump to the true
## beginning of the line.
# set smarthome

## Use smooth scrolling as the default.
set smooth

## Enable soft line wrapping (AKA full line display).
# set softwrap

## Use this spelling checker instead of the internal one.  This option
## does not properly have a default value.
##
# set speller "aspell -x -c"

## Allow nano to be suspended.
set suspend

## Use this tab size instead of the default; it must be greater than 0.
set tabsize 2

## Convert typed tabs to spaces.
# set tabstospaces

## Save automatically on exit, don't prompt.
# set tempfile

## Enable the new (EXPERIMENTAL) generic undo code, not just for line
## cuts.
set undo

## Disallow file modification.  Why would you want this in an rcfile? ;)
# set view

## The two single-column characters used to display the first characters
## of tabs and spaces.  187 in ISO 8859-1 (0000BB in Unicode) and 183 in
## ISO-8859-1 (0000B7 in Unicode) seem to be good values for these.
# set whitespace "  "

## Detect word boundaries more accurately by treating punctuation
## characters as parts of words.
# set wordbounds


## Color setup
##
## Format:
##
## syntax "short description" ["filename regex" ...]
##
## The "none" syntax is reserved; specifying it on the command line is
## the same as not having a syntax at all.  The "default" syntax is
## special: it takes no filename regexes, and applies to files that
## don't match any other syntax's filename regexes.
##
## color foreground,background "regex" ["regex"...]
## or
## icolor foreground,background "regex" ["regex"...]
##
## "color" will do case sensitive matches, while "icolor" will do case
## insensitive matches.
##
## Valid colors: white, black, red, blue, green, yellow, magenta, cyan.
## For foreground colors, you may use the prefix "bright" to get a
## stronger highlight.
##
## To use multi-line regexes, use the start="regex" end="regex"
## [start="regex" end="regex"...] format.
##
## If your system supports transparency, not specifying a background
## color will use a transparent color.  If you don't want this, be sure
## to set the background color to black or white.
##
## If you wish, you may put your syntaxes in separate files.  You can
## make use of such files (which can only include "syntax", "color", and
## "icolor" commands) as follows:
##
## include "/path/to/syntax_file.nanorc"
##
## Unless otherwise noted, the name of the syntax file (without the
## ".nanorc" extension) should be the same as the "short description"
## name inside that file.  These names are kept fairly short to make
## them easier to remember and faster to type using nano's -Y option.
##
## All regexes should be extended regular expressions.

## Key bindings
## Please see nanorc(5) for more details on this
##
## Here are some samples to get you going
##
# bind M-W nowrap main
# bind M-A casesens search
# bind ^S research main

## Set this if your backspace key sends delete most of the time (2.1.3+)
# bind kdel backspace all

bind ^W exit all
bind F4 exit all
bind ^S writeout all
bind ^O insert all
bind ^R refresh all
bind F5 refresh all
bind M-D suspend all

bind M-A firstline main
bind M-E lastline main
bind M-F nextword main
bind M-B prevword main
bind ^A home main
bind ^E end main

bind ^J justify main
bind ^X cut main
bind ^V uncut main
bind M-Space mark main
bind ^C copytext main

bind ^L gotoline all
bind ^F whereis all
bind ^G searchagain all
bind F3 searchagain all
bind ^H replace all

bind ^Z undo main
bind ^Y redo main

bind ^I indent main
bind ^U unindent main

bind ^R regexp search
bind ^R regexp replace
bind ^I casesens search
bind ^I casesens replace

bind M-A firstfile browser
bind M-E lastfile browser

bind M-H nohelp all

## Nanorc files
include "~/.nano/syntax/nanorc.nanorc"

## C/C++
include "~/.nano/syntax/c.nanorc"

## Makefiles
include "~/.nano/syntax/makefile.nanorc"

## Cascading Style Sheets
include "~/.nano/syntax/css.nanorc"

## Debian files
include "~/.nano/syntax/debian.nanorc"

## Gentoo files
include "~/.nano/syntax/gentoo.nanorc"

## HTML
include "~/.nano/syntax/html.nanorc"

## PHP
include "~/.nano/syntax/php.nanorc"

## TCL
include "~/.nano/syntax/tcl.nanorc"

## TeX
include "~/.nano/syntax/tex.nanorc"

## Quoted emails (under e.g. mutt)
include "~/.nano/syntax/mutt.nanorc"

## Patch files
include "~/.nano/syntax/patch.nanorc"

## Manpages
include "~/.nano/syntax/man.nanorc"

## Groff
include "~/.nano/syntax/groff.nanorc"

## Perl
include "~/.nano/syntax/perl.nanorc"

## Python
include "~/.nano/syntax/python.nanorc"

## Ruby
include "~/.nano/syntax/ruby.nanorc"

## Java
include "~/.nano/syntax/java.nanorc"

## Fortran
include "~/.nano/syntax/fortran.nanorc"

## Objective-C
include "~/.nano/syntax/objc.nanorc"

## OCaml
include "~/.nano/syntax/ocaml.nanorc"

## AWK
include "~/.nano/syntax/awk.nanorc"

## Assembler
include "~/.nano/syntax/asm.nanorc"

## Bourne shell scripts
include "~/.nano/syntax/sh.nanorc"

## POV-Ray
include "~/.nano/syntax/pov.nanorc"

## XML-type files
include "~/.nano/syntax/xml.nanorc"
ssnys さんが書きました: ちなみにnanoと同様、直感的な操作が可能なスクリーンエディタには以下のようなものがあります。触ってみましたが、どれも非常に優れたエディタです。
「nanoと同様」とはテキストエディターとしてnanoと同様の性能や、機能を有しているという意味ではございません。一個人の私見として、使いやすく直感的な操作が概ね可能なテキストエディタという意味でございます。また紹介したテキストエディタはどれも優れたテキストエディターだと思いますが、「非常に」というのは多少盛った表現でございました。「非常に」は取り消させていただきます。

以上のことについては当方の確認不足から生じたものでございます。一部誤解を招きかねない表現や内容の不足についてお詫びするとともに、誠に勝手ながら訂正させて頂きたいと思います。
ルビー さんが書きました: エディタに求める物は、人それぞれだと思うけど、非GUI環境ならばともかく、パピーのGUI環境で、あえてGeanyやLeafpadを押しのけて、端末で使うnanoを勧める理由を教えてください。
「エディタに求める物は、人それぞれ」についてはまったくその通りだと思います。「GeanyやLeafpadを押しのけて」とありますが、ここで用いられている「押しのけて」が、どういった意味かは当方の愚鈍さ故計り兼ねますが、GeanyやLeafpad、そしてnanoを適材適所で利用していくのがよいかと思われます。たとえば
ルビー さんが書きました: UTF-8のみでCP932も読めないのに、Windowsライクのキーバインドにしても、ありがたみがないです。
nanoの文字コードの対応が弱いことについては、仰る通りだと思います。実際にUTF-8以外の文字コードのファイルを開くときはGeanyやLeafpadを利用しています。

GeanyやLeafpadとnanoの比較については、当方がこの3種のテキストエディターの機能や性能を全て把握しているわけではないため、完全な比較というのは出来ませんが、nanoの優位な点としては以下のようなポイントではないかと思われます。
  • 使用メモリー量が少ない
  • 起動が少しだけ早く感じる
  • 仮想端末の設定をそのまま引き継げる
もちろんこれも、当方の個人的な私見でございます。テキストエディターで何を重視するかについては、繰り返しになりますが、ルビーさんが仰られた「エディタに求める物は、人それぞれ」という言葉に帰着するのではないかと思います。

今回ルビーさんから返信を頂いたことよって、以前の不適切な投稿を改めて見直し、訂正する機会となりました。誠にありがとうございます。 :P
💻Lenovo G550(CPU: Intel Celeron 900 @ 2.20GHz, RAM: 971MB, HDD: 149.05GiB) + Precise-571JP
🖥HITACHI FLORA 310 DL7(CPU: Intel Pentium III 700 MHz, RAM: 384MB) + Precise-571JP
アバター
ルビー
記事: 1240
登録日時: 14/11/24(月) 12:12

Re: Windowsのキーバインドに似せたnanoの設定

投稿記事 by ルビー »

HOWTOは、どちらかと言えば、初心者の手助けになる様な事を書く所だと思います。

パピーは、コマンドなど叩いた事のない、Linux初心者にも優しいディストリを目指していると思うし、実際、他のディストリよりも優しいと思います。

パピーでテキストファイルを開くのは、GUIのROX-FilerとGeanyで済みますし、簡単な操作です。
初心者は、余程の事でもない限り端末など開かないでしょう。
その上、コマンド叩いてエディタを起動して、全部CUIのnanoを喜んで使うとは思えないので、質問した次第です。

nano自体は優れたエディタだと思うので、それを使う事に、どうのこうの言うつもりはありません。
これが喫茶店のトピックなら構わないし、私は何も書かなかったでしょう。
ssnys さんが書きました:「GeanyやLeafpadを押しのけて」とありますが、ここで用いられている「押しのけて」が、どういった意味かは当方の愚鈍さ故計り兼ねますが、
「非GUI環境ならばともかく、パピーのGUI環境で、あえてGeanyやLeafpadを使わずに、端末で使うnanoを勧める理由を教えてください。」
です。

雑に書いてるつもりはありませんが、一字一句、推敲している訳でもありません。
まあ、良くない事かもしれませんが、論文書いてる訳でもないし、皆、そんな感じだと思います。
特に、書きづらいスマホで書いてる時など、そうですが…。
アバター
ルビー
記事: 1240
登録日時: 14/11/24(月) 12:12

Re: Windowsのキーバインドに似せたnanoの設定

投稿記事 by ルビー »

ルビー さんが書きました:その上、コマンド叩いてエディタを起動して、全部CUIのnanoを喜んで使うとは思えないので、質問した次第です。
デスクトップのメニューの中にnanoがあったのですね。
気が付きませんでした。
コンソールエディタをメニューで起動しても、?な気もしますが。
ssnys さんが書きました:各種言語のシンタックスハイライトも有効にしているとの記述にも関わらず、設定ファイルの内容にはシンタックスハイライトを有効にする記述が含まれていませんでした。本来の~/.nanorcの内容は以下のような記述になります。
書き忘れましたが、コピペして~/.nanorcを作成して、nanoを起動するとエラーが出ますけど、OKなのでしょうか。
ssnys
記事: 64
登録日時: 14/02/19(水) 17:50

Re: Windowsのキーバインドに似せたnanoの設定

投稿記事 by ssnys »

ルビーさん、返信頂きまして誠にありがとうございます。 :D
ルビー さんが書きました: HOWTOは、どちらかと言えば、初心者の手助けになる様な事を書く所だと思います。
当方この掲示板で積極的に活動していないため、掲示板内のローカルルールについて殆ど熟知しておらず、それ故このHOWTOフォーラムが適しているかと思い込んでいたのですが、フォーラム違いでしたら改めてお詫びいたします。 :oops:

一つ疑問が生じたのですが、初心者向けではない内容を投稿するには何処のフォーラムがベストでしょうか。例えば当方Precise-571JPのinitrd.gzを改造して、dm-crypt/LUKSのpupsaveに対応させました。またDebianパッケージをSquashFSに変換するShellScriptも現在作成中です。

これらの内容はいずれも大した内容ではございませんが、どなた様かの一助になれば幸いと思い、何れこの掲示板内で紹介記事を投稿させ頂ければと考えています。これらの内容はどこのフォーラムがベストでしょうか。やはり何でもありの「ユーザーズカフェ」がベストでしょうか。 :?:

できる限り掲示板内の慣習には従いたいと考えております故、皆様からご意見頂ければ幸いでございます。
ルビー さんが書きました: パピーは、コマンドなど叩いた事のない、Linux初心者にも優しいディストリを目指していると思うし、実際、他のディストリよりも優しいと思います。

パピーでテキストファイルを開くのは、GUIのROX-FilerとGeanyで済みますし、簡単な操作です。
初心者は、余程の事でもない限り端末など開かないでしょう。
その上、コマンド叩いてエディタを起動して、全部CUIのnanoを喜んで使うとは思えないので、質問した次第です。
PuppyLinuxが初心者にやさしいディストリビューションであるというのは、当方も同じ思いです。右も左も分からぬLinuxど素人だった私にも簡単に操作できたというのは、ありがたいことでした。 :)

仰られる通り、CUIについてはあまり触れられず、GUIに慣れ親しんでいる方々にとって、Geanyの方が使いやすいというのは、全くその通りだと思います。Geanyの利便性については当方も感じている次第です。
ルビー さんが書きました:
ssnys さんが書きました: 「GeanyやLeafpadを押しのけて」とありますが、ここで用いられている「押しのけて」が、どういった意味かは当方の愚鈍さ故計り兼ねますが、
「非GUI環境ならばともかく、パピーのGUI環境で、あえてGeanyやLeafpadを使わずに、端末で使うnanoを勧める理由を教えてください。」
です。

雑に書いてるつもりはありませんが、一字一句、推敲している訳でもありません。
当方の返信が、重箱の隅を突く様な回答で申し訳ない限りです。 :cry:
ルビー さんが書きました:
ssnys さんが書きました: 各種言語のシンタックスハイライトも有効にしているとの記述にも関わらず、設定ファイルの内容にはシンタックスハイライトを有効にする記述が含まれていませんでした。本来の~/.nanorcの内容は以下のような記述になります。
書き忘れましたが、コピペして~/.nanorcを作成して、nanoを起動するとエラーが出ますけど、OKなのでしょうか。
シンタックスハイライトを有効にするには個々の言語毎のシンタックスハイライトの設定ファイルが必要でした。すっかり書き漏らしていました。

シンタックスハイライトの設定ファイルは個人個人で作成してもよいのですが、https://bugs.launchpad.net/ubuntu/preci ... no/2.2.6-1から取ってくると簡単でございます。

nano_2.2.6-1_i386.debを解凍して、`/usr/share/nano`内の各ファイルを`${HOME}/.nano/syntax`にコピーすれば、各言語のシンタックスハイライトが有効になるかと思われます。

以下のような流れになると思います。

コード: 全て選択

~# cd /tmp
tmp# wget http://launchpadlibrarian.net/60061104/nano_2.2.6-1_i386.deb
--2018-06-16 23:48:00--  http://launchpadlibrarian.net/60061104/nano_2.2.6-1_i386.deb
launchpadlibrarian.net (launchpadlibrarian.net) をDNSに問いあわせています... 91.189.89.228, 91.189.89.229
launchpadlibrarian.net (launchpadlibrarian.net)|91.189.89.228|:80 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 180146 (176K) [application/x-debian-package]
Saving to: `nano_2.2.6-1_i386.deb'

100%[======================================>] 180,146     9.92K/s 時間 14s     

2018-06-16 23:48:16 (12.4 KB/s) - `nano_2.2.6-1_i386.deb' saved [180146/180146]

tmp# nanotmp=`mktemp -d`
tmp# dpkg-deb -x nano_2.2.6-1_i386.deb "${nanotmp}"
tmp# mkdir -p "${HOME}/.nano/syntax/"
tmp# cp -a ${nanotmp}/usr/share/nano/*.nanorc "${HOME}/.nano/syntax/"
tmp# rm -f -r nano_2.2.6-1_i386.deb "${nanotmp}"
tmp# unset nanotmp
tmp# cd -
添付ファイルを見るにはパーミッションが必要です
💻Lenovo G550(CPU: Intel Celeron 900 @ 2.20GHz, RAM: 971MB, HDD: 149.05GiB) + Precise-571JP
🖥HITACHI FLORA 310 DL7(CPU: Intel Pentium III 700 MHz, RAM: 384MB) + Precise-571JP
返信する