[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-seo-689133-105":3,"detail-sidebar-cat-0-en-105":80,"doc-detail-689133-en":130,"doc-similar-689133":148},{"code":4,"msg":5,"data":6},0,"ok",{"site_id":7,"language":8,"slug":9,"title":10,"keywords":11,"description":12,"schema_data":13,"social_meta":73,"head_meta":75,"extra_data":77,"updated_unix":79},105,"en","the-linux-programmers-toolbox-chapter-4-editing-and-maintaining-source-files","The Linux Programmer’s Toolbox - Chapter 4 - Editing and Maintaining Source Files","","Focuses on editing and maintaining source files in Linux using Vim and Emacs. Covers Vim configuration options for syntax highlighting, build integration (makeprg), error parsing (errorformat), and core workflow commands via GUI and command modes. Includes guidance on accessing help and enabling essential features like brace matching, autocompletion, regular expressions, automatic indenting, and code browsing. Then introduces Emacs as GNU’s flagship editor, explaining its extensibility via Lisp, modeless behavior via transient modes, and key-driven interaction using Ctrl and Meta/Alt keys.",{"@graph":14,"@context":72},[15,34,55],{"@type":16,"itemListElement":17},"BreadcrumbList",[18,23,27,31],{"item":19,"name":20,"@type":21,"position":22},"https://docshare.wps.com","Home","ListItem",1,{"item":24,"name":25,"@type":21,"position":26},"https://docshare.wps.com/document/","Document",2,{"item":28,"name":29,"@type":21,"position":30},"https://docshare.wps.com/document/technology/","Technology",3,{"item":32,"name":10,"@type":21,"position":33},"https://docshare.wps.com/document/the-linux-programmers-toolbox-chapter-4-editing-and-maintaining-source-files/689133/",4,{"url":32,"name":10,"@type":35,"image":36,"author":41,"headline":10,"publisher":44,"fileFormat":47,"inLanguage":8,"description":12,"dateModified":48,"datePublished":49,"encodingFormat":47,"isAccessibleForFree":50,"interactionStatistic":51},"DigitalDocument",{"url":37,"@type":38,"width":39,"height":40},"https://docshare.wps.com/thumbnails/the-linux-programmers-toolbox-chapter-4-editing-and-maintaining-source-files/689133.png","ImageObject",300,407,{"name":42,"@type":43},"Oliver","Person",{"url":19,"name":45,"@type":46},"DocShare","Organization","application/pdf","2026-11-11","2026-11-08",true,{"@type":52,"interactionType":53,"userInteractionCount":30},"InteractionCounter",{"@type":54},"ViewAction",{"@type":56,"mainEntity":57},"FAQPage",[58,64,68],{"name":59,"@type":60,"acceptedAnswer":61},"How can you enable or disable syntax highlighting in Vim?","Question",{"text":62,"@type":63},"Use the Ex commands :syn on and :syn off in Vim to toggle syntax highlighting.","Answer",{"name":65,"@type":60,"acceptedAnswer":66},"What are common ways to access core features in Vim?",{"text":67,"@type":63},"Examples include % for brace matching, Ctrl+N/Ctrl+P for autocompletion in insert mode, and Ctrl+] / Ctrl+T for code browsing using tags.",{"name":69,"@type":60,"acceptedAnswer":70},"What makes Emacs extensible and how do users add functionality?",{"text":71,"@type":63},"Emacs provides a script processor based on the Lisp programming language, allowing programmers to write extensions using Lisp knowledge.","https://schema.org",{"og:url":32,"og:type":74,"og:title":10,"og:site_name":45,"og:description":12},"article",{"robots":76,"canonical":32},"index,follow",{"doc_id":78,"site_id":7},689133,1794097421,{"code":4,"msg":81,"data":82},"success",[83,87,91,95,100,104,109,114,119,122,126],{"id":22,"doc_module":4,"doc_module_name":25,"category_name":84,"show_sort_weight":85,"slug":86},"Story & Novel",90,"story-novel",{"id":26,"doc_module":4,"doc_module_name":25,"category_name":88,"show_sort_weight":89,"slug":90},"Literature",80,"literature",{"id":33,"doc_module":4,"doc_module_name":25,"category_name":92,"show_sort_weight":93,"slug":94},"Exam",70,"exam",{"id":96,"doc_module":4,"doc_module_name":25,"category_name":97,"show_sort_weight":98,"slug":99},5,"Comic",60,"comic",{"id":101,"doc_module":4,"doc_module_name":25,"category_name":29,"show_sort_weight":102,"slug":103},6,50,"technology",{"id":105,"doc_module":4,"doc_module_name":25,"category_name":106,"show_sort_weight":107,"slug":108},7,"Healthcare",40,"healthcare",{"id":110,"doc_module":4,"doc_module_name":25,"category_name":111,"show_sort_weight":112,"slug":113},8,"Research & Report",30,"research-report",{"id":115,"doc_module":4,"doc_module_name":25,"category_name":116,"show_sort_weight":117,"slug":118},9,"Religion & Spirituality",20,"religion-spirituality",{"id":117,"doc_module":4,"doc_module_name":25,"category_name":120,"show_sort_weight":117,"slug":121},"World Cup","world-cup",{"id":123,"doc_module":4,"doc_module_name":25,"category_name":124,"show_sort_weight":123,"slug":125},10,"Lifestyle","lifestyle",{"id":127,"doc_module":4,"doc_module_name":25,"category_name":128,"show_sort_weight":96,"slug":129},19,"General","general",{"code":4,"msg":81,"data":131},{"doc_id":78,"user_id":132,"nickname":42,"user_avatar":133,"doc_module":4,"category_id":101,"category_name":29,"doc_title":10,"doc_description":12,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":30,"is_deleted":4,"is_public":22,"is_downloadable":22,"audit_status":22,"page_count":110,"language":139,"language_code":8,"site_id":7,"html_lang":8,"table_of_contents":140,"faqs":141,"seo_title":142,"seo_description":12,"update_tm":79,"read_time":117,"preview_page_count":22,"preview_urls":143},8796095461610,"https://ap-avatar.wpscdn.com/davatar_276721f389ce27ea32af1340a28f341c","The Linux Programmer’s Toolbox  \n168 Chapter 4 • Editing and Maintaining Source Files  \nTABLE 4-18 Continued  \n\n| Setting | Short\u003Cbr>Form | Example Usage | Description |\n| --- | --- | --- | --- |\n| syntax | sy | sy on | (Vim only) Turn syntax highlighting on or off. Notice that this does not use the set command. |\n| makeprg | mp | set mp=ant | (Vim only) Choose an alternative to make to run your build. |\n| errorformat | efm | set efm=%f\\ %d | (Vim only) Specify a scanf-like string for Vim to use to parse the error output from the compiler. Fora full description of the format, see:help efm in the Vim help system. |\n\nNotice that some settings are made via the :set command; other settings are themselves commands (such as :syntax) .  \n[4.2.4.13](4.2.4.13) GUI Mode  \nVim has a GUI available, usually as a separate program named gvim in GNOME systems and kvim in KDE.6 The GUI is an excellent enhancement and a great way to learn vi. If you despise modes and for some reason still want to use Vim, use the modeless option of gvim (-y) . This makes Vim behave like a typical modeless GUI editor for the faint of heart.  \nEach menu in GUI mode has reminders for the equivalent vi command to help you learn commands you may not be familiar with. The menu shows the keystrokes required to use the command without the GUI, so it is an excellent learning tool. Finding the right packages to install the GUI can be tricky, depending on your distribution. Table 4-19 lists a couple of packages for KDE and GNOME.  \n6. Interestingly, although many KDE and GNOME apps coexist peacefully, kvim and gvim cannot be installed at the same time.  \n4.2 The Text Editor 169  \nTABLE 4-19 Package Names for GUI-Enabled Vim  \n\n| Distribution | Package Name |\n| --- | --- |\n| Knoppix (KDE) | vim-gtk |\n| Ubuntu (KDE) | kvim |\n| Ubuntu (GNOME) | vim-gnome |\n| Fedora (GNOME) | vim-X11 |\n\n[4.2.4.14](4.2.4.14) The Bottom Line on Vim  \nRecalling the list of features in Table 4-2, let’s look at how to use them. Table 4-20 presents a summary of the features and how to access them.  \nMany more features are available in Vim. The most comprehensive help information is in Vim’s own help menus. These are accessible as read-only, tagged documents, which can be opened in command mode by typing :help keyword. Unfortunately, navigating Vim’s help system requires some knowledge of vi and tags. Just remember that to close a help page, you type :q.  \nTABLE 4-20 How to Access Core Features in Vim  \n\n| Feature | How |\n| --- | --- |\n| Brace matching | In command mode, type % . |\n| Syntax highlighting | Normally on by default. You can enable and disable it manually by typing :syn on or :syn off in Ex mode. |\n| Autocompletion | Ctrl+N / Ctrl+P in insert mode. |\n| Regular expressions | Available during search in command mode and via the substitute command in Ex mode. |\n| Automatic indenting | Enable and disable from command mode with :set ai\u003Cbr>and :set noai. |\n| Code browsing | In command mode, Ctrl+] to follow the tag of the text under the cursor and Ctrl+T to return from the tag. |\n\n170 Chapter 4 • Editing and Maintaining Source Files  \n4.2.5 Emacs  \nEmacs is the flagship text editor of the GNU project. As an alternative to vi, Emacs has a loyal following. Emacs comes with a script processor based on the Lisp programming language so that anyone can program extensions (anyone who knows Lisp, that is) . Because the primary users of Emacs are programmers, the result is that Emacs has become something of a sandbox for developers over the years, having accumulated many features that have little or nothing to do with text editing. If these happen to be features you are looking for in a text editor, Emacs wins hands down.  \n4.2.5.1 Emacs Features  \nAs you might expect, Emacs has all the features listed in Table 4-2, but finding them can be difficult. Along with the basics, Emacs has several tools for manipulating source code that you are not likely to find elsewhere. In most instances, these are shell c","cbCaipwwFSexvILC","https://ap.wps.com/l/cbCaipwwFSexvILC","pdf",135105,"English","# GUI Mode\n# The Bottom Line on Vim\n# Emacs\n## Emacs Features\n## Modes? What Modes?","[{\"question\":\"How can you enable or disable syntax highlighting in Vim?\",\"answer\":\"Use the Ex commands :syn on and :syn off in Vim to toggle syntax highlighting.\"},{\"question\":\"What are common ways to access core features in Vim?\",\"answer\":\"Examples include % for brace matching, Ctrl+N/Ctrl+P for autocompletion in insert mode, and Ctrl+] / Ctrl+T for code browsing using tags.\"},{\"question\":\"What makes Emacs extensible and how do users add functionality?\",\"answer\":\"Emacs provides a script processor based on the Lisp programming language, allowing programmers to write extensions using Lisp knowledge.\"}]","The Linux Programmer’s Toolbox - Chapter 4 - Editing and Maintaining Source Files | PDF",[144],{"page_no":22,"url":145,"width":146,"height":147},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/08e7074382152f578715804c57ce8adb.webp",983,1308,{"list":149,"token":11},[150,156,162,168,174,179,185,191,197,203],{"doc_id":151,"doc_title":152,"file_type":137,"home_preview_img_url":153,"slug":154,"view_count":30,"category_name":29,"create_tm":155},688774,"Emacs - Quickstart - A Lisp Machine for Editing and Computing","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230001486301/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796112059&Signature=CHGmysMmVbRpvBnYE%2BfX3OoZZ7s%3D","emacs-quickstart-a-lisp-machine-for-editing-and-computing",1794091487,{"doc_id":157,"doc_title":158,"file_type":137,"home_preview_img_url":159,"slug":160,"view_count":30,"category_name":29,"create_tm":161},689142,"Editing with gVim","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230001521916/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796112059&Signature=ZQFvjbHeo75JUHKopwroLflXGwk%3D","editing-with-gvim",1794097588,{"doc_id":163,"doc_title":164,"file_type":137,"home_preview_img_url":165,"slug":166,"view_count":96,"category_name":29,"create_tm":167},687588,"Intermediate Vim - Simple and powerful editor basics","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230001262648/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796112059&Signature=V%2BPjGdK3%2BvGKgKqyV8CZG%2Bbe%2F8A%3D","intermediate-vim-simple-and-powerful-editor-basics",1794084211,{"doc_id":169,"doc_title":170,"file_type":137,"home_preview_img_url":171,"slug":172,"view_count":96,"category_name":29,"create_tm":173},689145,"Let there be vim - Part 3 - editor war, modes, and keyboard power","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000681798/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796112059&Signature=Bx3LQJnD3KOgRTi0OEV6nmXxDks%3D","let-there-be-vim-part-3-editor-war-modes-and-keyboard-power",1794097592,{"doc_id":175,"doc_title":176,"file_type":137,"home_preview_img_url":177,"slug":178,"view_count":33,"category_name":29,"create_tm":167},687586,"Quick Vim Reference - Foreword and Table of Contents - Quick Survey of Vim Features","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230001262644/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796112059&Signature=5rFkNSO4toV5eodsuZ1T34AO8Tk%3D","quick-vim-reference-foreword-and-table-of-contents-quick-survey-of-vim-features",{"doc_id":180,"doc_title":181,"file_type":137,"home_preview_img_url":182,"slug":183,"view_count":33,"category_name":29,"create_tm":184},689143,"Practical Vim - Second Edition - Text at the Speed of Thought","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230001521929/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796112059&Signature=%2F3dmbHxoGQzoFsvnhQ5yySBYbZ4%3D","practical-vim-second-edition-text-at-the-speed-of-thought",1794097590,{"doc_id":186,"doc_title":187,"file_type":137,"home_preview_img_url":188,"slug":189,"view_count":33,"category_name":29,"create_tm":190},689136,"Emacs Beginner's HOWTO","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230001520004/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796112059&Signature=V9pHS9NCay3eKWgwTEjHsv1Ey4o%3D","emacs-beginners-howto",1794097425,{"doc_id":192,"doc_title":193,"file_type":137,"home_preview_img_url":194,"slug":195,"view_count":33,"category_name":29,"create_tm":196},687591,"VIM USER MANUAL - Getting Started - Editing Effectively - Tuning Vim","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230001262652/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796112059&Signature=ST0A1UG8A0WJsDOOxzmtWVDUkOc%3D","vim-user-manual-getting-started-editing-effectively-tuning-vim",1794084219,{"doc_id":198,"doc_title":199,"file_type":137,"home_preview_img_url":200,"slug":201,"view_count":30,"category_name":29,"create_tm":202},689141,"Practical Vim - Drew Neil - Practical Vim Edit Text at the Speed of Thought","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230001521872/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796112059&Signature=DJDnsn5J7sjxXBEq4x4S62AtWGg%3D","practical-vim-drew-neil-practical-vim-edit-text-at-the-speed-of-thought",1794097585,{"doc_id":204,"doc_title":205,"file_type":137,"home_preview_img_url":206,"slug":207,"view_count":101,"category_name":29,"create_tm":208},678093,"Chapter 02 - Where and How to Use Mermaid","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229994792867/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796112059&Signature=XsIJwhOrWqeQOf84Weis8U7JyTI%3D","chapter-02-where-and-how-to-use-mermaid",1793784197]