How do I make show or hide line numbers and find a word in vi editor ?

เมื่ออยูู่ในโหมด vi editor แล้ว พิมพ์ : (the colon) แล้วตามด้วย เป็นการ show line numbers
set nu           #สั่งให้ vi แสดงหมายเลขบรรทัด (nu = number)
set ic             #สั่งให้เวลา Search ไม่ดูการค้น ตัวเล็ก ตัวใหญ่ ใด ๆ (ic = Ignore Case)
set nu ic       #สั่งให้ทำงานทั้ง 2 แบบ

อ่านเพิ่มเติมได้ที่ https://kb.iu.edu/d/afcx

การค้นหาไฟล์ใน vi editor

 /test            #ทำการค้นหา keyword
n                   #ค้นหา keyword เดิม next occurrence of the word

อ่านเพิ่มเติมได้ที่ http://ccm.net/faq/982-finding-a-word-in-vi-vim

 820 total views,  1 views today

Leave a Reply

Your email address will not be published. Required fields are marked *