Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
Dorian Karter committed Feb 12, 2016
0 parents commit 46ea103
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- Fork the project
- Create feature branch
- Make your feature addition or bug fix
- Submit a pull request
Empty file added LICENSE.md
Empty file.
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Description

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

# Installation

With VimPlug:

```vim
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.


# TODO

- [ ] eliminate trailing bullet on previous line if user pressed <cr> twice
- [x] allow indenting while in insert mode
- [ ] scope the keybindings and functions to markdown and perhaps text
- [ ] allow checkbox auto bullet
- [ ] prefix shortcuts and allow disabling them
- [ ] add numbered list
- [ ] add alphabetic list
- [ ] allow user to define a global var with custom bullets
- [ ] allow <C-cr> for return without creating a bullet
- [ ] detect lists that have multiline bullets (should have no empty lines between
lines). (like this list 😆)




Empty file added doc/bullets.txt
Empty file.
Binary file added plugin/.bullets.vim.un~
Binary file not shown.
25 changes: 25 additions & 0 deletions plugin/bullets.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
" Vim plugin for automated bulleted lists
" Last Change: Friday Feb 12, 2016
" Maintainer: Dorian Karter
" License: MIT
" FileTypes: *.markdown, *.md, *.txt

fun! bullets#MarkdownAutoList()
let curr_line_num = getpos(".")[1]
let curr_line = getline(curr_line_num)
let matches = matchlist(curr_line, '\v^\s*(-|*) ')
if !empty(matches)
call append(curr_line_num, [matches[0]])
normal! j$
:startinsert!
else
call append(curr_line_num, [""])
normal! j$
:startinsert
endif
endfun

inoremap <cr> <esc>:call bullets#MarkdownAutoList()<cr>
nnoremap o <esc>:call bullets#MarkdownAutoList()<cr>
inoremap <C-tab> <esc>>>A
inoremap <C-S-tab> <esc><<A

0 comments on commit 46ea103

Please sign in to comment.