Loading ...
Sorry, an error occurred while loading the content.

Range substitute with backticks

Expand Messages
  • Alexandru Tudor Constantinescu
    Hello vim gurus! I have a problem and don t know how to go about: I am trying to make a script which would a) permute letters and b) change them in pairs. [I
    Message 1 of 1 , Nov 29, 2004
    • 0 Attachment
      Hello vim gurus!

      I have a problem and don't know how to go about: I am trying to
      make a script which would a) permute letters and b) change them
      in pairs. [I am a biochemist and work with DNA. Sometime you need
      to get from ATGC GCAT etc]. The function below does the job, but
      is being applied to the WHOLE row(s) being selected, not only the
      selection itself.

      So, let's suppose I have something like:
      this_is_a_name ATCGA(...)TGCA
      and I (visually) select only the ATCGA(...)TGCA part. I would
      like to apply the function only on this range.

      I tried to use `<,`>s... but it does not work. If I simply type
      `> or `< I get exactly where I am supposed to, but it seems that
      :s does not swallow this kind of marks. Any suggestions?

      Second question: why am getting this message?
      Line 9:
      E488: Trailing characters: c<C-O>:set revins<cr><C-R>

      Third: bizarre, behaviour. If I select multiple lines, it seems
      that the function is applied to the whole block as many times as
      selected lines. Since the operation is like a circular
      permuation, if I select an odd number of lines I end up with no
      change at all. Also, if I select multiple lines I get the
      "statistics" from the substitutions (like 6 substitutions on 2
      lines etc) despite the ge flags in the :s lines. Why in the world
      would the function be applied a number of times instead of only once?

      Code attached.
      Output from :version
      :ver
      VIM - Vi IMproved 6.2 (2003 Jun 1, compiled 10/21/03 12:53:30)
      MacOS X (unix) version
      Included patches: 1-127
      Compiled by Benji Fisher <benji@...>
      Huge version with Carbon GUI. Features included (+) or not (-):
      +arabic +autocmd -balloon_eval +browse ++builtin_terms
      +byte_offset +cindent -clientserver +clipboard +cmdline_compl
      +cmdline_hist +cmdline_info +comments +cryptv -cscope
      +dialog_con_gui +diff +digraphs -dnd -ebcdic +emacs_tags +eval
      +ex_extra +extra_search +farsi +file_in_path +find_in_path
      +folding -footer +fork() -gettext -hangul_input -iconv
      +insert_expand +jumplist +keymap +langmap -libcall +linebreak
      +lispindent +listcmds +localmap +menu +mksession
      +modify_fname +mouse -mouseshape -mouse_dec -mouse_gpm
      -mouse_jsbterm -mouse_netterm -mouse_xterm +multi_byte
      +multi_lang -netbeans_intg -osfiletype +path_extra -perl
      +postscript +printer -python +quickfix +rightleft -ruby
      +scrollbind +signs +smartindent -sniff +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"
      system gvimrc file: "$VIM/gvimrc"
      user gvimrc file: "$HOME/.gvimrc"
      system menu file: "$VIMRUNTIME/menu.vim"
      fall-back for $VIM: "/usr/local/share/vim"
      Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -arch ppc
      -fno-common -fpascal-strings -Wall -Wno-unknown-pragmas -mdyna
      mic-no-pic -pipe -I. -Iproto -I/Developer/Headers/FlatCarbon
      -O2 -fno-strength-reduce -Wall -DMACOS_X_UNIX -DMACOS_X_U
      NIX -DMACOS_X_UNIX -DMACOS_X_UNIX -DMACOS_X_UNIX -DMACOS_X_UNIX
      -DMACOS_X_UNIX
      Linking: gcc -L/usr/local/lib -o Vim -framework Carbon
      -ltermcap -lncurses



      Many thanks,

      Alexandru

      Dr. Alexandru Tudor Constantinescu
      Max-Planck-Institute of Molecular Cell Biology and Genetics
      Hyman lab
      Pfotenhauerstr. 108
      D-01307 Dresden
      Germany
    Your message has been successfully submitted and would be delivered to recipients shortly.