Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding vertical space between lines in vim

Tags:

vim

layout

Summary: I'd like to view my text in vim with a small bit of extra vertical space between some lines.

I'm writing latex in vim, and have each sentence on a new line. I'd like to add a little bit of vertical space (a few pixels) between sentences to make them clearer. I don't want to add anything to the buffer, just to how I view it.

I don't want to add a whole newline, as that has meaning in latex.

Example text:

Conventional wisdom states that a compiled program should run an
order-of-magnitude faster than an interpreted program.
In our experience, however, dynamic scripting languages do not follow this rule
of thumb.
Instead, a program written in a scripting language spends most of its run-time
handling dynamic features, such as dynamic types and \code{zval}s.
This limits the potential improvement of simply removing the interpreter loop.
This is particularly important for a compiler like \phc{} which re-uses the PHP
system, as many of the code paths executed will be the same, whether the program
is interpreted or compiled.

Any ideas?

Update:

Maybe something with breakat, linebreak, showbreak and linespace, but I dont think this is enough.

  • linespace will put space between every line, but I'd like space only after lines ending in .
  • The others aren't enough without some equivalent to linespace
like image 653
Paul Biggar Avatar asked Aug 17 '09 11:08

Paul Biggar


People also ask

How do you jump in front of a line in Vim?

Press 0 to go to the beginning of a line, or ^ to go to the first non-blank character in a line.

How do I change a whole line in Vim?

Use c$ or just C to quickly change from the cursor to the end of a line, cc to change an entire line, or cis for a sentence. The standard change word command requires you to type cw , then a new word, then press Escape.

How do I add a line to a file in Vim?

Starting in normal mode, you can press O to insert a blank line before the current line, or o to insert one after. O and o ("open") also switch to insert mode so you can start typing. To add 10 empty lines below the cursor in normal mode, type 10o<Esc> or to add them above the cursor type 10O<Esc> .

How do I select the number of lines in Vim?

If you want to select the entire line in a file, press V. Now when you press k or j to go up and down, vim will select the entire line above and below your cursor. Finally, you can select text in columns by pressing ctrl+v and moving up or down the block.


1 Answers

If you're using gvim, can't you do this command?

:set linespace=5
like image 67
Rob Wells Avatar answered Oct 14 '22 07:10

Rob Wells