Shougo / vimshell.vim

:shell: Powerful shell implemented by vim.
1.09k stars 89 forks source link

man git-init show NAAMMEE like ugly strings #198

Open lambdalisue opened 9 years ago

lambdalisue commented 9 years ago

Minimum vimrc

" vim -u ~/vimrc.min
set nocompatible
set runtimepath&

let s:required_plugins = [
      \ expand('~/.vim/bundle/vimproc.vim'),
      \ expand('~/.vim/bundle/vimshell.vim'),
      \]
for s:required_plugin in s:required_plugins
  execute printf('set runtimepath+=%s', s:required_plugin)
endfor

Procedure

  1. vim -u ~/vimrc.min
  2. Hit :VimShell
  3. Run man git-init

Result

NAAMMEE
       git-init - Create an empty Git repository or reinitialize an existing one

SYYNNOOPPSSIISS
       _g_i_t _i_n_i_t [-q | --quiet] [--bare] [--template=<template_directory>]
                 [--separate-git-dir <git dir>]
                 [--shared[=<permissions>]] [directory]

DEESSCCRRIIPPTTIIOONN
       This command creates an empty Git repository - basically a .git directory with subdirectories for
       objects, refs/heads, refs/tags, and template files. An initial HEAD file that references the HEAD of the
       master branch is also created.

       If the $GIT_DIR environment variable is set then it specifies a path to use instead of ./.git for the
       base of the repository.

       If the object storage directory is specified via the $GIT_OBJECT_DIRECTORY environment variable then the
       sha1 directories are created underneath - otherwise the default $GIT_DIR/objects directory is used.

       Running _g_i_t _i_n_i_t in an existing repository is safe. It will not overwrite things that are already there.
       The primary reason for rerunning _g_i_t _i_n_i_t is to pick up newly added templates (or to move the repository
       to another place if --separate-git-dir is given).

...

vim version

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Dec  9 2014 17:36:40)
Included patches: 1-488
Modified by pkg-vim-maintainers@lists.alioth.debian.org
Compiled by buildd@
Huge version with GTK2 GUI.  Features included (+) or not (-):
+acl             +cindent         +conceal         +digraphs        +farsi           +gettext         +libcall         +mksession       +mouse_netterm   -mzscheme        +profile         +scrollbind      +syntax          +textobjects     +visualextra     +X11
+arabic          +clientserver    +cryptv          +dnd             +file_in_path    -hangul_input    +linebreak       +modify_fname    +mouse_sgr       +netbeans_intg   +python          +signs           +tag_binary      +title           +viminfo         -xfontset
+autocmd         +clipboard       +cscope          -ebcdic          +find_in_path    +iconv           +lispindent      +mouse           -mouse_sysmouse  +path_extra      -python3         +smartindent     +tag_old_static  +toolbar         +vreplace        +xim
+balloon_eval    +cmdline_compl   +cursorbind      +emacs_tags      +float           +insert_expand   +listcmds        +mouseshape      +mouse_urxvt     +perl            +quickfix        -sniff           -tag_any_white   +user_commands   +wildignore      +xsmp_interact
+browse          +cmdline_hist    +cursorshape     +eval            +folding         +jumplist        +localmap        +mouse_dec       +mouse_xterm     +persistent_undo +reltime         +startuptime     +tcl             +vertsplit       +wildmenu        +xterm_clipboard
++builtin_terms  +cmdline_info    +dialog_con_gui  +ex_extra        -footer          +keymap          +lua             +mouse_gpm       +multi_byte      +postscript      +rightleft       +statusline      +terminfo        +virtualedit     +windows         -xterm_save
+byte_offset     +comments        +diff            +extra_search    +fork()          +langmap         +menu            -mouse_jsbterm   +multi_lang      +printer         +ruby            -sun_workshop    +termresponse    +visual          +writebackup     +xpm
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "$VIM/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/usr/share/vim"

...
voondo commented 9 years ago

FYI, I cannot reproduce this on a recent neovim

Shougo commented 9 years ago

Yes, it is well known problem. It is hard to fix...

lambdalisue commented 9 years ago

Can't you just emulate the behaviour of backspace? I could successfully show manpage with removing ^H and character before the ^H with this code in my plugin

lambdalisue commented 9 years ago

The code didn't show ^H in github... The correct one would be

function! s:remove_backspaces() abort " {{{
  let saved_pos = getpos('.')
  :%s/.^H//ge
  keepjump call setpos('.', saved_pos)
endfunction " }}}

^H is typed as Ctrl-v h so Copy & Paste won't work.

Shougo commented 9 years ago

@lambdalisue Pull request is wellcome.

Shougo commented 9 years ago

Can't you just emulate the behaviour of backspace? I could successfully show manpage with removing ^H and character before the ^H with this code in my plugin

The emulation code is already available in s:control.delete_backward_char().

lambdalisue commented 9 years ago

@lambdalisue Pull request is wellcome.

:+1:

The emulation code is already available in s:control.delete_backward_char().

Hum...