Skip to content

Commit 6d262f9

Browse files
authored
Merge pull request #51 from dkarter/remove-text-objects-and-selections
Remove text objects for bullets
2 parents fd9ce9d + abeff15 commit 6d262f9

File tree

3 files changed

+0
-60
lines changed

3 files changed

+0
-60
lines changed

README.md

-4
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,11 @@ Capybara integration testing. ❤️
8787
- [x] check if plugin initialized and don't load if it did
8888
- [x] allow <C-cr> for return without creating a bullet (only possible in GuiVim
8989
unfortunately)
90-
- [x] create a text object for bullets
91-
- [x] create a text object for GFM-style checkboxes
9290
- [x] check if user is at EOL before appending auto-bullet - they may just want to
9391
- [x] attempt to keep the same total bullet width even as number width varies (right padding)
9492
- [x] detect lists that have multiline bullets (should have no empty lines between
9593
lines).
9694
- [x] add alphabetic list
97-
- [ ] allow user to define a global var with custom bullets
98-
- [ ] create a text object for bullet list indentation
9995
- [ ] support for intelligent alphanumeric indented bullets e.g. 1. \t a. \t 1.
10096

10197
---

doc/bullets.txt

-23
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@ B) or this style of alphabetic
3838
It also provides support for wrapped text in a bullet, allowing you to use the
3939
`textwidth` feature in Vim seamlessly.
4040

41-
Future versions aim to support the following:
42-
43-
]] User defined bullets
44-
4541

4642
GENERAL COMMANDS *bullets-commands*
4743

@@ -230,24 +226,5 @@ VISUAL MODE
230226
*bullets-v_gN*
231227
gN Renumbers selected bullet list items.
232228

233-
OPERATOR-PENDING MODE
234-
235-
*bullets-ab*
236-
ab "a bullet block", select a bullet block, including the bullet
237-
leader.
238-
239-
*bullets-ib*
240-
ib "inner bullet block", select a bullet block, excluding the bullet
241-
leader.
242-
243-
*bullets-ac*
244-
ac "a checkbox block", select a checkbox block, including the '[' and
245-
']'.
246-
247-
*bullets-ic*
248-
ic "inner checkbox block", select a checkbox block, excluding the '['
249-
and ']'.
250-
251-
252229

253230
vim:tw=78:et:ft=help:norl:

plugin/bullets.vim

-33
Original file line numberDiff line numberDiff line change
@@ -573,28 +573,6 @@ endfun
573573
command! -range=% RenumberSelection call <SID>renumber_selection()
574574
" --------------------------------------------------------- }}}
575575

576-
" Bullets ------------------------------------------------- {{{
577-
fun! s:find_bullet_position(lnum)
578-
let line_text = getline(a:lnum)
579-
return matchend(line_text, '\v^\s*(\*|-)')
580-
endfun
581-
582-
fun! s:select_bullet(inner)
583-
let lnum = getpos('.')[1]
584-
let bullet_col = s:find_bullet_position(lnum)
585-
586-
if bullet_col
587-
" decide if we need to select with the bullet or without
588-
let offset = a:inner? 2 : 0
589-
call setpos('.', [0, lnum, bullet_col + offset])
590-
normal! vg_
591-
endif
592-
endfun
593-
594-
command! SelectBulletText call <SID>select_bullet(1)
595-
command! SelectBullet call <SID>select_bullet(0)
596-
" Bullets ------------------------------------------------- }}}
597-
598576
" Keyboard mappings --------------------------------------- {{{
599577
fun! s:add_local_mapping(mapping_type, mapping, action)
600578
let l:file_types = join(g:bullets_enabled_file_types, ',')
@@ -635,17 +613,6 @@ augroup TextBulletsMappings
635613

636614
" Toggle checkbox
637615
call s:add_local_mapping('nnoremap', '<leader>x', ':ToggleCheckbox<cr>')
638-
639-
" Text Objects -------------------------------------------- {{{
640-
" inner bullet (just the text)
641-
call s:add_local_mapping('onoremap', 'ib', ':SelectBulletText<cr>')
642-
" a bullet including the bullet markup
643-
call s:add_local_mapping('onoremap', 'ab', ':SelectBullet<cr>')
644-
" inside a checkbox
645-
call s:add_local_mapping('onoremap', 'ic', ':SelectCheckboxInside<cr>')
646-
" a checkbox
647-
call s:add_local_mapping('onoremap', 'ac', ':SelectCheckbox<cr>')
648-
" Text Objects -------------------------------------------- }}}
649616
end
650617
augroup END
651618
" --------------------------------------------------------- }}}

0 commit comments

Comments
 (0)