Practical Vim: Edit Text at the Speed of Thought, 2nd Edition Год издания: 2015 Автор: Drew Neil Издательство: Pragmatic Bookshelf ISBN: 978-1680501278 Язык: Английский Формат: PDF Качество: Издательский макет или текст (eBook) Интерактивное оглавление: Да Количество страниц: 320 Описание: Vim is a fast and efficient text editor that will make you a faster and more efficient developer. It's available on almost every OS, and if you master the techniques in this book, you'll never need another text editor. In more than 120 Vim tips, you'll quickly learn the editor's core functionality and tackle your trickiest editing and writing tasks. This beloved bestseller has been revised and updated to Vim 7.4 and includes three brand-new tips and five fully revised tips. A highly configurable, cross-platform text editor, Vim is a serious tool for programmers, web developers, and sysadmins who want to raise their game. No other text editor comes close to Vim for speed and efficiency; it runs on almost every system imaginable and supports most coding and markup languages. Learn how to edit text the "Vim way": complete a series of repetitive changes with The Dot Formula using one keystroke to strike the target, followed by one keystroke to execute the change. Automate complex tasks by recording your keystrokes as a macro. Discover the "very magic" switch that makes Vim's regular expression syntax more like Perl's. Build complex patterns by iterating on your search history. Search inside multiple files, then run Vim's substitute command on the result set for a project-wide search and replace. All without installing a single plugin! Three new tips explain how to run multiple ex commands as a batch, autocomplete sequences of words, and operate on a complete search match. Practical Vim, Second Edition will show you new ways to work with Vim 7.4 more efficiently, whether you're a beginner or an intermediate Vim user. All this, without having to touch the mouse.
Примеры страниц
Оглавление
Contents Acknowledgments . . . . . . . . . . . xi Foreword to the First Edition. . . . . . . . . xv Read Me . . . . . . . . . . . . . xvii Read the Forgotten Manual . . . . . . . . . xix 1. The Vim Way . . . . . . . . . . . . . 1 Tip 1. Meet the Dot Command 1 Tip 2. Don’t Repeat Yourself 4 Tip 3. Take One Step Back, Then Three Forward 6 Tip 4. Act, Repeat, Reverse 8 Tip 5. Find and Replace by Hand 9 Tip 6. Meet the Dot Formula 11 Part I — Modes 2. Normal Mode . . . . . . . . . . . . 15 Tip 7. Pause with Your Brush Off the Page 16 Tip 8. Chunk Your Undos 16 Tip 9. Compose Repeatable Changes 18 Tip 10. Use Counts to Do Simple Arithmetic 20 Tip 11. Don’t Count If You Can Repeat 22 Tip 12. Combine and Conquer 24 3. Insert Mode . . . . . . . . . . . . . 29 Tip 13. Make Corrections Instantly from Insert Mode 29 Tip 14. Get Back to Normal Mode 30 Tip 15. Paste from a Register Without Leaving Insert Mode 31 Tip 16. Do Back-of-the-Envelope Calculations in Place 33 Tip 17. Insert Unusual Characters by Character Code 34 Tip 18. Insert Unusual Characters by Digraph 35 Tip 19. Overwrite Existing Text with Replace Mode 36 4. Visual Mode . . . . . . . . . . . . . 39 Tip 20. Grok Visual Mode 39 Tip 21. Define a Visual Selection 41 Tip 22. Repeat Line-Wise Visual Commands 43 Tip 23. Prefer Operators to Visual Commands Where Possible 45 Tip 24. Edit Tabular Data with Visual-Block Mode 47 Tip 25. Change Columns of Text 49 Tip 26. Append After a Ragged Visual Block 50 5. Command-Line Mode . . . . . . . . . . 53 Tip 27. Meet Vim’s Command Line 53 Tip 28. Execute a Command on One or More Consecutive Lines 56 Tip 29. Duplicate or Move Lines Using ‘:t’ and ‘:m’ Commands 61 Tip 30. Run Normal Mode Commands Across a Range 63 Tip 31. Repeat the Last Ex Command 65 Tip 32. Tab-Complete Your Ex Commands 67 Tip 33. Insert the Current Word at the Command Prompt 68 Tip 34. Recall Commands from History 70 Tip 35. Run Commands in the Shell 72 Tip 36. Run Multiple Ex Commands as a Batch 76 Part II — Files 6. Manage Multiple Files . . . . . . . . . . 83 Tip 37. Track Open Files with the Buffer List 83 Tip 38. Group Buffers into a Collection with the Argument List 86 Tip 39. Manage Hidden Files 89 Tip 40. Divide Your Workspace into Split Windows 92 Tip 41. Organize Your Window Layouts with Tab Pages 95 7. Open Files and Save Them to Disk . . . . . . . 99 Tip 42. Open a File by Its Filepath Using ‘:edit’ 99 Tip 43. Open a File by Its Filename Using ‘:find’ 102 Tip 44. Explore the File System with netrw 104 Tip 45. Save Files to Nonexistent Directories 107 Tip 46. Save a File as the Super User 108 Part III — Getting Around Faster 8. Navigate Inside Files with Motions . . . . . . . 113 Tip 47. Keep Your Fingers on the Home Row 114 Tip 48. Distinguish Between Real Lines and Display Lines 116 Tip 49. Move Word-Wise 118 Tip 50. Find by Character 120 Tip 51. Search to Navigate 124 Tip 52. Trace Your Selection with Precision Text Objects 126 Tip 53. Delete Around, or Change Inside 129 Tip 54. Mark Your Place and Snap Back to It 131 Tip 55. Jump Between Matching Parentheses 132 9. Navigate Between Files with Jumps. . . . . . . 135 Tip 56. Traverse the Jump List 135 Tip 57. Traverse the Change List 137 Tip 58. Jump to the Filename Under the Cursor 138 Tip 59. Snap Between Files Using Global Marks 141 Part IV — Registers 10. Copy and Paste. . . . . . . . . . . . 145 Delete, Yank, and Put with Vim’s Unnamed Register 145 Tip 60. Tip 61. Grok Vim’s Registers 148 Tip 62. Replace a Visual Selection with a Register 153 Tip 63. Paste from a Register 155 Tip 64. Interact with the System Clipboard 158 11. Macros. . . . . . . . . . . . . . 161 Tip 65. Record and Execute a Macro 162 Tip 66. Normalize, Strike, Abort 165 Tip 67. Play Back with a Count 166 Tip 68. Repeat a Change on Contiguous Lines 168 Tip 69. Append Commands to a Macro 172 Tip 70. Act Upon a Collection of Files 173 Tip 71. Evaluate an Iterator to Number Items in a List 177 Tip 72. Edit the Contents of a Macro 180 Part V — Patterns 12. Matching Patterns and Literals . . . . . . . . 185 Tip 73. Tune the Case Sensitivity of Search Patterns 186 Tip 74. Use the \v Pattern Switch for Regex Searches 187 Tip 75. Use the \V Literal Switch for Verbatim Searches 189 Tip 76. Use Parentheses to Capture Submatches 191 Tip 77. Stake the Boundaries of a Word 193 Tip 78. Stake the Boundaries of a Match 194 Tip 79. Escape Problem Characters 195 13. Search . . . . . . . . . . . . . . 201 Tip 80. Meet the Search Command 201 Tip 81. Highlight Search Matches 204 Tip 82. Preview the First Match Before Execution 205 Tip 83. Offset the Cursor to the End of a Search Match 206 Tip 84. Operate on a Complete Search Match 208 Tip 85. Create Complex Patterns by Iterating upon Search History 211 Tip 86. Count the Matches for the Current Pattern 214 Tip 87. Search for the Current Visual Selection 216 14. Substitution . . . . . . . . . . . . 219 Tip 88. Meet the Substitute Command 220 Tip 89. Find and Replace Every Match in a File 222 Tip 90. Eyeball Each Substitution 223 Tip 91. Reuse the Last Search Pattern 225 Tip 92. Replace with the Contents of a Register 226 Tip 93. Repeat the Previous Substitute Command 229 Tip 94. Rearrange CSV Fields Using Submatches 232 Tip 95. Perform Arithmetic on the Replacement 233 Tip 96. Swap Two or More Words 234 Tip 97. Find and Replace Across Multiple Files 236 15. Global Commands . . . . . . . . . . . 241 Tip 98. Meet the Global Command 241 Tip 99. Delete Lines Containing a Pattern 242 Tip 100. Collect TODO Items in a Register 244 Tip 101. Alphabetize the Properties of Each Rule in a CSS File 246 Part VI — Tools 16. Index and Navigate Source Code with ctags . . . . . 253 Tip 102. Meet ctags 253 Tip 103. Configure Vim to Work with ctags 256 Tip 104. Navigate Keyword Definitions with Vim’s Tag Navigation Commands 258 17. Compile Code and Navigate Errors with the Quickfix List . 263 Tip 105. Compile Code Without Leaving Vim 264 Tip 106. Browse the Quickfix List 266 Tip 107. Recall Results from a Previous Quickfix List 269 Tip 108. Customize the External Compiler 269 18. Search Project-Wide with grep, vimgrep, and Others. . . 273 Tip 109. Call grep Without Leaving Vim 273 Tip 110. Customize the grep Program 275 Tip 111. Grep with Vim’s Internal Search Engine 277 19. Dial X for Autocompletion . . . . . . . . . 281 Tip 112. Meet Vim’s Keyword Autocompletion 281 Tip 113. Work with the Autocomplete Pop-Up Menu 283 Tip 114. Understand the Source of Keywords 285 Tip 115. Autocomplete Words from the Dictionary 287 Tip 116. Autocomplete Entire Lines 288 Tip 117. Autocomplete Sequences of Words 289 Tip 118. Autocomplete Filenames 291 Tip 119. Autocomplete with Context Awareness 293 20. Find and Fix Typos with Vim’s Spell Checker . . . . 295 Tip 120. Spell Check Your Work 295 Tip 121. Use Alternate Spelling Dictionaries 297 Tip 122. Add Words to the Spell File 298 Tip 123. Fix Spelling Errors from Insert Mode 299 21. Now What?. . . . . . . . . . . . . 301 Keep Practicing! 301 Make Vim Your Own 301 Know the Saw, Then Sharpen It 302 A1. Customize Vim to Suit Your Preferences . . . . . 303 Change Vim’s Settings on the Fly 303 Save Your Configuration in a vimrc File 304 Apply Customizations to Certain Types of Files 306 Index . . . . . . . . . . . . . . 307
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum