Skip to content
GalvarcusPublic

About

A structured writing environment for Vim9.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Bartleby

Bartleby Banner A structured writing environment for Vim. It provides a binder, a corkboard, an outliner, and a compile pipeline for long-form prose and screenplays. "When you prefer not to be wrong, but write."

Vim License: GPL v3

main: CI

Development: CI

Bartleby Screenshot

Contents

For a walkthrough written for authors, see Users_Guide.md. To add support for another language, see Localization_README.md. For the commands, mappings, and keys on a few pages, see the cheat sheet.

Introduction

A project, called a scrive, is a tree of folders and documents. You build and arrange the tree in a sidebar, shuffle scenes on a corkboard, review them in an outline, and compile the tree into a submission manuscript, a typeset book, or a screenplay.

Every document is a plain .md file, or a .fountain file for screenplays. A small JSON file next to each document holds its metadata: label, status, synopsis, keywords, and word-count target. The tree itself is one project.json per scrive. You can edit all of these files with any editor.

Requirements

  • Vim 9.2 or newer, with +popupwin.1
  • Logger - a Vim9script logging utility that Bartleby uses. Install it the same way as Bartleby.
  • Compile needs Pandoc 3.x and a LaTeX distribution with pdflatex, xelatex, microtype, and the sffms class. A Book in a language other than English also needs the LaTeX support for that language, such as texlive-lang-german. Without it, words such as Contents stay English. Screenplays need screenplain instead.
  • Dictionary and thesaurus need curl and your own free Merriam-Webster API keys, one for the Collegiate Dictionary and one for the Collegiate Thesaurus.
  • Spotlight's Nouns, Verbs, Adjectives, and Passive modes need Python 3 with spaCy and its English model. See Spotlight modes.

Writing needs only Vim. Compile, the lookups, and the tagger modes are the only features with other requirements.

Installation

Install Logger and Bartleby the same way.

With vim-plug:

Plug 'Galvarcus/Logger'
Plug 'Galvarcus/bartleby'

With Vim's native packages:

git clone https://github.com/Galvarcus/Logger ~/.vim/pack/plugins/start/Logger
git clone https://github.com/Galvarcus/bartleby ~/.vim/pack/plugins/start/bartleby

With Vundle:

Plugin 'Galvarcus/Logger'
Plugin 'Galvarcus/bartleby'

Restart Vim, then create a scrive to confirm that Bartleby loaded:

:BartlebyNewScrive TestProject

Quick start

:BartlebyNewScrive My Novel

Bartleby asks for the scrive type: novel, novel with parts, short story, or screenplay. It creates the scrive under g:bartleby_binder_root and opens the Binder with a starter tree: Front Matter, Manuscript with a first chapter and scene, Back Matter, Characters, and Research.

In the Binder:

  • <CR> on a document opens it.
  • a adds a document. A adds a folder.
  • go opens the Outliner for the folder under the cursor. gc opens its Corkboard.

Elsewhere:

  • <leader>bi toggles the Inspector for the current document.
  • :BartlebyCompile compiles the scrive.
  • :BartlebyOpen reopens the last scrive. :BartlebyList lists all scrives.

Concepts

Scrive - one writing project. It is a folder under g:bartleby_binder_root that holds project.json, a binder/ folder with the documents, and a compile/ folder with compile targets and their output.

Binder item - a folder or a document. A document also has a metadata file, <name>.meta.json.

Files on disk - a document lives in the folders of its place in the Binder, as in binder/manuscript/part-1/chapter-2/arrival.md for the scene Arrival in Chapter 2 of Part 1. New scrives and new documents follow this layout. After you move documents in the Binder, :BartlebyTidyFiles moves their files to match, after a confirmation that says how many move. It stops when a document has unsaved changes, never writes over another file, and leaves the Trash as it is.

Structural folders - Front Matter, Manuscript, Back Matter, Characters, and Research. Every scrive has them, and compile uses them. You cannot rename, delete, or move them. dd on one moves its contents to the Trash, after a confirmation. Chapter and Part folders inside Manuscript are also structural, but you can add, move, and delete them.

Trash - the last folder of every Binder. dd moves an item into it, and its files stay on disk. In the Trash, u puts an item back where it was, and m moves it anywhere else. dd on an item in the Trash deletes it and its files for good, and dd on the Trash itself empties it, both after a confirmation. The Trash shows only what is still on disk, and compile and search leave it out.

Binder

The Binder is the sidebar with the scrive's tree. It opens with the scrive, and :BartlebyToggleBinder toggles it. Line 1 shows the scrive title. Folders end with /. A document with a label shows the label color after its title. Long titles wrap.

Key Action
<CR> Open the document, or expand or collapse the folder
<Tab> Expand or collapse the folder
a Add a document
A Add a folder: Chapter or Part where the scrive type allows
dd Move the item to the Trash. On a structural folder, move its contents there, after a confirmation. In the Trash, delete for good, after a confirmation
u Restore the item from the Trash to where it was
r Rename the item
J / K Move the item down or up. A scene at the end of its chapter moves on into the next chapter, or the previous one
m Move the item to another folder, picked from a list, to the end of it
>> / << Indent or outdent the item
l Set the document's label
s Set the document's status
L Show or hide the Chapter: and Part: prefixes
S Take a snapshot of the document
gS View or restore snapshots
gc Open the Corkboard for the folder
go Open the Outliner for the folder
v Open a Scrivening of the folder, or of the folder of the document
/ Search the scrive
? Show this key list
q Close the Binder

A confirmation question takes y for yes, and n or <Esc> for no. <Enter> gives the default answer, which is No for every deletion.

The Binder and the Inspector are panes beside the edit window. When you close the edit window with :q and a pane is open, an empty edit window stays in its place, and the panes keep their widths. :q in the empty edit window closes it.

Corkboard

gc on a folder shows its documents as index cards with each document's title and synopsis.

Key Action
Arrows or h j k l Move between cards
<CR> or <Space> Open the selected document
e Edit the synopsis
J / K Move the card later or earlier
? Show this key list
<Esc> Close the Corkboard

Outliner

go on a folder shows all items under it as a table: Title, Label, Status, Words, Target, and Keywords. Rows are indented like the tree.

Key Action
j / k Move the selection
<CR> Open the document
l Set the document's label
s Set the document's status
gs Sort by a column. This changes the view only, not the tree
? Show this key list
q Close the Outliner

Scrivenings

v on a folder in the Manuscript shows its documents, and those of the folders inside it, in Binder order, in one buffer: a Scrivening. You read and edit them as one text. v on a document opens the Scrivening of its folder at that document. :BartlebyScrivenings does the same from a document.

:BartlebyScrivenings! saves and closes the Scrivening. Its window then shows the document that the cursor was in, at the same line. :bd closes it too. To leave it open, open another document: the Scrivening stays, and auto-save keeps it saved.

A title line starts each document, as in ── Chapter: 2 / Scene 1 ──. The title lines are protected. Bartleby undoes a change to one, and <BS> and <Del> do not join text to one. :w and auto-save write only the documents that changed. If a title line is damaged anyway, saving writes nothing, so that no text goes to another document.

A document opens in one place only. Opening a Scrivening saves and closes the documents of the folder that are open on their own. While it is open, a document of the folder that opens in any other way shows in the Scrivening, at the same line.

The Inspector, Quill, Spotlight, Focus, snapshots, and the session follow the document under the cursor. A change in the Binder, such as a new or moved document, shows in the Scrivening at once. One Scrivening is open at a time.

The word counts of Bartleby leave the title lines out. The word count of Vim, g CTRL-G, and that of vim-airline count the whole buffer, so in a Scrivening they count the title lines too.

Goals and progress

:BartlebyGoals sets the writing goals of the scrive. All are optional, and 0 turns one off:

  • Session goal - the words to write since the scrive opened.
  • Daily goal - the words to write each day.
  • Tracker - a target over a number of days from a start date, as for NaNoWriMo.

The words written are the net change of the words of the Manuscript. Deleting text lowers them. Unsaved text counts, and Research, notes, the Trash, and the title lines of a Scrivening do not. A day starts at midnight, or at the hour of g:bartleby_day_starts_at.

The status line shows the goals that are set, as in Today 1,180/1,667 · Session 230/500. With a tracker and no daily goal, today's goal is its share of what is left. vim-airline shows it in section y, or in the section of g:bartleby_airline_section. Without airline, Bartleby adds it to the status line of Vim when the statusline option is empty. To place it in a status line of your own, add %{bartleby#progress#Status()}.

:BartlebyProgress shows the progress in a popup. With a tracker, it shows its figures, such as the words to have by now and the projected finish date, and the words of each day. Without one, it shows the words of the last 30 days. e edits the goals, and q closes it.

progress.json in the scrive keeps the goals and the words of each day.

Inspector

<leader>bi or :BartlebyToggleInspector opens a read-only pane with the current document's Title, Label, Status, Target, Keywords, and Synopsis. It follows the document in the editor window. When writing goals are set, it shows them after the synopsis.

Key Action
e on Label or Status Pick a value
e on Target or Keywords Type a value
e on Synopsis Edit the synopsis. <CR> adds a line. <C-s> saves, or <Tab> to the Save button
e on a goal Edit the writing goals

Scrive list

:BartlebyList shows every scrive with its title and type. If no scrive exists, it asks for a name and creates one. :BartlebyOpen with no name and no previous scrive also shows this list.

Key Action
j / k Move the selection
<CR> Open the scrive
? Show this key list
q Close the list

Focus, Spotlight, and Quill

Three independent writing aids:

Tool Command Mapping Effect
Focus :BartlebyFocus <leader>bz A centered writing column. The rest of the screen is dimmed
Spotlight :BartlebySpotlight <leader>bl Dims all text except the current paragraph, or except what the selected mode keeps bright. <leader>bL picks the mode
Quill :BartlebyQuill <leader>bp Word-processor wrapping, soft or hard, detected from the document

All three work only in the edit window. In the Binder or the Inspector they say so and change nothing, so that a pane keeps its keys and its text. Spotlight can still be turned off there.

Spotlight modes

<leader>bL opens a searchable list of the modes, and :BartlebySpotlight {mode} selects one by name. In the list, type to search, or scroll with the arrow keys, <PageUp>, <PageDown>, or the mouse wheel. Each part-of-speech mode keeps its words bright and dims everything else. Markdown headings and Fountain scene headings, character cues, and transitions dim completely.

Mode Keeps bright Source
Paragraph The paragraph with the cursor
Dialogue Quoted speech. In Fountain, the dialogue under each character cue
Nouns Nouns and proper nouns Tagger only
Verbs Main verbs Tagger only
Adjectives Adjectives Tagger only
Adverbs Adverbs Tagger, else word list and the -ly ending
Pronouns Pronouns Tagger, else word list
Determiners Articles and other determiners such as this and every Tagger, else word list
Prepositions Prepositions Tagger, else word list
Conjunctions Conjunctions Tagger, else word list
Auxiliaries Helping verbs such as was, have, and can Tagger, else word list
Contractions Contractions such as don't and they're Word list and pattern
Fillers Filler words such as just, really, and very Word list
Passive Passive constructions such as was opened Tagger only

Tagger. A tagger reads whole sentences, so it knows that "run" is a verb in "they run" and a noun in "a long run". Word lists cannot know this, so Nouns, Verbs, Adjectives, and Passive need a tagger and are hidden without one. To use spaCy:

python3 -m pip install spacy
python3 -m spacy download en_core_web_sm
let g:bartleby_spotlight_tagger = 'spacy'

The tagger starts when a mode first needs it and stays running. It receives one paragraph at a time and does not receive text while you type. A paragraph is tagged again when you leave Insert mode. If the tagger fails, Bartleby reports the error once and hides the tagger modes.

Contractions. 's counts as a contraction only after the words in the s_contraction_words list, such as it, that, and there. After other words, 's is usually possessive, as in "John's hat", so it does not count.

Word lists. The lists are in the language file, tools/lang/en.json for English. They hold single words. To add or remove words for a mode, use its name as a key:

let g:bartleby_spotlight_words_add = {'Fillers': ['anyway', 'somehow']}
let g:bartleby_spotlight_words_remove = {'Adverbs': ['well']}

With a tagger, all modes except Contractions and Fillers use the tagger, so list changes affect only those two.

Consoles with 8 or 16 colors

On a text console with 8 or 16 colors, such as the Linux virtual terminal, Bartleby sets its own colors, with a black background. A terminal with more colors keeps the colors of your own theme, and Bartleby sets none.

  • Bartleby applies its colors at startup, only when you have not chosen a color scheme. Choose one in your vimrc and Bartleby leaves the colors alone. Set g:bartleby_tty_colors to 0 to turn this off.
  • :colorscheme bartleby applies the colors by hand, on any terminal.
  • The colors set the background option to dark. Vim assumes a light background on 16 colors, and its colors for it are hard to read on black.
  • Spotlight dims to dark gray. There is nothing to blend toward with so few colors, so a coefficient has no effect. If dark gray does not show on your console, set g:bartleby_spotlight_conceal_ctermfg.

Fountain

Screenplay scrives use .fountain files. They have their own filetype and syntax highlighting. Spotlight's Dialogue mode finds character cues and scene headings in them.

Palette and menu

:BartlebyCommands or <leader>b<Space> opens a searchable list of all Bartleby commands. :BartlebyMenu or <leader>bm shows the same commands in groups: Scrive, Binder, View, Document, and Project.

Session, snapshots, and search

Session - Bartleby remembers, for each scrive, the open document, the cursor position, and which Binder folders are collapsed. It also remembers the last scrive. To reopen it when Vim starts, set g:bartleby_session_auto_restore.

Snapshots - S in the Binder or :BartlebySnapshot saves a timestamped copy of a document. gS or :BartlebySnapshots lists the copies and restores one. A restore first takes a snapshot of the current text.

Search - / in the Binder or :BartlebySearch searches the scrive and puts the results in the quickfix list.

Backup and recovery - each save of the Binder keeps the version before it as project.json.bak. A project.json that cannot be read does not open, and is never saved over. :BartlebyRecover adds the documents on disk that the Binder does not list to a folder named Recovered. :BartlebyRecover <name> rebuilds the Binder of a scrive that does not open, after a confirmation. It keeps the damaged file as project.json.damaged, starts from the backup when that loads, and recovers every other document.

Auto-save

Bartleby saves changed scrive documents while you work, in the editor window and in Focus mode. Other files are not affected.

  • When you pause in Normal mode or leave Insert mode, it saves at most once every g:bartleby_autosave_interval seconds. A save that the interval skips runs when the interval ends.
  • When you leave the document or Vim loses focus, it saves at once.

It writes only changed documents. To turn it off, set g:bartleby_autosave to 0.

Dictionary and thesaurus

These need Merriam-Webster API keys. See Configuration.

<leader>bd shows the definition of the word under the cursor. <leader>bt shows its synonyms. In Visual mode, both look up the selected text on one line. :BartlebyDefine {word} and :BartlebyThesaurus {word} look up a typed word.

Key Action
j / k Move the selection
<CR> in the thesaurus Replace the word in the text, with the same capitalization. For a typed word, copy the synonym to the unnamed register
<CR> on a suggestion Look up the suggestion
r on a suggestion Replace the misspelled word in the text, with the same capitalization. For a typed word, copy the suggestion to the unnamed register
a Show antonyms or synonyms
d Show the definition of the selected word
? Show this key list
q Close

One u undoes a replacement. A misspelled word shows Merriam-Webster's suggestions.

Results are cached in ~/.bartleby/lexicon_cache.json, so a repeated lookup sends no request. The cache does not contain your keys.

Each lookup needs its own key. Without the key, its mapping and its palette and menu entries are not created, and its command reports the missing setting. Set the keys before Bartleby loads, or use the $BARTLEBY_MW_DICTIONARY_KEY and $BARTLEBY_MW_THESAURUS_KEY environment variables to keep them out of a shared vimrc.

Compile

:BartlebyCompile asks for the documents to include, a kind, a format, and settings for that kind such as font, line spacing, and cover image. It saves the answers as a named target that you can run again.

The selection pane lists the contents of Front Matter, Manuscript, and Back Matter. Only these folders go into a compile.

Kind Formats Result
Manuscript PDF Submission format through sffms: double-spaced Courier, running header, and a title page with the word count
Book PDF, HTML, EPUB, Markdown A typeset book with chapter openings, running headers, a table of contents, and an optional cover image
Screenplay PDF, HTML, FDX Standard screenplay format through screenplain

The tree sets the structure. A Chapter folder becomes a numbered chapter, and each Front Matter and Back Matter document becomes an unnumbered chapter. Other folders add no heading. In a Book PDF, front matter pages use roman numerals, and page 1 is the first page of the main text.

When a compile ends, Bartleby asks whether to open the result, and <Enter> answers yes. Markdown opens in a new tab, so no scrive window changes. Other formats open in the system viewer through Vim's :Open.

Each successful Pandoc run writes Pandoc's own log to ~/.bartleby/logs/, named for the scrive, the target, and the time. Pandoc writes no log when it fails, so on a failure Bartleby writes the error output to a .log file there instead, and asks whether to open it. <Enter> opens it in a new tab. Bartleby keeps the newest g:bartleby_compile_log_retention logs for each target.

Key in the selection pane Action
x Include or exclude the document. On a folder, all documents under it
<CR> Accept the selection and continue
? Show this key list
q Cancel

Commands

Command Description
:BartlebyOpen [name] Open a scrive by name. <Tab> completes the name. Without a name, open the last scrive
:BartlebyNewScrive {name} Create a scrive. Asks for its type
:BartlebyList List all scrives and open the selected one
:BartlebyClose[!] Close the scrive and all that is open of Bartleby: Focus, Spotlight, a Scrivening, the Binder, the Inspector, and the documents. It saves first and leaves an empty buffer. With !, throw away changes that are not saved
:BartlebyToggleBinder Show or hide the Binder
:BartlebyToggleInspector Show or hide the Inspector
:BartlebySearch Search the scrive into the quickfix list
:BartlebyFocus[!] [dim] Toggle Focus. ! turns it off
:BartlebySpotlight[!] [mode or coefficient] Toggle Spotlight. ! turns it off
:BartlebyQuill [detect, off, hard, soft, or toggle] Set the Quill wrap mode
:BartlebySnapshot Take a snapshot of the current document
:BartlebySnapshots View or restore snapshots of the current document
:BartlebyProfile Edit your author profile
:BartlebyProjectInfo Edit the profile for this scrive only
:BartlebyCompile Compile the scrive
:BartlebyEmptyTrash Delete everything in the Trash for good, after a confirmation
:BartlebyScrivenings[!] Open a Scrivening of the folder of the current document. With !, save and close the open Scrivening
:BartlebyTidyFiles Move the files of the scrive, so that the folders on disk follow the Binder
:BartlebyRecover [name] Add documents on disk that the Binder does not list to Recovered. With a name, rebuild the Binder of a scrive that does not open
:BartlebyGoals Set the session goal, the daily goal, and the tracker
:BartlebyProgress Show the writing progress and the words of each day
:BartlebyCommands Open the command palette
:BartlebyMenu Open the command menu
:BartlebyDefine [word] Define the word under the cursor or word
:BartlebyThesaurus [word] Show synonyms for the word under the cursor or word
:BartlebyLexiconClearCache Delete the lookup cache

Mappings

Mapping Action
<leader>bi Toggle the Inspector
<leader>bz Toggle Focus
<leader>bl Toggle Spotlight
<leader>bL Pick a Spotlight mode
<leader>bp Toggle Quill
<leader>b<Space> Open the command palette
<leader>bm Open the command menu
<leader>bd Define the word under the cursor or the Visual selection
<leader>bt Thesaurus for the word under the cursor or the Visual selection

<leader>bd and <leader>bt exist only when their API key is set. The Binder, Corkboard, Outliner, and other panes have their own keys, listed in their sections.

Configuration

Set these variables in your vimrc before Bartleby loads. Each has a default, so set only the ones you want to change.

General

Variable Default Description
g:bartleby_binder_root ~/Documents Scrives are created in a Bartleby/ folder here
g:bartleby_binder_show_role_labels 1 Show Chapter: and Part: prefixes in the Binder
g:bartleby_session_auto_restore 0 Reopen the last scrive when Vim starts
g:bartleby_language '' Language of your writing, such as 'en'. Empty uses Vim's own language, and a language without a language file uses English. See Localization_README.md
g:bartleby_snapshot_retention 5 Snapshots kept per document. The oldest is deleted first
g:bartleby_autosave 1 Save changed scrive documents automatically
g:bartleby_autosave_interval 30 Minimum seconds between automatic saves of a document
g:bartleby_day_starts_at 0 The hour, 0 to 23, at which a writing day starts
g:bartleby_statusline true Add the writing progress to the status line when the statusline option is empty
g:bartleby_airline_section 'y' The section of vim-airline that shows the writing progress

Focus

Variable Default Description
g:bartleby_focus_width 80 Width of the writing column
g:bartleby_focus_height '85%' Height of the writing column
g:bartleby_focus_margin_top -1 Top margin. -1 centers the column
g:bartleby_focus_margin_bottom -1 Bottom margin. -1 centers the column
g:bartleby_focus_linenr 0 Show line numbers in Focus
g:bartleby_focus_bg 'black' Color of the dimmed area
g:bartleby_focus_fullscreen 0 In the GUI, show Focus in fullscreen.2
g:bartleby_focus_guifont '' In the GUI, the font for Focus, for example 'DejaVu Sans Mono 14'. Empty keeps the current font

Spotlight

Variable Default Description
g:bartleby_tty_colors 1 Apply Bartleby's colors on a console with 8 or 16 colors, when no color scheme is set
g:bartleby_spotlight_default_coefficient 0.5 Dim strength when no mode or coefficient is given. Not used on 8 or 16 colors
g:bartleby_spotlight_conceal_guifg '' GUI color of dimmed text. Empty uses the colorscheme
g:bartleby_spotlight_conceal_ctermfg '' Terminal color of dimmed text. Also for a console with 8 or 16 colors, where Spotlight otherwise dims to dark gray
g:bartleby_spotlight_bop '^\s*$\n\zs' Pattern for the start of a paragraph
g:bartleby_spotlight_eop '^\s*$' Pattern for the end of a paragraph
g:bartleby_spotlight_paragraph_span 0 Extra paragraphs kept bright around the cursor
g:bartleby_spotlight_priority 10 Match priority of Spotlight's highlight
g:bartleby_spotlight_dialogue_pattern '' Pattern for dialogue in prose documents. Empty uses the quotes of the language: straight or curly double quotes for English
g:bartleby_spotlight_tagger '' Part-of-speech tagger: 'spacy', or a command as a list. Empty turns the tagger modes off
g:bartleby_spotlight_spacy_model '' spaCy model for 'spacy'. Empty uses the model of the language, en_core_web_sm for English
g:bartleby_spotlight_words_add {} Words to add to a mode's list, by mode name
g:bartleby_spotlight_words_remove {} Words to remove from a mode's list, by mode name

Quill

Variable Default Description
g:bartleby_quill_wrap_mode_default 'hard' Wrap mode when detection finds no clear style
g:bartleby_quill_textwidth 74 textwidth in hard-wrap mode
g:bartleby_quill_autoformat 1 Reformat paragraphs as you type
g:bartleby_quill_autoformat_config Per filetype formatoptions changes for each filetype
g:bartleby_quill_autoformat_aliases A filetype map Filetypes that share one autoformat setting
g:bartleby_quill_joinspaces 0 Two spaces after a sentence when lines are joined
g:bartleby_quill_cursorwrap 1 Move the cursor by screen line in soft-wrap mode
g:bartleby_quill_conceallevel 3 conceallevel in soft-wrap mode
g:bartleby_quill_concealcursor 'c' concealcursor in soft-wrap mode
g:bartleby_quill_soft_detect_sample 20 Lines read to detect the wrap style
g:bartleby_quill_soft_detect_threshold 130 Sensitivity of the detection
g:bartleby_quill_auto 1 Start Quill for scrive documents automatically

Compile

Variable Default Description
g:bartleby_compile_pandoc_bin 'pandoc' Pandoc program
g:bartleby_compile_screenplain_bin 'screenplain' screenplain program
g:bartleby_compile_toc 0 Add a table of contents
g:bartleby_compile_standalone 1 Pass --standalone to Pandoc
g:bartleby_compile_manuscript_font 'Courier New' Manuscript font. sffms uses Courier or not Courier
g:bartleby_compile_book_font 'Georgia' Book font
g:bartleby_compile_screenplay_font 'Courier Prime' Screenplay font
g:bartleby_compile_manuscript_double_spaced 1 Line spacing of new Manuscript targets
g:bartleby_compile_indent_paragraphs 1 Indent Book paragraphs instead of spacing them
g:bartleby_compile_book_chapter_style 'numeral' Book chapter numbers: numeral or spelled
g:bartleby_compile_book_part_style 'numeral' Book part numbers: numeral or spelled
g:bartleby_compile_extra_args [] More arguments for every Pandoc run
g:bartleby_compile_log_retention 10 Compile logs kept per target. 0 keeps all
g:bartleby_compile_lang '' Language code for Pandoc, such as 'en-GB'. Empty uses the code of the language, en-US for English
g:bartleby_compile_papersize '' Paper size of PDF output, 'letter' or 'a4'. Empty uses the paper size of the language, letter for English

Dictionary and thesaurus

Variable Default Description
g:bartleby_dictionary_api_key '' Collegiate Dictionary key. Else $BARTLEBY_MW_DICTIONARY_KEY
g:bartleby_thesaurus_api_key '' Collegiate Thesaurus key. Else $BARTLEBY_MW_THESAURUS_KEY
g:bartleby_dictionary_reference '' Dictionary reference. Empty uses the reference of the language, collegiate for English
g:bartleby_thesaurus_reference '' Thesaurus reference. Empty uses the reference of the language, thesaurus for English
g:bartleby_lexicon_cache_max_entries 1000 Results kept in the disk cache. 0 turns the disk cache off
g:bartleby_lexicon_timeout 10 Seconds to wait for Merriam-Webster
g:bartleby_lexicon_base_url 'https://www.dictionaryapi.com/api/v3/references' API address. Change it only for a proxy or a test server

Logging

Bartleby shows its messages through Logger, so Logger's options apply, with bartleby as the plugin name. To also write Bartleby's messages to a log file, one file per Vim session in ~/.Logger/:

let g:logger_bartleby_log_file = v:true

:LoggerMessages shows the recent messages of all plugins. See the Logger README for the other options, such as the message level and the number of log files to keep.

Known Issues

Word counts in a Scrivening - the word count of Vim, g CTRL-G, and that of vim-airline count the whole buffer, so in a Scrivening they count its title lines too. The counts of Bartleby, in the status line, the Inspector, the Outliner, and the goals, leave them out.

Ctrl-S on the Linux console - the Linux console, and terminals such as vt100 and vt220, use Ctrl-S and Ctrl-Q for flow control. Vim leaves flow control on for them, so Ctrl-S stops the screen instead of reaching Bartleby. To save in a popup, press <Tab> to its Save or Submit button and press <CR>. If the screen stops after Ctrl-S, press Ctrl-Q to start it again.

To use Ctrl-S on the console, turn flow control off before you start Vim. In bash, add this line to ~/.bashrc:

[[ $- == *i* ]] && stty -ixon

In zsh, add this line to ~/.zshrc:

unsetopt flow_control

A command such as :!stty -ixon in Vim has no effect, because Vim sets the terminal again after the command.

License

GNU GPL 3.0. See LICENSE.

Footnotes

  1. The binder tree uses a Vim9 class with a field that is a list of its own class. Vim 9.1 cannot load it and reports E1010: Type not recognized. Some Linux distributions still package Vim 9.1. Run vim --version to check. Bartleby does not support Vim 8 or Neovim. ↩

  2. MacVim uses its 'fullscreen' option. The GTK and Windows GUIs use the s flag in 'guioptions'. Other GUIs have no fullscreen mode. When Focus ends, also by :q in the Focus window, Bartleby restores the previous font and window state. ↩

About

A structured writing environment for Vim9.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages