Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove text objects for bullets #51

Merged
merged 1 commit into from
Feb 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,11 @@ Capybara integration testing. ❤️
- [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)
- [x] create a text object for bullets
- [x] create a text object for GFM-style checkboxes
- [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).
- [x] add alphabetic list
- [ ] allow user to define a global var with custom bullets
- [ ] create a text object for bullet list indentation
- [ ] support for intelligent alphanumeric indented bullets e.g. 1. \t a. \t 1.

---
Expand Down
23 changes: 0 additions & 23 deletions doc/bullets.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ B) or this style of alphabetic
It also provides support for wrapped text in a bullet, allowing you to use the
`textwidth` feature in Vim seamlessly.

Future versions aim to support the following:

]] User defined bullets


GENERAL COMMANDS *bullets-commands*

Expand Down Expand Up @@ -230,24 +226,5 @@ VISUAL MODE
*bullets-v_gN*
gN Renumbers selected bullet list items.

OPERATOR-PENDING MODE

*bullets-ab*
ab "a bullet block", select a bullet block, including the bullet
leader.

*bullets-ib*
ib "inner bullet block", select a bullet block, excluding the bullet
leader.

*bullets-ac*
ac "a checkbox block", select a checkbox block, including the '[' and
']'.

*bullets-ic*
ic "inner checkbox block", select a checkbox block, excluding the '['
and ']'.



vim:tw=78:et:ft=help:norl:
33 changes: 0 additions & 33 deletions plugin/bullets.vim
Original file line number Diff line number Diff line change
Expand Up @@ -573,28 +573,6 @@ endfun
command! -range=% RenumberSelection call <SID>renumber_selection()
" --------------------------------------------------------- }}}

" Bullets ------------------------------------------------- {{{
fun! s:find_bullet_position(lnum)
let line_text = getline(a:lnum)
return matchend(line_text, '\v^\s*(\*|-)')
endfun

fun! s:select_bullet(inner)
let lnum = getpos('.')[1]
let bullet_col = s:find_bullet_position(lnum)

if bullet_col
" decide if we need to select with the bullet or without
let offset = a:inner? 2 : 0
call setpos('.', [0, lnum, bullet_col + offset])
normal! vg_
endif
endfun

command! SelectBulletText call <SID>select_bullet(1)
command! SelectBullet call <SID>select_bullet(0)
" Bullets ------------------------------------------------- }}}

" Keyboard mappings --------------------------------------- {{{
fun! s:add_local_mapping(mapping_type, mapping, action)
let l:file_types = join(g:bullets_enabled_file_types, ',')
Expand Down Expand Up @@ -635,17 +613,6 @@ augroup TextBulletsMappings

" Toggle checkbox
call s:add_local_mapping('nnoremap', '<leader>x', ':ToggleCheckbox<cr>')

" Text Objects -------------------------------------------- {{{
" inner bullet (just the text)
call s:add_local_mapping('onoremap', 'ib', ':SelectBulletText<cr>')
" a bullet including the bullet markup
call s:add_local_mapping('onoremap', 'ab', ':SelectBullet<cr>')
" inside a checkbox
call s:add_local_mapping('onoremap', 'ic', ':SelectCheckboxInside<cr>')
" a checkbox
call s:add_local_mapping('onoremap', 'ac', ':SelectCheckbox<cr>')
" Text Objects -------------------------------------------- }}}
end
augroup END
" --------------------------------------------------------- }}}
Expand Down