You are previewing Hacking Vim 7.2.

Hacking Vim 7.2

Cover of Hacking Vim 7.2 by Kim Schulz Published by Packt Publishing
  1. Hacking Vim 7.2
    1. Table of Contents
    2. Hacking Vim 7.2
    3. Credits
    4. About the Author
    5. About the Reviewers
    6. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. New to Vim?
      5. Conventions
      6. Reader feedback
      7. Customer support
    7. 1. Getting Started with Vim
      1. Getting Vim
      2. vi, Vim, and friends
      3. Vim is charityware
      4. Common terminology
      5. Summary
    8. 2. Personalizing Vim
      1. Where are the configuration files?
      2. Changing the fonts
      3. Changing color scheme
      4. A more informative status line
      5. Toggle menu and toolbar
      6. Adding your own menu and toolbar buttons
      7. Modifying tabs
      8. Work area personalization
      9. Summary
    9. 3. Better Navigation
      1. Faster navigation in a file
      2. Faster navigation in Vim help
      3. Search and you will find
      4. X marks the spot
      5. Summary
    10. 4. Production Boosters
      1. Using templates
      2. Using tag lists
      3. Using autocompletion
      4. Using macro recording
      5. Using sessions
      6. Registers and undo branching
      7. Using undo branching
      8. Folding
      9. Open files anywhere
      10. Summary
    11. 5. Advanced Formatting
      1. Formatting text
      2. Formatting code
      3. Using external formatting tools
      4. Summary
    12. 6. Basic Vim Scripting
      1. Syntax-color schemes
      2. Syntax regions
      3. Using scripts
      4. Script development
      5. Summary
    13. 7. Extended Vim Scripting
      1. Script structure
      2. Scripting tips
      3. Debugging Vim scripts
      4. Distributing Vim scripts
      5. Remember the documentation
      6. Using external interpreters
      7. Summary
    14. A. Vim Can Do Everything
      1. Vim games
      2. Programmers IDE
      3. Mail program
      4. Chat with Vim
      5. Using Vim as a Twitter client
    15. B. Vim Configuration Alternatives
      1. Tips for keeping your vimrc file clean
      2. A vimrc setup system
      3. Storing vimrc online
    16. Index
O'Reilly logo

Chapter 5. Advanced Formatting

Often, the simplest modification to a text or a piece of code is what changes it from being obscure to being easily readable. In this chapter, we will look at some of the simple tricks you can use to format the text you are working on—no matter whether it is plain text or code.

This chapter will have recipes in three categories:

  • Text formatting
  • Code formatting
  • Using external formatter programs

After reading this chapter, you should have a good idea about what is possible and what is not when it comes to text formatting in Vim.

Formatting text

Even though most people prefer graphical word processors such as Microsoft Word or OpenOffice Writer when they want to write plain text, there are still times where an editor such ...

The best content for your career. Discover unlimited learning on demand for around $1/day.