Question

Vim newbie here.

I would like to be able to create tabs in Vim such that, for example, the tabs are at 4" left and 1.5" right for one type of section, 1.5"/1.5" for another, etc.

I know how to set tab stops, etc. but the trick here is I would like vim to recognize key combinations like shift-enter to go to one kind of formatting, plain enter to go to another kind, etc.

Is this even possible with vim?

TIA

Was it helpful?

Solution 2

Check out these screenplay scripts. At least the first one contains custom tab widths as required in the traditional play formats. Perhaps they provide you the right idea on what's possible with Vim:

OTHER TIPS

I think you're confusing Vim with a word processor (like Word or Writer). There's no measurement in inches, no left / right margins, etc.

Vim's 'tabstop' option is a multiple of the width of a single space character that a <Tab> character (ASCII 0x09) expands to. This is fixed for the entire buffer (though you could use a set of :autocmds to change it in different parts of a buffer). Vim has no notion of paragraph text styles like a word processor, where you can define different styles. Vim only has a rather primitive :hardcopy command for printing.

If you need elaborate text formatting capabilities, Vim probably is the wrong tool, except if you choose to edit a source code document (like Latex, HTML, or Markdown), which is only compiled into a document (for those, like editing programming languages, it's actually well suited and powerful).

The vimtutor command (see :help vimtutor inside Vim) provides a good introduction to Vim's capabilities.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top