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

show hidden chars

Expand Messages
  • luke@chipcity.com.au
    Hi. I have a file that is used by a GUI to show options in a form. Example: filename: birds /~~~~~ budgie canary pigeon _____ This file is used to create a
    Message 1 of 4 , Aug 5, 2005
    • 0 Attachment
      Hi.

      I have a file that is used by a GUI to show options in a form.


      Example:
      filename: 'birds'
      /~~~~~
      budgie
      canary
      pigeon
      \_____

      This file is used to create a drop-down list in a form.
      To do this I am using a PHP script.
      When a user chooses an option from the drop-down list, that option is then saved
      in a database.
      The problem is that the database field has a carraige return at the end that
      causes all kinds of problems.
      The lines in the file have a 'newline' or 'return' at the end that I cannot get
      rid of by using 'chop', 'rtrim' or any other php function.
      Obviously there is a char at the end of those lines that is not being detected
      by the usual means.
      So what I am doing is getting rid of the last char by using 'substr'.

      However this has the drawback that when a new bird is added by someone with a
      different editor the form shows 'goos' instead of goose 'swa' instead of swan
      etc.

      My Question is (sorry about the long preamble):
      How do I get Vim to show the hidden chars?

      Thanks in advance.
      Kind regards.
      Luke.



      --
      ............._..
      .| .| |.|/.|_ .
      .|__.|_|.|\.|_ .
      :61 421 276 282:
    • Thomas
      ... Maybe it helps to set fileformat to unix when editing the files in vim, or did I misunderstand the problem? ... Cheers, Thomas.
      Message 2 of 4 , Aug 5, 2005
      • 0 Attachment
        > The lines in the file have a 'newline' or 'return' at the end that I cannot get
        > rid of by using 'chop', 'rtrim' or any other php function.

        Maybe it helps to set fileformat to unix when editing the files in vim,
        or did I misunderstand the problem?

        :h ff

        Cheers,
        Thomas.
      • luke@chipcity.com.au
        Hi. 06Aug2005 @ 08:56 Thomas thusly spake ... I want to *show* the hidden chars. Thanks for your reply. Kr. Luke. -- ............._.. .| .| |.|/.|_ .
        Message 3 of 4 , Aug 6, 2005
        • 0 Attachment
          Hi.

          06Aug2005 @ 08:56 Thomas thusly spake
          > >The lines in the file have a 'newline' or 'return' at the end that I
          > >cannot get
          > >rid of by using 'chop', 'rtrim' or any other php function.
          >
          > Maybe it helps to set fileformat to unix when editing the files in vim,
          > or did I misunderstand the problem?

          I want to *show* the hidden chars.
          Thanks for your reply.
          Kr.
          Luke.

          --
          ............._..
          .| .| |.|/.|_ .
          .|__.|_|.|\.|_ .
          :61 421 276 282:
        • Mark Woodward
          ... add this (or whatever characters you want spaces/tabs etc to display as) to your vimrc see :h lcs set lcs=tab: ·,trail:-,eol:$,extends:»,precedes:«
          Message 4 of 4 , Aug 6, 2005
          • 0 Attachment
            luke@... said the following on 6/08/2005 5:35 PM:

            >Hi.
            >
            >06Aug2005 @ 08:56 Thomas thusly spake
            >
            >
            >>>The lines in the file have a 'newline' or 'return' at the end that I
            >>>cannot get
            >>>rid of by using 'chop', 'rtrim' or any other php function.
            >>>
            >>>
            >>Maybe it helps to set fileformat to unix when editing the files in vim,
            >>or did I misunderstand the problem?
            >>
            >>
            >
            >I want to *show* the hidden chars.
            >Thanks for your reply.
            >Kr.
            >Luke.
            >
            >
            >
            add this (or whatever characters you want spaces/tabs etc to display as)
            to your vimrc
            see :h lcs

            set lcs=tab:>·,trail:-,eol:$,extends:»,precedes:«
            " set and toggle
            nnoremap <leader>shc :set invlist<BAR>set list?<CR> " hidden
            characters

            --
            Mark
          Your message has been successfully submitted and would be delivered to recipients shortly.