def PostVimMessage(message, warning=True, truncate=False):
 echo_command = (u'echom' if warning else u'echo')
 vim.command(u'redraw')
 if warning:
  vim.command(u'echohl WarningMsg')
 message = ToUnicode(message)
 if truncate:
  vim_width = GetIntValue(u'&columns')
  message = message.replace(u'\n', u' ')
  if (len(message) > vim_width):
   message = (message[:(vim_width - 4)] + u'...')
  old_ruler = GetIntValue(u'&ruler')
  old_showcmd = GetIntValue(u'&showcmd')
  vim.command(u'set noruler noshowcmd')
  vim.command(u"{0} '{1}'".format(echo_command, EscapeForVim(message)))
  SetVariableValue(u'&ruler', old_ruler)
  SetVariableValue(u'&showcmd', old_showcmd)
 else:
  for line in message.split(u'\n'):
   vim.command(u"{0} '{1}'".format(echo_command, EscapeForVim(line)))
 if warning:
  vim.command(u'echohl None')

def PostVimMessage ( message , warning = True , truncate = False ) : echo_command = ( u'echom' if warning else u'echo' ) vim . command ( u'redraw' ) if warning : vim . command ( u'echohl WarningMsg' ) message = ToUnicode ( message ) if truncate : vim_width = GetIntValue ( u'&columns' ) message = message . replace ( u'\n' , u' ' ) if ( len ( message ) > vim_width ) : message = ( message [ : ( vim_width - 4 ) ] + u'...' ) old_ruler = GetIntValue ( u'&ruler' ) old_showcmd = GetIntValue ( u'&showcmd' ) vim . command ( u'set noruler noshowcmd' ) vim . command ( u"{0} '{1}'" . format ( echo_command , EscapeForVim ( message ) ) ) SetVariableValue ( u'&ruler' , old_ruler ) SetVariableValue ( u'&showcmd' , old_showcmd ) else : for line in message . split ( u'\n' ) : vim . command ( u"{0} '{1}'" . format ( echo_command , EscapeForVim ( line ) ) ) if warning : vim . command ( u'echohl None' )
display a message on the vim status line .