Vim Macros for Editing DocBook Documents
The macros are bound to function keys (F-Keys) followed by zero, one or two modifier characters. Function keys are specified as <FN>, where N is the function key number. Shifted function keys are specified as <S-FN>. The key mappings are detailed belwo in Tables 1-4.
Table 1. Key Mappings
|<F2>tag-keys||Insert tag template. Inserts a template for the tag corresponding to the specified tag-keys in the document. See Table 2 for a list of defined tag-keys.|
|<F3>symbol-keys||Insert symbol character. Inserts the symbol character corresponding to the specified symbol-keys in the document. Most often, this inserts the DocBook/XML entity reference for the symbol. See Table 3 for a list of defined symbol-keys.|
|<F4>foreign-char-keys||Insert foreign character. Inserts the foreign character corresponding to the specified foreign-char-keys into the document. See Table 4 for a list of defined foreign-char-keys.|
|<F5>tag-keys||Insert opening tag. Inserts the opening tag corresponding to the specified tag-keys.|
|<F6>tag-keys||Insert closing tag. Inserts the closing tag corresponding to the specified tag-keys.|
|<F7>tag-keys||Tag word. If the cursor is on a word, this places tags corresponding to the specified tag-keys around the word.|
|<F7>tag-keys||Tag range (command mode). When a range of lines is specified, this places tags corresponding to the specified tag-keys around the lines. Note: this is done in command mode; type a colon followed by the key sequence.|
|<F8>tag-keys||Change tag. If the cursor is on a tag, this changes the tag to the tag that corresponds to the specified tag-keys.|
|<F9>||Move cursor to the left by tags. If the cursor is on a tag, this moves to the beginning of the tag (to the <). If the cursor is not on a tag, this moves to the beginning of the next tag to the left of the cursor.|
|<F10>||Move tag left of preceding word. If the cursor is on a tag, this moves the tag to the left of the preceding word. In other words, if the cursor is on a start tag, it expands the amount of tagged content to include the word to the left of the tag. If the cursor is on an end tag, it removes the word to the left of the tag from the tagged contents.|
|<F11>||Move tag right of following word. If the cursor is on a tag, this moves the tag to the right of the following word. In other words, if the cursor is on a start tag, it removes the word to the right of the tag from the tagged contents. If the cursor is on an end tag it, expands the amount of tagged content to include the word to the right of the tag.|
|<F12>||Move cursor to the right by tags. If the cursor is on a tag, this moves to the end of the tag (to the >). If the cursor is not on a tag, this moves to end of the next tag to the right of the cursor.|
|<S-F8>||Delete tag. If the cursor is on a tag, this deletes the tag.|
|<S-F9>||Delete whitespace to the left of the tag. If the cursor is on a tag, this deletes any whitespace to the left of the tag.|
|<S-F10>||Insert a space to the left of the tag. If the cursor is on a tag, this inserts a single space to the left of the tag.|
|<S-F11>||Insert a space to the right of the tag. If the cursor is on a tag, this inserts a single space to the right of the tag.|
|<S-F12>||Delete whitespace to the right of the tag. If the cursor is on a tag, this deletes any whitespace to the right of the tag.|
The following keys are used in combination with the function keys <F2>, <F5>, <F6>, <F7> and <F8> . The function key determines the action; the keys that follow determine the tag.
Table 2. Tag Keys
For example, <F2> inserts a tag template, so <F2>p inserts <para></para>, places the cursor between the two tags and enters insert mode. Many of the templates consist of more than the start and end tag. For example, the template for a table inserts empty heading and body rows.
The following keys are used in combination with function key <F3>.
Table 3. Symbol Keys
|5||‘||Left single quote|
|6||’||Right single quote|
|7||“||Left double quote|
|8||”||Right double quote|
|,||<||Less than sign|
|.||>||Greater than sign|
|<||<||Less than sign|
|>||>||Greater than sign|
|_ (underscore)||-date-||Current date|
For example, <F3>3 inserts ¾ into the text.
The following keys are used in combination with function key <F4>.
Table 4. Foreign Character Keys
|n||ñ||n with tilde|
|'a (singlequote-a)||á||a with acute accent|
|'c||ç||c with cedilla|
|'e||é||e with acute accent|
|'i||í||i with acute accent|
|'o||ó||o with acute accent|
|'u||ú||u with acute accent|
|`a (backtick-a)||à||a with grave accen|
|`e||è||e with grave accent|
|`i||ì||i with grave accent|
|`o||ò||o with grave accent|
|`u||ù||u with grave accent|
|"a (doublequote-a)||ä||a with diaeresis|
|"e||ë||e with diaeresis|
|"i||ï||i with diaeresis|
|"o||ö||o with diaeresis|
|"u||ü||u with diaeresis|
|^a||â||a with circumflex|
|^e||ê||e with circumflex|
|^i||î||i with circumflex|
|^o||ô||o with circumflex|
|^u||û||u with circumflex|
For example, <F4>'a inserts á (an a with an acute accent) into the text.
Mitch Frazier is an Associate Editor for Linux Journal.
Practical Task Scheduling Deployment
July 20, 2016 12:00 pm CDT
One of the best things about the UNIX environment (aside from being stable and efficient) is the vast array of software tools available to help you do your job. Traditionally, a UNIX tool does only one thing, but does that one thing very well. For example, grep is very easy to use and can search vast amounts of data quickly. The find tool can find a particular file or files based on all kinds of criteria. It's pretty easy to string these tools together to build even more powerful tools, such as a tool that finds all of the .log files in the /home directory and searches each one for a particular entry. This erector-set mentality allows UNIX system administrators to seem to always have the right tool for the job.
Cron traditionally has been considered another such a tool for job scheduling, but is it enough? This webinar considers that very question. The first part builds on a previous Geek Guide, Beyond Cron, and briefly describes how to know when it might be time to consider upgrading your job scheduling infrastructure. The second part presents an actual planning and implementation framework.
Join Linux Journal's Mike Diehl and Pat Cameron of Help Systems.
Free to Linux Journal readers.Register Now!
- SUSE LLC's SUSE Manager
- Murat Yener and Onur Dundar's Expert Android Studio (Wrox)
- My +1 Sword of Productivity
- Tech Tip: Really Simple HTTP Server with Python
- Managing Linux Using Puppet
- Non-Linux FOSS: Caffeine!
- Returning Values from Bash Functions
- Doing for User Space What We Did for Kernel Space
- Rogue Wave Software's Zend Server
- Google's SwiftShader Released
With all the industry talk about the benefits of Linux on Power and all the performance advantages offered by its open architecture, you may be considering a move in that direction. If you are thinking about analytics, big data and cloud computing, you would be right to evaluate Power. The idea of using commodity x86 hardware and replacing it every three years is an outdated cost model. It doesn’t consider the total cost of ownership, and it doesn’t consider the advantage of real processing power, high-availability and multithreading like a demon.
This ebook takes a look at some of the practical applications of the Linux on Power platform and ways you might bring all the performance power of this open architecture to bear for your organization. There are no smoke and mirrors here—just hard, cold, empirical evidence provided by independent sources. I also consider some innovative ways Linux on Power will be used in the future.Get the Guide