1

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

Marc Adler
  • 534
  • 1
  • 4
  • 16

2 Answers2

3

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.

Ingo Karkat
  • 167,457
  • 16
  • 250
  • 324
  • Yeah, I thought that might be the case. I was actually aware that "inches" would be impossible - I would be fine with an approximation. Thanks anyway! – Marc Adler Sep 23 '13 at 18:06
  • See progo's comment. Apparently it is possible after all. :) – Marc Adler Sep 24 '13 at 14:16
  • I couldn't deduce from your general question that you're interested in writing plays. Those plugins contort Vim in a way that I've hinted at. I'm glad you've managed to express what you're actually looking for, and have found something! Happy Vimming :-) – Ingo Karkat Sep 24 '13 at 15:03
1

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:

mike3996
  • 17,047
  • 9
  • 64
  • 80
  • Wow. I'll try those out. What I'm really looking for is something that can do stageplay format, not screenplay, but I can fiddle with the scripts (no, uh, pun intended) to get the margins right. Ultimately, anything that produces a text file whose formatting is close enough to allow easy merging with an existing MMSW script will be good. – Marc Adler Sep 24 '13 at 14:15