• Stars
    star
    431
  • Rank 100,311 (Top 2 %)
  • Language
    Vim Script
  • License
    Other
  • Created over 8 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

πŸ”« Bullets.vim is a Vim/NeoVim plugin for automated bullet lists.

Bullets.vim

Build Status

All Contributors

ℹ️ Looking for help/maintainers #126

Description

Bullets.vim is a Vim plugin for automated bullet lists.

Simple bullets:

demo

Wrapped text bullets: wrapped bullets

Renumbering lines: renumber demo

Installation

With Vim 8.1+ native package manager:

Clone into

.vim/pack/plugins/start

Make sure to include packloadall in your vimrc.

With VimPlug:

Plug 'dkarter/bullets.vim'

Then source your bundle file and run :PlugInstall.

Usage

In markdown or a text file start a bulleted list using - or *. Press return to go to the next line, a new list item will be created.

Configuration

Filetypes

You can choose which file types this plugin will work on:

" Bullets.vim
let g:bullets_enabled_file_types = [
    \ 'markdown',
    \ 'text',
    \ 'gitcommit',
    \ 'scratch'
    \]

You can disable this plugin for empty buffers (no filetype):

let g:bullets_enable_in_empty_buffers = 0 " default = 1

Enable/disable default key mappings:

let g:bullets_set_mappings = 0 " default = 1

Add a leader key before default mappings:

let g:bullets_mapping_leader = '<M-b>' " default = ''

Customize key mappings:

let g:bullets_set_mappings = 0 " disable adding default key mappings, default = 1

" default = []
" N.B. You can set these mappings as-is without using this g:bullets_custom_mappings option but it
" will apply in this case for all file types while when using g:bullets_custom_mappings it would
" take into account file types filter set in g:bullets_enabled_file_types, and also
" g:bullets_enable_in_empty_buffers option.
let g:bullets_custom_mappings = [
  \ ['imap', '<cr>', '<Plug>(bullets-newline)'],
  \ ['inoremap', '<C-cr>', '<cr>'],
  \
  \ ['nmap', 'o', '<Plug>(bullets-newline)'],
  \
  \ ['vmap', 'gN', '<Plug>(bullets-renumber)'],
  \ ['nmap', 'gN', '<Plug>(bullets-renumber)'],
  \
  \ ['nmap', '<leader>x', '<Plug>(bullets-toggle-checkbox)'],
  \
  \ ['imap', '<C-t>', '<Plug>(bullets-demote)'],
  \ ['nmap', '>>', '<Plug>(bullets-demote)'],
  \ ['vmap', '>', '<Plug>(bullets-demote)'],
  \ ['imap', '<C-d>', '<Plug>(bullets-promote)'],
  \ ['nmap', '<<', '<Plug>(bullets-promote)'],
  \ ['vmap', '<', '<Plug>(bullets-promote)'],
  \ ]

Enable/disable deleting the last empty bullet when hitting <cr> (insert mode) or o (normal mode):

let g:bullets_delete_last_bullet_if_empty = 0 " default = 1

Line spacing between bullets (1 = no blank lines, 2 = one blank line, etc.):

let g:bullets_line_spacing = 2 " default = 1

Don't/add extra padding between the bullet and text when bullets are multiple characters long:

let g:bullets_pad_right = 1 " default = 1
" I. text
" II. text
" III. text
" IV.  text
" V.   text
"     ^ extra spaces to align the text with the longest bullet

let g:bullets_pad_right = 0
" I. text
" II. text
" III. text
" IV. text
"    ^ no extra space between bullet and text

Indent new bullets when the previous bullet ends with a colon:

let g:bullets_auto_indent_after_colon = 1 " default = 1
" a. text
" b. text:
"   i. text

Maximum number of alphabetic characters to use for bullets:

let g:bullets_max_alpha_characters = 2 " default = 2
" ...
" y. text
" z. text
" aa. text
" ab. text

let g:bullets_max_alpha_characters = 1
" ...
" y. text
" z. text
" text

Nested outline bullet levels:

let g:bullets_outline_levels = ['ROM', 'ABC', 'num', 'abc', 'rom', 'std-', 'std*', 'std+'] " default
" Ordered list containing the heirarchical bullet levels, starting from the outer most level.
" Available bullet level options (cannot use the same marker more than once)
" ROM/rom = upper/lower case Roman numerals (e.g., I, II, III, IV)
" ABC/abc = upper/lower case alphabetic characters (e.g., A, B, C)
" std[-/*/+] = standard bullets using a hyphen (-), asterisk (*), or plus (+) as the marker.
" chk = checkbox (- [ ])

let g:bullets_outline_levels = ['num', 'abc', 'std-']
" Example [keys pressed to get this bullet]:
" 1. first parent
"   a. child bullet [ <cr><C-t> ]
"     - unordered bullet [ <cr><C-t> ]
"   b. second child bullet [ <cr><C-d> ]
" 2. second parent [ <cr><C-d> ]

Enable/disable automatically renumbering the current ordered bullet list when changing the indent level of bullets or inserting a new bullet:

let g:bullets_renumber_on_change = 1 " default = 1
" Example 1:
" 1. first existing bullet
"   a. second existing bullet [ hit <C-t> ]
" 2. third existing bullet [ this got renumbered 3 -> 2 when bullet 2 got demoted ]
"
" Example 2:
" 1. first existing bullet
" 2. second existing bullet [ use <cr>/o to add a new bullet below this ]
" 3. new bullet
" 4. third existing bullet [ this got renumbered 3 -> 2 when bullet 2 got demoted ]

let g:bullets_renumber_on_change = 0
" Example:
" 1. first existing bullet
"   a. second existing bullet [ hit <C-t> ]
" 3. third existing bullet [ no renumbering so this bullet remained `3` ]
"
" Example 2:
" 1. first existing bullet
" 2. second existing bullet [ use <cr>/o to add a new bullet below this ]
" 3. new bullet
" 3. third existing bullet [ no renumbering so this bullet remained `3` ]

Enable/disable toggling parent and child checkboxes to indicate "completion" of child checkboxes:

let g:bullets_nested_checkboxes = 1 " default = 1
" Example:
" - [ ] first bullet
"   - [ ] child bullet  [ type <leader>x ]
"     - [ ] sub-child
"   - [ ] child bullet
"
" Result:
" - [o] first bullet   [ <- indicates partial completion of sub-tasks ]
"   - [X] child bullet
"     - [X] sub-child  [ <- children get checked when parents get checked ]
"   - [ ] child bullet

Define the checkbox markers to use to indicate unchecked, checked, and "partially" checked. When only two marker characters are defined, the use of partial completion markers will be disabled. If more than two markers are defined, each character between the first and last characters will be used to indicate a percentage of the child checkboxes that are checked. Each marker corresponds to 1/n, where n is the number of partial completion markers. By default, there are three partial completion markers, ., o, and O, corresponding to 33%, 66%, and up to but less than 100%, respectively. Note that unchecked ([ ]) and checked ([x] or [X]) statuses using the default markers are always valid, even if you set custom markers for unchecked and checked.

let g:bullets_checkbox_markers = ' .oOX'
" Example:
" - [o] parent bullet  [ <- `o` indicates 66% - 99% of children are checked ]
"   - [ ] child bullet
"   - [.] child bullet [ <- partial completions don't count as complete ]
"     - [ ] sub-child bullet [ <- 1/4 of children checked so parent is `.` ]
"     - [ ] sub-child bullet
"     - [ ] sub-child bullet
"     - [X] sub-child bullet
"   - [X] child bullet
"   - [X] child bullet
"
" You can use fancy markers:
" let g:bullets_checkbox_markers = 'βœ—β—‹β—β—βœ“'
" - [βœ—] unchecked
" - [β—‹] partial
"   - [βœ“] checked
"   - [βœ—] unchecked
"   - [βœ—] unchecked
"   - [βœ—] unchecked

Define whether toggling partially complete checkboxes sets the checkbox to checked or unchecked:

" Example 1:
let g:bullets_checkbox_partials_toggle = 1 " default = 1
" - [o] partially checked  [ type <leader>x ]
"   - [x] sub bullet
"   - [ ] sub bullet
"
" Result:
" - [x] checked
"   - [x] sub bullet
"   - [x] sub bullet
"
" Example 2:
let g:bullets_checkbox_partials_toggle = 0
" - [o] partially checked  [ type <leader>x ]
"   - [x] sub bullet
"   - [ ] sub bullet
"
" Result:
" - [ ] checked
"   - [ ] sub bullet
"   - [ ] sub bullet

Mappings

  • Insert new bullet in INSERT mode: <cr> (Return key)
  • Same as in case you want to unmap in INSERT mode (compatibility depends on your terminal emulator): <C-cr>
  • Insert new bullet in NORMAL mode: o
  • Renumber current visual selection: gN
  • Renumber entire bullet list containing the cursor in NORMAL mode: gN
  • Toggle a checkbox in NORMAL mode: <leader>x
  • Demote a bullet (indent it, decrease bullet level, and make it a child of the previous bullet):
    • NORMAL mode: >>
    • INSERT mode: <C-t>
    • VISUAL mode: >
  • Promote a bullet (unindent it and increase the bullet level):
    • NORMAL mode: <<
    • INSERT mode: <C-d>
    • VISUAL mode: >

Disable default mappings:

let g:bullets_set_mappings = 0

Add a leader key before default mappings:

let g:bullets_mapping_leader = '<M-b>'
" Set <M-b> to the leader before all default mappings:
" Example: renumbering becomes `<M-b>gN` instead of just `gN`

Just add above to your .vimrc

Documentation

:h bullets

Testing

The test suite is written using vimrunner. It is known to run on macOS with MacVim installed, and on travis. Your vim must have +clientserver and either have its own GUI or in a virtual X11 window.

On your mac run:

bundle install
bundle exec rspec

On linux:

bundle install
xvfb-run bundle exec rspec

You should see a Vim window open which will run each test, same general idea as Capybara integration testing. ❀️

TODO

  • eliminate trailing bullet on previous line if user pressed twice
  • allow indenting while in insert mode (C-l: indent right, C-h: indent left)
  • scope the keybindings and functions to markdown and perhaps text
  • allow GFM-style checkbox auto bullet
  • prefix shortcuts and allow disabling them
  • add numbered list
  • reset numbers (user selects numbered bullets 3-5 and copies to middle of document, then reselects and resets them to 1-3)
  • check if plugin initialized and don't load if it did
  • allow for return without creating a bullet (only possible in GuiVim unfortunately)
  • check if user is at EOL before appending auto-bullet - they may just want to
  • attempt to keep the same total bullet width even as number width varies (right padding)
  • detect lists that have multiline bullets (should have no empty lines between lines).
  • add alphabetic list
  • support for intelligent alphanumeric indented bullets e.g. 1. \t a. \t 1.
  • change nested outline levels in visual mode
  • support renumbering of alphabetical, roman numerals, and nested lists
  • update documentation for nested bullets
  • support nested bullets with child and partial completion
  • support for nested numerical bullets, e.g., 1. -> 1.1 -> 1.1.1, 1.1.2
  • add option to turn non-bullet lines into new bullets with <C-t>/>>/>

About

Hashrocket logo

Bullets.vim is kindly supported by Hashrocket, a multidisciplinary design and development consultancy. If you'd like to work with us or join our team, don't hesitate to get in touch.

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Dorian Karter

πŸ’» ⚠️ πŸ“– 🚧

Cormac Relf

πŸ’» πŸ›

Keith Miyake

πŸ’» πŸ“– πŸ€” 🚧

Chayoung You

πŸ’» πŸ“–

Adriaan Zonnenberg

πŸ’»

eater

πŸ’»

hut

πŸ’» πŸ“–

mykoza

πŸ’» πŸ€”

noodlor

πŸ’»

Harshad Srinivasan

πŸ’» πŸ›

Erick A. ChacΓ³n MontalvΓ‘n

πŸ€”

Sam Griesemer

πŸ’» πŸ›

Charles Pence

πŸ’»

Marko Stojanovic

πŸ“–

Clark

πŸ“–

Wenzel

πŸ’»

This project follows the all-contributors specification. Contributions of any kind welcome!

More Repositories

1

dotfiles

✨ My dev setup
Lua
102
star
2

king_of_tokyo

πŸ‘‘ King of Tokyo Multiplayer Board Game using Phoenix LiveView
Elixir
41
star
3

Bang

β—οΈπŸ¦† Autocomplete DuckDuckGo Bangs with Alfred
37
star
4

alfred-switch-audio

πŸ”Š Switch Audio Output/Input with Alfred
32
star
5

deploy-elixir-example

βš™οΈ Automatic server provisioning and configuration for Elixir and Phoenix Deployment
Elixir
18
star
6

capybara_error_intel

πŸ› Ruby gem for heuristic error messages in Capybara based Page Objects
Ruby
16
star
7

NetflixScraperAPI

Netflix Scraper API to allow autocomplete for movie titles
JavaScript
14
star
8

fretmaster-elm

🎸 Guitar Learning Game (PWA) written in Elm
Elm
13
star
9

AlfredNetflixSearchWorkflow

An Alfred v2 workflow for searching Netflix with autocomplete
Ruby
13
star
10

nerves_remote_led

πŸ’‘ Example for using websockets to control Nerves devices
JavaScript
12
star
11

alfred_hex_docs

πŸ“– Alfred Workflow for quickly opening Elixir Hex Docs
Elixir
11
star
12

CoronaTime

🦠 Corona Time: An Alfred Workflow For Tracking COVID-19
Ruby
9
star
13

game_of_life

❇️ Game of Life in Phoenix LiveView
Elixir
8
star
14

Nietzche-Ipsum-TextExpander

πŸ“– Nietzche Ipsum for TextExpander
7
star
15

PasteurClient

OS X menu bar application for sharing system clipboard between macs, securely, via WebSockets
Swift
6
star
16

alfred-magic-link

Magically insert links into markdown using Alfred
Ruby
6
star
17

uule_grabber

🌎 Generates UULE codes for Google Search to allow localized searches.
Elixir
5
star
18

cookie_monster

πŸͺ HTTP Cookie Encoder and Decoder in pure Elixir with zero runtime dependencies.
Elixir
5
star
19

retrovertigo

le blog
TypeScript
5
star
20

weekly_commits

πŸ“… List your commits on a project for every day of a specified week
Ruby
4
star
21

FailSpell

Speed up your TDD workflow with FailSpell the RSpec failure re-runner
Ruby
4
star
22

ukey

πŸ” Automatically lock macOS when a USB device is removed
Ruby
4
star
23

meetup_giveaway

🎲 A quick Elixir script for fetching a random attendee name from meetup.com
Elixir
3
star
24

neptune

β˜” Elixir Cluster on K8s
Elixir
3
star
25

SecureInputPaste

🎩 Alfred Workflow: Allows pasting text into macOS secure inputs
3
star
26

ReactReduxTesting

JavaScript
2
star
27

tab_search

🎸 Tab Search Alfred Workflow
2
star
28

klick

Ⓜ️ Metronome Built with Elm and Web Audio API
Elm
2
star
29

ultra_sonic_pi

πŸ₯§ Collaborative code editor for SonicPi. Written in Phoenix with Channels.
JavaScript
2
star
30

RiffBox

🎸 Arduino Based Guitar Riff Generator
C++
2
star
31

alfred-workflows

2
star
32

downgest

Yet another RSS reader. This one converts content to markdown. Elixir, Phoenix and Elm.
HTML
2
star
33

socks

🧦 Example of relaying private messages on Phoenix Channels for only specific users.
Elixir
1
star
34

distributed_nodes

Elixir
1
star
35

chainz

πŸ’¬ Text generation using a basic Markov Chain in Elixir
Elixir
1
star
36

snagg

WIP - Shared resource management
Elixir
1
star
37

tpi-cluster-ansible-playbook

βš“οΈ Turing Pi 2 Cluster Management Playbooks
1
star
38

front_line_project

πŸ‘ [WIP] Home Security System (Nerves + Raspberry Pi)
Elixir
1
star
39

open_sesame_umbrella

Garage Door Opener built for the Raspberry Pi Zero W using Elixir, Nerves and Phoenix
Elixir
1
star
40

caddy-digitalocean-docker

🐳 Docker image with Caddy compiled from source with DigitalOcean DNS ACME verification
Dockerfile
1
star
41

7_concurrency_models

Working through examples from the "7 Concurrency Models in 7 Weeks" book.
Java
1
star
42

stl_parser

πŸ‘“ STL File Parser in Elixir using :leex and :yecc
Erlang
1
star
43

backpack

πŸŽ’ Minimal personal Vim configuration for pairing situations, neatly packaged as a Vim plugin
Vim Script
1
star
44

hangman_app

πŸ•Ή Hangman Game CLI/WebApp Written in Elixir
JavaScript
1
star
45

blockchain.rb

This is a POC blockchain data structure written in Ruby.
Ruby
1
star
46

PossibleEmail

JavaScript
1
star
47

3letter_domain

Finds 3 letter .io domains available for purchase
Ruby
1
star
48

sn-vim

πŸ“ A Vim Markdown Editor component for the E2E encrypted notes app, StandardNotes
SCSS
1
star
49

absinthe_subscription

πŸš‡ An example of creating GraphQL Subscriptions over WebSockets using Absinthe and Phoenix Channels
Elixir
1
star
50

SayTest

Bash script for testing all `say` voices on OS X
Shell
1
star
51

portfolio-react

JavaScript
1
star
52

AngularJS-ToDo

This is a repository for my experiments with Yeoman, Grunt, Bower, and AngularJS
JavaScript
1
star
53

PasteurServer

A websocket server for Pasteur
Ruby
1
star
54

AssignmentHub

Rails application for managing classes and assignment schedules. It is provided as open source as-is with no guarantee. It was developed for a class in Illinois Institute of Technology and won first place in the finals.
JavaScript
1
star
55

atmo-watch

🌑️ Nerves powered local weather station
Elixir
1
star
56

streamdeck-zoom

HTML
1
star