atom-vim-mode-plus icon indicating copy to clipboard operation
atom-vim-mode-plus copied to clipboard

Support for is/as (= sentence) text object

Open gnl opened this issue 9 years ago • 3 comments

...including back/forward navigation with '(' and ')'.

Not particularly important for code, but very useful for writing plain text. Any plans?

gnl avatar Dec 15 '15 20:12 gnl

I feel this should be implemented in future, but priority is very low. I wan to focus feature for code editing and internal cleanup for a while.

t9md avatar Dec 18 '15 01:12 t9md

I've added this hack to my init script to select a sentence in visual mode.

# vim sentence textobject
atom.commands.add 'atom-text-editor', 'init:visual-a-sentence': ->
  getEditorView = () ->
    atom.views.getView(atom.workspace.getActiveTextEditor())
  atom.commands.dispatch(getEditorView(), 'vim-mode-plus:activate-characterwise-visual-mode')
  atom.commands.dispatch(getEditorView(), 'vim-mode-plus:move-to-previous-sentence')
  atom.commands.dispatch(getEditorView(), 'vim-mode-plus:reverse-selections')
  atom.commands.dispatch(getEditorView(), 'vim-mode-plus:move-to-next-sentence')
  atom.commands.dispatch(getEditorView(), 'vim-mode-plus:move-to-previous-word')

I'd be up for having a go at implementing the sentence text object properly. Would need a bit of a pointer as to how/where the other text objects are defined. I've done some JS development before but am reasonably new to coffeescript and the way atom packages are developed. If anyone's able to suggest where to start I can have a go and open a PR if successful.

lemongrassnginger avatar Jul 07 '17 15:07 lemongrassnginger

Sentence motion is in place, but there is still no as/is. Can we bump this issue up?

dkotik avatar Feb 05 '22 14:02 dkotik