Vi/Vim (Why it’s worth the effort)

Clovertech Forums Read Only Archives Cloverleaf General Vi/Vim (Why it’s worth the effort)

Viewing 2 reply threads
  • Author
    Replies
    • #72551

      Here is an absolutely incredible article on Vim: http://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim/1220118#1220118

      Read the section below the question (the reply to the question).

      -- Max Drown (Infor)

    • #72552
      David Barr
      Participant

        I might as well put in a plug for Emacs. 🙂

        If you’re already an intermediate to advanced VI user, I wouldn’t necessarily recommend switching, but if you’re a beginning VI user, you should take a look at Emacs as well.

        Here’s a summary of some of the powerful features of Emacs:

        http://www.gnu.org/software/emacs/tour/” class=”bbcode_url”>http://www.gnu.org/software/emacs/tour/

      • #72553

        Do you ever receive a file of HL7 with messages split into segments (one segment per line)?

        Here’s a quick way to convert that to HL7 one message per line using Vim.

        Place this line in your ~/.vimrc file.

        Code:

        ” Convert HL7 files from one segment per line to one message per line
        nnoremap :%s/n//g%s/rMSH/rMSH/g
        ” Split HL7 into one segment per line
        nnoremap :%s//r/g

        Then, open your HL7 file in Vim, and hit F3.

        Example

        Code:

        MSH|^~&|INTELLIDOT||||20101011172748||RAS|1285683329013|P|2.3|
        EVN|RAS|201010111726|
        PID|||0070020689||TEST-PROD-INTELLIDOT^FIVE^|||||||||||||50280266|
        PV1|||3 West^0350^01|
        ORC|CM|242241837|61||||^BID|||admin^User^Admin|^^^^^^^N||||201010111726|
        RXA|||201010112100||80100222^TACROLIMUS 0.5 MG CAP|1^250^MG|||Note|||||||||||CP|
        RXR|PO|||MED|

        MSH|^~&|INTELLIDOT||||20101011172748||RAS|1285683329013|P|2.3|
        EVN|RAS|201010111726|
        PID|||0070020689||TEST-PROD-INTELLIDOT^FIVE^|||||||||||||50280266|
        PV1|||3 West^0350^01|
        ORC|CM|242241837|61||||^BID|||admin^User^Admin|^^^^^^^N||||201010111726|
        RXA|||201010112100||80100222^TACROLIMUS 0.5 MG CAP|1^250^MG|||Note|||||||||||CP|
        RXR|PO|||MED|

        MSH|^~&|INTELLIDOT||||20101011172748||RAS|1285683329013|P|2.3|
        EVN|RAS|201010111726|
        PID|||0070020689||TEST-PROD-INTELLIDOT^FIVE^|||||||||||||50280266|
        PV1|||3 West^0350^01|
        ORC|CM|242241837|61||||^BID|||admin^User^Admin|^^^^^^^N||||201010111726|
        RXA|||201010112100||80100222^TACROLIMUS 0.5 MG CAP|1^250^MG|||Note|||||||||||CP|
        RXR|PO|||MED|

        See attached image for result.

        -- Max Drown (Infor)

    Viewing 2 reply threads
    • The forum ‘General’ is closed to new topics and replies.