สร้างสีสันด้วย vim


Posted in:



เริ่มแรกด้วยการเปิด program terminal แล้วพิมพ์คำสั่งดังนี้
sudo apt-get install vim
เมื่อ Install เสร็จให้สรา้งไฟล์ชื่อ .vimrc
โดยไฟล์ .vimrc ตัวนี้จะใช้ในการเขียน script ต่าง ๆ ที่ใช้กับโปรแกรม vim
พิมพ์ vi .vimrc (หรือ vim .vimrc)


จากนั้นในไฟล์ .vimrc ให้พิมพ์คำสั่ง syntax on save แล้วออกจาก vi


ลองเปิดไฟล์ที่มีอยู่แล้ว หรือเขียนไฟล์ใหม่ก้ได้ ในที่นี้เปิดไฟล์ test.cpp

ความสวยงามมีจริง

ถ้าต้องกา

ถ้าต้องการให้มี line number ให้ใส่

set number

เพิ่มเข้าไปอีกบรรทัดนึงครับ

แนะนำเว็บนี้ด้วยครับ

แนะนำเว็บนี้ด้วยครับ vim.org

ความรู้ใหม่

ใช้แต่ nano ซะเคย
ขอบคุณครับ

ว่าแต่ว่า

ว่าแต่ว่า ไอ้ไฟล์ .vimrc เนี่ยครับ จะเอาวางไว้ตรงไหน?

วางไว้ที่

วางไว้ที่ /home/username/ ครับ หรือไม่ก็ไปแก้ที่ /etc/vim/vimrc แทน

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
  • Allowed HTML tags: <i> <center> <span> <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <br> <dt> <dd> <object> <embed> <hr> <img> <blockquote> <b> <u> <del> <div> <p> <table> <tr> <td> <font>

More information about formatting options