forked from bullets-vim/bullets.vim
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Dorian Karter
committed
Feb 12, 2016
0 parents
commit 46ea103
Showing
6 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |