├── .gitignore ├── .DS_Store ├── macros ├── SingleReturn.sublime-macro ├── DoubleReturn.sublime-macro ├── AddLine.sublime-macro ├── AddDoubleLine.sublime-macro ├── CapLineParentheses.sublime-macro ├── CapCurrentLine.sublime-macro ├── CapLine.sublime-macro ├── CapScene.sublime-macro ├── CapSceneBrackets.sublime-macro └── atCapLineParentheses.sublime-macro ├── capitalize.py ├── Title Page.sublime-snippet ├── Symbols.tmPreferences ├── scopes.py ├── messages.json ├── Comments.tmPreferences ├── autosave.py ├── sublime_helper └── __init__.py ├── LICENSE ├── Default.sublime-commands ├── hide.py ├── Fountainhead.sublime-settings ├── CHANGELOG.txt ├── schemes ├── Night Owl.tmTheme ├── Day.tmTheme ├── Ebony.tmTheme ├── Ivory.tmTheme ├── Night.tmTheme ├── Bezarro.tmTheme ├── Superbman.tmTheme ├── OdysseusDark.tmTheme ├── OdysseusLight.tmTheme ├── SolarizedLight.tmTheme └── SolarizedDark.tmTheme ├── Main.sublime-menu ├── contd.py ├── scenes.py ├── autoscroll.py ├── characters.py └── Fountainhead.tmLanguage /.gitignore: -------------------------------------------------------------------------------- 1 | *.fountain 2 | *.pyc 3 | -------------------------------------------------------------------------------- /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/derickc/Fountainhead/HEAD/.DS_Store -------------------------------------------------------------------------------- /macros/SingleReturn.sublime-macro: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "args": 4 | { 5 | "characters": "\n" 6 | }, 7 | "command": "insert" 8 | } 9 | ] 10 | -------------------------------------------------------------------------------- /macros/DoubleReturn.sublime-macro: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "args": 4 | { 5 | "characters": "\n\n" 6 | }, 7 | "command": "insert" 8 | } 9 | ] 10 | -------------------------------------------------------------------------------- /macros/AddLine.sublime-macro: -------------------------------------------------------------------------------- 1 | [ 2 | {"command": "move_to", "args": {"to": "hardeol"}}, 3 | {"command": "insert", "args": {"characters": "\n"}} 4 | ] 5 | -------------------------------------------------------------------------------- /macros/AddDoubleLine.sublime-macro: -------------------------------------------------------------------------------- 1 | [ 2 | {"command": "move_to", "args": {"to": "hardeol"}}, 3 | {"command": "insert", "args": {"characters": "\n\n"}} 4 | ] 5 | -------------------------------------------------------------------------------- /capitalize.py: -------------------------------------------------------------------------------- 1 | import sublime_plugin 2 | 3 | 4 | class CapCurrentLineCommand(sublime_plugin.TextCommand): 5 | 6 | def run(self, edit): 7 | self.view.run_command('run_macro_file', {"file": "Packages/Fountainhead/macros/CapCurrentLine.sublime-macro"}) 8 | -------------------------------------------------------------------------------- /Title Page.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 13 | title 14 | text.fountain 15 | -------------------------------------------------------------------------------- /macros/CapLineParentheses.sublime-macro: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "args": 4 | { 5 | "extend": true, 6 | "to": "bol" 7 | }, 8 | "command": "move_to" 9 | }, 10 | { 11 | "args": null, 12 | "command": "upper_case" 13 | }, 14 | { 15 | "args": 16 | { 17 | "file": "res://Packages/Default/AddLine.sublime-macro" 18 | }, 19 | "command": "run_macro_file" 20 | } 21 | ] 22 | -------------------------------------------------------------------------------- /macros/CapCurrentLine.sublime-macro: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "args": 4 | { 5 | "to": "bol" 6 | }, 7 | "command": "move_to" 8 | }, 9 | { 10 | "args": 11 | { 12 | "extend": true, 13 | "to": "eol" 14 | }, 15 | "command": "move_to" 16 | }, 17 | { 18 | "args": null, 19 | "command": "upper_case" 20 | }, 21 | { 22 | "args": 23 | { 24 | "by": "characters", 25 | "forward": true 26 | }, 27 | "command": "move" 28 | } 29 | ] 30 | -------------------------------------------------------------------------------- /macros/CapLine.sublime-macro: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "args": 4 | { 5 | "extend": true, 6 | "to": "bol" 7 | }, 8 | "command": "move_to" 9 | }, 10 | { 11 | "args": null, 12 | "command": "upper_case" 13 | }, 14 | { 15 | "args": 16 | { 17 | "by": "characters", 18 | "forward": true 19 | }, 20 | "command": "move" 21 | }, 22 | { 23 | "args": 24 | { 25 | "characters": "\n" 26 | }, 27 | "command": "insert" 28 | } 29 | ] 30 | -------------------------------------------------------------------------------- /macros/CapScene.sublime-macro: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "args": 4 | { 5 | "extend": true, 6 | "to": "bol" 7 | }, 8 | "command": "move_to" 9 | }, 10 | { 11 | "args": null, 12 | "command": "upper_case" 13 | }, 14 | { 15 | "args": 16 | { 17 | "by": "characters", 18 | "forward": true 19 | }, 20 | "command": "move" 21 | }, 22 | { 23 | "args": 24 | { 25 | "characters": "\n\n" 26 | }, 27 | "command": "insert" 28 | } 29 | ] 30 | -------------------------------------------------------------------------------- /macros/CapSceneBrackets.sublime-macro: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "args": 4 | { 5 | "extend": true, 6 | "to": "bol" 7 | }, 8 | "command": "move_to" 9 | }, 10 | { 11 | "args": null, 12 | "command": "upper_case" 13 | }, 14 | { 15 | "args": 16 | { 17 | "file": "res://Packages/Default/AddLine.sublime-macro" 18 | }, 19 | "command": "run_macro_file" 20 | }, 21 | { 22 | "args": 23 | { 24 | "file": "Packages/Fountainhead/macros/SingleReturn.sublime-macro" 25 | }, 26 | "command": "run_macro_file" 27 | } 28 | ] 29 | -------------------------------------------------------------------------------- /Symbols.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Symbol List 7 | scope 8 | entity.name.filename, entity.name.function 9 | settings 10 | 11 | showInSymbolList 12 | 1 13 | 14 | uuid 15 | d0972de4-1a06-4d83-8965-8b49f88089fb 16 | 17 | 18 | -------------------------------------------------------------------------------- /scopes.py: -------------------------------------------------------------------------------- 1 | fountain_scope = 'text.fountain ' 2 | action_scope = 'foreground ' 3 | boneyard_scope = 'comment ' 4 | dialogue_scope = 'dialogue ' # string 5 | lyrics_scope = 'lyrics ' 6 | character_scope = 'string ' # entity.name.class 7 | parenthetical_scope = 'entity.other.inherited-class ' 8 | note_scope = 'variable.parameter ' 9 | scene_scope = 'entity.name.function ' 10 | character_list_scope = 'suport.constant ' 11 | section_scope = 'entity.name.filename ' 12 | synopses_scope = 'meta.diff ' 13 | pagebreak_scope = 'support.function ' 14 | title_page_scope = 'constant.numeric ' 15 | center_scope = 'foreground ' 16 | transition_scope = 'entity.name.tag ' 17 | -------------------------------------------------------------------------------- /macros/atCapLineParentheses.sublime-macro: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "args": 4 | { 5 | "by": "words", 6 | "extend": true, 7 | "forward": false 8 | }, 9 | "command": "move" 10 | }, 11 | { 12 | "args": 13 | { 14 | "by": "words", 15 | "extend": true, 16 | "forward": false 17 | }, 18 | "command": "move" 19 | }, 20 | { 21 | "args": null, 22 | "command": "upper_case" 23 | }, 24 | { 25 | "args": 26 | { 27 | "by": "characters", 28 | "forward": true 29 | }, 30 | "command": "move" 31 | }, 32 | { 33 | "args": 34 | { 35 | "file": "res://Packages/Default/AddLine.sublime-macro" 36 | }, 37 | "command": "run_macro_file" 38 | } 39 | ] 40 | -------------------------------------------------------------------------------- /messages.json: -------------------------------------------------------------------------------- 1 | { 2 | "install": "messages/install.txt", 3 | "0.1.0": "CHANGELOG.txt", 4 | "0.2.0": "CHANGELOG.txt", 5 | "0.3.0": "CHANGELOG.txt", 6 | "0.3.1": "CHANGELOG.txt", 7 | "0.3.2": "CHANGELOG.txt", 8 | "0.3.3": "CHANGELOG.txt", 9 | "0.3.4": "CHANGELOG.txt", 10 | "0.3.5": "CHANGELOG.txt", 11 | "0.4.0": "CHANGELOG.txt", 12 | "0.4.1": "CHANGELOG.txt", 13 | "0.4.2": "CHANGELOG.txt", 14 | "0.5.0": "CHANGELOG.txt", 15 | "0.5.1": "CHANGELOG.txt", 16 | "0.6.0": "CHANGELOG.txt", 17 | "0.6.1": "CHANGELOG.txt", 18 | "0.7.0": "CHANGELOG.txt", 19 | "1.0.0": "CHANGELOG.txt", 20 | "1.0.1": "CHANGELOG.txt", 21 | "1.0.2": "CHANGELOG.txt", 22 | "1.0.3": "CHANGELOG.txt", 23 | "1.0.4": "CHANGELOG.txt", 24 | "1.0.5": "CHANGELOG.txt" 25 | } -------------------------------------------------------------------------------- /Comments.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Comments 7 | scope 8 | text.fountain 9 | settings 10 | 11 | shellVariables 12 | 13 | 14 | name 15 | TM_COMMENT_START 16 | value 17 | /* 18 | 19 | 20 | name 21 | TM_COMMENT_END 22 | value 23 | */ 24 | 25 | 26 | 27 | uuid 28 | 5ed0ecca-a9fa-4fd8-b882-d6db2de1f510 29 | 30 | 31 | -------------------------------------------------------------------------------- /autosave.py: -------------------------------------------------------------------------------- 1 | import sublime 2 | import sublime_plugin 3 | 4 | 5 | class AutomaticSaveCommand(sublime_plugin.EventListener): 6 | 7 | clicks = 0 8 | 9 | def save_me(self, view): 10 | if view.settings().get('syntax') == 'Packages/Fountainhead/Fountainhead.tmLanguage': 11 | # if 'Fountainhead.tmLanguage' in view.settings().get('syntax'): 12 | # if sublime.load_settings('Fountainhead.sublime-settings').get('auto_save', True): 13 | if view.settings().get('auto_save', True): 14 | # self.clicksTrigger = sublime.load_settings('Fountainhead.sublime-settings').get('auto_save_count', 42) 15 | self.clicksTrigger = view.settings().get('auto_save_count', 42) 16 | self.clicks += 1 17 | if self.clicks >= self.clicksTrigger: 18 | self.clicks = 0 19 | view.run_command('save') 20 | 21 | def on_modified(self, view): 22 | if int(sublime.version()) < 3000: 23 | self.save_me(view) 24 | 25 | def on_modified_async(self, view): 26 | if int(sublime.version()) >= 3000: 27 | self.save_me(view) 28 | -------------------------------------------------------------------------------- /sublime_helper/__init__.py: -------------------------------------------------------------------------------- 1 | class SublimeHelper: 2 | 3 | def cursor_scope(self, view, offset=1): 4 | ''' 5 | Gives the scope based on cursor position. 6 | ''' 7 | return view.scope_name(view.sel()[0].end() - offset) 8 | 9 | def line_scope(self, view, offset=1): 10 | ''' 11 | Gives the scope for a given line based on cursor position. Defaults to the previous line. 12 | ''' 13 | return view.scope_name(view.text_point(view.rowcol(view.sel()[0].end())[0] - offset, 0)) 14 | 15 | def line_string(self, view, offset=1): 16 | ''' 17 | Gives the string of text for a given line. Defaults to the previous line. 18 | ''' 19 | return view.substr(view.line(view.text_point(view.rowcol(view.sel()[0].end())[0] - offset, 0))) 20 | 21 | def scope_list(self, view, scope='text.fountain '): 22 | ''' 23 | Gives a list of all strings for a given scope. 24 | ''' 25 | regions = [] 26 | scopes = [] 27 | regions = view.find_by_selector(scope) 28 | for region in regions: 29 | scopes.append(view.substr(region)) 30 | return scopes 31 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Fountainhead License 2 | 3 | This license applies to all files in the Fountainhead codebase, except for the specific files that are described in the other licenses contained in this document. 4 | 5 | The MIT License (MIT) 6 | 7 | Copyright (c) 2014 Derick Ochi Chan 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy 10 | of this software and associated documentation files (the "Software"), to deal 11 | in the Software without restriction, including without limitation the rights 12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | copies of the Software, and to permit persons to whom the Software is 14 | furnished to do so, subject to the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be included in all 17 | copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 25 | SOFTWARE. 26 | 27 | ------------------------------------------------------------------------------- 28 | -------------------------------------------------------------------------------- /Default.sublime-commands: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "caption": "Fountainhead: Show/Hide Boneyard", 4 | "command": "hide_boneyard" 5 | }, 6 | { 7 | "caption": "Fountainhead: Show/Hide Synopses", 8 | "command": "hide_synopses" 9 | }, 10 | { 11 | "caption": "Fountainhead: Show/Hide Notes", 12 | "command": "hide_notes" 13 | }, 14 | { 15 | "caption": "Fountainhead: Show Character List", 16 | "command": "show_characters" 17 | }, 18 | { 19 | "caption": "Fountainhead: Show Scene List", 20 | "command": "show_scenes" 21 | }, 22 | { 23 | "caption": "Fountainhead: Update Character List", 24 | "command": "update_character_list" 25 | }, 26 | { 27 | "caption": "Fountainhead: Update Scene List", 28 | "command": "update_scene_list" 29 | }, 30 | { 31 | "caption": "Fountainhead: Update Character (CONT'D)s", 32 | "command": "update_contd" 33 | }, 34 | { 35 | "caption": "Fountainhead: Remove all Character (CONT'D)s", 36 | "command": "remove_all_contd" 37 | }, 38 | { 39 | "caption": "Fountainhead: Convert to Lowercase", 40 | "command": "lower_case" 41 | }, 42 | { 43 | "caption": "Fountainhead: Convert to Uppercase", 44 | "command": "upper_case" 45 | }, 46 | { 47 | "caption": "Fountainhead: Capitalize Current Line", 48 | "command": "cap_current_line" 49 | } 50 | 51 | ] -------------------------------------------------------------------------------- /hide.py: -------------------------------------------------------------------------------- 1 | # import sublime 2 | import sublime_plugin 3 | try: 4 | from . import scopes 5 | except (ImportError, ValueError): 6 | import scopes 7 | 8 | fountain_scope = scopes.fountain_scope 9 | action_scope = scopes.action_scope 10 | boneyard_scope = scopes.boneyard_scope 11 | dialogue_scope = scopes.dialogue_scope 12 | lyrics_scope = scopes.lyrics_scope 13 | character_scope = scopes.character_scope 14 | parenthetical_scope = scopes.parenthetical_scope 15 | note_scope = scopes.note_scope 16 | scene_scope = scopes.scene_scope 17 | character_list_scope = scopes.character_list_scope 18 | section_scope = scopes.section_scope 19 | synopses_scope = scopes.synopses_scope 20 | pagebreak_scope = scopes.pagebreak_scope 21 | title_page_scope = scopes.title_page_scope 22 | center_scope = scopes.center_scope 23 | transition_scope = scopes.transition_scope 24 | 25 | 26 | class FoldBoneyard(sublime_plugin.EventListener): 27 | 28 | def on_load_async(self, view): 29 | if (view.settings().get('syntax') == 'Packages/Fountainhead/Fountainhead.tmLanguage'): 30 | # if 'Fountainhead.tmLanguage' in view.settings().get('syntax'): 31 | # if sublime.load_settings('Fountainhead.sublime-settings').get('fold_boneyard', False): 32 | if view.settings().get('fold_boneyard', False): 33 | # view.fold(view.find_by_selector('comment')) 34 | view.fold(view.find_by_selector(boneyard_scope)) 35 | 36 | 37 | class FoldSynopses(sublime_plugin.EventListener): 38 | 39 | def on_load(self, view): 40 | if (view.settings().get('syntax') == 'Packages/Fountainhead/Fountainhead.tmLanguage'): 41 | # if 'Fountainhead.tmLanguage' in view.settings().get('syntax'): 42 | # if sublime.load_settings('Fountainhead.sublime-settings').get('fold_synopses', False): 43 | if view.settings().get('fold_synopses', False): 44 | # view.fold(view.find_by_selector('meta.diff')) 45 | view.fold(view.find_by_selector(synopses_scope)) 46 | 47 | 48 | class FoldNotes(sublime_plugin.EventListener): 49 | 50 | def on_load(self, view): 51 | if (view.settings().get('syntax') == 'Packages/Fountainhead/Fountainhead.tmLanguage'): 52 | # if 'Fountainhead.tmLanguage' in view.settings().get('syntax'): 53 | # if sublime.load_settings('Fountainhead.sublime-settings').get('fold_notes', False): 54 | if view.settings().get('fold_notes', False): 55 | # view.fold(view.find_by_selector('variable.parameter')) 56 | view.fold(view.find_by_selector(note_scope)) 57 | 58 | 59 | class HideBoneyardCommand(sublime_plugin.TextCommand): 60 | 61 | def run(self, edit): 62 | if self.view.fold(self.view.find_by_selector(boneyard_scope)): 63 | self.view.fold(self.view.find_by_selector(boneyard_scope)) 64 | else: 65 | for region in self.view.find_by_selector(boneyard_scope): 66 | self.view.unfold(region) 67 | 68 | 69 | class HideSynopsesCommand(sublime_plugin.TextCommand): 70 | 71 | def run(self, edit): 72 | if self.view.fold(self.view.find_by_selector(synopses_scope)): 73 | self.view.fold(self.view.find_by_selector(synopses_scope)) 74 | else: 75 | for region in self.view.find_by_selector(synopses_scope): 76 | self.view.unfold(region) 77 | 78 | 79 | class HideNotesCommand(sublime_plugin.TextCommand): 80 | 81 | def run(self, edit): 82 | if self.view.fold(self.view.find_by_selector(note_scope)): 83 | self.view.fold(self.view.find_by_selector(note_scope)) 84 | else: 85 | for region in self.view.find_by_selector(note_scope): 86 | self.view.unfold(region) 87 | 88 | # http://www.sublimetext.com/forum/viewtopic.php?f=3&t=4620 89 | -------------------------------------------------------------------------------- /Fountainhead.sublime-settings: -------------------------------------------------------------------------------- 1 | { 2 | // To change settings: 3 | // 1. Selection > Select All (⌘A / ⌃A) 4 | // 2. Edit > Copy (⌘C / ⌃C) 5 | // 3. Tools > Fountainhead > Preferences > Fountain Settings - User 6 | // 4. Edit > Paste (⌘V / ⌃V) 7 | // 5. Comment/Uncomment (⌘/ / ⌃/ or by adding/deleting the // at the beginning of the line) or Edit the value of the setting you want to change (Note: Each setting should only have one active value) 8 | // 6. Save (⌘S / ⌃S) 9 | "extensions": 10 | [ 11 | "fountain" 12 | ], 13 | // Monospaced Fonts 14 | // Find more fonts at: http://www.fontsquirrel.com/fonts/list/classification/monospaced 15 | // "font_face": "Menlo", 16 | // "font_face": "Lekton", 17 | "font_face": "Source Code Pro Light", 18 | // "font_face": "Courier", 19 | // "font_face": "Courier Screenplay", 20 | // "font_face": "Courier Final Draft", 21 | // "font_face": "Courier Prime", 22 | // "font_face": "Iconsolata", 23 | // "font_face": "Inconsolata-dz", 24 | // Download and learn more about Input, fonts for code, from Font Bureau at http://input.fontbureau.com 25 | // If you are trying to use Input's proportional typefaces, please read http://input.fontbureau.com/workarounds/ 26 | // "font_face": "InputMono ExLight", 27 | // Download and learn more about the free Dyslexia Typeface at http://opendyslexic.org 28 | // "font_face": "OpenDyslexicMono", 29 | "font_size": 16, 30 | 31 | // Uncomment a desired color_scheme that will only be used when working on .fountain files. Program restart or reopening document may be required for changes to take effect. 32 | // "color_scheme": "Packages/Fountainhead/schemes/Ebony.tmTheme", 33 | // "color_scheme": "Packages/Fountainhead/schemes/Ivory.tmTheme", 34 | // "color_scheme": "Packages/Fountainhead/schemes/Night Owl.tmTheme", 35 | // "color_scheme": "Packages/Fountainhead/schemes/Night.tmTheme", 36 | // "color_scheme": "Packages/Fountainhead/schemes/Day.tmTheme", 37 | // "color_scheme": "Packages/Fountainhead/schemes/OdysseusDark.tmTheme", 38 | // "color_scheme": "Packages/Fountainhead/schemes/OdysseusLight.tmTheme", 39 | // "color_scheme": "Packages/Fountainhead/schemes/Superbman.tmTheme", 40 | // "color_scheme": "Packages/Fountainhead/schemes/Bezarro.tmTheme", 41 | // "color_scheme": "Packages/Fountainhead/schemes/SolarizedDark.tmTheme", 42 | // "color_scheme": "Packages/Fountainhead/schemes/SolarizedLight.tmTheme", 43 | 44 | 45 | // Enables auto-completions of character and scene headings when the first character typed on a line is lowercase or a period 46 | "auto_complete": true, 47 | "auto_complete_selector": "constant.character", 48 | "word_separators": "/\\()\"-:,;<>~!@#$%^&*|+=[]{}`~?", 49 | "draw_indent_guides": false, 50 | 51 | // Always show fold buttons in the gutter 52 | "fade_fold_buttons": false, 53 | "indent_subsequent_lines": true, 54 | "auto_indent": false, 55 | "draw_white_space": "selection", //"all" "none" "selection" 56 | "word_wrap": true, 57 | "wrap_width": 62, 58 | "gutter": true, 59 | "margin": 0, 60 | "caret_extra_top": 2, 61 | "caret_extra_bottom": 2, 62 | "caret_extra_width": 0, 63 | "line_padding_top": 1, 64 | "highlight_line": true, 65 | "draw_centered": true, 66 | "spell_check": true, 67 | "fold_buttons": true, 68 | "trim_automatic_white_space": true, 69 | "line_numbers": false, 70 | "tab_size": 4, 71 | "translate_tabs_to_spaces": true, 72 | "use_tab_stops": true, 73 | "shift_tab_unindent": true, 74 | "auto_complete_commit_on_tab": true, 75 | "tab_completion": true, 76 | "auto_complete_with_fields": true, 77 | 78 | // Automatically save your progress 79 | "auto_save": false, 80 | // Saves after the desired number of key strokes; useful when used with a program like Marked 2 81 | "auto_save_count": 42, 82 | // Saves when you go to another window or bring up an overlay 83 | "save_on_focus_lost": false, 84 | 85 | // Automatically scrolls the page up when you reach the bottom of the screen 86 | "auto_scroll": true, 87 | 88 | // Automatically hides Boneyard, Synopses, or Notes when opening a .fountain file 89 | "fold_boneyard": false, 90 | "fold_synopses": false, 91 | "fold_notes": false, 92 | 93 | // Automatically create a list of characters 94 | "characters": true, 95 | 96 | // Automatically create a list of scene headings 97 | "scenes": true, 98 | 99 | // Automatically add (CONT'D) to character names 100 | "contd": true, 101 | 102 | // Add a blank line (double line space) after dialogue (lyrics have single line spaces) 103 | "dialogue_double_line_space": true, 104 | 105 | // Add a blank line (double line space) after notes 106 | "note_double_line_space": true, 107 | 108 | // Toggle key binding commands 109 | // Move cursor forward using shift + space 110 | "forward_cursor": true, 111 | // Toggle boneyard, synopses, and notes folding keyboard shortcuts 112 | "fold_text": true, 113 | // Toggle capitalizing of current line 114 | "cap_current_line": true, 115 | // Automatically capitalize scene headings, transitions, and character names when pressing Return 116 | "line_cap": true, 117 | // Automatically places a blank line after scene headings, action, and transitions 118 | "auto_line": true, 119 | // Automatically wrap/unwrap text when using markdown text emphasis 120 | "text_emphasis": true 121 | } -------------------------------------------------------------------------------- /CHANGELOG.txt: -------------------------------------------------------------------------------- 1 | # Fountainhead Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | This project adheres to [Semantic Versioning](http://semver.org/). 5 | Restart Sublime Text and re-open Fountain files for the updates to be properly applied. 6 | 7 | ## [1.0.5] - 2016-08-13 8 | 9 | ### Changed 10 | - Updated Notes: Double line spaces are inserted when pressing Return by default. 11 | - Notes can be changed to single line spaces by adding "note_double_line_space": false," to the user's Fountainhead settings file. 12 | 13 | ## [1.0.4] - 2016-07-21 14 | 15 | ### Changed 16 | - Updated to support Cyrillic character names. 17 | 18 | ## [1.0.3] - 2016-02-10 19 | 20 | ### Changed 21 | - Updated Fountainhead.tmLanguage file to escape parenthese to fix Regex errors. Thanks Manuel! 22 | 23 | ## [1.0.2] - 2015-02-18 24 | 25 | ### Changed 26 | - CHANGELOG.md now CHANGELOG.txt to make it compatible with Package Control messages. 27 | 28 | 29 | ## [1.0.1] - 2015-02-18 30 | 31 | ### Changed 32 | - Removed in-page links in README.md to improve support with https://packagecontrol.io. 33 | - Clean up help.fountain and install.txt. 34 | 35 | ### Fixed 36 | - References in messages.json were not correct, so install and update messages were not appearing. 37 | 38 | ## [1.0.0] - 2015-02-17 39 | Happy to announce that version 1.0.0 has finally arrived for Fountainhead. This version is about creating a great writing and editing environment. Future versions will deal with previewing and converting screenplays. 40 | 41 | ### Added 42 | - Ability to capitalize entire lines of text using ⌘K,K / ⌃K,K. See below for full documentation. Great when editing! 43 | - Manual Capitalization section in the help documentation. 44 | - Reference and link to the Input font for coding, by Font Bureau. Read more about it here: http://input.fontbureau.com 45 | - Dialogue and Lyric syntax scopes. Lyrics are character dialogue that begin with ~. 46 | - Ability to change between single or double line spacing after Dialogue, using the dialogue_double_line_space setting. 47 | - README.md FAQ entry on beginning characters that end in a period (e.g., JR.) with an "@". 48 | 49 | ### Changed 50 | - Scene and Character lists retain their capitalization as entered, which means they will most likely be in all uppercase letters (except @ characters). Great when editing! 51 | - Improved support for default Sublime Text Color Schemes. Dialogue and Lyrics default to foreground (Action) colors, and Characters default to string scopes. 52 | - All version updates combined into a single change log (CHANGELOG.md). 53 | - All color schemes to use the new Dialog, Lyrics, and Character scopes. 54 | 55 | ### Fixed 56 | - Removed Default.sublime-keymap, which was causing conflicts with the Default (OSX).sublime-keymap file, and is redundant with the Linux and Windows keymap files. 57 | - Scene and Character pop-up menus are updated properly when new scenes/characters are entered (Sublime Text 3 feature). 58 | - Pressing Enter/Return at the end of a parenthetical will no longer make the line uppercase. 59 | - Dialogue that is not a complete sentence will no longer be automatically capitalized when Enter/Return is pressed. 60 | 61 | ### Notes 62 | 63 | #### Manual Capitalization 64 | 65 | For those times that manual capitalization is needed (e.g., edits), the following commands are provided: 66 | 67 | Key Combination | Performs the Following Action 68 | --------------------|------------------------------- 69 | ⌘K,⌘L / ⌃K,⌃L (1) | Convert highlighted text to lowercase 70 | ⌘K,⌘U / ⌃K,⌃U (1) | Convert highlighted text to uppercase 71 | ⌘K,K / ⌃K,K (2) | Capitalize the entire line 72 | 73 | (1) The comma is used to separate the sequence of key presses (X,Y is equal to "Press X, and then press Y"). 74 | 75 | (2) All commands use lowercase letters (e.g., K is equal to pressing k), unless preceded by ⇧/Shift. 76 | 77 | The above commands can also be selected through the use of menus: 78 | 79 | Tools > Fountainhead > Convert to Lowercase 80 | Tools > Fountainhead > Convert to Uppercase 81 | Tools > Fountainhead > Capitalize Current Line 82 | or 83 | Tools > Command Palette (⇧⌘P / ⇧⌃P) and entering "Fountainhead: Convert to Lowercase" 84 | Tools > Command Palette (⇧⌘P / ⇧⌃P) and entering "Fountainhead: Convert to Uppercase" 85 | Tools > Command Palette (⇧⌘P / ⇧⌃P) and entering "Fountainhead: Capitalize Current Line" 86 | 87 | 88 | ## [0.7.0] - 2015-01-28 89 | 90 | ### Added 91 | - OpenDyslexic monospaced font to settings. Read more about this font, which helps dyslexic individuals, at http://opendyslexic.org 92 | - Instructions on how to install fonts added to the README and help files. 93 | 94 | ### Notes 95 | 96 | #### Installing Fonts 97 | 98 | ##### Mac 99 | 100 | 1. Double-click the font file (usually ending in .otf or .ttf) 101 | 2. The Font Book app will open and display the font 102 | 3. Click Install Font on the bottom of the preview window 103 | 104 | ##### Windows 105 | 106 | Taken from http://windows.microsoft.com/en-us/windows-vista/install-or-uninstall-fonts 107 | 108 | 1. Open Fonts by clicking the Start button, clicking Control Panel, clicking Appearance and Personalization, and then clicking Fonts. 109 | 2. Click File, and then click Install New Font. 110 | - If you don't see the File menu, press ALT. 111 | 3. In the Add Fonts dialog box, under Drives, click the drive where the font that you want to install is located. 112 | 4. Under Folders, double-click the folder containing the fonts that you want to add. 113 | 5. Under List of fonts, click the font that you want to add, and then click Install. 114 | 115 | ##### Linux (Ubuntu) 116 | 117 | 1. Double-click the font file (usually ending in .otf or .ttf) 118 | 2. Font Viewer will launch and display the font 119 | 3. Click Install Font in the lower right-hand corner of the preview window 120 | 121 | 122 | ## [0.6.1] - 2015-01-23 123 | 124 | ### Fixed 125 | - Add missing ő and ű (Thanks to fricy for finding the issue). 126 | - Cleaned up Fountainhead.tmLanguage scene_headings scope to remove redundant capital letters (since the ?i regex makes it case insensitive). 127 | 128 | 129 | ## [0.6.0] - 2015-01-22 130 | 131 | ### Added 132 | - Support for accented characters. 133 | 134 | 135 | ## [0.5.1] - 2014-12-19 136 | 137 | ### Fixed 138 | - Action text with parentheses no longer auto-capitalizes. 139 | 140 | 141 | ## [0.5.0] - 2014-12-18 142 | 143 | ### Added 144 | - Anatomatic's Night Owl color scheme. 145 | 146 | 147 | ## [0.4.2] - 2014-12-16 148 | 149 | ### Fixed 150 | - Action and Dialogue spacing issues and they no longer auto-capitalize. 151 | 152 | 153 | ## [0.4.1] - 2014-12-16 154 | 155 | ### Fixed 156 | - Character auto-capitalization. 157 | 158 | 159 | ## [0.4.0] - 2014-12-16 160 | 161 | ### Added 162 | - Help documentation now located in Tools > Fountainhead > Help 163 | 164 | ### Changed 165 | - README.md to include the new documentation. 166 | - By default, no Fountainhead color schemes are selected in settings, allowing the user to select Sublime Text's general color schemes. Fountain-only color schemes can be selected in Fountainhead's user settings. 167 | 168 | ### Fixed 169 | - Cleaned up fountain syntax support and added the ability to use \* to produce a * in your script. 170 | 171 | 172 | ## [0.3.5] - 2014-12-02 173 | 174 | ### Fixed 175 | - Fountain syntax found using comparison to path name for ST2 support. 176 | 177 | 178 | ## [0.3.4] - 2014-12-01 179 | 180 | ### Changed 181 | - File settings are retrieved using view.settings().get() as opposed to sublime.load_settings().get(). 182 | 183 | 184 | ## [0.3.3] - 2014-11-30 185 | 186 | ### Changed 187 | - Character and Scene completion files created in User/Fountainhead/. 188 | - User/Fountainhead/ is created if it doesn't currently exist. 189 | 190 | 191 | ## [0.3.2] - 2014-11-30 192 | 193 | ### Fixed 194 | - SublimeHelper in sublime_helper/__init__.py is now imported properly. 195 | 196 | 197 | ## [0.3.1] - 2014-11-30 198 | 199 | ### Changed 200 | - Move SublimeHelper into sublime_helper/__init__.py. 201 | 202 | 203 | ## [0.3.0] - 2014-11-30 204 | 205 | ### Added 206 | - Sublime Text 2 support. 207 | 208 | 209 | ## [0.2.0] - 2014-11-29 210 | 211 | ### Added 212 | - Support for Character and Scene Lists in Windows and Linux. 213 | 214 | 215 | ## [0.1.0] - 2014-11-21 216 | 217 | Initial release. -------------------------------------------------------------------------------- /schemes/Night Owl.tmTheme: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | author 6 | Ian McAlpin (based on Derick) 7 | name 8 | FH Night Owl 9 | scope 10 | text.html.markdown.fountain 11 | settings 12 | 13 | 14 | settings 15 | 16 | background 17 | #202020 18 | caret 19 | #E28964 20 | 21 | foreground 22 | #B8B8B8 23 | invisibles 24 | #bfbfbf 25 | lineHighlight 26 | #1e1e1e 27 | selection 28 | #A8644A 29 | selectionForeground 30 | #fffff8 31 | inactiveSelection 32 | #bbbbbb 33 | inactiveSelectionForeground 34 | #222222 35 | bracketsForeground 36 | #F8F8F2A5 37 | bracketsOptions 38 | underline 39 | bracketContentsForeground 40 | #F8F8F2A5 41 | bracketContentsOptions 42 | underline 43 | 44 | 45 | 46 | name 47 | Synopses 48 | scope 49 | meta.diff 50 | settings 51 | 52 | foreground 53 | #808080 54 | fontStyle 55 | italic 56 | 57 | 58 | 59 | name 60 | Scene Headings 61 | scope 62 | entity.name.function 63 | settings 64 | 65 | foreground 66 | #D7B977 67 | fontStyle 68 | bold 69 | 70 | 71 | 72 | name 73 | Sections 74 | scope 75 | entity.name.filename 76 | settings 77 | 78 | foreground 79 | #E28964 80 | 82 | 83 | 84 | 85 | name 86 | Dialogue 87 | scope 88 | dialogue 89 | settings 90 | 91 | foreground 92 | #B8B8B8 93 | 94 | 95 | 96 | name 97 | Lyrics 98 | scope 99 | lyrics 100 | settings 101 | 102 | foreground 103 | #B8B8B8 104 | fontStyle 105 | italic 106 | 107 | 108 | 109 | name 110 | Character 111 | scope 112 | string 113 | settings 114 | 115 | foreground 116 | #8DB7A5 117 | 118 | 119 | 120 | name 121 | Parenthetical 122 | scope 123 | entity.other.inherited-class 124 | settings 125 | 126 | foreground 127 | #808080 128 | fontStyle 129 | italic 130 | 131 | 132 | 133 | name 134 | Transitions 135 | scope 136 | entity.name.tag 137 | settings 138 | 139 | foreground 140 | #A7616B 141 | 142 | 143 | 144 | name 145 | Notes 146 | scope 147 | variable.parameter 148 | settings 149 | 150 | foreground 151 | #909090 152 | background 153 | #a7e9b011 154 | fontStyle 155 | italic 156 | 157 | 158 | 159 | name 160 | Boneyard 161 | scope 162 | comment 163 | settings 164 | 165 | foreground 166 | #394347 167 | fontStyle 168 | italic 169 | 170 | 171 | 172 | name 173 | Bold Text 174 | scope 175 | markup.changed 176 | settings 177 | 178 | fontStyle 179 | bold 180 | 182 | 183 | 184 | 185 | name 186 | Italic Text 187 | scope 188 | message.error 189 | settings 190 | 191 | fontStyle 192 | italic 193 | 195 | 196 | 197 | 198 | name 199 | Bold Italic Text 200 | scope 201 | markup.inserted 202 | settings 203 | 204 | fontStyle 205 | bold italic 206 | 208 | 209 | 210 | 211 | name 212 | Underline Text 213 | scope 214 | markup.deleted 215 | settings 216 | 217 | fontStyle 218 | underline 219 | 221 | 222 | 223 | 224 | name 225 | Page Breaks 226 | scope 227 | support.function 228 | settings 229 | 230 | foreground 231 | #A7616B 232 | 233 | 234 | 235 | name 236 | Characters and Scenes 237 | scope 238 | constant.character 239 | settings 240 | 241 | foreground 242 | #917df2 243 | 244 | 245 | 246 | uuid 247 | e87c1b79-82c3-4304-9624-a713665e216e 248 | 249 | 250 | -------------------------------------------------------------------------------- /schemes/Day.tmTheme: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | author 6 | Derick 7 | name 8 | Day 9 | scope 10 | text.html.markdown.fountain 11 | settings 12 | 13 | 14 | settings 15 | 16 | background 17 | #fefef8 18 | caret 19 | #34c4e0 20 | 21 | foreground 22 | #272822 23 | invisibles 24 | #777777 25 | lineHighlight 26 | #f4f4ed 27 | selection 28 | #9D550F 29 | selectionForeground 30 | #fffff8 31 | inactiveSelection 32 | #bbbbbb 33 | inactiveSelectionForeground 34 | #222222 35 | bracketsForeground 36 | #555555A5 37 | bracketsOptions 38 | underline 39 | bracketContentsForeground 40 | #555555A5 41 | bracketContentsOptions 42 | underline 43 | 44 | 45 | 46 | name 47 | Title Page 48 | scope 49 | constant.numeric 50 | settings 51 | 52 | foreground 53 | #9c7308 54 | fontStyle 55 | italic 56 | 57 | 58 | 59 | name 60 | Synopses 61 | scope 62 | meta.diff 63 | settings 64 | 65 | foreground 66 | #9c7308 67 | fontStyle 68 | italic 69 | 70 | 71 | 72 | name 73 | Scene Headings 74 | scope 75 | entity.name.function 76 | settings 77 | 78 | foreground 79 | #1498e4 80 | fontStyle 81 | bold 82 | 83 | 84 | 85 | name 86 | Sections 87 | scope 88 | entity.name.filename 89 | settings 90 | 91 | foreground 92 | #1498e4 93 | 94 | 95 | 96 | name 97 | Dialogue 98 | scope 99 | dialogue 100 | settings 101 | 102 | foreground 103 | #919482 104 | 105 | 106 | 107 | name 108 | Lyrics 109 | scope 110 | lyrics 111 | settings 112 | 113 | foreground 114 | #919482 115 | fontStyle 116 | italic 117 | 118 | 119 | 120 | name 121 | Character 122 | scope 123 | string 124 | settings 125 | 126 | foreground 127 | #25a4ec 128 | 129 | 130 | 131 | name 132 | Parenthetical 133 | scope 134 | entity.other.inherited-class 135 | settings 136 | 137 | foreground 138 | #f92772 139 | fontStyle 140 | italic 141 | 142 | 143 | 144 | name 145 | Transitions 146 | scope 147 | entity.name.tag 148 | settings 149 | 150 | foreground 151 | #9e71ef 152 | 153 | 154 | 155 | name 156 | Notes 157 | scope 158 | variable.parameter 159 | settings 160 | 161 | foreground 162 | #ff950f 163 | fontStyle 164 | italic 165 | 166 | 167 | 168 | name 169 | Boneyard 170 | scope 171 | comment 172 | settings 173 | 174 | foreground 175 | #c6c6c6 176 | fontStyle 177 | italic 178 | 179 | 180 | 181 | name 182 | Bold Text 183 | scope 184 | markup.changed 185 | settings 186 | 187 | fontStyle 188 | bold 189 | foreground 190 | #be17d2 191 | 192 | 193 | 194 | name 195 | Italic Text 196 | scope 197 | message.error 198 | settings 199 | 200 | fontStyle 201 | italic 202 | foreground 203 | #be17d2 204 | 205 | 206 | 207 | name 208 | Bold Italic Text 209 | scope 210 | markup.inserted 211 | settings 212 | 213 | fontStyle 214 | bold italic 215 | foreground 216 | #be17d2 217 | 218 | 219 | 220 | name 221 | Underline Text 222 | scope 223 | markup.deleted 224 | settings 225 | 226 | fontStyle 227 | underline 228 | foreground 229 | #be17d2 230 | 231 | 232 | 233 | name 234 | Page Breaks 235 | scope 236 | support.function 237 | settings 238 | 239 | foreground 240 | #34c4e0 241 | 242 | 243 | 244 | name 245 | Characters and Scenes 246 | scope 247 | constant.character 248 | settings 249 | 250 | foreground 251 | #917df2 252 | 253 | 254 | 255 | uuid 256 | 27b37852-9380-4de1-b94e-680d5a4b4943 257 | 258 | 259 | -------------------------------------------------------------------------------- /schemes/Ebony.tmTheme: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | author 6 | Derick 7 | name 8 | Ebony 9 | scope 10 | text.html.markdown.fountain 11 | settings 12 | 13 | 14 | settings 15 | 16 | background 17 | #272822 18 | caret 19 | #f3f3f3 20 | 21 | foreground 22 | #f3f3f3 23 | invisibles 24 | #777777 25 | lineHighlight 26 | #333333 27 | selection 28 | #f3f3f3 29 | selectionForeground 30 | #272822 31 | inactiveSelection 32 | #bbbbbb 33 | inactiveSelectionForeground 34 | #272822 35 | bracketsForeground 36 | #F8F8F2A5 37 | bracketsOptions 38 | underline 39 | bracketContentsForeground 40 | #F8F8F2A5 41 | bracketContentsOptions 42 | underline 43 | 44 | 45 | 46 | name 47 | Title Page 48 | scope 49 | constant.numeric 50 | settings 51 | 52 | foreground 53 | #777777 54 | fontStyle 55 | italic 56 | 57 | 58 | 59 | name 60 | Synopses 61 | scope 62 | meta.diff 63 | settings 64 | 65 | foreground 66 | #777777 67 | fontStyle 68 | italic 69 | 70 | 71 | 72 | name 73 | Scene Headings 74 | scope 75 | entity.name.function 76 | settings 77 | 78 | foreground 79 | #f3f3f3 80 | fontStyle 81 | bold 82 | 83 | 84 | 85 | name 86 | Sections 87 | scope 88 | entity.name.filename 89 | settings 90 | 91 | foreground 92 | #f3f3f3 93 | 94 | 95 | 96 | name 97 | Dialogue 98 | scope 99 | dialogue 100 | settings 101 | 102 | foreground 103 | #f3f3f3 104 | 105 | 106 | 107 | name 108 | Lyrics 109 | scope 110 | lyrics 111 | settings 112 | 113 | foreground 114 | #f3f3f3 115 | fontStyle 116 | italic 117 | 118 | 119 | 120 | name 121 | Character 122 | scope 123 | string 124 | settings 125 | 126 | foreground 127 | #f3f3f3 128 | 129 | 130 | 131 | name 132 | Parenthetical 133 | scope 134 | entity.other.inherited-class 135 | settings 136 | 137 | foreground 138 | #777777 139 | fontStyle 140 | italic 141 | 142 | 143 | 144 | name 145 | Transitions 146 | scope 147 | entity.name.tag 148 | settings 149 | 150 | foreground 151 | #777777 152 | 153 | 154 | 155 | name 156 | Notes 157 | scope 158 | variable.parameter 159 | settings 160 | 161 | foreground 162 | #cbd012 163 | fontStyle 164 | italic 165 | 166 | 167 | 168 | name 169 | Boneyard 170 | scope 171 | comment 172 | settings 173 | 174 | foreground 175 | #525252 176 | fontStyle 177 | italic 178 | 179 | 180 | 181 | name 182 | Bold Text 183 | scope 184 | markup.changed 185 | settings 186 | 187 | fontStyle 188 | bold 189 | foreground 190 | #777777 191 | 192 | 193 | 194 | name 195 | Italic Text 196 | scope 197 | message.error 198 | settings 199 | 200 | fontStyle 201 | italic 202 | foreground 203 | #777777 204 | 205 | 206 | 207 | name 208 | Bold Italic Text 209 | scope 210 | markup.inserted 211 | settings 212 | 213 | fontStyle 214 | bold italic 215 | foreground 216 | #777777 217 | 218 | 219 | 220 | name 221 | Underline Text 222 | scope 223 | markup.deleted 224 | settings 225 | 226 | fontStyle 227 | underline 228 | foreground 229 | #777777 230 | 231 | 232 | 233 | name 234 | Page Breaks 235 | scope 236 | support.function 237 | settings 238 | 239 | foreground 240 | #777777 241 | 242 | 243 | 244 | name 245 | Characters and Scenes 246 | scope 247 | constant.character 248 | settings 249 | 250 | foreground 251 | #777777 252 | 253 | 254 | 255 | uuid 256 | e1f7deeb-e051-4d3e-80c6-27256662a174 257 | 258 | 259 | -------------------------------------------------------------------------------- /schemes/Ivory.tmTheme: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | author 6 | Derick 7 | name 8 | Ivory 9 | scope 10 | text.html.markdown.fountain 11 | settings 12 | 13 | 14 | settings 15 | 16 | background 17 | #f3f3f3 18 | caret 19 | #272822 20 | 21 | foreground 22 | #272822 23 | invisibles 24 | #aaaaaa 25 | lineHighlight 26 | #ebebeb 27 | selection 28 | #272822 29 | selectionForeground 30 | #f3f3f3 31 | inactiveSelection 32 | #bbbbbb 33 | inactiveSelectionForeground 34 | #272822 35 | bracketsForeground 36 | #555555A5 37 | bracketsOptions 38 | underline 39 | bracketContentsForeground 40 | #555555A5 41 | bracketContentsOptions 42 | underline 43 | 44 | 45 | 46 | name 47 | Title Page 48 | scope 49 | constant.numeric 50 | settings 51 | 52 | foreground 53 | #aaaaaa 54 | fontStyle 55 | italic 56 | 57 | 58 | 59 | name 60 | Synopses 61 | scope 62 | meta.diff 63 | settings 64 | 65 | foreground 66 | #aaaaaa 67 | fontStyle 68 | italic 69 | 70 | 71 | 72 | name 73 | Scene Headings 74 | scope 75 | entity.name.function 76 | settings 77 | 78 | foreground 79 | #272822 80 | fontStyle 81 | bold 82 | 83 | 84 | 85 | name 86 | Sections 87 | scope 88 | entity.name.filename 89 | settings 90 | 91 | foreground 92 | #272822 93 | 94 | 95 | 96 | name 97 | Dialogue 98 | scope 99 | dialogue 100 | settings 101 | 102 | foreground 103 | #272822 104 | 105 | 106 | 107 | name 108 | Lyrics 109 | scope 110 | lyrics 111 | settings 112 | 113 | foreground 114 | #272822 115 | fontStyle 116 | italic 117 | 118 | 119 | 120 | name 121 | Character 122 | scope 123 | string 124 | settings 125 | 126 | foreground 127 | #272822 128 | 129 | 130 | 131 | name 132 | Parenthetical 133 | scope 134 | entity.other.inherited-class 135 | settings 136 | 137 | foreground 138 | #aaaaaa 139 | fontStyle 140 | italic 141 | 142 | 143 | 144 | name 145 | Transitions 146 | scope 147 | entity.name.tag 148 | settings 149 | 150 | foreground 151 | #aaaaaa 152 | 153 | 154 | 155 | name 156 | Notes 157 | scope 158 | variable.parameter 159 | settings 160 | 161 | foreground 162 | #ff950f 163 | fontStyle 164 | italic 165 | 166 | 167 | 168 | name 169 | Boneyard 170 | scope 171 | comment 172 | settings 173 | 174 | foreground 175 | #c6c6c6 176 | fontStyle 177 | italic 178 | 179 | 180 | 181 | name 182 | Bold Text 183 | scope 184 | markup.changed 185 | settings 186 | 187 | fontStyle 188 | bold 189 | foreground 190 | #aaaaaa 191 | 192 | 193 | 194 | name 195 | Italic Text 196 | scope 197 | message.error 198 | settings 199 | 200 | fontStyle 201 | italic 202 | foreground 203 | #aaaaaa 204 | 205 | 206 | 207 | name 208 | Bold Italic Text 209 | scope 210 | markup.inserted 211 | settings 212 | 213 | fontStyle 214 | bold italic 215 | foreground 216 | #aaaaaa 217 | 218 | 219 | 220 | name 221 | Underline Text 222 | scope 223 | markup.deleted 224 | settings 225 | 226 | fontStyle 227 | underline 228 | foreground 229 | #aaaaaa 230 | 231 | 232 | 233 | name 234 | Page Breaks 235 | scope 236 | support.function 237 | settings 238 | 239 | foreground 240 | #aaaaaa 241 | 242 | 243 | 244 | name 245 | Characters and Scenes 246 | scope 247 | constant.character 248 | settings 249 | 250 | foreground 251 | #aaaaaa 252 | 253 | 254 | 255 | uuid 256 | da780661-37b2-4062-a2fe-c85c3867234e 257 | 258 | 259 | -------------------------------------------------------------------------------- /schemes/Night.tmTheme: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | author 6 | Derick 7 | name 8 | Night 9 | scope 10 | text.html.markdown.fountain 11 | settings 12 | 13 | 14 | settings 15 | 16 | background 17 | #272822 18 | caret 19 | #34c4e0 20 | 21 | foreground 22 | #9d9d9d 23 | invisibles 24 | #bfbfbf 25 | lineHighlight 26 | #2b2e33 27 | selection 28 | #9D550F 29 | selectionForeground 30 | #fffff8 31 | inactiveSelection 32 | #bbbbbb 33 | inactiveSelectionForeground 34 | #222222 35 | bracketsForeground 36 | #F8F8F2A5 37 | bracketsOptions 38 | underline 39 | bracketContentsForeground 40 | #F8F8F2A5 41 | bracketContentsOptions 42 | underline 43 | 44 | 45 | 46 | name 47 | Title Page 48 | scope 49 | constant.numeric 50 | settings 51 | 52 | foreground 53 | #75715e 54 | fontStyle 55 | italic 56 | 57 | 58 | 59 | name 60 | Synopses 61 | scope 62 | meta.diff 63 | settings 64 | 65 | foreground 66 | #75715e 67 | fontStyle 68 | italic 69 | 70 | 71 | 72 | name 73 | Scene Headings 74 | scope 75 | entity.name.function 76 | settings 77 | 78 | foreground 79 | #25a4ec 80 | fontStyle 81 | bold 82 | 83 | 84 | 85 | name 86 | Sections 87 | scope 88 | entity.name.filename 89 | settings 90 | 91 | foreground 92 | #25a4ec 93 | 94 | 95 | 96 | name 97 | Dialogue 98 | scope 99 | dialogue 100 | settings 101 | 102 | foreground 103 | #f3f3f3 104 | 105 | 106 | 107 | name 108 | Lyrics 109 | scope 110 | lyrics 111 | settings 112 | 113 | foreground 114 | #f3f3f3 115 | fontStyle 116 | italic 117 | 118 | 119 | 120 | name 121 | Character 122 | scope 123 | string 124 | settings 125 | 126 | foreground 127 | #1079b5 128 | 129 | 130 | 131 | name 132 | Parenthetical 133 | scope 134 | entity.other.inherited-class 135 | settings 136 | 137 | foreground 138 | #f92772 139 | fontStyle 140 | italic 141 | 142 | 143 | 144 | name 145 | Transitions 146 | scope 147 | entity.name.tag 148 | settings 149 | 150 | foreground 151 | #9e71ef 152 | 153 | 154 | 155 | name 156 | Notes 157 | scope 158 | variable.parameter 159 | settings 160 | 161 | foreground 162 | #cbd012 163 | fontStyle 164 | italic 165 | 166 | 167 | 168 | name 169 | Boneyard 170 | scope 171 | comment 172 | settings 173 | 174 | foreground 175 | #5a6a70 176 | fontStyle 177 | italic 178 | 179 | 180 | 181 | name 182 | Bold Text 183 | scope 184 | markup.changed 185 | settings 186 | 187 | fontStyle 188 | bold 189 | foreground 190 | #ff8a28 191 | 192 | 193 | 194 | name 195 | Italic Text 196 | scope 197 | message.error 198 | settings 199 | 200 | fontStyle 201 | italic 202 | foreground 203 | #ff8a28 204 | 205 | 206 | 207 | name 208 | Bold Italic Text 209 | scope 210 | markup.inserted 211 | settings 212 | 213 | fontStyle 214 | bold italic 215 | foreground 216 | #ff8a28 217 | 218 | 219 | 220 | name 221 | Underline Text 222 | scope 223 | markup.deleted 224 | settings 225 | 226 | fontStyle 227 | underline 228 | foreground 229 | #ff8a28 230 | 231 | 232 | 233 | name 234 | Page Breaks 235 | scope 236 | support.function 237 | settings 238 | 239 | foreground 240 | #34c4e0 241 | 242 | 243 | 244 | name 245 | Characters and Scenes 246 | scope 247 | constant.character 248 | settings 249 | 250 | foreground 251 | #917df2 252 | 253 | 254 | 255 | uuid 256 | e87c1b79-82c3-4304-9624-a713665e216e 257 | 258 | 259 | -------------------------------------------------------------------------------- /schemes/Bezarro.tmTheme: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | author 6 | Derick 7 | name 8 | Bezarro 9 | scope 10 | text.html.markdown.fountain 11 | settings 12 | 13 | 14 | settings 15 | 16 | background 17 | #e0dfe6 18 | caret 19 | #4c5e7c 20 | 21 | foreground 22 | #4c5e7c 23 | invisibles 24 | #4c5e7c 25 | lineHighlight 26 | #d2d1db 27 | selection 28 | #ffe902 29 | selectionForeground 30 | #4c5e7c 31 | inactiveSelection 32 | #555555 33 | inactiveSelectionForeground 34 | #e0dfe6 35 | bracketsForeground 36 | #555555A5 37 | bracketsOptions 38 | underline 39 | bracketContentsForeground 40 | #555555A5 41 | bracketContentsOptions 42 | underline 43 | 44 | 45 | 46 | name 47 | Title Page 48 | scope 49 | constant.numeric 50 | settings 51 | 52 | foreground 53 | #bd0022 54 | fontStyle 55 | italic 56 | 57 | 58 | 59 | name 60 | Synopses 61 | scope 62 | meta.diff 63 | settings 64 | 65 | foreground 66 | #bd0022 67 | fontStyle 68 | italic 69 | 70 | 71 | 72 | name 73 | Scene Headings 74 | scope 75 | entity.name.function 76 | settings 77 | 78 | foreground 79 | #0076e5 80 | background 81 | #ffe902 82 | fontStyle 83 | bold 84 | 85 | 86 | 87 | name 88 | Sections 89 | scope 90 | entity.name.filename 91 | settings 92 | 93 | foreground 94 | #0076e5 95 | 96 | 97 | 98 | name 99 | Dialogue 100 | scope 101 | dialogue 102 | settings 103 | 104 | foreground 105 | #4c5e7c 106 | 107 | 108 | 109 | name 110 | Lyrics 111 | scope 112 | lyrics 113 | settings 114 | 115 | foreground 116 | #4c5e7c 117 | fontStyle 118 | italic 119 | 120 | 121 | 122 | name 123 | Character 124 | scope 125 | string 126 | settings 127 | 128 | foreground 129 | #0076e5 130 | 131 | 132 | 133 | name 134 | Parenthetical 135 | scope 136 | entity.other.inherited-class 137 | settings 138 | 139 | foreground 140 | #bd0022 141 | fontStyle 142 | italic 143 | 144 | 145 | 146 | name 147 | Transitions 148 | scope 149 | entity.name.tag 150 | settings 151 | 152 | foreground 153 | #bd0022 154 | 155 | 156 | 157 | name 158 | Notes 159 | scope 160 | variable.parameter 161 | settings 162 | 163 | foreground 164 | #ffe902 165 | background 166 | #0076e5 167 | fontStyle 168 | italic 169 | 170 | 171 | 172 | name 173 | Boneyard 174 | scope 175 | comment 176 | settings 177 | 178 | foreground 179 | #9eacc3 180 | fontStyle 181 | italic 182 | 183 | 184 | 185 | name 186 | Bold Text 187 | scope 188 | markup.changed 189 | settings 190 | 191 | fontStyle 192 | bold 193 | foreground 194 | #bd0022 195 | 196 | 197 | 198 | name 199 | Italic Text 200 | scope 201 | message.error 202 | settings 203 | 204 | fontStyle 205 | italic 206 | foreground 207 | #bd0022 208 | 209 | 210 | 211 | name 212 | Bold Italic Text 213 | scope 214 | markup.inserted 215 | settings 216 | 217 | fontStyle 218 | bold italic 219 | foreground 220 | #bd0022 221 | 222 | 223 | 224 | name 225 | Underline Text 226 | scope 227 | markup.deleted 228 | settings 229 | 230 | fontStyle 231 | underline 232 | foreground 233 | #bd0022 234 | 235 | 236 | 237 | name 238 | Page Breaks 239 | scope 240 | support.function 241 | settings 242 | 243 | foreground 244 | #bd0022 245 | 246 | 247 | 248 | name 249 | Characters and Scenes 250 | scope 251 | constant.character 252 | settings 253 | 254 | foreground 255 | #bd0022 256 | 257 | 258 | 259 | uuid 260 | c7615650-d135-44d9-b0c2-64e7452c4b66 261 | 262 | 263 | -------------------------------------------------------------------------------- /schemes/Superbman.tmTheme: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | author 6 | Derick 7 | name 8 | Superbman 9 | scope 10 | text.html.markdown.fountain 11 | settings 12 | 13 | 14 | settings 15 | 16 | background 17 | #022c62 18 | caret 19 | #e0dfe6 20 | 21 | foreground 22 | #e0dfe6 23 | invisibles 24 | #e0dfe6 25 | lineHighlight 26 | #02377b 27 | selection 28 | #ffe902 29 | selectionForeground 30 | #022c62 31 | inactiveSelection 32 | #555555 33 | inactiveSelectionForeground 34 | #e0dfe6 35 | bracketsForeground 36 | #F8F8F2A5 37 | bracketsOptions 38 | underline 39 | bracketContentsForeground 40 | #F8F8F2A5 41 | bracketContentsOptions 42 | underline 43 | 44 | 45 | 46 | name 47 | Title Page 48 | scope 49 | constant.numeric 50 | settings 51 | 52 | foreground 53 | #ffe902 54 | fontStyle 55 | italic 56 | 57 | 58 | 59 | name 60 | Synopses 61 | scope 62 | meta.diff 63 | settings 64 | 65 | foreground 66 | #ffe902 67 | fontStyle 68 | italic 69 | 70 | 71 | 72 | name 73 | Scene Headings 74 | scope 75 | entity.name.function 76 | settings 77 | 78 | foreground 79 | #bd0022 80 | background 81 | #ffe902 82 | fontStyle 83 | bold 84 | 85 | 86 | 87 | name 88 | Sections 89 | scope 90 | entity.name.filename 91 | settings 92 | 93 | foreground 94 | #bd0022 95 | 96 | 97 | 98 | name 99 | Dialogue 100 | scope 101 | dialogue 102 | settings 103 | 104 | foreground 105 | #e0dfe6 106 | 107 | 108 | 109 | name 110 | Lyrics 111 | scope 112 | lyrics 113 | settings 114 | 115 | foreground 116 | #e0dfe6 117 | fontStyle 118 | italic 119 | 120 | 121 | 122 | name 123 | Character 124 | scope 125 | string 126 | settings 127 | 128 | foreground 129 | #bd0022 130 | 131 | 132 | 133 | name 134 | Parenthetical 135 | scope 136 | entity.other.inherited-class 137 | settings 138 | 139 | foreground 140 | #ffe902 141 | fontStyle 142 | italic 143 | 144 | 145 | 146 | name 147 | Transitions 148 | scope 149 | entity.name.tag 150 | settings 151 | 152 | foreground 153 | #ffe902 154 | 155 | 156 | 157 | name 158 | Notes 159 | scope 160 | variable.parameter 161 | settings 162 | 163 | foreground 164 | #bd0022 165 | background 166 | #ffe902 167 | fontStyle 168 | italic 169 | 170 | 171 | 172 | name 173 | Boneyard 174 | scope 175 | comment 176 | settings 177 | 178 | foreground 179 | #7e7a98 180 | fontStyle 181 | italic 182 | 183 | 184 | 185 | name 186 | Bold Text 187 | scope 188 | markup.changed 189 | settings 190 | 191 | fontStyle 192 | bold 193 | foreground 194 | #ffe902 195 | 196 | 197 | 198 | name 199 | Italic Text 200 | scope 201 | message.error 202 | settings 203 | 204 | fontStyle 205 | italic 206 | foreground 207 | #ffe902 208 | 209 | 210 | 211 | name 212 | Bold Italic Text 213 | scope 214 | markup.inserted 215 | settings 216 | 217 | fontStyle 218 | bold italic 219 | foreground 220 | #ffe902 221 | 222 | 223 | 224 | name 225 | Underline Text 226 | scope 227 | markup.deleted 228 | settings 229 | 230 | fontStyle 231 | underline 232 | foreground 233 | #ffe902 234 | 235 | 236 | 237 | name 238 | Page Breaks 239 | scope 240 | support.function 241 | settings 242 | 243 | foreground 244 | #ffe902 245 | 246 | 247 | 248 | name 249 | Characters and Scenes 250 | scope 251 | constant.character 252 | settings 253 | 254 | foreground 255 | #ffe902 256 | 257 | 258 | 259 | uuid 260 | 6614ee2a-97e8-499a-b402-0c403b5980d5 261 | 262 | 263 | -------------------------------------------------------------------------------- /schemes/OdysseusDark.tmTheme: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | author 6 | Derick 7 | 8 | name 9 | OdysseueDark 10 | scope 11 | text.html.markdown.fountain 12 | settings 13 | 14 | 15 | settings 16 | 17 | background 18 | #1a1a1a 19 | caret 20 | #34c4e0 21 | 22 | foreground 23 | #939293 24 | invisibles 25 | #939293 26 | lineHighlight 27 | #2e2e2e 28 | selection 29 | #424242 30 | selectionForeground 31 | #dcdcdc 32 | inactiveSelection 33 | #dcdcdc 34 | inactiveSelectionForeground 35 | #424242 36 | bracketsForeground 37 | #F8F8F2A5 38 | bracketsOptions 39 | underline 40 | bracketContentsForeground 41 | #F8F8F2A5 42 | bracketContentsOptions 43 | underline 44 | 45 | 46 | 47 | name 48 | Title Page 49 | scope 50 | constant.numeric 51 | settings 52 | 53 | foreground 54 | #a91d66 55 | fontStyle 56 | italic 57 | 58 | 59 | 60 | name 61 | Synopses 62 | scope 63 | meta.diff 64 | settings 65 | 66 | foreground 67 | #a91d66 68 | fontStyle 69 | italic 70 | 71 | 72 | 73 | name 74 | Scene Headings 75 | scope 76 | entity.name.function 77 | settings 78 | 79 | foreground 80 | #007fb4 81 | background 82 | #103747 83 | fontStyle 84 | bold 85 | 86 | 87 | 88 | name 89 | Sections 90 | scope 91 | entity.name.filename 92 | settings 93 | 94 | foreground 95 | #007fb4 96 | 97 | 98 | 99 | name 100 | Dialogue 101 | scope 102 | dialogue 103 | settings 104 | 105 | foreground 106 | #939293 107 | 108 | 109 | 110 | name 111 | Lyrics 112 | scope 113 | lyrics 114 | settings 115 | 116 | foreground 117 | #939293 118 | fontStyle 119 | italic 120 | 121 | 122 | 123 | name 124 | Character 125 | scope 126 | string 127 | settings 128 | 129 | foreground 130 | #007fb4 131 | 132 | 133 | 134 | name 135 | Parenthetical 136 | scope 137 | entity.other.inherited-class 138 | settings 139 | 140 | foreground 141 | #a91d66 142 | fontStyle 143 | italic 144 | 145 | 146 | 147 | name 148 | Transitions 149 | scope 150 | entity.name.tag 151 | settings 152 | 153 | foreground 154 | #0d7a46 155 | 156 | 157 | 158 | name 159 | Notes 160 | scope 161 | variable.parameter 162 | settings 163 | 164 | foreground 165 | #323232 166 | background 167 | #fff8b5 168 | fontStyle 169 | italic 170 | 171 | 172 | 173 | name 174 | Boneyard 175 | scope 176 | comment 177 | settings 178 | 179 | foreground 180 | #5e5c47 181 | fontStyle 182 | italic 183 | 184 | 185 | 186 | name 187 | Bold Text 188 | scope 189 | markup.changed 190 | settings 191 | 192 | fontStyle 193 | bold 194 | foreground 195 | #a91d66 196 | 197 | 198 | 199 | name 200 | Italic Text 201 | scope 202 | message.error 203 | settings 204 | 205 | fontStyle 206 | italic 207 | foreground 208 | #a91d66 209 | 210 | 211 | 212 | name 213 | Bold Italic Text 214 | scope 215 | markup.inserted 216 | settings 217 | 218 | fontStyle 219 | bold italic 220 | foreground 221 | #a91d66 222 | 223 | 224 | 225 | name 226 | Underline Text 227 | scope 228 | markup.deleted 229 | settings 230 | 231 | fontStyle 232 | underline 233 | foreground 234 | #a91d66 235 | 236 | 237 | 238 | name 239 | Page Breaks 240 | scope 241 | support.function 242 | settings 243 | 244 | foreground 245 | #0d7a46 246 | 247 | 248 | 249 | name 250 | Characters and Scenes 251 | scope 252 | constant.character 253 | settings 254 | 255 | foreground 256 | #9e4577 257 | 258 | 259 | 260 | uuid 261 | 73fd0561-33cd-4e5a-b993-c9e04b4cf62c 262 | 263 | 264 | -------------------------------------------------------------------------------- /schemes/OdysseusLight.tmTheme: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | author 6 | Derick 7 | 8 | name 9 | OdysseusLight 10 | scope 11 | text.html.markdown.fountain 12 | settings 13 | 14 | 15 | settings 16 | 17 | background 18 | #f3f3f3 19 | caret 20 | #34c4e0 21 | 22 | foreground 23 | #5e5e5e 24 | invisibles 25 | #5e5e5e 26 | lineHighlight 27 | #e7e7e7 28 | selection 29 | #a4c9f5 30 | selectionForeground 31 | #5e5e5e 32 | inactiveSelection 33 | #dcdcdc 34 | inactiveSelectionForeground 35 | #5e5e5e 36 | bracketsForeground 37 | #555555A5 38 | bracketsOptions 39 | underline 40 | bracketContentsForeground 41 | #555555A5 42 | bracketContentsOptions 43 | underline 44 | 45 | 46 | 47 | name 48 | Title Page 49 | scope 50 | constant.numeric 51 | settings 52 | 53 | foreground 54 | #a91d66 55 | fontStyle 56 | italic 57 | 58 | 59 | 60 | name 61 | Synopses 62 | scope 63 | meta.diff 64 | settings 65 | 66 | foreground 67 | #a91d66 68 | fontStyle 69 | italic 70 | 71 | 72 | 73 | name 74 | Scene Headings 75 | scope 76 | entity.name.function 77 | settings 78 | 79 | foreground 80 | #007fb4 81 | background 82 | #b2d1e0 83 | fontStyle 84 | bold 85 | 86 | 87 | 88 | name 89 | Sections 90 | scope 91 | entity.name.filename 92 | settings 93 | 94 | foreground 95 | #007fb4 96 | 97 | 98 | 99 | name 100 | Dialogue 101 | scope 102 | dialogue 103 | settings 104 | 105 | foreground 106 | #5e5e5e 107 | 108 | 109 | 110 | name 111 | Lyrics 112 | scope 113 | lyrics 114 | settings 115 | 116 | foreground 117 | #5e5e5e 118 | fontStyle 119 | italic 120 | 121 | 122 | 123 | name 124 | Character 125 | scope 126 | string 127 | settings 128 | 129 | foreground 130 | #007fb4 131 | 132 | 133 | 134 | name 135 | Parenthetical 136 | scope 137 | entity.other.inherited-class 138 | settings 139 | 140 | foreground 141 | #a91d66 142 | fontStyle 143 | italic 144 | 145 | 146 | 147 | name 148 | Transitions 149 | scope 150 | entity.name.tag 151 | settings 152 | 153 | foreground 154 | #00a65b 155 | 156 | 157 | 158 | name 159 | Notes 160 | scope 161 | variable.parameter 162 | settings 163 | 164 | foreground 165 | #b6b6b6 166 | background 167 | #fdf7c0 168 | fontStyle 169 | italic 170 | 171 | 172 | 173 | name 174 | Boneyard 175 | scope 176 | comment 177 | settings 178 | 179 | foreground 180 | #b6b6b6 181 | fontStyle 182 | italic 183 | 184 | 185 | 186 | name 187 | Bold Text 188 | scope 189 | markup.changed 190 | settings 191 | 192 | fontStyle 193 | bold 194 | foreground 195 | #a91d66 196 | 197 | 198 | 199 | name 200 | Italic Text 201 | scope 202 | message.error 203 | settings 204 | 205 | fontStyle 206 | italic 207 | foreground 208 | #a91d66 209 | 210 | 211 | 212 | name 213 | Bold Italic Text 214 | scope 215 | markup.inserted 216 | settings 217 | 218 | fontStyle 219 | bold italic 220 | foreground 221 | #a91d66 222 | 223 | 224 | 225 | name 226 | Underline Text 227 | scope 228 | markup.deleted 229 | settings 230 | 231 | fontStyle 232 | underline 233 | foreground 234 | #a91d66 235 | 236 | 237 | 238 | name 239 | Page Breaks 240 | scope 241 | support.function 242 | settings 243 | 244 | foreground 245 | #00a65b 246 | 247 | 248 | 249 | name 250 | Characters and Scenes 251 | scope 252 | constant.character 253 | settings 254 | 255 | foreground 256 | #a91d66 257 | 258 | 259 | 260 | uuid 261 | baef6904-130a-4988-8f10-a8198664fbfe 262 | 263 | 264 | -------------------------------------------------------------------------------- /schemes/SolarizedLight.tmTheme: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | author 6 | Derick 7 | 8 | name 9 | SolarizedLight 10 | scope 11 | text.html.markdown.fountain 12 | settings 13 | 14 | 15 | settings 16 | 17 | background 18 | 19 | #fdf6e3 20 | caret 21 | 22 | #002b36 23 | 24 | foreground 25 | 26 | #586e75 27 | invisibles 28 | 29 | #586e75 30 | lineHighlight 31 | 32 | #eee8d5 33 | selection 34 | 35 | #eee8d5 36 | bracketsForeground 37 | #F8F8F2A5 38 | bracketsOptions 39 | underline 40 | bracketContentsForeground 41 | #F8F8F2A5 42 | bracketContentsOptions 43 | underline 44 | 45 | 46 | 47 | name 48 | Title Page 49 | scope 50 | constant.numeric 51 | settings 52 | 53 | foreground 54 | 55 | #859900 56 | fontStyle 57 | italic 58 | 59 | 60 | 61 | name 62 | Synopses 63 | scope 64 | meta.diff 65 | settings 66 | 67 | foreground 68 | 69 | #859900 70 | fontStyle 71 | italic 72 | 73 | 74 | 75 | name 76 | Scene Headings 77 | scope 78 | entity.name.function 79 | settings 80 | 81 | foreground 82 | 83 | #268bd2 84 | fontStyle 85 | bold 86 | 87 | 88 | 89 | name 90 | Sections 91 | scope 92 | entity.name.filename 93 | settings 94 | 95 | foreground 96 | 97 | #6c71c4 98 | 99 | 100 | 101 | name 102 | Dialogue 103 | scope 104 | dialogue 105 | settings 106 | 107 | foreground 108 | 109 | #839496 110 | 111 | 112 | 113 | name 114 | Lyrics 115 | scope 116 | lyrics 117 | settings 118 | 119 | foreground 120 | 121 | #839496 122 | fontStyle 123 | italic 124 | 125 | 126 | 127 | name 128 | Character 129 | scope 130 | string 131 | settings 132 | 133 | foreground 134 | 135 | #2aa198 136 | 137 | 138 | 139 | name 140 | Parenthetical 141 | scope 142 | entity.other.inherited-class 143 | settings 144 | 145 | foreground 146 | 147 | #d33682 148 | fontStyle 149 | italic 150 | 151 | 152 | 153 | name 154 | Transitions 155 | scope 156 | entity.name.tag 157 | settings 158 | 159 | foreground 160 | 161 | #cb4b16 162 | 163 | 164 | 165 | name 166 | Notes 167 | scope 168 | variable.parameter 169 | settings 170 | 171 | foreground 172 | 173 | #b58900 174 | fontStyle 175 | italic 176 | 177 | 178 | 179 | name 180 | Boneyard 181 | scope 182 | comment 183 | settings 184 | 185 | foreground 186 | 187 | #d8ca9f 188 | fontStyle 189 | italic 190 | 191 | 192 | 193 | name 194 | Bold Text 195 | scope 196 | markup.changed 197 | settings 198 | 199 | fontStyle 200 | bold 201 | foreground 202 | 203 | #dc322f 204 | 205 | 206 | 207 | name 208 | Italic Text 209 | scope 210 | message.error 211 | settings 212 | 213 | fontStyle 214 | italic 215 | foreground 216 | 217 | #dc322f 218 | 219 | 220 | 221 | name 222 | Bold Italic Text 223 | scope 224 | markup.inserted 225 | settings 226 | 227 | fontStyle 228 | bold italic 229 | foreground 230 | 231 | #dc322f 232 | 233 | 234 | 235 | name 236 | Underline Text 237 | scope 238 | markup.deleted 239 | settings 240 | 241 | fontStyle 242 | underline 243 | foreground 244 | 245 | #dc322f 246 | 247 | 248 | 249 | name 250 | Page Breaks 251 | scope 252 | support.function 253 | settings 254 | 255 | foreground 256 | 257 | #cb4b16 258 | 259 | 260 | 261 | name 262 | Characters and Scenes 263 | scope 264 | constant.character 265 | settings 266 | 267 | foreground 268 | 269 | #cb4b16 270 | 271 | 272 | 273 | uuid 274 | f2414b89-0704-4481-abb6-1461adf4ce45 275 | 276 | 277 | -------------------------------------------------------------------------------- /schemes/SolarizedDark.tmTheme: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | author 6 | Derick 7 | 8 | name 9 | SolarizedDark 10 | scope 11 | text.html.markdown.fountain 12 | settings 13 | 14 | 15 | settings 16 | 17 | background 18 | 19 | #002b36 20 | caret 21 | 22 | #fdf6e3 23 | 24 | foreground 25 | 26 | #93a1a1 27 | invisibles 28 | 29 | #93a1a1 30 | lineHighlight 31 | 32 | #073642 33 | selection 34 | 35 | #073642 36 | bracketsForeground 37 | #F8F8F2A5 38 | bracketsOptions 39 | underline 40 | bracketContentsForeground 41 | #F8F8F2A5 42 | bracketContentsOptions 43 | underline 44 | 45 | 46 | 47 | name 48 | Title Page 49 | scope 50 | constant.numeric 51 | settings 52 | 53 | foreground 54 | 55 | #859900 56 | fontStyle 57 | italic 58 | 59 | 60 | 61 | name 62 | Synopses 63 | scope 64 | meta.diff 65 | settings 66 | 67 | foreground 68 | 69 | #859900 70 | fontStyle 71 | italic 72 | 73 | 74 | 75 | name 76 | Scene Headings 77 | scope 78 | entity.name.function 79 | settings 80 | 81 | foreground 82 | 83 | #268bd2 84 | fontStyle 85 | bold 86 | 87 | 88 | 89 | name 90 | Sections 91 | scope 92 | entity.name.filename 93 | settings 94 | 95 | foreground 96 | 97 | #6c71c4 98 | 99 | 100 | 101 | name 102 | Dialogue 103 | scope 104 | dialogue 105 | settings 106 | 107 | foreground 108 | 109 | #657b83 110 | 111 | 112 | 113 | name 114 | Lyrics 115 | scope 116 | lyrics 117 | settings 118 | 119 | foreground 120 | 121 | #657b83 122 | fontStyle 123 | italic 124 | 125 | 126 | 127 | name 128 | Character 129 | scope 130 | string 131 | settings 132 | 133 | foreground 134 | 135 | #2aa198 136 | 137 | 138 | 139 | name 140 | Parenthetical 141 | scope 142 | entity.other.inherited-class 143 | settings 144 | 145 | foreground 146 | 147 | #d33682 148 | fontStyle 149 | italic 150 | 151 | 152 | 153 | name 154 | Transitions 155 | scope 156 | entity.name.tag 157 | settings 158 | 159 | foreground 160 | 161 | #cb4b16 162 | 163 | 164 | 165 | name 166 | Notes 167 | scope 168 | variable.parameter 169 | settings 170 | 171 | foreground 172 | 173 | #b58900 174 | fontStyle 175 | italic 176 | 177 | 178 | 179 | name 180 | Boneyard 181 | scope 182 | comment 183 | settings 184 | 185 | foreground 186 | 187 | #0c5c70 188 | fontStyle 189 | italic 190 | 191 | 192 | 193 | name 194 | Bold Text 195 | scope 196 | markup.changed 197 | settings 198 | 199 | fontStyle 200 | bold 201 | foreground 202 | 203 | #dc322f 204 | 205 | 206 | 207 | name 208 | Italic Text 209 | scope 210 | message.error 211 | settings 212 | 213 | fontStyle 214 | italic 215 | foreground 216 | 217 | #dc322f 218 | 219 | 220 | 221 | name 222 | Bold Italic Text 223 | scope 224 | markup.inserted 225 | settings 226 | 227 | fontStyle 228 | bold italic 229 | foreground 230 | 231 | #dc322f 232 | 233 | 234 | 235 | name 236 | Underline Text 237 | scope 238 | markup.deleted 239 | settings 240 | 241 | fontStyle 242 | underline 243 | foreground 244 | 245 | #dc322f 246 | 247 | 248 | 249 | name 250 | Page Breaks 251 | scope 252 | support.function 253 | settings 254 | 255 | foreground 256 | 257 | #cb4b16 258 | 259 | 260 | 261 | name 262 | Characters and Scenes 263 | scope 264 | constant.character 265 | settings 266 | 267 | foreground 268 | 269 | #cb4b16 270 | 271 | 272 | 273 | uuid 274 | 710463bf-546b-4c42-9932-a35bff89a4fa 275 | 276 | 277 | -------------------------------------------------------------------------------- /Main.sublime-menu: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "tools", 4 | "caption": "Tools", 5 | "children": 6 | [ 7 | { 8 | "id": "Fountainhead", 9 | "mnemonic": "f", 10 | "caption": "Fountainhead", 11 | "children": 12 | [ 13 | { 14 | "command": "open_file", 15 | "args": { 16 | "file": "${packages}/Fountainhead/help.fountain" 17 | }, 18 | "caption": "Help" 19 | }, 20 | { "caption": "-" }, 21 | { 22 | "command": "hide_boneyard", 23 | "caption": "Boneyard: Show/Hide" 24 | }, 25 | { 26 | "command": "hide_synopses", 27 | "caption": "Synopses: Show/Hide" 28 | }, 29 | { 30 | "command": "hide_notes", 31 | "caption": "Notes: Show/Hide" 32 | }, 33 | { "caption": "-" }, 34 | { 35 | "command": "lower_case", 36 | "caption": "Convert to Lowercase" 37 | }, 38 | { 39 | "command": "upper_case", 40 | "caption": "Convert to Uppercase" 41 | }, 42 | { 43 | "command": "cap_current_line", 44 | "caption": "Capitalize Current Line" 45 | }, 46 | { "caption": "-" }, 47 | { 48 | "command": "show_overlay", 49 | "args": {"overlay": "goto", "text": "@"}, 50 | "caption": "Goto..." 51 | }, 52 | { 53 | "command": "toggle_minimap" 54 | }, 55 | { "caption": "-" }, 56 | { 57 | "command": "show_characters", 58 | "caption": "Show Character List" 59 | }, 60 | { 61 | "command": "show_scenes", 62 | "caption": "Show Scene List" 63 | }, 64 | { "caption": "-" }, 65 | { 66 | "command": "update_character_list", 67 | "caption": "Update Character List" 68 | }, 69 | { 70 | "command": "update_scene_list", 71 | "caption": "Update Scene List" 72 | }, 73 | { 74 | "command": "update_contd", 75 | "caption": "Update Character (CONT'D)s" 76 | }, 77 | { 78 | "command": "remove_all_contd", 79 | "caption": "Remove all Character (CONT'D)s" 80 | }, 81 | { "caption": "-" }, 82 | { 83 | "caption": "Preferences", 84 | "children": 85 | [ 86 | { 87 | "command": "open_file", 88 | "args": { 89 | "file": "${packages}/Fountainhead/Default (OSX).sublime-keymap", 90 | "platform": "OSX" 91 | }, 92 | "caption": "Key Bindings – Default" 93 | }, 94 | { 95 | "command": "open_file", 96 | "args": { 97 | "file": "${packages}/Fountainhead/Default (Linux).sublime-keymap", 98 | "platform": "Linux" 99 | }, 100 | "caption": "Key Bindings – Default" 101 | }, 102 | { 103 | "command": "open_file", 104 | "args": { 105 | "file": "${packages}/Fountainhead/Default (Windows).sublime-keymap", 106 | "platform": "Windows" 107 | }, 108 | "caption": "Key Bindings – Default" 109 | }, 110 | { 111 | "command": "open_file", 112 | "args": { 113 | "file": "${packages}/User/Default (OSX).sublime-keymap", 114 | "platform": "OSX" 115 | }, 116 | "caption": "Key Bindings – User" 117 | }, 118 | { 119 | "command": "open_file", 120 | "args": { 121 | "file": "${packages}/User/Default (Linux).sublime-keymap", 122 | "platform": "Linux" 123 | }, 124 | "caption": "Key Bindings – User" 125 | }, 126 | { 127 | "command": "open_file", 128 | "args": { 129 | "file": "${packages}/User/Default (Windows).sublime-keymap", 130 | "platform": "Windows" 131 | }, 132 | "caption": "Key Bindings – User" 133 | }, 134 | { "caption": "-" }, 135 | { 136 | "command": "open_file", 137 | "args": {"file": "${packages}/Fountainhead/Fountainhead.sublime-settings"}, 138 | "caption": "Fountainhead Settings – Default" 139 | }, 140 | { 141 | "command": "open_file", 142 | "args": {"file": "${packages}/User/Fountainhead.sublime-settings"}, 143 | "caption": "Fountainhead Settings – User" 144 | } 145 | ] 146 | } 147 | ] 148 | } 149 | ] 150 | }, 151 | { 152 | "caption": "Preferences", 153 | "mnemonic": "n", 154 | "id": "preferences", 155 | "children": 156 | [ 157 | { 158 | "caption": "Package Settings", 159 | "mnemonic": "P", 160 | "id": "package-settings", 161 | "children": 162 | [ 163 | { 164 | "caption": "Fountainhead", 165 | "children": 166 | [ 167 | { 168 | "command": "open_file", 169 | "args": { 170 | "file": "${packages}/Fountainhead/help.fountain" 171 | }, 172 | "caption": "Help" 173 | }, 174 | { "caption": "-" }, 175 | { 176 | "command": "open_file", 177 | "args": { 178 | "file": "${packages}/Fountainhead/Default (OSX).sublime-keymap", 179 | "platform": "OSX" 180 | }, 181 | "caption": "Key Bindings – Default" 182 | }, 183 | { 184 | "command": "open_file", 185 | "args": { 186 | "file": "${packages}/Fountainhead/Default (Linux).sublime-keymap", 187 | "platform": "Linux" 188 | }, 189 | "caption": "Key Bindings – Default" 190 | }, 191 | { 192 | "command": "open_file", 193 | "args": { 194 | "file": "${packages}/Fountainhead/Default (Windows).sublime-keymap", 195 | "platform": "Windows" 196 | }, 197 | "caption": "Key Bindings – Default" 198 | }, 199 | { 200 | "command": "open_file", 201 | "args": { 202 | "file": "${packages}/User/Default (OSX).sublime-keymap", 203 | "platform": "OSX" 204 | }, 205 | "caption": "Key Bindings – User" 206 | }, 207 | { 208 | "command": "open_file", 209 | "args": { 210 | "file": "${packages}/User/Default (Linux).sublime-keymap", 211 | "platform": "Linux" 212 | }, 213 | "caption": "Key Bindings – User" 214 | }, 215 | { 216 | "command": "open_file", 217 | "args": { 218 | "file": "${packages}/User/Default (Windows).sublime-keymap", 219 | "platform": "Windows" 220 | }, 221 | "caption": "Key Bindings – User" 222 | }, 223 | { "caption": "-" }, 224 | 225 | { 226 | "command": "open_file", 227 | "args": {"file": "${packages}/Fountainhead/Fountainhead.sublime-settings"}, 228 | "caption": "Fountainhead Settings – Default" 229 | }, 230 | { 231 | "command": "open_file", 232 | "args": {"file": "${packages}/User/Fountainhead.sublime-settings"}, 233 | "caption": "Fountainhead Settings – User" 234 | } 235 | ] 236 | } 237 | ] 238 | } 239 | ] 240 | } 241 | ] 242 | -------------------------------------------------------------------------------- /contd.py: -------------------------------------------------------------------------------- 1 | import sublime 2 | import sublime_plugin 3 | import re 4 | # import threading 5 | # import sys 6 | try: 7 | from . import scopes 8 | except (ImportError, ValueError): 9 | import scopes 10 | try: 11 | from .sublime_helper import SublimeHelper 12 | except (ImportError, ValueError): 13 | from sublime_helper import SublimeHelper 14 | # sys.path.append(sublime.packages_path() + '/Fountainhead') 15 | # import sublime_helper 16 | 17 | # if int(sublime.version()) < 3000: 18 | # on_modified_async = sublime.on_modified 19 | 20 | fountain_scope = scopes.fountain_scope 21 | action_scope = scopes.action_scope 22 | boneyard_scope = scopes.boneyard_scope 23 | dialogue_scope = scopes.dialogue_scope 24 | lyrics_scope = scopes.lyrics_scope 25 | character_scope = scopes.character_scope 26 | parenthetical_scope = scopes.parenthetical_scope 27 | note_scope = scopes.note_scope 28 | scene_scope = scopes.scene_scope 29 | character_list_scope = scopes.character_list_scope 30 | section_scope = scopes.section_scope 31 | synopses_scope = scopes.synopses_scope 32 | pagebreak_scope = scopes.pagebreak_scope 33 | title_page_scope = scopes.title_page_scope 34 | center_scope = scopes.center_scope 35 | transition_scope = scopes.transition_scope 36 | 37 | character1 = '' 38 | character2 = '' 39 | 40 | 41 | class Contd(sublime_plugin.EventListener): 42 | 43 | contd = " (CONT'D)" 44 | cursor_row = 0 45 | cursor_position1 = 0 46 | cursor_position2 = 0 47 | 48 | def on_activated(self, view): 49 | if view.settings().get('syntax') == 'Packages/Fountainhead/Fountainhead.tmLanguage': 50 | # s = view.settings().get('syntax') 51 | # if 'Fountainhead.tmLanguage' in s: 52 | # if sublime.load_settings('Fountainhead.sublime-settings').get('contd', False): 53 | if view.settings().get('contd', False): 54 | self.cursor_row = view.rowcol(view.sel()[0].end())[0] - 1 55 | 56 | def modified_contd(self, view): 57 | if view.settings().get('syntax') == 'Packages/Fountainhead/Fountainhead.tmLanguage': 58 | # if 'Fountainhead.tmLanguage' in view.settings().get('syntax'): 59 | self.cursor_position2 = view.rowcol(view.sel()[0].end()) 60 | # if sublime.load_settings('Fountainhead.sublime-settings').get('contd', False) and (self.cursor_position1 != self.cursor_position2): 61 | if view.settings().get('contd', False) and (self.cursor_position1 != self.cursor_position2): 62 | s = SublimeHelper() 63 | # if s.cursor_scope(view) == 'text.fountain string entity.name.class ': 64 | if s.cursor_scope(view) == fountain_scope + dialogue_scope + character_scope: 65 | self.cursor_row = view.rowcol(view.sel()[0].end())[0] - 1 66 | self.cursor_position1 = self.cursor_position2 67 | # elif s.cursor_scope(view) == 'text.fountain entity.name.function ': 68 | elif s.cursor_scope(view) == fountain_scope + scene_scope: 69 | self.cursor_row = view.rowcol(view.sel()[0].end())[0] 70 | self.cursor_position1 = self.cursor_position2 71 | # elif s.cursor_scope(view) != 'text.fountain string entity.name.class ': 72 | elif s.cursor_scope(view) != fountain_scope + dialogue_scope + character_scope: 73 | # print('cursor row ' + str(self.cursor_row)) 74 | # scope_array = view.find_by_selector('text.fountain entity.name.function ') 75 | scope_array = view.find_by_selector(fountain_scope + scene_scope) 76 | row_array = [] 77 | for position in scope_array: 78 | row_array.append(view.rowcol(sublime.Region.end(position))[0]) 79 | row_begin = 0 80 | row_end = 0 81 | for row in row_array: 82 | if row <= self.cursor_row: 83 | row_begin = row 84 | if row >= self.cursor_row and row_end == 0: 85 | row_end = row 86 | if row_end == 0 or row_end <= self.cursor_row: 87 | row = 0 88 | text_point1 = 0 89 | text_point2 = 1 90 | while text_point1 != text_point2: 91 | text_point1 = view.text_point(row, 0) 92 | row += 1 93 | text_point2 = view.text_point(row, 0) 94 | row_end = row 95 | self.update_contd(view, row_begin, row_end) 96 | self.cursor_position1 = self.cursor_position2 97 | 98 | def on_modified_async(self, view): 99 | if int(sublime.version()) >= 3000: 100 | self.modified_contd(view) 101 | 102 | def on_modified(self, view): 103 | if int(sublime.version()) < 3000: 104 | self.modified_contd(view) 105 | 106 | def remove_all_contd(self, view): 107 | if view.settings().get('syntax') == 'Packages/Fountainhead/Fountainhead.tmLanguage': 108 | # if 'Fountainhead.tmLanguage' in view.settings().get('syntax'): 109 | row = 0 110 | text_point1 = -1 111 | text_point2 = 0 112 | line_beginning = 0 113 | line_end = 0 114 | scope = '' 115 | character = '' 116 | try: 117 | while text_point1 != text_point2: 118 | text_point1 = view.text_point(row, 0) 119 | line_beginning = text_point1 120 | line_end = line_beginning + len(view.substr(view.line(text_point1))) 121 | RemovecontdCommand.region = sublime.Region(line_end - len("(CONT'D)") - 1, line_end) 122 | scope = view.scope_name(line_end - 1) 123 | # if scope == 'text.fountain string entity.name.class ': 124 | if scope == fountain_scope + character_scope: 125 | character = view.substr(view.line(text_point1)) 126 | if re.search(r"\s+\([cC][oO][nN][tT]\'[dD]\)", character) is not None: 127 | view.run_command('removecontd') 128 | row += 1 129 | text_point2 = view.text_point(row, 0) 130 | except IndexError: 131 | pass 132 | 133 | def update_contd(self, view, row_begin=0, row_end=0): 134 | 135 | if view.settings().get('syntax') == 'Packages/Fountainhead/Fountainhead.tmLanguage': 136 | # if 'Fountainhead.tmLanguage' in view.settings().get('syntax'): 137 | try: 138 | text_point1 = -1 139 | text_point2 = 0 140 | text_point3 = 1 141 | line_beginning = 0 142 | line_end = 0 143 | scope = '' 144 | character1 = '' 145 | character2 = '' 146 | if row_end != 0: 147 | while text_point1 != text_point2 and text_point2 <= text_point3: 148 | text_point1 = view.text_point(row_begin, 0) 149 | text_point3 = view.text_point(row_end, 0) 150 | line_beginning = text_point1 151 | line_end = line_beginning + len(view.substr(view.line(text_point1))) 152 | InsertcontdCommand.point = line_end 153 | RemovecontdCommand.region = sublime.Region(line_end - len("(CONT'D)") - 1, line_end) 154 | if line_beginning == line_end: 155 | row_begin += 1 156 | else: 157 | scope = view.scope_name(line_end - 1) 158 | # if scope == 'text.fountain string entity.name.class ': 159 | if scope == fountain_scope + dialogue_scope + character_scope: 160 | # get the entire line string 161 | character2 = view.substr(view.line(text_point1)) 162 | # try to remove leading spaces 163 | if character2[0] == ' ' or character2[0] == '\t': 164 | character2 = re.split(r"^\s*", character2)[1] 165 | if re.search(r"\s+\([cC][oO][nN][tT]\'[dD]\)", character2) is not None and re.split(r"\s+\([cC][oO][nN][tT]\'[dD]\)", character1)[0] != re.split(r"\s+\([cC][oO][nN][tT]\'[dD]\)", character2)[0]: 166 | view.run_command('removecontd') 167 | # do not add (CONT'D) if already there 168 | elif character2 == character1 and re.search(r"\s+\([cC][oO][nN][tT]\'[dD]\)", character2) is not None: 169 | pass 170 | # add (CONT'D) to current matching character if previous character already has it 171 | elif re.split(r"\s+\([cC][oO][nN][tT]\'[dD]\)", character1)[0] == character2: 172 | view.run_command('insertcontd') 173 | elif character2 == character1: 174 | view.run_command('insertcontd') 175 | character1 = character2 176 | # if scope == 'text.fountain entity.name.function ': 177 | if scope == fountain_scope + scene_scope: 178 | character1 = '' 179 | row_begin += 1 180 | text_point2 = view.text_point(row_begin, 0) 181 | elif row_end == 0: 182 | while text_point1 != text_point2: 183 | text_point1 = view.text_point(row_begin, 0) 184 | line_beginning = text_point1 185 | line_end = line_beginning + len(view.substr(view.line(text_point1))) 186 | InsertcontdCommand.point = line_end 187 | RemovecontdCommand.region = sublime.Region(line_end - len("(CONT'D)") - 1, line_end) 188 | if line_beginning == line_end: 189 | row_begin += 1 190 | else: 191 | scope = view.scope_name(line_end - 1) 192 | # if scope == 'text.fountain string entity.name.class ': 193 | if scope == fountain_scope + dialogue_scope + character_scope: 194 | character2 = view.substr(view.line(text_point1)) 195 | # try to remove leading spaces 196 | if character2[0] == ' ' or character2[0] == '\t': 197 | character2 = re.split(r"^\s*", character2)[1] 198 | if re.search(r"\s+\([cC][oO][nN][tT]\'[dD]\)", character2) is not None and re.split(r"\s+\([cC][oO][nN][tT]\'[dD]\)", character1)[0] != re.split(r"\s+\([cC][oO][nN][tT]\'[dD]\)", character2)[0]: 199 | view.run_command('removecontd') 200 | # do not add (CONT'D) if already there 201 | elif character2 == character1 and re.search(r"\s+\([cC][oO][nN][tT]\'[dD]\)", character2) is not None: 202 | pass 203 | # add (CONT'D) to current matching character if previous character already has it 204 | elif re.split(r"\s+\([cC][oO][nN][tT]\'[dD]\)", character1)[0] == character2: 205 | view.run_command('insertcontd') 206 | elif character2 == character1: 207 | view.run_command('insertcontd') 208 | character1 = character2 209 | # if scope == 'text.fountain entity.name.function ': 210 | if scope == fountain_scope + scene_scope: 211 | character1 = '' 212 | row_begin += 1 213 | text_point2 = view.text_point(row_begin, 0) 214 | except IndexError: 215 | pass 216 | 217 | 218 | class RemovecontdCommand(sublime_plugin.TextCommand): 219 | 220 | region = sublime.Region(0, 0) 221 | 222 | def run(self, edit): 223 | self.view.erase(edit, self.region) 224 | 225 | 226 | class InsertcontdCommand(sublime_plugin.TextCommand): 227 | 228 | point = 0 229 | 230 | def run(self, edit): 231 | string = Contd.contd 232 | self.view.insert(edit, self.point, string) 233 | 234 | 235 | class UpdateContdCommand(sublime_plugin.TextCommand): 236 | 237 | def run(self, edit): 238 | update = Contd() 239 | update.update_contd(self.view) 240 | 241 | 242 | class RemoveAllContdCommand(sublime_plugin.TextCommand): 243 | 244 | def run(self, edit): 245 | remove = Contd() 246 | remove.remove_all_contd(self.view) 247 | Contd.cursor_position1 = self.view.rowcol(self.view.sel()[0].end()) 248 | -------------------------------------------------------------------------------- /scenes.py: -------------------------------------------------------------------------------- 1 | import sublime 2 | import sublime_plugin 3 | import re 4 | import os 5 | import codecs 6 | # import sys 7 | # import platform 8 | # from .sublime_helper import * 9 | try: 10 | from . import scopes 11 | except (ImportError, ValueError): 12 | import scopes 13 | # try: 14 | # from .sublime_helper import SublimeHelper 15 | # except (ImportError, ValueError): 16 | # from sublime_helper import SublimeHelper 17 | 18 | # cursor_scope = SublimeHelper.cursor_scope 19 | # line_scope = SublimeHelper.line_scope 20 | # line_string = SublimeHelper.line_string 21 | 22 | fountain_scope = scopes.fountain_scope 23 | action_scope = scopes.action_scope 24 | boneyard_scope = scopes.boneyard_scope 25 | dialogue_scope = scopes.dialogue_scope 26 | lyrics_scope = scopes.lyrics_scope 27 | character_scope = scopes.character_scope 28 | parenthetical_scope = scopes.parenthetical_scope 29 | note_scope = scopes.note_scope 30 | scene_scope = scopes.scene_scope 31 | character_list_scope = scopes.character_list_scope 32 | section_scope = scopes.section_scope 33 | synopses_scope = scopes.synopses_scope 34 | pagebreak_scope = scopes.pagebreak_scope 35 | title_page_scope = scopes.title_page_scope 36 | center_scope = scopes.center_scope 37 | transition_scope = scopes.transition_scope 38 | 39 | user = '' 40 | # user_os = platform.system() 41 | 42 | 43 | class Scenes(sublime_plugin.EventListener): 44 | 45 | scene_headings = [] 46 | scene = '' 47 | # major_scenes = [] 48 | current_scene = '' 49 | previous_line = 0 50 | current_line = 0 51 | filename = '' 52 | 53 | # transition_scope = scopes.transition_scope 54 | 55 | def modified_scene(self, view): 56 | if view.settings().get('syntax') == 'Packages/Fountainhead/Fountainhead.tmLanguage': 57 | # if 'Fountainhead.tmLanguage' in view.settings().get('syntax'): 58 | # if sublime.load_settings('Fountainhead.sublime-settings').get('scenes', True): 59 | if view.settings().get('scenes', True): 60 | if self.scene_headings == []: 61 | self.on_activated(view) 62 | view.set_status('SceneList', 63 | '') 64 | if view.rowcol(view.sel()[0].end())[0] != self.current_line: 65 | self.previous_line = self.current_line 66 | self.current_line = view.rowcol(view.sel()[0].end())[0] 67 | # if view.scope_name(view.text_point(self.previous_line + 1, 0) - 2) == fountain_scope+scene_scope'text.fountain entity.name.function ': 68 | if view.scope_name(view.text_point(self.previous_line + 1, 0) - 2) == fountain_scope+scene_scope: 69 | self.current_scene = view.substr(view.line(view.text_point(self.previous_line, 0))) 70 | scene = self.current_scene 71 | if scene[0] == ' ' or scene[0] == '\t': 72 | scene = re.split(r'^\s*', scene)[1] 73 | if scene not in self.scene_headings and scene != '' and scene is not None: 74 | self.scene_headings.append(scene) 75 | self.scene_headings = sorted(self.scene_headings) 76 | ShowScenesCommand.scenes = self.scene_headings 77 | 78 | packages_directory = sublime.packages_path() + '/User/Fountainhead/' 79 | if not os.path.exists(packages_directory): 80 | os.mkdir(packages_directory) 81 | completions_file = packages_directory + 'Scenes.sublime-completions' 82 | completions = codecs.open(completions_file, 'w', 'utf8') 83 | # completions.write('{\n\t\t"scope": "text.fountain - comment - string - entity.other.attribute-name - entity.other.inherited-class - foreground - meta.diff - entity.name.tag - entity.name.class - variable.parameter",\n\n\t\t"completions":\n\t\t[') 84 | completions.write('{\n\t\t"scope": ' + '"' + fountain_scope + '- ' + boneyard_scope + '- ' + action_scope + '- ' + dialogue_scope + '- ' + lyrics_scope + '- ' + character_scope + '- ' + parenthetical_scope + '- ' + note_scope + '- ' + scene_scope + '- ' + section_scope + '- ' + synopses_scope + '- ' + pagebreak_scope + '- ' + title_page_scope + '- ' + center_scope + '- ' + transition_scope[0:-1] + '",\n\n\t\t"completions":\n\t\t[') 85 | length = len(self.scene_headings) 86 | scene_counter = 0 87 | for scene in self.scene_headings: 88 | if scene_counter < length - 1: 89 | completions.write('"%s",' % scene) 90 | scene_counter += 1 91 | else: 92 | completions.write('"%s"' % scene) 93 | completions.write(']\n}') 94 | completions.close() 95 | 96 | # Not needed since scenes are no longer converted to lowercase 97 | # if scene.lower() not in self.major_scenes: 98 | # self.major_scenes.append(scene.lower()) 99 | # self.major_scenes = sorted(self.major_scenes) 100 | # packages_directory = sublime.packages_path() + '/User/Fountainhead/' 101 | # if not os.path.exists(packages_directory): 102 | # os.mkdir(packages_directory) 103 | # completions_file = packages_directory + 'Scenes.sublime-completions' 104 | # completions = codecs.open(completions_file, 'w', 'utf8') 105 | # completions.write('{\n\t\t"scope": "text.fountain - comment - string - entity.other.attribute-name - entity.other.inherited-class - foreground - meta.diff - entity.name.tag - entity.name.class - variable.parameter",\n\n\t\t"completions":\n\t\t[') 106 | # length = len(self.major_scenes) 107 | # scene_counter = 0 108 | # for scene in self.major_scenes: 109 | # if scene_counter < length - 1: 110 | # completions.write('"%s",' % scene) 111 | # scene_counter += 1 112 | # else: 113 | # completions.write('"%s"' % scene) 114 | # completions.write(']\n}') 115 | # completions.close() 116 | 117 | # Clear out scene list message 118 | view.set_status('SceneList', 119 | '') 120 | 121 | def on_modified_async(self, view): 122 | if int(sublime.version()) >= 3000: 123 | self.modified_scene(view) 124 | 125 | def on_modified(self, view): 126 | if int(sublime.version()) < 3000: 127 | self.modified_scene(view) 128 | 129 | def on_activated(self, view): 130 | 131 | if view.settings().get('syntax') == 'Packages/Fountainhead/Fountainhead.tmLanguage': 132 | # if 'Fountainhead.tmLanguage' in view.settings().get('syntax'): 133 | # if sublime.load_settings('Fountainhead.sublime-settings').get('scenes', True): 134 | if view.settings().get('scenes', True): 135 | if self.filename == view.file_name() and len(self.scene_headings) > 0: 136 | pass 137 | else: 138 | view.set_status('SceneList', 139 | 'FINDING SCENES...') 140 | self.scene_headings = [] 141 | # self.major_scenes = [] 142 | counter = 0 143 | self.filename = view.file_name() 144 | try: 145 | while counter >= 0: 146 | # scene = view.substr(view.find_by_selector('text.fountain entity.name.function ')[counter]) 147 | scene = view.substr(view.find_by_selector(fountain_scope+scene_scope)[counter]) 148 | # heading = scene 149 | if scene[0] == ' ' or scene[0] == '\t': 150 | scene = (re.split(r'^\s*', scene))[1] 151 | if scene not in self.scene_headings and scene != '' and scene is not None: 152 | if scene[0] != '#': 153 | self.scene_headings.append(scene) 154 | counter += 1 155 | except IndexError: 156 | pass 157 | # if user_os == 'Windows': 158 | # print("Sorry, not supported at this time.") 159 | # elif user_os == 'Darwin': 160 | # for scene in self.scene_headings: 161 | # self.major_scenes.append(scene.lower()) 162 | # self.major_scenes = sorted(self.major_scenes) 163 | self.scene_headings = sorted(self.scene_headings) 164 | # proc_env = os.environ.copy() 165 | # encoding = sys.getfilesystemencoding() 166 | # for k, v in proc_env.items(): 167 | # proc_env[k] = os.path.expandvars(v).encode(encoding) 168 | # user = (proc_env['HOME']).decode(encoding='UTF-8') 169 | 170 | # completions = open(user + '/Library/Application Support/Sublime Text 3/Packages/Fountainhead/Scenes.sublime-completions', 'w') 171 | # packages_directory = sublime.packages_path() 172 | # completions_file = packages_directory + '/Fountainhead/Scenes.sublime-completions' 173 | # Create Fountainhead directory if it doesn't exist 174 | packages_directory = sublime.packages_path() + '/User/Fountainhead/' 175 | if not os.path.exists(packages_directory): 176 | os.mkdir(packages_directory) 177 | completions_file = packages_directory + 'Scenes.sublime-completions' 178 | completions = codecs.open(completions_file, 'w', 'utf8') 179 | # completions.write('{\n\t\t"scope": "text.fountain - comment - string - entity.other.attribute-name - entity.other.inherited-class - foreground - meta.diff - entity.name.tag - entity.name.class - variable.parameter",\n\n\t\t"completions":\n\t\t[') 180 | completions.write('{\n\t\t"scope": ' + '"' + fountain_scope + '- ' + boneyard_scope + '- ' + action_scope + '- ' + dialogue_scope + '- ' + lyrics_scope + '- ' + character_scope + '- ' + parenthetical_scope + '- ' + note_scope + '- ' + scene_scope + '- ' + section_scope + '- ' + synopses_scope + '- ' + pagebreak_scope + '- ' + title_page_scope + '- ' + center_scope + '- ' + transition_scope[0:-1] + '",\n\n\t\t"completions":\n\t\t[') 181 | 182 | # length = len(self.major_scenes) 183 | length = len(self.scene_headings) 184 | scene_counter = 0 185 | # for scene in self.major_scenes: 186 | for scene in self.scene_headings: 187 | if scene_counter < length - 1: 188 | completions.write('"%s",' % scene) 189 | scene_counter += 1 190 | else: 191 | completions.write('"%s"' % scene) 192 | completions.write(']\n}') 193 | completions.close() 194 | # Print confirmation message 195 | view.set_status('SceneList', 196 | 'SCENES FOUND!') 197 | # ShowScenesCommand.unsorted_scenes = self.scene_headings 198 | ShowScenesCommand.scenes = self.scene_headings 199 | 200 | 201 | class UpdateSceneListCommand(sublime_plugin.TextCommand): 202 | 203 | scene_headings = [] 204 | filename = '' 205 | 206 | def run(self, edit): 207 | self.scene_headings = [] 208 | s = Scenes() 209 | s.on_activated(self.view) 210 | 211 | 212 | class ShowScenesCommand(sublime_plugin.TextCommand): 213 | 214 | scene = '' 215 | # unsorted_scenes = [] 216 | # sorted_scenes = [] 217 | scenes = [] 218 | 219 | def run(self, edit): 220 | # if sublime.load_settings('Fountainhead.sublime-settings').get('scenes', True) and int(sublime.version()) >= 3000: 221 | if self.view.settings().get('scenes', True) and int(sublime.version()) >= 3000: 222 | # self.sorted_scenes = sorted(self.unsorted_scenes) 223 | # self.view.show_popup_menu(self.sorted_scenes, self.on_done) 224 | self.view.show_popup_menu(self.scenes, self.on_done) 225 | 226 | self.view.run_command('insert', {"characters": self.scene}) 227 | 228 | def on_done(self, index): 229 | if index == -1: 230 | self.scene = '' 231 | else: 232 | self.scene = self.sorted_scenes[index] 233 | self.scene = self.scenes[index] 234 | -------------------------------------------------------------------------------- /autoscroll.py: -------------------------------------------------------------------------------- 1 | import sublime 2 | import sublime_plugin 3 | try: 4 | from . import scopes 5 | except (ImportError, ValueError): 6 | import scopes 7 | 8 | fountain_scope = scopes.fountain_scope 9 | action_scope = scopes.action_scope 10 | boneyard_scope = scopes.boneyard_scope 11 | dialogue_scope = scopes.dialogue_scope 12 | lyrics_scope = scopes.lyrics_scope 13 | character_scope = scopes.character_scope 14 | parenthetical_scope = scopes.parenthetical_scope 15 | note_scope = scopes.note_scope 16 | scene_scope = scopes.scene_scope 17 | character_list_scope = scopes.character_list_scope 18 | section_scope = scopes.section_scope 19 | synopses_scope = scopes.synopses_scope 20 | pagebreak_scope = scopes.pagebreak_scope 21 | title_page_scope = scopes.title_page_scope 22 | center_scope = scopes.center_scope 23 | transition_scope = scopes.transition_scope 24 | 25 | 26 | class AutoScrollCommand(sublime_plugin.EventListener): 27 | # pagesWritten = 0 28 | 29 | # def on_activated(self, view): 30 | # if 'Fountainhead.tmLanguage' in view.settings().get('syntax'): 31 | # if view.settings().get('auto_scroll', True): 32 | # view.set_status('AutoScrollCommand', 33 | # 'Pages written: %d' % self.pagesWritten) 34 | 35 | def modified_scroll(self, view): 36 | if view.settings().get('syntax') == 'Packages/Fountainhead/Fountainhead.tmLanguage': 37 | # if 'Fountainhead.tmLanguage' in view.settings().get('syntax'): 38 | # if sublime.load_settings('Fountainhead.sublime-settings').get('auto_scroll', True): 39 | if view.settings().get('auto_scroll', True): 40 | self.currentY = view.text_to_layout(view.sel()[0].begin())[1] 41 | self.viewportY = view.viewport_position()[1] 42 | self.viewportHeight = view.viewport_extent()[1] 43 | self.lineHeight = view.line_height() 44 | self.pageLines = ((self.currentY - self.viewportY) / 45 | self.lineHeight) 46 | self.rowCounter = 1 47 | self.stopCounter = 0 48 | # sets how many rows to look for a previous element (a row can be many lines) 49 | self.rowCounterLimit = 8 50 | # sets the threshold on how many lines to look for a previous element 51 | self.lineAmount = 8 52 | # sets how many lines to scroll up if scrolling to the previous element is too much 53 | self.scrollAmount = 6 54 | 55 | if (self.currentY >= (self.viewportY + self.viewportHeight - 56 | (1.9 * self.lineHeight))): 57 | self.rowCounter = 1 58 | while (self.rowCounter <= self.rowCounterLimit and 59 | self.stopCounter == 0): 60 | self.currentRow = (view.rowcol(view.sel()[0].begin()))[0] 61 | self.scope = view.scope_name(view.text_point((self.currentRow - self.rowCounter - 1), 0)) 62 | # Needed? 63 | # if (self.scope == 'text.fountain keyword entity.other.attribute-name '): 64 | # self.rowCounter += 1 65 | # Needed? 66 | # elif (self.scope == 'text.fountain keyword '): 67 | # self.rowCounter += 1 68 | # if (self.scope == 'text.fountain ') and (view.text_point((self.currentRow - self.rowCounter), 0) == view.text_point((self.currentRow - self.rowCounter - 1), 1)): 69 | if (self.scope == fountain_scope) and (view.text_point((self.currentRow - self.rowCounter), 0) == view.text_point((self.currentRow - self.rowCounter - 1), 1)): 70 | self.rowCounter += 1 71 | # Scene Heading 72 | # elif (self.scope == 'text.fountain entity.name.function '): 73 | elif (self.scope == fountain_scope + scene_scope): 74 | self.newY = view.text_to_layout((view.text_point((self.currentRow - self.rowCounter - 1), 0)))[1] 75 | if (((self.currentY - self.newY) / self.lineHeight) > self.lineAmount): 76 | view.run_command('scroll_lines', {"amount": -(self.pageLines - self.scrollAmount)}) 77 | # self.pagesWritten += 1 78 | # view.set_status('AutoScrollCommand', 'Pages written: %d' % self.pagesWritten) 79 | self.stopCounter = 1 80 | self.rowCounter = 1 81 | else: 82 | view.run_command('scroll_lines', {"amount": -(((self.newY - self.viewportY) / self.lineHeight) - (0.5))}) 83 | # self.pagesWritten += 1 84 | # view.set_status('AutoScrollCommand', 'Pages written: %d' % self.pagesWritten) 85 | self.stopCounter = 1 86 | self.rowCounter = 1 87 | # Character Name 88 | # elif (self.scope == 'text.fountain string entity.name.class '): 89 | elif (self.scope == fountain_scope + dialogue_scope + character_scope): 90 | self.newY = view.text_to_layout((view.text_point((self.currentRow - self.rowCounter - 1), 0)))[1] 91 | if (((self.currentY - self.newY) / self.lineHeight) > self.lineAmount): 92 | view.run_command('scroll_lines', {"amount": -(self.pageLines - self.scrollAmount)}) 93 | # self.pagesWritten += 1 94 | # view.set_status('AutoScrollCommand', 'Pages written: %d' % self.pagesWritten) 95 | self.stopCounter = 1 96 | self.rowCounter = 1 97 | else: 98 | view.run_command('scroll_lines', {"amount": -(((self.newY - self.viewportY) / self.lineHeight) - (0.5))}) 99 | # self.pagesWritten += 1 100 | # view.set_status('AutoScrollCommand', 'Pages written: %d' % self.pagesWritten) 101 | self.stopCounter = 1 102 | self.rowCounter = 1 103 | # Action 104 | # elif (self.scope == 'text.fountain foreground '): 105 | elif (self.scope == fountain_scope + action_scope): 106 | self.newY = view.text_to_layout((view.text_point((self.currentRow - self.rowCounter - 1), 0)))[1] 107 | if (((self.currentY - self.newY) / self.lineHeight) > self.lineAmount): 108 | view.run_command('scroll_lines', {"amount": -(self.pageLines - self.scrollAmount)}) 109 | # self.pagesWritten += 1 110 | # view.set_status('AutoScrollCommand', 'Pages written: %d' % self.pagesWritten) 111 | self.stopCounter = 1 112 | self.rowCounter = 1 113 | else: 114 | view.run_command('scroll_lines', {"amount": -(((self.newY - self.viewportY) / self.lineHeight) - (0.5))}) 115 | # self.pagesWritten += 1 116 | # view.set_status('AutoScrollCommand', 'Pages written: %d' % self.pagesWritten) 117 | self.stopCounter = 1 118 | self.rowCounter = 1 119 | # Notes 120 | # elif (self.scope == 'text.fountain variable.parameter '): 121 | elif (self.scope == fountain_scope + note_scope): 122 | self.newY = view.text_to_layout((view.text_point((self.currentRow - self.rowCounter - 1), 0)))[1] 123 | if (((self.currentY - self.newY) / self.lineHeight) > self.lineAmount): 124 | view.run_command('scroll_lines', {"amount": -(self.pageLines - self.scrollAmount)}) 125 | # self.pagesWritten += 1 126 | # view.set_status('AutoScrollCommand', 'Pages written: %d' % self.pagesWritten) 127 | self.stopCounter = 1 128 | self.rowCounter = 1 129 | else: 130 | view.run_command('scroll_lines', {"amount": -(((self.newY - self.viewportY) / self.lineHeight) - (0.5))}) 131 | # self.pagesWritten += 1 132 | # view.set_status('AutoScrollCommand', 'Pages written: %d' % self.pagesWritten) 133 | self.stopCounter = 1 134 | self.rowCounter = 1 135 | # Synopses 136 | # elif (self.scope == 'text.fountain meta.diff '): 137 | elif (self.scope == fountain_scope + synopses_scope): 138 | self.newY = view.text_to_layout((view.text_point((self.currentRow - self.rowCounter - 1), 0)))[1] 139 | if (((self.currentY - self.newY) / self.lineHeight) > self.lineAmount): 140 | view.run_command('scroll_lines', {"amount": -(self.pageLines - self.scrollAmount)}) 141 | # self.pagesWritten += 1 142 | # view.set_status('AutoScrollCommand', 'Pages written: %d' % self.pagesWritten) 143 | self.stopCounter = 1 144 | self.rowCounter = 1 145 | else: 146 | view.run_command('scroll_lines', {"amount": -(((self.newY - self.viewportY) / self.lineHeight) - (0.5))}) 147 | # view.run_command('scroll_lines', {"amount": -(self.pageLines - (self.rowCounter + 0.5)) }) 148 | # self.pagesWritten += 1 149 | # view.set_status('AutoScrollCommand', 'Pages written: %d' % self.pagesWritten) 150 | self.stopCounter = 1 151 | self.rowCounter = 1 152 | # elif (self.scope == 'text.fountain '): 153 | elif (self.scope == fountain_scope): 154 | self.newY = view.text_to_layout((view.text_point((self.currentRow - self.rowCounter - 1), 0)))[1] 155 | if (((self.currentY - self.newY) / self.lineHeight) > self.lineAmount): 156 | view.run_command('scroll_lines', {"amount": -(self.pageLines - self.scrollAmount)}) 157 | # self.pagesWritten += 1 158 | # view.set_status('AutoScrollCommand', 'Pages written: %d' % self.pagesWritten) 159 | self.stopCounter = 1 160 | self.rowCounter = 1 161 | else: 162 | view.run_command('scroll_lines', {"amount": -(((self.newY - self.viewportY) / self.lineHeight) - (0.5))}) 163 | # self.pagesWritten += 1 164 | # view.set_status('AutoScrollCommand', 'Pages written: %d' % self.pagesWritten) 165 | self.stopCounter = 1 166 | self.rowCounter = 1 167 | # Section 168 | # elif (self.scope == 'text.fountain entity.name.filename '): 169 | elif (self.scope == fountain_scope + section_scope): 170 | self.newY = view.text_to_layout((view.text_point((self.currentRow - self.rowCounter - 1), 0)))[1] 171 | if (((self.currentY - self.newY) / self.lineHeight) > self.lineAmount): 172 | view.run_command('scroll_lines', {"amount": -(self.pageLines - self.scrollAmount)}) 173 | # self.pagesWritten += 1 174 | # view.set_status('AutoScrollCommand', 'Pages written: %d' % self.pagesWritten) 175 | self.stopCounter = 1 176 | self.rowCounter = 1 177 | else: 178 | view.run_command('scroll_lines', {"amount": -(((self.newY - self.viewportY) / self.lineHeight) - (0.5))}) 179 | # self.pagesWritten += 1 180 | # view.set_status('AutoScrollCommand', 'Pages written: %d' % self.pagesWritten) 181 | self.stopCounter = 1 182 | self.rowCounter = 1 183 | # Boneyard 184 | # elif (self.scope == 'text.fountain comment '): 185 | # self.newY = view.text_to_layout((view.text_point((self.currentRow - self.rowCounter - 1), 0)))[1] 186 | # if (((self.currentY - self.newY) / self.lineHeight) > self.lineAmount): 187 | # view.run_command('scroll_lines', {"amount": -(self.pageLines - self.scrollAmount)}) 188 | # self.pagesWritten += 1 189 | # view.set_status('AutoScrollCommand', 'Pages written: %d' % self.pagesWritten) 190 | # self.stopCounter = 1 191 | # self.rowCounter = 1 192 | # else: 193 | # view.run_command('scroll_lines', {"amount": -(((self.newY - self.viewportY) / self.lineHeight) - (0.5))}) 194 | # self.pagesWritten += 1 195 | # view.set_status('AutoScrollCommand', 'Pages written: %d' % self.pagesWritten) 196 | # self.stopCounter = 1 197 | # self.rowCounter = 1 198 | else: 199 | self.rowCounter += 1 200 | 201 | while ((self.rowCounter > self.rowCounterLimit) and self.stopCounter == 0): 202 | view.run_command('scroll_lines', {"amount": -(self.pageLines - self.scrollAmount)}) 203 | # self.pagesWritten += 1 204 | # Will keep track of written pages in preview script 205 | # view.set_status('AutoScrollCommand', 'Pages written: %d' % self.pagesWritten) 206 | self.stopCounter = 1 207 | 208 | def on_modified_async(self, view): 209 | if int(sublime.version()) >= 3000: 210 | self.modified_scroll(view) 211 | 212 | def on_modified(self, view): 213 | if int(sublime.version()) < 3000: 214 | self.modified_scroll(view) 215 | -------------------------------------------------------------------------------- /characters.py: -------------------------------------------------------------------------------- 1 | import sublime 2 | import sublime_plugin 3 | import re 4 | import os 5 | import codecs 6 | # import sys 7 | # import platform 8 | # from .sublime_helper import * 9 | try: 10 | from . import scopes 11 | except (ImportError, ValueError): 12 | import scopes 13 | try: 14 | from .sublime_helper import SublimeHelper 15 | except (ImportError, ValueError): 16 | from sublime_helper import SublimeHelper 17 | 18 | fountain_scope = scopes.fountain_scope 19 | action_scope = scopes.action_scope 20 | boneyard_scope = scopes.boneyard_scope 21 | dialogue_scope = scopes.dialogue_scope 22 | lyrics_scope = scopes.lyrics_scope 23 | character_scope = scopes.character_scope 24 | parenthetical_scope = scopes.parenthetical_scope 25 | note_scope = scopes.note_scope 26 | scene_scope = scopes.scene_scope 27 | character_list_scope = scopes.character_list_scope 28 | section_scope = scopes.section_scope 29 | synopses_scope = scopes.synopses_scope 30 | pagebreak_scope = scopes.pagebreak_scope 31 | title_page_scope = scopes.title_page_scope 32 | center_scope = scopes.center_scope 33 | transition_scope = scopes.transition_scope 34 | 35 | user = '' 36 | # user_os = platform.system() 37 | 38 | 39 | class Characters(sublime_plugin.EventListener): 40 | 41 | characters = [] 42 | person = '' 43 | # lower_characters = [] 44 | # camel_characters = [] 45 | current_character = '' 46 | previous_line = 0 47 | current_line = 0 48 | filename = '' 49 | 50 | def modified_character(self, view): 51 | if view.settings().get('syntax') == 'Packages/Fountainhead/Fountainhead.tmLanguage': 52 | # if 'Fountainhead.tmLanguage' in view.settings().get('syntax'): 53 | # if sublime.load_settings('Fountainhead.sublime-settings').get('characters', True): 54 | if view.settings().get('characters', True): 55 | if self.characters == []: 56 | self.on_activated(view) 57 | view.set_status('CharacterList', '') 58 | if view.rowcol(view.sel()[0].end())[0] != self.current_line: 59 | self.previous_line = self.current_line 60 | self.current_line = view.rowcol(view.sel()[0].end())[0] 61 | # if view.scope_name(view.text_point(self.previous_line, 0)) == 'text.fountain dialogue entity.name.class ': 62 | # if view.scope_name(view.text_point(self.previous_line, 0)) == 'text.fountain dialogue entity.name.class ': 63 | if view.scope_name(view.text_point(self.previous_line, 0)) == fountain_scope + dialogue_scope + character_scope: 64 | # get character name from line 65 | s = SublimeHelper() 66 | self.current_character = view.substr(view.line(view.text_point(self.previous_line, 0))) 67 | character = s.line_string(view) 68 | name = self.current_character.split(' (O.S.)')[0] 69 | name = name.split(' (V.O.)')[0] 70 | name = name.split(' (OS)')[0] 71 | name = name.split(' (VO)')[0] 72 | name = name.split(" (CONT'D)")[0] 73 | if name[0] == ' ' or name[0] == '\t': 74 | name = re.split(r'^\s*', name)[1] 75 | if name not in self.characters and name != '' and name is not None: 76 | self.characters.append(name) 77 | self.characters = sorted(self.characters) 78 | ShowCharactersCommand.characters = self.characters 79 | # Create Fountainhead directory if it doesn't exist 80 | packages_directory = sublime.packages_path() + '/User/Fountainhead/' 81 | if not os.path.exists(packages_directory): 82 | os.mkdir(packages_directory) 83 | completions_file = packages_directory + 'Characters.sublime-completions' 84 | # if user_os == 'Windows': 85 | # print("Sorry, not supported at this time.") 86 | # elif user_os == 'Darwin': 87 | 88 | completions = codecs.open(completions_file, 'w', 'utf8') 89 | # completions.write('{\n\t\t"scope": "text.fountain - comment - string - dialogue - entity.other.attribute-name - entity.other.inherited-class - foreground - meta.diff - entity.name.function - entity.name.tag - entity.name.class - variable.parameter",\n\n\t\t"completions":\n\t\t[') 90 | completions.write('{\n\t\t"scope": ' + '"' + fountain_scope + '- ' + boneyard_scope + '- ' + action_scope + '- ' + dialogue_scope + '- ' + lyrics_scope + '- ' + character_scope + '- ' + parenthetical_scope + '- ' + note_scope + '- ' + scene_scope + '- ' + section_scope + '- ' + synopses_scope + '- ' + pagebreak_scope + '- ' + title_page_scope + '- ' + center_scope + '- ' + transition_scope[0:-1] + '",\n\n\t\t"completions":\n\t\t[') 91 | length = len(self.characters) 92 | character_counter = 0 93 | for character in self.characters: 94 | if character_counter < length - 1: 95 | completions.write('"%s",' % character) 96 | character_counter += 1 97 | else: 98 | completions.write('"%s"' % character) 99 | completions.write(']\n}') 100 | completions.close() 101 | 102 | # Not needed since characters are no longer converted to lowercase 103 | # if name[0] != '@': 104 | # if name.lower() not in self.lower_characters: 105 | # self.lower_characters.append(name.lower()) 106 | # self.lower_characters = sorted(self.lower_characters) 107 | # completions = codecs.open(completions_file, 'w', 'utf8') 108 | # completions.write('{\n\t\t"scope": "text.fountain - comment - string - entity.other.attribute-name - entity.other.inherited-class - foreground - meta.diff - entity.name.function - entity.name.tag - entity.name.class - variable.parameter",\n\n\t\t"completions":\n\t\t[') 109 | # length = len(self.lower_characters) 110 | # character_counter = 0 111 | # for character in self.lower_characters: 112 | # if character_counter < length - 1: 113 | # completions.write('"%s",' % character) 114 | # character_counter += 1 115 | # else: 116 | # completions.write('"%s"' % character) 117 | # completions.write(']\n}') 118 | # completions.close() 119 | # elif name[0] == '@': 120 | # if name not in self.lower_characters: 121 | # self.lower_characters.append(name) 122 | # self.lower_characters = sorted(self.lower_characters) 123 | # completions = codecs.open(completions_file, 'w', 'utf8') 124 | # completions.write('{\n\t\t"scope": "text.fountain - comment - string - entity.other.attribute-name - entity.other.inherited-class - foreground - meta.diff - entity.name.function - entity.name.tag - entity.name.class - variable.parameter",\n\n\t\t"completions":\n\t\t[') 125 | # length = len(self.lower_characters) 126 | # character_counter = 0 127 | # for character in self.lower_characters: 128 | # if character_counter < length - 1: 129 | # completions.write('"%s",' % character) 130 | # character_counter += 1 131 | # else: 132 | # completions.write('"%s"' % character) 133 | # completions.write(']\n}') 134 | # completions.close() 135 | 136 | # Clear out character list message 137 | view.set_status('CharacterList', 138 | '') 139 | 140 | def on_modified_async(self, view): 141 | if int(sublime.version()) >= 3000: 142 | self.modified_character(view) 143 | 144 | def on_modified(self, view): 145 | if int(sublime.version()) < 3000: 146 | self.modified_character(view) 147 | 148 | def on_activated(self, view): 149 | if view.settings().get('syntax') == 'Packages/Fountainhead/Fountainhead.tmLanguage': 150 | # s = view.settings().get('syntax') 151 | # while s is None: 152 | # s = view.settings().get('syntax') 153 | # if 'Fountainhead.tmLanguage' in s: 154 | # if sublime.load_settings('Fountainhead.sublime-settings').get('characters', True): 155 | if view.settings().get('characters', True): 156 | if self.filename == view.file_name() and len(self.characters) > 0: 157 | pass 158 | # print(view.file_name()) 159 | else: 160 | view.set_status('CharacterList', 161 | 'FINDING CHARACTERS...') 162 | self.characters = [] 163 | # self.lower_characters = [] 164 | counter = 0 165 | self.filename = view.file_name() 166 | try: 167 | while counter >= 0: 168 | # character = view.substr(view.find_by_selector('text.fountain dialogue entity.name.class ')[counter]) 169 | character = view.substr(view.find_by_selector(fountain_scope + dialogue_scope + character_scope)[counter]) 170 | name = character.split(' (O.S.)')[0] 171 | name = name.split(' (V.O.)')[0] 172 | name = name.split(' (OS)')[0] 173 | name = name.split(' (VO)')[0] 174 | name = name.split(" (CONT'D)")[0] 175 | if name[0] == ' ' or name[0] == '\t': 176 | name = (re.split(r'^\s*', name))[1] 177 | if name not in self.characters and name != '' and name is not None: 178 | self.characters.append(name) 179 | counter += 1 180 | except IndexError: 181 | pass 182 | 183 | # for character in self.characters: 184 | # if character[0] != '@': 185 | # self.lower_characters.append(character.lower()) 186 | # if character[0] == '@': 187 | # self.lower_characters.append(character) 188 | # self.lower_characters = sorted(self.lower_characters) 189 | 190 | self.characters = sorted(self.characters) 191 | # proc_env = os.environ.copy() 192 | # encoding = sys.getfilesystemencoding() 193 | # for k, v in proc_env.items(): 194 | # proc_env[k] = os.path.expandvars(v).encode(encoding) 195 | # user = (proc_env['HOME']).decode(encoding='UTF-8') 196 | # completions = open(user + '/Library/Application Support/Sublime Text 3/Packages/Fountainhead/Characters.sublime-completions', 'w') 197 | # packages_directory = sublime.packages_path() 198 | # completions_file = packages_directory + '/Fountainhead/Characters.sublime-completions' 199 | # Create Fountainhead directory if it doesn't exist 200 | packages_directory = sublime.packages_path() + '/User/Fountainhead/' 201 | if not os.path.exists(packages_directory): 202 | os.mkdir(packages_directory) 203 | completions_file = packages_directory + 'Characters.sublime-completions' 204 | completions = codecs.open(completions_file, 'w', 'utf8') 205 | # completions.write('{\n\t\t"scope": "text.fountain - comment - string - dialogue - entity.other.attribute-name - entity.other.inherited-class - foreground - meta.diff - entity.name.function - entity.name.tag - entity.name.class - variable.parameter",\n\n\t\t"completions":\n\t\t[') 206 | completions.write('{\n\t\t"scope": ' + '"' + fountain_scope + '- ' + boneyard_scope + '- ' + action_scope + '- ' + dialogue_scope + '- ' + lyrics_scope + '- ' + character_scope + '- ' + parenthetical_scope + '- ' + note_scope + '- ' + scene_scope + '- ' + section_scope + '- ' + synopses_scope + '- ' + pagebreak_scope + '- ' + title_page_scope + '- ' + center_scope + '- ' + transition_scope[0:-1] + '",\n\n\t\t"completions":\n\t\t[') 207 | # length = len(self.lower_characters) 208 | length = len(self.characters) 209 | character_counter = 0 210 | # for character in self.lower_characters: 211 | for character in self.characters: 212 | if character_counter < length - 1: 213 | completions.write('"%s",' % character) 214 | character_counter += 1 215 | else: 216 | completions.write('"%s"' % character) 217 | completions.write(']\n}') 218 | completions.close() 219 | # Print confirmation message 220 | view.set_status('CharacterList', 221 | 'CHARACTERS FOUND!') 222 | 223 | # ShowCharactersCommand.unsorted_characters = self.characters 224 | ShowCharactersCommand.characters = self.characters 225 | 226 | 227 | class UpdateCharacterListCommand(sublime_plugin.TextCommand): 228 | 229 | characters = [] 230 | filename = '' 231 | 232 | def run(self, edit): 233 | self.characters = [] 234 | c = Characters() 235 | c.on_activated(self.view) 236 | 237 | 238 | class ShowCharactersCommand(sublime_plugin.TextCommand): 239 | 240 | person = '' 241 | # unsorted_characters = [] 242 | # sorted_characters = [] 243 | characters = [] 244 | 245 | def run(self, edit): 246 | # if sublime.load_settings('Fountainhead.sublime-settings').get('characters', True) and int(sublime.version()) >= 3000: 247 | if self.view.settings().get('characters', True) and int(sublime.version()) >= 3000: 248 | # self.sorted_characters = sorted(self.unsorted_characters) 249 | # self.view.show_popup_menu(self.sorted_characters, self.on_done) 250 | self.view.show_popup_menu(self.characters, self.on_done) 251 | 252 | self.view.run_command('insert', {"characters": self.person}) 253 | 254 | def on_done(self, index): 255 | if index == -1: 256 | self.person = '' 257 | else: 258 | # self.person = self.sorted_characters[index] 259 | self.person = self.characters[index] 260 | -------------------------------------------------------------------------------- /Fountainhead.tmLanguage: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fileTypes 6 | 7 | fountain 8 | 9 | firstLineMatch 10 | ^[A-Z]+$ 11 | foldingStartMarker 12 | ^\s+ 13 | foldingStopMarker 14 | ^$ 15 | name 16 | Fountainhead 17 | 18 | 19 | patterns 20 | 21 | 22 | 23 | 24 | include 25 | #comments 26 | 27 | 28 | 29 | 30 | include 31 | #title_page 32 | 33 | 34 | 35 | 36 | include 37 | #scene_headings 38 | 39 | 40 | 41 | 42 | include 43 | #sections 44 | 45 | 46 | include 47 | #synopses 48 | 49 | 50 | 51 | 52 | include 53 | #transitions 54 | 55 | 56 | 57 | 58 | include 59 | #character_list 60 | 61 | 62 | 63 | 64 | include 65 | #dialogue 66 | 67 | 68 | 69 | 70 | include 71 | #lyrics 72 | 73 | 74 | 75 | 76 | include 77 | #markup 78 | 79 | 80 | 81 | 82 | include 83 | #notes 84 | 85 | 86 | 87 | 88 | include 89 | #pagebreaks 90 | 91 | 92 | 93 | 94 | include 95 | #action 96 | 97 | 98 | 99 | 100 | include 101 | #center 102 | 103 | 104 | 105 | 106 | 107 | repository 108 | 109 | 110 | 111 | 112 | action 113 | 114 | begin 115 | ^([ \t]*)(?=\S) 116 | contentName 117 | foreground 118 | end 119 | ^$ 120 | patterns 121 | 122 | 123 | include 124 | #markup 125 | 126 | 127 | 128 | 129 | 130 | comments 131 | 132 | name 133 | comment 134 | begin 135 | /\* 136 | end 137 | \*/ 138 | 139 | 140 | dialogue 141 | 142 | name 143 | 144 | dialogue 145 | begin 146 | (^\s*(@.*$|[A-Z0-9ÂÃÄÀÁÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖŐØÙÚÛÜŰÝßАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯЀЁЂЃЄЅІЇЈЉЊЋЌЍЎЏѠѢѤѦѨѪѬѮѰѲѴѶѸѺѼѾҀҌҎҐҒҔҖҘҚҜҞҠҢҤҦҨҪҬҮҰҲҴҶҸҺҼҾӀӁӃӇӋӐӒӔӖӘӚӜӞӠӢӤӦӨӪӬӮӰӲӴӸ#]([A-Z0-9ÂÃÄÀÁÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖŐØÙÚÛÜŰÝßАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯЀЁЂЃЄЅІЇЈЉЊЋЌЍЎЏѠѢѤѦѨѪѬѮѰѲѴѶѸѺѼѾҀҌҎҐҒҔҖҘҚҜҞҠҢҤҦҨҪҬҮҰҲҴҶҸҺҼҾӀӁӃӇӋӐӒӔӖӘӚӜӞӠӢӤӦӨӪӬӮӰӲӴӸ# :().'\-]*[\!\?]*(\(.*\))*(\s*\^)?$))) 147 | end 148 | ^$ 149 | beginCaptures 150 | 151 | 1 152 | 153 | name 154 | 155 | string 156 | 157 | 158 | applyEndPatternLast 159 | 1 160 | patterns 161 | 162 | 163 | name 164 | comment 165 | begin 166 | /\* 167 | end 168 | \*/ 169 | 170 | 171 | name 172 | lyrics 173 | 174 | begin 175 | ~ 176 | end 177 | $ 178 | 179 | 180 | name 181 | variable.parameter 182 | begin 183 | \[\[\s*(?=\S) 184 | end 185 | \]\] 186 | 187 | 188 | name 189 | entity.other.inherited-class 190 | match 191 | ^\s*\(.*\)$ 192 | patterns 193 | 194 | 195 | include 196 | #nested_parens 197 | 198 | 199 | 200 | 201 | include 202 | #markup 203 | 204 | 205 | 206 | 207 | 208 | nested_parens 209 | 210 | begin 211 | \( 212 | end 213 | \) 214 | patterns 215 | 216 | 217 | include 218 | #nested_parens 219 | 220 | 221 | 222 | 223 | 224 | notes 225 | 226 | name 227 | variable.parameter 228 | begin 229 | \[\[\s*(?=\S) 230 | end 231 | \]\] 232 | 233 | 234 | 235 | scene_headings 236 | 237 | match 238 | ^\s*(?i)((\.[a-z0-9ßàáâãäåæçèéêëìíîïðñòóôõöőøùúûüűýþÿабвгдежзийклмнопрстуфхцчшщъыьэюяѐёђѓєѕіїјљњћќѝўџѡѣѥѧѩѫѭѯѱѳѵѷѹѻѽѿҁҍҏґғҕҗҙқҝҟҡңҥҧҩҫҭүұҳҵҷҹһҽҿӏӂӄӈӌӑӓӕӗәӛӝӟӡӣӥӧөӫӭӯӱӳӵӹ_]|int\.? |ext\.? |est\.? |int\.?/ext\.? |i/e|flashback)(?:|\.| )(.*?)(?<! )(#[a-z0-9ßàáâãäåæçèéêëìíîïðñòóôõöőøùúûüűýþÿабвгдежзийклмнопрстуфхцчшщъыьэюяѐёђѓєѕіїјљњћќѝўџѡѣѥѧѩѫѭѯѱѳѵѷѹѻѽѿҁҍҏґғҕҗҙқҝҟҡңҥҧҩҫҭүұҳҵҷҹһҽҿӏӂӄӈӌӑӓӕӗәӛӝӟӡӣӥӧөӫӭӯӱӳӵӹ\-._]+#)? *$) 239 | captures 240 | 241 | 1 242 | 243 | name 244 | entity.name.function 245 | 246 | 247 | 248 | 249 | 250 | character_list 251 | 252 | begin 253 | ^([ \t]*)[a-zàáâãäåæçèéêëìíîïðñòóôõöőøùúûüűýþÿßабвгдежзийклмнопрстуфхцчшщъыьэюяѐёђѓєѕіїјљњћќѝўџѡѣѥѧѩѫѭѯѱѳѵѷѹѻѽѿҁҍҏґғҕҗҙқҝҟҡңҥҧҩҫҭүұҳҵҷҹһҽҿӏӂӄӈӌӑӓӕӗәӛӝӟӡӣӥӧөӫӭӯӱӳӵӹ.]$ 254 | contentName 255 | constant.character 256 | end 257 | ^$ 258 | 259 | 260 | 261 | sections 262 | 263 | match 264 | ^(#{1,6})(?!#).* 265 | name 266 | entity.name.filename 267 | 268 | synopses 269 | 270 | match 271 | ^(=)(?!=).* 272 | name 273 | meta.diff 274 | 275 | 276 | 277 | pagebreaks 278 | 279 | name 280 | support.function 281 | match 282 | ===(=+)? 283 | 284 | 285 | 286 | markup 287 | 288 | patterns 289 | 290 | 291 | name 292 | foreground 293 | match 294 | ^\s*>[A-Za-z1-9(). ]+<\s*$ 295 | patterns 296 | 297 | 298 | include 299 | #markup 300 | 301 | 302 | 303 | 304 | name 305 | markup.deleted 306 | begin 307 | \_ 308 | end 309 | \_ 310 | patterns 311 | 312 | 313 | include 314 | #markup 315 | 316 | 317 | 318 | 319 | 320 | name 321 | 322 | markup.inserted 323 | begin 324 | \*\*\* 325 | end 326 | \*\*\* 327 | patterns 328 | 329 | 330 | include 331 | #markup 332 | 333 | 334 | 335 | 336 | 337 | name 338 | markup.changed 339 | begin 340 | \*\* 341 | end 342 | \*\* 343 | patterns 344 | 345 | 346 | include 347 | #markup 348 | 349 | 350 | 351 | 352 | 353 | name 354 | message.error 355 | begin 356 | \* 357 | end 358 | \* 359 | patterns 360 | 361 | 362 | include 363 | #markup 364 | 365 | 366 | 367 | 368 | 369 | 370 | name 371 | foreground 372 | match 373 | \\\* 374 | patterns 375 | 376 | 377 | include 378 | #markup 379 | 380 | 381 | 382 | 383 | 384 | patterns 385 | 386 | 387 | include 388 | #notes 389 | 390 | 391 | include 392 | #comments 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | title_page 402 | 403 | name 404 | constant.numeric 405 | begin 406 | ^(?i)(format|title|credit|authors?|source|draft date|contact|copyright|notes): 407 | end 408 | ^$ 409 | beginCaptures 410 | 411 | 1 412 | 413 | name 414 | constant.numeric 415 | 416 | 417 | applyEndPatternLast 418 | 1 419 | patterns 420 | 421 | 422 | name 423 | comment 424 | begin 425 | /\* 426 | end 427 | \*/ 428 | 429 | 430 | name 431 | string 432 | begin 433 | \[\[\s*(?=\S) 434 | end 435 | \]\] 436 | 437 | 438 | include 439 | #markup 440 | 441 | 442 | 443 | 444 | 445 | center 446 | 447 | name 448 | foreground 449 | match 450 | ^\s*(>[A-Za-z1-9(). ]+(<))\s* 451 | 452 | 453 | 454 | transitions 455 | 456 | name 457 | entity.name.tag 458 | match 459 | ^\s*(?i)(>[A-Za-z1-9(). ]+(?!<)$|[A-Za-z. ]+ to:|fade out\.|fade to black\.|fade in:)\s* 460 | 461 | 462 | 463 | scopeName 464 | text.fountain 465 | uuid 466 | 601e72e1-41ed-417f-83ae-d7e3e325609f 467 | 468 | 469 | --------------------------------------------------------------------------------