Giter Club home page Giter Club logo

vim-expand-region's People

Contributors

bitdeli-chef avatar kljohann avatar terryma avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vim-expand-region's Issues

HTML/XML tags

Thanks for the great plugin!
It would be really cool if this worked with HTML/XML tags.
For example, if I have
<div id="foo"><span class=".bar">some content</span></div>
and the cursor is in "some content", it would cool if
pressing + selected the content
and pressing + again selected <span class=".bar">some content</span>
and pressing + again selected <div id="foo"><span class=".bar">some content</span></div>.
Have you seen anything that does this?

insert of keymap instead expanding/shringkin

instead of expanding / shrinking the selection, i get this inserted:

vmap v <Plug>(expand_region_expand)
vmap <C-v> <Plug>(expand_region_shrink)vmap v <Plug>(expand_region_expand)
vmap <C-v> <Plug>(expand_region_shrink)vmap v <Plug>(expand_region_expand)
vmap <C-v> <Plug>(expand_region_shrink)

Quoted text not selected correctly

Hi,

I've been using this plugin for a while, and I like it very much.

When starting selection inside quoted text, I noticed that at the second selection action, the plugin selects outside of the quotes (space delimited text object), rather than the whole content, if the part selected at first is a word at the beginning or at the end of the quoted text.

Example:

if (method() == "some example text")

If I stand on the word text and select it, the next selection will select text"). The same happens for standing on some and selecting twice: "some will be selected.
The whole content of the quotes (some example text), without them, will be selected only on the third selection action.

Is this a bug, or the designed behavior?
For me it is more intuitive to have the whole content selected right after selecting either of the words in the quotes.

Not compatible with neovim?

Hi,
Thanks for creating this tool. I've been using it for a long time.

I'm migrating over to neovim, and noticed that it doesn't work in my setup. Below are the relevant lines in my config:

call plug#begin(stdpath('config') . '/plugged')
Plug 'terryma/vim-expand-region'
call plug#end()

nnoremap <space> <Plug>(expand_region_expand)

I'm wondering whether it is known to be incompatible with neovim, or something is wrong with my setup?

Problems with remapping keys

This is probably an issue with my configuration but I'm stumped.

I have installed the plugin via Vundle and remapped the expand and shrink functions using vmap
vmap v (expand_region_expand)
vmap (expand_region_shrink)

But now I get :call <SNR>7_NextTextObject('i') every time I try to expand the selected region. What am I doing wrong?

not working as expected

  1. When I press the first +, it selects the WHOLE WORD
  2. The second +, it selects the WHOLE PARAGRAPH
  3. Any + right after the 2nd one DOES NOT WORK AT ALL

Ruby block objects

Thanks for this great plugin that I've just discovered.

Do you support ruby block objects provided by nelstrom/vim-textobj-rubyblock?

I tried using the following configuration:

call expand_region#custom_text_objects('ruby', {
       \ 'ir' :0,
       \ 'ar' :0,
       \ 'im' :0,
       \ 'am' :0,
       \ })

But it is not working.

Proper settings for Python

Hello there,

Can someone help me & possibly add this to the documentation - what should be the proper settings for visual expansion in Python?

Right now does not respect indentation and the visual expanding is not always correct.

E119 after update

So today I updated all plugins.

When trying to expand region I am getting:

Error detected while processing function expand_region#next[1]..<SNR>57_expand_region[20]..<SNR>57_select_region:
line    2:
E119: Not enough arguments for function: targets#e

I use:

NVIM v0.2.3-dev
Build type: RelWithDebInfo
Lua 5.1
Compilation: /usr/bin/x86_64-linux-gnu-gcc -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -O2 -g -DMIN_LOG_LEVEL=3 -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wvla -fstack-protector-strong -fdiagnostics-color=auto -Wno-array-bounds -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -I/build/neovim-BZSxou/neovim-0.2.2ubuntu2+git201804092017-84bac9f-f2f288d/build/config -I/build/neovim-BZSxou/neovim-0.2.2ubuntu2+git201804092017-84bac9f-f2f288d/src -I/build/neovim-BZSxou/neovim-0.2.2ubuntu2+git201804092017-84bac9f-f2f288d/.deps/usr/include -I/usr/include -I/build/neovim-BZSxou/neovim-0.2.2ubuntu2+git201804092017-84bac9f-f2f288d/build/src/nvim/auto -I/build/neovim-BZSxou/neovim-0.2.2ubuntu2+git201804092017-84bac9f-f2f288d/build/include
Compiled by buildd@lcy01-amd64-019

Features: +acl +iconv +jemalloc +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

Edit:

One of following fixed the issue:

pip3 install --upgrade neovim
gem install neovim

First + sometimes shrinks selection

I saw a report of something similar (#3) but I'll open this separately anyway, since the other one is closed.

Here are some issues I'm seeing, using this code as an example:

call winrestview(s:candidates[s:cur_index].prev_winview)
  1. If the cursor is on the first character of winrestview, viw+ does not grow the selection beyond the initial word. If, however, the cursor is after the first character, viw+ seems to grow the selection. I can only reproduce this ~90% of the time, so it seems that there's some sort of a race going on.
  2. If I manually select winrestview(, hitting + actually shrinks the selection.

fine expanding

Often users want more fine control on text, currently it's not the case for vim-expand-region.

An example is:

/a/b/c-d/g-f

we often want to be able to expand to c-d or g-f

Docs for zero vs one

Thanks for the great plugin — everything's working well so far.

One question — what do the 0 & 1 values mean in the mappings? Did I just miss something in the docs?

`+` should only ever expand selection

Right now, there are times when pressing + will shrink the left side of the selection to accomodate a larger selection on the right side:

[submodule "vim/bundle/vim-expand-region"]
    path = vim/bundle/vim-expand-region
    url = https://github.com/terryma/vim-expand-region.git

If you place the cursor on the second bundle and continue pressing +, the selection will large to expand on the left, then suddenly, the selection on the left will shrink in order to accomodate a larger selection on the right.

keep jumplist unchanged

Avoid that the visual expansion mapping <Plug>(expand_region_expand) adds a mark to the jump list.

Should check whether new region includes cursor position

I noticed that some text objects can select unexpected regions. For example, put the following into a file:

index(list, '(')
empty(taginfo)

then put the cursor on top of empty and press vib. The parentheses on the first line should now be selected. This is obviously not useful for our case. So it would make sense to check whether the region candidates actually include the original cursor position before trying to use them.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.