ALT+Sで保存が私のデフォルトなので:Vzジャンキーのなれの果て
おまけ.nanorc 付き
nanoをCUIでさくっと編集する用エディタとして活用しています
nanoは、どのディスりビューションでも標準です。ここだいじです。debian/ubuntu/manjaro/Archlinuxなどメジャーなディストロ。
6年前は行番号を左側に表示する機能がありませんでした。ubuntu/Mintでは追随するのが2年おきなのでめんどうでしたが、今はManjaroメインなのでハッピーです。放置プレイでほぼ最新が使えるからです。
コンパイルオプションの違いなのか、デフォルト導入バージョンでは、~/.nanorc でキーアサインが反映されません。debianとubuntuでは全く同じバージョンですね(数年前の話)
nano --version
GNU nano バージョン 2.2.6 (コンパイル日時: 14:12:08, Oct 1 2012)
(C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
2008, 2009 Free Software Foundation, Inc.
Email: nano@nano-editor.org Web: http://www.nano-editor.org/
コンパイルオプション: --disable-wrapping-as-root --enable-color --enable-extra --enable-multibuffer --enable-nanorc --enable-utf8
2.2.6がubuntu14.04,mint17.xのデフォルトで、Debianも同じです。
GNU nano, version 2.4.1
●いままで使っていたバージョン。make。
(C) 1999..2015 Free Software Foundation, Inc.
Email: nano@nano-editor.org Web: http://www.nano-editor.org/
コンパイルオプション: --disable-libmagic --enable-utf8
GNU nano, version 2.5.1
●今makeしたもの。
(C) 1999..2016 Free Software Foundation, Inc.
Email: nano@nano-editor.org Web: http://www.nano-editor.org/
コンパイルオプション: --disable-libmagic --enable-utf8
自分でmakeしたものはキーアサイン変更が反映されます。ハッピーです。深入りしません。単に、
正統:
.configure
make
sudo make install
アナザ:パッケージを作った場合
dpkg -i nano_2.5.1-1_amd64.deb
ありがとうございます。
(sudo checkinstall --install=no)の簡易パッケージ。
付箋:ちょっとしたメモ
purgeしてから、インストールしたほうがいいです。sudo apt-get purge nano
sudo dpkg -i nano_2.5.1-1_amd64.deb
[sudo] password for testman:
(データベースを読み込んでいます ... 現在 277279 個のファイルとディレクトリがインストールされています。)
nano_2.5.1-1_amd64.deb を展開する準備をしています ...
nano (2.5.1-1) で (2.2.6-1ubuntu1 に) 上書き展開しています ...
nano (2.5.1-1) を設定しています ...
man-db (2.6.7.1-1ubuntu1) のトリガを処理しています ...
install-info (5.2.0.dfsg.1-2) のトリガを処理しています ...
doc-base (0.10.5) のトリガを処理しています ...
doc-base ファイルを 2 個削除 を処理中...
scrollkeeper をドキュメントとして登録しています...
おまけ .nanorc 実物(4年位前からほぼ変わってません)
$ perl -lne '/^#.*$/ or s/^\s*$//g or print ' .nanorc
set autoindent
set mouse
set softwrap
set tabstospaces
set titlecolor brightwhite,blue
set statuscolor yellow,black
set numbercolor yellow
set keycolor brightwhite
set functioncolor green
bind F4 findprevious main #
bind F5 findnext main #
bind F6 whereis main #regex
bind F7 replace main #対話式
bind F8 cut main #
bind F9 uncut main #
bind F10 mark main #
bind ^Q exit main
bind M-Q exit main
bind M-H help main #
bind ^F whereis main #
bind ^N nextword main #
bind ^P prevword main #
bind ^E up main #
bind ^C copytext main # the cutbuffer [copytext]
bind ^X delete main #
bind ^V uncut main #
bind ^Y uncut main #
bind ^S savefile main # no prompt save
bind M-S writeout main # save as
bind M-I insert main #insert a file into the current buffer
bind ^P prevpage main ##
bind ^N nextpage main ##
bind ^P prevpage help ##
bind ^N nextpage help ##
bind ^E up help #
bind ^X down help #
bind ^Q exit help
bind M-Q exit help
bind ^U undo main #
bind ^R redo main #
bind M-P curpos main # Display the position of the cursor [curpos]
bind M-I firstline main
bind M-M lastline main
set nowrap #自動改行を禁止(表示上だけでなく改行が入力されうざい)
set softwrap #折り返し有効(表示上だけ)
set smooth #一行ずつスクロール
set suspend #C-zで中断してシェルに戻る(→fgコマンドで復帰できます)
set linenumbers #4年位まえに実装された。これで使う気になった。
set wordbounds #文字境界の正確さ向上だけど。なくても「今2018年」は困らない気がする。nano -W などがなくてもうまいこといってるような気がする。
include "/usr/share/nano/*.nanorc" #*が使えることにある日気づいた。
# include "/usr/share/nano/nanorc.nanorc"
# include "/usr/share/nano/c.nanorc"
# include "/usr/share/nano/makefile.nanorc"
# include "/usr/share/nano/css.nanorc"
# include "/usr/share/nano/debian.nanorc"
# include "/usr/share/nano/tex.nanorc"
# include "/usr/share/nano/perl.nanorc"
# include "/usr/share/nano/python.nanorc"
おまけ2::ハッピーになれるかも。rootでも同じにする。Teamてきとう
sudo ln .nanorc /root/.nanorc
おまけ3 .nanorc 実物(かなりかわりました)
$ cat .nanorc | perl -lnE '/^#.*$/ or s/^$//g or print'
set autoindent
set mouse
set softwrap
set tabstospaces
set titlecolor brightwhite,blue
set statuscolor yellow,black
set numbercolor yellow
set keycolor brightwhite
set functioncolor green
bind F4 findprevious main #
bind F5 findnext main #
bind F6 whereis main #regex
bind F7 replace main #対話式
bind F8 cut main #
bind F9 paste main #
bind F10 mark main #
bind ^Q exit main
bind M-Q exit main
bind M-H help main #
bind ^F whereis main #
bind ^N nextword main #
bind ^P prevword main #
bind ^E up main #
bind ^C copy main # the cutbuffer [copytext]
bind ^X delete main #
bind ^V paste main #
bind ^Y paste main #
bind ^S savefile main # no prompt save
bind M-S writeout main # save as
bind M-I insert main #insert a file into the current buffer
bind ^P prevpage main ##
bind ^N nextpage main ##
bind ^P prevpage help ##
bind ^N nextpage help ##
bind ^E up help #
bind ^X down help #
bind ^Q exit help
bind M-Q exit help
bind ^U undo main #
bind ^R redo main #
bind M-P curpos main # Display the position of the cursor [curpos]
bind M-I firstline main
bind M-M lastline main
set nowrap #自動改行を禁止(表示上だけでなく改行が入力されるため)
set softwrap #折り返しを有効に(表示上だけで改行は入力されない)
set smooth #一行ずつスクロール
set suspend #C-zで中断してシェルに戻る(→fgコマンドで復帰)
set linenumbers
set wordbounds #文字境界の正確さ向上だけど。なくても今は困らない気がする。
include "/usr/share/nano/nanorc.nanorc"
include "/usr/share/nano/c.nanorc"
include "/usr/share/nano/makefile.nanorc"
include "/usr/share/nano/css.nanorc"
include "/usr/share/nano/debian.nanorc"
include "/usr/share/nano/tex.nanorc"
include "/usr/share/nano/perl.nanorc"
include "/usr/share/nano/python.nanorc"
include "/usr/share/nano/awk.nanorc"
include "/usr/share/nano/sh.nanorc"