Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 22 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,36 @@ name: Test

on:
push:
branches: [ master ]
branches: [master]
pull_request:
branches: [ master ]
branches: [master]
workflow_dispatch:

jobs:
test:

fmt:
name: Check Formatting
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v6.0.2
- name: Checkout Code
uses: actions/checkout@v6.0.2

- name: Install system dependencies
run: sudo apt install vim-gtk3 xvfb
- name: Set up tools via mise
uses: jdx/mise-action@v4.0.1

- name: Set up Ruby via mise
uses: jdx/mise-action@v4.0.1
- name: Check formatting
run: mise run fmt:check

test:
name: Run Tests
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v6.0.2

- name: Install gems
run: bundle install
- name: Set up tools via mise
uses: jdx/mise-action@v4.0.1

- name: Run headless tests
run: xvfb-run -a bundle exec rspec
- name: Run Lua tests
run: mise run test
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
doc/tags
vendor/
spec/examples.txt
doc/tags
2 changes: 0 additions & 2 deletions .rspec

This file was deleted.

5 changes: 0 additions & 5 deletions .rubocop.yml

This file was deleted.

52 changes: 0 additions & 52 deletions .travis.yml

This file was deleted.

10 changes: 0 additions & 10 deletions Gemfile

This file was deleted.

46 changes: 0 additions & 46 deletions Gemfile.lock

This file was deleted.

61 changes: 26 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
![Bullets.vim](img/bullets-vim-logo.svg)

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->

[![All Contributors](https://img.shields.io/badge/all_contributors-16-orange.svg?style=flat-square)](#contributors-)

<!-- ALL-CONTRIBUTORS-BADGE:END -->

> :information_source: Looking for help/maintainers https://github.com/dkarter/bullets.vim/issues/126
Expand All @@ -23,6 +25,7 @@ Renumbering lines:
# Installation

### With Vim 8.1+ native package manager:

Clone into

`.vim/pack/plugins/start`
Expand All @@ -35,8 +38,7 @@ Make sure to include `packloadall` in your `vimrc`.
Plug 'bullets-vim/bullets.vim'
```

Then source your bundle file and run `:PlugInstall`.

Then source your Vim config and run `:PlugInstall`.

# Usage

Expand Down Expand Up @@ -306,20 +308,20 @@ let g:bullets_checkbox_partials_toggle = 0

# Mappings

* Insert new bullet in INSERT mode: `<cr>` (Return key)
* Same as <cr> in case you want to unmap <cr> 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: `<`
- Insert new bullet in INSERT mode: `<cr>` (Return key)
- Same as <cr> in case you want to unmap <cr> 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:

Expand All @@ -345,34 +347,25 @@ Just add above to your .vimrc

# 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.
The test suite is written in Lua and runs under Neovim with [Plenary](https://github.com/nvim-lua/plenary.nvim).

## Local Development Setup

This project uses [mise](https://mise.jdx.dev) to manage the Ruby version. Install it, then run:
This project uses [mise](https://mise.jdx.dev) to install Neovim. Install mise, then run:

```sh
mise install
bundle install
```

## Running Tests

On your mac run:

```sh
bundle exec rspec
```

On linux:
Run the full test suite with:

```sh
bundle install
xvfb-run bundle exec rspec
mise run test
```

You should see a Vim window open which will run each test, same general idea as
Capybara integration testing. ❤️
The test task runs Neovim headlessly and downloads Plenary to `/tmp/plenary.nvim` on first run.

# TODO

Expand All @@ -385,11 +378,11 @@ Capybara integration testing. ❤️
- [x] reset numbers (user selects numbered bullets 3-5 and copies to middle of document, then reselects and resets them to 1-3)
- [x] check if plugin initialized and don't load if it did
- [x] allow <C-cr> for return without creating a bullet (only possible in GuiVim
unfortunately)
unfortunately)
- [x] check if user is at EOL before appending auto-bullet - they may just want to
- [x] attempt to keep the same total bullet width even as number width varies (right padding)
- [x] detect lists that have multiline bullets (should have no empty lines between
lines).
lines).
- [x] add alphabetic list
- [x] support for intelligent alphanumeric indented bullets e.g. 1. \t a. \t 1.
- [x] change nested outline levels in visual mode
Expand All @@ -406,9 +399,7 @@ Capybara integration testing. ❤️
[![Hashrocket logo](https://hashrocket.com/hashrocket_logo.svg)](https://hashrocket.com)

Bullets.vim is kindly supported by [Hashrocket, a multidisciplinary design and
development consultancy](https://hashrocket.com). If you'd like to [work with
us](https://hashrocket.com/contact-us/hire-us) or [join our
team](https://hashrocket.com/contact-us/jobs), don't hesitate to get in touch.
development consultancy](https://hashrocket.com). If you'd like to [work with us](https://hashrocket.com/contact-us/hire-us) or [join our team](https://hashrocket.com/contact-us/jobs), don't hesitate to get in touch.

## Contributors ✨

Expand Down
7 changes: 0 additions & 7 deletions Rakefile

This file was deleted.

3 changes: 3 additions & 0 deletions committed.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
subject_capitalized = false
style = "conventional"
subject_length = 72
28 changes: 28 additions & 0 deletions dprint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"json": {
},
"markdown": {
},
"toml": {
},
"yaml": {
},
"excludes": [
"**/*-lock.json"
],
"includes": [
"**/*.lua",
"**/*.yml",
"**/*.yaml",
"**/*.md",
"**/*.json",
"**/*.toml"
],
"plugins": [
"https://plugins.dprint.dev/RubixDev/stylua-v0.2.1.wasm",
"https://plugins.dprint.dev/json-0.21.3.wasm",
"https://plugins.dprint.dev/markdown-0.22.1.wasm",
"https://plugins.dprint.dev/toml-0.7.0.wasm",
"https://plugins.dprint.dev/g-plane/pretty_yaml-v0.6.0.wasm"
]
}
18 changes: 18 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/evilmartians/lefthook/master/schema.json

output:
- summary

commit-msg:
jobs:
- name: conventional commits
run: mise exec -- committed --commit-file {1}

pre-commit:
parallel: true
jobs:
- name: check formatting
run: mise run fmt:check

- name: check secrets
run: mise exec -- gitleaks git --staged --pre-commit --no-banner --redact
34 changes: 33 additions & 1 deletion mise.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,34 @@
[tools]
ruby = "4"
"github:crate-ci/committed" = "latest"
dprint = "latest"
gitleaks = "latest"
lefthook = "latest"
neovim = "latest"

[hooks]
postinstall = "lefthook install"

[tasks.fmt]
description = "Format code with dprint"
run = "dprint fmt"

[tasks."fmt:check"]
description = "Check code formatting with dprint"
run = "dprint check"

[tasks.test]
description = "Run Neovim test suite via plenary"
run = """
PLENARY_PATH=/tmp/plenary.nvim
if [ ! -d "$PLENARY_PATH" ]; then
git clone --depth=1 https://github.com/nvim-lua/plenary.nvim "$PLENARY_PATH"
fi
status=0
for spec in test/*_spec.lua; do
nvim --headless \
-c "set rtp+=.,${PLENARY_PATH} | runtime plugin/plenary.vim | runtime plugin/bullets.vim" \
--noplugin \
-c "lua require('plenary.busted').run('${spec}')" || status=1
done
exit $status
"""
Loading