Kawin Chailerd

November 10, 2008

เปลี่ยน default editor บน ubuntu

Filed under: Linux and *BSD, Ubuntu — Tags: , , , , , , , , , , , — กวิน ชัยเลิศ @ 4:34 pm

จากประสบการณ์ที่ผ่านมา default editor บน linux และ *bsd มักจะเป็น vi ซึ่งตามปกติแล้ว system administrator (sysadmin) จำเป็นต้องใช้ default editor ของ os ในหลายๆ เหตุการณ์ เช่น ใช้ในคำสั่ง crontab เป็นต้น

หลังจากที่ติดตั้ง Ubuntu 8.04 hardy ก็พบว่า default editor ไม่ใช่ vi ที่ผมคุ้นเคย กลับกลายเป็น nano editor หน้าตาเหมือนกับ pine (pine e-mail client) สมัยที่ linux ยังไม่เฟื่องฟู … เพื่อไม่ให้ยืดเยื้อไปกว่านี้ เรามาเปลี่ยน default editor บน ubuntu กันดีกว่าครับ


แปลงร่างเป็น root หรือใครถนัดใช้ sudo ก็ข้ามไปใช้ sudo ตามสะดวกครับ

su -

ทีนี้ก็เปลี่ยน default editor ตามนี้ครับ

update-alternatives --config editor

There are 4 alternatives which provide `editor’.

Selection Alternative
———————————————–
1 /usr/bin/vim.tiny
2 /bin/ed
+ 3 /bin/nano
* 4 /usr/bin/vim.basic

Press enter to keep the default[*], or type selection number:

แฟนพันธุ์ vi ก็ต้องเลือกหมายเลข 4 อยู่แล้ว … เพื่อนๆ เลือกหมายเลขอะไรกันครับ

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

You must be logged in to post a comment.

Powered by WordPress