guns / vim-sexp

Precision Editing for S-expressions
MIT License
612 stars 33 forks source link

Text Objects Don't Work #1

Closed asivitz closed 11 years ago

asivitz commented 11 years ago

The plugin is loading, but then the text objects don't seem to work. If I understand correctly, I should be able to put my cursor inside of

(an sexp)

and type

daf

and it will delete it? Other bindings don't seem to really work either. Matched parentheses are inserted though during insert mode.

guns commented 11 years ago

If I understand correctly, I should be able to put my cursor inside of

(an sexp)

and type

daf

Yes, that's correct. Could you please execute the following command:

vim -c 'redir! > /tmp/debug.vim' -c 'sil! version' -c 'sil! scriptnames' -c 'sil! let g:sexp_mappings' -c 'sil! map <buffer>' -c 'sil! map! <buffer>' -c 'q' SEXP-FILE

Then paste the contents of /tmp/debug.vim?

SEXP-FILE is the Lisp buffer you are trying to edit.

Thank you for the report!

asivitz commented 11 years ago

Hey, thanks for the fast response.

/tmp/debug.vim

VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Jun 24 2011 20:00:09) Compiled by root@apple.com Normal version without 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 +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 -xterm_clipboard -xterm_save system vimrc file: "$VIM/vimrc" user vimrc file: "$HOME/.vimrc" user exrc file: "$HOME/.exrc" fall-back for $VIM: "/usr/share/vim" Compilation: gcc -c -I. -D_FORTIFY_SOURCE=0 -Iproto -DHAVE_CONFIG_H -arch i386 -arch x86_64 -g -Os -pipe Linking: gcc -arch i386 -arch x86_64 -o vim -lncurses 1: /usr/share/vim/vimrc 2: /Users/rrr/.vimrc 3: /usr/share/vim/vim73/ftoff.vim 4: /Users/rrr/.vim/autoload/pathogen.vim 5: /Users/rrr/.vim/filetype.vim 6: /usr/share/vim/vim73/filetype.vim 7: /Users/rrr/.vim/bundle/scala-vim-support/ftdetect/scala.vim 8: /usr/share/vim/vim73/indent.vim 9: /usr/share/vim/vim73/ftplugin.vim 10: /usr/share/vim/vim73/syntax/syntax.vim 11: /usr/share/vim/vim73/syntax/synload.vim 12: /usr/share/vim/vim73/syntax/syncolor.vim 13: /Users/rrr/.vim/colors/desert256.vim 14: /Users/rrr/.vim/plugin/SyntaxAttr.vim 15: /Users/rrr/.vim/bundle/CuteErrorMarker/plugin/cuteErrorMarker.vim 16: /Users/rrr/.vim/bundle/VisIncr/plugin/visincrPlugin.vim 17: /Users/rrr/.vim/bundle/alternate/plugin/a.vim 18: /Users/rrr/.vim/bundle/cocoa/plugin/cocoa.vim 19: /Users/rrr/.vim/bundle/command-t/plugin/command-t.vim 20: /Users/rrr/.vim/bundle/easymotion/plugin/EasyMotion.vim 21: /Users/rrr/.vim/bundle/easymotion/autoload/EasyMotion.vim 22: /Users/rrr/.vim/bundle/matchit/plugin/matchit.vim 23: /Users/rrr/.vim/bundle/nerdcommenter/plugin/NERD_commenter.vim 24: /Users/rrr/.vim/bundle/nerdtree/plugin/NERD_tree.vim 25: /Users/rrr/.vim/bundle/rainbow_parentheses/plugin/rainbow_parentheses.vim 26: /Users/rrr/.vim/bundle/scala-vim-support/plugin/31-create-scala.vim 27: /Users/rrr/.vim/bundle/snipmate/plugin/snipMate.vim 28: /Users/rrr/.vim/bundle/addon-mw-utils/autoload/funcref.vim 29: /Users/rrr/.vim/bundle/snipmate/plugin/snipMateInterface.vim 30: /Users/rrr/.vim/bundle/supertab/plugin/supertab.vim 31: /Users/rrr/.vim/bundle/surround/plugin/surround.vim 32: /Users/rrr/.vim/bundle/tagbar/plugin/tagbar.vim 33: /Users/rrr/.vim/bundle/tlib/plugin/02tlib.vim 34: /Users/rrr/.vim/bundle/vim-gnupg/plugin/gnupg.vim 35: /Users/rrr/.vim/bundle/vim-latex/plugin/SyntaxFolds.vim 36: /Users/rrr/.vim/bundle/vim-latex/plugin/filebrowser.vim 37: /Users/rrr/.vim/bundle/vim-latex/plugin/imaps.vim 38: /Users/rrr/.vim/bundle/vim-latex/plugin/libList.vim 39: /Users/rrr/.vim/bundle/vim-latex/plugin/remoteOpen.vim 40: /Users/rrr/.vim/bundle/vim-sexp/plugin/sexp.vim 41: /usr/share/vim/vim73/plugin/getscriptPlugin.vim 42: /usr/share/vim/vim73/plugin/gzip.vim 43: /usr/share/vim/vim73/plugin/matchparen.vim 44: /usr/share/vim/vim73/plugin/netrwPlugin.vim 45: /usr/share/vim/vim73/plugin/rrhelper.vim 46: /usr/share/vim/vim73/plugin/spellfile.vim 47: /usr/share/vim/vim73/plugin/tarPlugin.vim 48: /usr/share/vim/vim73/plugin/tohtml.vim 49: /usr/share/vim/vim73/plugin/vimballPlugin.vim 50: /usr/share/vim/vim73/plugin/zipPlugin.vim 51: /Users/rrr/.vim/bundle/snipmate/after/plugin/snipMate.vim 52: /usr/share/vim/vim73/indent/scheme.vim 53: /usr/share/vim/vim73/indent/lisp.vim 54: /Users/rrr/.vim/ftplugin/scheme.vim 55: /usr/share/vim/vim73/ftplugin/scheme.vim 56: /usr/share/vim/vim73/ftplugin/lisp.vim 57: /usr/share/vim/vim73/syntax/scheme.vim g:sexp_mappings {}

o ( @sexp_move_to_prev_bracket x ( @sexp_move_to_prev_bracket n ( @sexp_move_to_prev_bracket o ) @sexp_move_to_next_bracket x ) @sexp_move_to_next_bracket n ) @sexp_move_to_next_bracket o [e @sexp_select_prev_element x [e @sexp_select_prev_element n [e @sexp_select_prev_element o [[ @sexp_move_to_prev_top_element x [[ @sexp_move_to_prev_top_element n [[ @sexp_move_to_prev_top_element x \O @sexp_lift_element n \O @sexp_lift_element x \o @sexp_lift_list n \o @sexp_lift_list x \@ @sexp_splice_list n \@ @sexp_splice_list x \l @sexp_insert_at_list_tail n \l @sexp_insert_at_list_tail x \h @sexp_insert_at_list_head n \h @sexp_insert_at_list_head x \e} @sexp_curly_tail_wrap_element n \e} @sexp_curly_tail_wrap_element x \e{ @sexp_curly_head_wrap_element n \e{ @sexp_curly_head_wrap_element x \e] @sexp_square_tail_wrap_element n \e] @sexp_square_tail_wrap_element x \e[ @sexp_square_head_wrap_element n \e[ @sexp_square_head_wrap_element x \W @sexp_round_tail_wrap_element n \W @sexp_round_tail_wrap_element x \w @sexp_round_head_wrap_element n \w @sexp_round_head_wrap_element x } @sexp_curly_tail_wrap_list n } @sexp_curly_tail_wrap_list x { @sexp_curly_head_wrap_list n { @sexp_curly_head_wrap_list x ] @sexp_square_tail_wrap_list n ] @sexp_square_tail_wrap_list x [ @sexp_square_head_wrap_list n [ @sexp_square_head_wrap_list x \I @sexp_round_tail_wrap_list n \I @sexp_round_tail_wrap_list x \i @sexp_round_head_wrap_list n \i @sexp_round_head_wrap_list o ]e @sexp_select_next_element x ]e @sexp_select_next_element n ]e @sexp_select_next_element o ]] @sexp_move_to_next_top_element x ]] @sexp_move_to_next_top_element n ]] @sexp_move_to_next_top_element o ae @sexp_outer_element x ae @sexp_outer_element o as @sexp_outer_string x as @sexp_outer_string o aF @sexp_outer_top_list x aF @sexp_outer_top_list o af @sexp_outer_list x af @sexp_outer_list o gå @sexp_move_to_prev_element_tail x gå @sexp_move_to_prev_element_tail n gå @sexp_move_to_prev_element_tail o ie @sexp_inner_element x ie @sexp_inner_element o is @sexp_inner_string x is @sexp_inner_string o iF @sexp_inner_top_list x iF @sexp_inner_top_list o if @sexp_inner_list x if @sexp_inner_list x Ì @sexp_capture_next_element n Ì @sexp_capture_next_element x È @sexp_capture_prev_element n È @sexp_capture_prev_element x Ë @sexp_emit_tail_element n Ë @sexp_emit_tail_element x Ê @sexp_emit_head_element n Ê @sexp_emit_head_element x ì @sexp_swap_element_forward n ì @sexp_swap_element_forward x è @sexp_swap_element_backward n è @sexp_swap_element_backward x ê @sexp_swap_list_forward n ê @sexp_swap_list_forward x ë @sexp_swap_list_backward n ë @sexp_swap_list_backward o å @sexp_move_to_next_element_tail x å @sexp_move_to_next_element_tail n å @sexp_move_to_next_element_tail o ÷ @sexp_move_to_next_element_head x ÷ @sexp_move_to_next_element_head n ÷ @sexp_move_to_next_element_head o â @sexp_move_to_prev_element_head x â @sexp_move_to_prev_element_head n â @sexp_move_to_prev_element_head

i @sexp_insert_backspace i " @sexp_insert_double_quote i ( @sexp_insert_opening_round i ) @sexp_insert_closing_round i [ @sexp_insert_opening_square i ] @sexp_insert_closing_square i { @sexp_insert_opening_curly i } @sexp_insert_closing_curly

guns commented 11 years ago

Oh, I forgot one thing: what kind of filetype is the buffer you are editing?

asivitz commented 11 years ago

It's a .scm file. Filetype shows unix/SCHEME. Maybe it's not being detected early enough in the loading process?

asivitz commented 11 years ago

Oops, to clarify--

:set ft --> filetype=scheme

guns commented 11 years ago

I can duplicate the problem now on an old iMac; I'll build a few versions of vim (old versions, and with different feature levels) to narrow down the problem.

Thank you for alerting me to this problem. If you're curious to try out vim-sexp tonight, it definitely works on newer versions of vim with FEATURES=huge.

asivitz commented 11 years ago

Thanks so much. I'm happy to upgrade my vim installation.

guns commented 11 years ago

Update:

Patch 7.3.590 introduced the ability to directly set visual marks, which this plugin uses to a great extent.

At first I thought I would just bump the requirements to 7.3.590+, but this excludes almost everyone who doesn't use a rolling release operating system or compiles Vim from source.

Consequently I am adding a fallback to classic visual mark setting behavior, which has the nasty limitation that visual mode must actually be entered and exited to set the '< and '> marks.

guns commented 11 years ago

I believe this commit solves the issue. I would appreciate your feedback with your local setup!

asivitz commented 11 years ago

Hey, yes, it works now with Apple's default vim installation. Thanks!