atom-vim-mode-plus
atom-vim-mode-plus copied to clipboard
Support for is/as (= sentence) text object
...including back/forward navigation with '(' and ')'.
Not particularly important for code, but very useful for writing plain text. Any plans?
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.
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.
Sentence motion is in place, but there is still no as/is. Can we bump this issue up?