Only last line of block are selected #5

Closed
DanielChesters opened this Issue Dec 28, 2010 · 13 comments

Comments

Projects
None yet
3 participants

When I try plug in with a ruby file, it goes, select only last line of block and keep select mode when I do 'var'. With 'vir', I have three lines selected, the line with good end, the line before and the line after.

Owner

nelstrom commented Dec 28, 2010

Do you have the matchit.vim plugin enabled?

Try adding this line to your vimrc file:

runtime macros/matchit.vim

I have already add "runtime macros/matchit.vim" line in my vimrc.

Owner

nelstrom commented Dec 28, 2010

To help diagnose the problem, could you tell me the version of Vim you are running as well as the version of matchit.vim?

Run :version to find out which Vim you're on.
Run :edit $VIMRUNTIME/macros/matchit.vim to open the matchit plugin, which includes the version number in the first few lines.

I am running Vim 7.3, with matchit.vim 1.13.2.

:version
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Dec 2 2010 10:44:11)
Included patches: 1-69
Compiled by ArchLinux
Big version with GTK2 GUI. Features included (+) or not (-):
+arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent +clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments +conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con_gui +diff
+digraphs +dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path +find_in_path +float +folding -footer +fork() +gettext -hangul_input +iconv +insert_expand +jumplist +keymap +langmap +libcall +linebreak +lispindent
+listcmds +localmap -lua +menu +mksession +modify_fname +mouse +mouseshape +mouse_dec +mouse_gpm -mouse_jsbterm +mouse_netterm -mouse_sysmouse +mouse_xterm +multi_byte +multi_lang -mzscheme +netbeans_intg -osfiletype +path_extra +perl
+persistent_undo +postscript +printer -profile +python -python3 +quickfix +reltime +rightleft +ruby +scrollbind +signs +smartindent -sniff +startuptime +statusline -sun_workshop +syntax +tag_binary +tag_old_static -tag_any_white -tcl
+terminfo +termresponse +textobjects +title +toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo +vreplace +wildignore +wildmenu +windows +writebackup +X11 -xfontset +xim +xsmp_interact +xterm_clipboard
-xterm_save
system vimrc file: "/etc/vimrc"
user vimrc file: "$HOME/.vimrc"
user exrc file: "$HOME/.exrc"
system gvimrc file: "/etc/gvimrc"
user gvimrc file: "$HOME/.gvimrc"
system menu file: "$VIMRUNTIME/menu.vim"
fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include
/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng14 -march=x86-64 -mtune=generic -O2 -pipe -D_FORTIFY_SOURCE=1
Linking: gcc -L. -rdynamic -Wl,-export-dynamic -Wl,-E -Wl,-rpath,/usr/lib/perl5/core_perl/CORE -Wl,--hash-style=gnu -Wl,--as-needed -L/usr/local/lib -Wl,--as-needed -o vim -pthread -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0
-lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lm -lcairo -lpng14 -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0 -lSM -lICE -lXt -lX11 -lXdmcp -lSM -lICE -lm -lncurses -lelf -lnsl -l
acl -lattr -lgpm -ldl -Wl,-E -Wl,-rpath,/usr/lib/perl5/core_perl/CORE -fstack-protector -L/usr/local/lib -L/usr/lib/perl5/core_perl/CORE -lperl -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc -L/usr/lib/python2.7/config -lpython2.7 -lp
thread -ldl -lutil -lm -Xlinker -export-dynamic -lruby -lpthread -lrt -ldl -lcrypt -lm

:edit $VIMRUNTIME/macros/matchit.vim

[…]
" Version: 1.13.2, for Vim 6.3+
[...]

EDIT : I have a copy of my vim config in https://github.com/OniTux/dotvim maybe a conflict between two plug-ins.

Owner

nelstrom commented Dec 28, 2010

Thanks for the info. You have the same versions as me, so that wasn't it. I'll have a look at your dotfiles, and see if anything stands out.

I try with only pathogen, textobj-user, textobj-rubyblock and matchit.vim and I have the same problem.

EDIT : Same problem with old-school plug-ins installation.

Owner

nelstrom commented Dec 30, 2010

Curiouser and curiouser.

I just had a closer look at your vimrc on github, and it doesn't appear to include the line set nocompatible. Could you try adding it, and let me know if that improves the situation?

No change with set nocompatible

halcyon commented Jan 22, 2011

I'm having the same problem too. I'm running vim 7.2 with matchit 1.13.2 on ubuntu 10.10. Thanks for writing this, can hardly wait to start using rubyblock once this is figured out!

halcyon commented Jan 22, 2011

Have reproduced it on my macbook with macvim 7.3 and seeing same behavior there too... starting to think it must be something about my .vimrc or .vim contents.

[smcleod@arya ~] ➔ cat .vimrc
set nocompatible
runtime macros/matchit.vim
call pathogen#runtime_append_all_bundles()
call pathogen#helptags()
[smcleod@arya ~] ➔

[smcleod@arya ~/.vim]

├── ./autoload
│ └── ./autoload/pathogen.vim
└── ./bundle
├── ./bundle/vim-textobj-rubyblock
│ ├── ./bundle/vim-textobj-rubyblock/doc
│ │ ├── ./bundle/vim-textobj-rubyblock/doc/tags
│ │ └── ./bundle/vim-textobj-rubyblock/doc/textobj-rubyblock.txt
│ ├── ./bundle/vim-textobj-rubyblock/plugin
│ │ └── ./bundle/vim-textobj-rubyblock/plugin/textobj
│ │ └── ./bundle/vim-textobj-rubyblock/plugin/textobj/rubyblock.vim
│ ├── ./bundle/vim-textobj-rubyblock/README.md
│ ├── ./bundle/vim-textobj-rubyblock/readme.vim.org
│ ├── ./bundle/vim-textobj-rubyblock/test
│ │ ├── ./bundle/vim-textobj-rubyblock/test/basic.input
│ │ └── ./bundle/vim-textobj-rubyblock/test/examples.rb
│ ├── ./bundle/vim-textobj-rubyblock/textobj-rubyblock.vba
│ ├── ./bundle/vim-textobj-rubyblock/todo.otl
│ └── ./bundle/vim-textobj-rubyblock/vimballer
└── ./bundle/vim-textobj-user
├── ./bundle/vim-textobj-user/autoload
│ └── ./bundle/vim-textobj-user/autoload/textobj
│ └── ./bundle/vim-textobj-user/autoload/textobj/user.vim
├── ./bundle/vim-textobj-user/doc
│ ├── ./bundle/vim-textobj-user/doc/tags
│ └── ./bundle/vim-textobj-user/doc/textobj-user.txt
├── ./bundle/vim-textobj-user/Makefile
├── ./bundle/vim-textobj-user/mduem
└── ./bundle/vim-textobj-user/test
├── ./bundle/vim-textobj-user/test/plugin.expected
└── ./bundle/vim-textobj-user/test/plugin.input

13 directories, 17 files
[smcleod@arya ~/.vim] ➔

halcyon commented Jan 26, 2011

I've found the solution. I used Drew's dotfiles and through bisection discovered that I need to have this line in my vimrc:

filetype plugin indent on

Owner

nelstrom commented Jan 26, 2011

Halcyon,

That's awesome that you figured out the solution. I'll update the installation instructions to mention this.

Enjoy using your new text object!

Cheers,
Drew

halcyon commented Feb 4, 2011

Thanks Drew, I'm enjoying it very much. Keep up the great work!

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment