Two wonderful Fountain Plugins for Vim have been unmaintained for a while now:
- Fountain (A Syntax Highlighter for Fountain Files)
- Fountain Flow (A Fountain Exporter written in VimScript)
This project seeks to combine their functionality and extend where possible.
The changes so far, include:
- Ends with " OUT." –
FADE OUT.
IRIS OUT.
- Ends with " IN." –
FADE IN.
IRIS IN.
- Starts with "CUT TO " –
CUT TO BLACK.
END CREDITS:
FREEZE FRAME:
INTERCUT WITH:
OPENING CREDITS:
SPLIT SCREEN:
STOCK SHOT:
TIME CUT:
TITLE OVER:
- Any single ALL-CAPS word with no spaces ending with a colon –
WIPE:
PRE-LAP:
DISSOLVE:
]]
/[[
– Jump Between Scene Headings & Notes[]
/][
– Jump Between Sections & Notes
I included [[Notes]]
in those navigation since they tend to be used to mark places that need to be revisited.
- Using an abbreviations file for character names allows you to type
george
and have it correct toGEORGE
, saving you needing to capitalize recuring character names - Like a standard abbreviations file, adding common misspellings to this file works as well
Fountain allows you to write screenplays in any text editor on any device. Because it’s just text, it’s portable and future-proof. It is a simple markup syntax for writing, editing and sharing screenplays in plain, human-readable text. Fountain allows you to work on your screenplay anywhere, on any computer or tablet, using any software that edits text files.
Taking its cues from Markdown, Fountain files are eminently readable. When special syntax is required, it is straightforward and intuitive.
I like distraction free writing. And, a terminal is about as distraction free as you can get. Writing in plain text not only keeps me from playing with fonts, etc, but it also means that what I write is easily portable to any new program/systems/etc.
For more information, see writingVim.
The code below (from my .vimrc
) allows me to toggle easily between Coding and Writing:
"Toggle Writing/Code
map <silent><leader><leader> <esc>:call ToggleWriteCode()<cr>
function! ToggleWriteCode()
if &foldcolumn=='0'
:call WriteMode()
else
:call CodeMode()
endif
endfunction
"Hide line numbers, activate spellcheck, increase left margin
function! WriteMode()
exec('set nonumber')
exec('set spell spelllang=en')
exec('map j gj')
exec('map k gk')
exec('set foldcolumn=1')
exec('set linespace=11')
endfunction
"Show line numbers, deactivate spellcheck, reduce left margin
function! CodeMode()
exec('set number')
exec('set nospell')
exec('map j j')
exec('map k k')
exec('set foldcolumn=0')
exec('set linespace=0')
endfunction
Exporting to an editable format allows me to review the content graphically before signing off on the final PDF.
And, the LibreOffice PDF Export Tool has all of the options that I would ever need.
Also, I already do a similar thing with Markdown files using cmark
to translate those files:
"eXport Markdown (LibreOffice)
map <silent><leader>xm <esc>:!cmark % > /tmp/%:r.html<cr>:!libreoffice -o /tmp/%:r.html<cr>
Mostly, this is a typical Vim plugin:
doc/
fountain.txt
ftdetect/
fountain.vim
ftplugin/
fountain.vim
plugin/
fountain.vim
syntax/
fountain.vim
Remember to open vim and :helptags ALL
to generate the new documentation.
You will need to add this to your .vimrc
if you move the fountain
folder.
let g:flow_directory = $HOME.'/path/to/fountain/'
To Import the LibreOffice Templates:
- Open LibreOffice Writer
- Open File > Templates > Manage Templates
- In the Templates Window, find the Manage Dropdown and choose Import
The plugin will automatically identify any file ending with .fountain and highlight all of the elements (Scene Headings, Actions, Characters, Dialogue, Parentheticals, Lyrics, Transitions, etc).
Right now, the Syntax Highlighter recognizes every Standard Transition that I could find. I will be working on adding that functionality to the export function. So, if your Transition does not render in the output, follow the Fountain Standard of using a >
(example: >MYTRANSITION) until I can add it to the code.
I added the following to my .vimrc
:
"eXport Fountain (LibreOffice)
map <silent><leader>xf <esc>:FountainFlow<cr>:LibreOffice<cr>
The two functions are :FountainFlow
and :LibreOffice
. Instead of calling these separately, I have connected the two with a single command.
FountainFlow
parses the current file and fills the current buffer with an HTML version of the file.
LibreOffice
opens the current file in LibreOffice (Writer in this case).
You can press DELETE
to delete the HTML fie and return to your original document in Vim.
Back in LibreOffice:
- find the Menu Item marked
Styles
>Load Styles from Template
- Check the boxes for
Paragraph and Character
,List
,Page
, andOverwrite
- Choose one of the two templates that you imported earlier
- Then click
OK