Results 1 to 6 of 6

Thread: White space in vi editor

  1. #1
    Join Date
    Nov 2009
    Posts
    359

    White space in vi editor

    Hi everyone,
    This is a little question but important for me. To replace all white spaces with nothing in the vi, "I"
    Code:
    : 1, $ s / / / g
    But it does not work? I think we should add \ somewhere, but I tweak and it does not work. Can you help me? Thank you in advance.

  2. #2
    Join Date
    Apr 2008
    Posts
    2,139

    Re: White space in vi editor

    Hi
    Your command is good, yet it lacks a space.
    Code:
    : 1, $ s / / / g
    Can you explain with some more details? It would be better for our understanding if you provide some more details.

  3. #3
    Join Date
    Nov 2009
    Posts
    359

    Re: White space in vi editor

    Hi
    I discovered the usefulness of the file. exrc, and I am trying to define macros cool, like it, supposed to imitate the behavior of eclipse.
    Code:
    map! (() I <esc>
    This function is meaningful, every time you tap an open parenthesis in insert mode, type "()", then i do, i.e move the slider to read inside the parentheses.
    The problem is that <esc> is not interpreted as escape character but as a sequence of characters "<esc>. Finally, I can not find the character vi interprets as the esc key. I will then make the memory thing for braces (), except that I intend to squeeze them a newline and a tab.
    Code:
    map! ((\ N) O <esc> <tab>
    Can someone tell me the character to put in place of \ n and vi <tab> that the interpreter correctly?

  4. #4
    Join Date
    Nov 2009
    Posts
    359

    Re: White space in vi editor

    Hi
    I found the answer but I posted here because it could be used by others.
    Instead of <esc>, typing on the keyboard ctrl + v, then the escape key and the appropriate text will be set any one in the macro. Same for the enter key or tab, type first ctrl + v then enter key or tab.
    Info for rendering is this:
    Code:
    map! (() ^ [I
    map! ((M) ^ ^ [O
    map! [[] ^ [I

  5. #5
    Join Date
    Dec 2009
    Posts
    23

    Re: White space in vi editor

    Thank you for posting your final approach.

    If you want to automate this, you can use the stream editors available in biterscripting. For example, to replace all non-printable characters with nothing in file X.txt, you can use something like the following commands.


    Code:
    var str content
    cat "X.txt" > $content
    while ( { sen -r "^,^" $content } > 0 )
        sal -r "^,^" "" $content > null
    echo $content > "X.txt"

  6. #6
    Join Date
    Nov 2009
    Posts
    359

    Re: White space in vi editor

    Hey, Thanks for the help... This script is really easy while implementing in automated queries...

Similar Threads

  1. Replies: 2
    Last Post: 21-02-2012, 05:13 PM
  2. Replies: 7
    Last Post: 18-09-2011, 08:00 AM
  3. Strange white space services menu windows
    By Fabiulin91 in forum Operating Systems
    Replies: 1
    Last Post: 16-04-2011, 12:55 AM
  4. How to use white space property for CSS to No Wrap
    By Pratyush in forum Software Development
    Replies: 3
    Last Post: 07-08-2009, 03:42 PM
  5. Required white space is missing
    By Basaam in forum Technology & Internet
    Replies: 3
    Last Post: 09-06-2009, 10:08 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,752,108,431.92276 seconds with 16 queries