sponsor Vim development Vim logo Vim Book Ad

DumpStr.vim : dump vimscript string to clearly see multi-byte chars, bytes, and codes of both

 script karma  Rating 7/4, Downloaded by 1110  Comments, bugs, improvements  Vim wiki

created by
Yakov Lerner
 
script type
utility
 
description
When debugging vimscript, you sometimes need to clearly see what's inside the string value: which unprintable characters it contains ? Does it contain any multibyte chars ? In which positions ?

For buffer characters, you can use 'ga' to see them clearly. To see characters of strings (variables, registers etc),  you can use DumpStr.vim.

Usage:
  - :source DumpStr.vim
  - :call TestDumpStr()        " test/demo
  - :call DumpStr(string_variable)
  - :call DumpStr(@Register)

When string has multi-byte characters, DumpStr prints in following format:

String length:   M bytes, N chars
                   (string has multibyte characters) ( encoding=ENC )
Char dump:       decimalCode(char) ...
Bytes:          "..."
Byte dump:       decimalCode(byte) ....

When string has no multi-byte characters, DumpStr dumps in this format:

String length:   M bytes (no multibyte characters) ( encoding=ENC )
Bytes:          "..."
Byte dump:       decimalCode(byte) ....

 
install details
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
DumpStr.vim 0.5 2004-04-11 6.0 Yakov Lerner Initial upload
ip used for rating: 142.132.191.50

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github