Vim中的中欧人物和打印(PDF)他们

前端之家收集整理的这篇文章主要介绍了Vim中的中欧人物和打印(PDF)他们前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我试图说服GVim 7.3正确打印(:硬拷贝)中欧人物(šđč枊ĐČĆŽ)到PDF.我认为相关的设置
set encoding=utf8
set fileencodings=ucs-bom,utf8,cp1250,latin1
set guifont=Consolas:h9:cEASTEUROPE
set printfont=Consolas:h9:cEASTEUROPE

将编码更改为cp1250(并再次编写它们,因为编码的更改将其拧紧),它们会正确打印出来.

现在,我认为utf-8比cp1250更大更完整.为什么在这个改变后他们正确地打印出来,或者更重要的是,为什么我不能将它们与enc = utf-8结合使用(我通常使用它是因为其他字符丰富,通常无法访问)?

:version
VIM - Vi IMproved 7.3 (2010 Aug 15,compiled Oct 27 2010 17:59:02)
MS-Windows 32-bit GUI version with OLE support
Included patches: 1-46
Compiled by Bram@KIBAALE
Big version with GUI.  Features included (+) or not (-):
+arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent +clientserver +clipboard +cmdline_compl
+cmdline_hist +cmdline_info +comments +conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con_gui +diff +digraphs -dnd
-ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path +find_in_path +float +folding -footer +gettext/dyn
-hangul_input +iconv/dyn +insert_expand +jumplist +keymap +langmap +libcall +linebreak +lispindent +listcmds +localmap -lua +menu
 +mksession +modify_fname +mouse +mouseshape +multi_byte_ime/dyn +multi_lang -mzscheme +netbeans_intg +ole -osfiletype
+path_extra +perl/dyn +persistent_undo -postscript +printer -profile +python/dyn +python3/dyn +quickfix +reltime +rightleft
+ruby/dyn +scrollbind +signs +smartindent -sniff +startuptime +statusline -sun_workshop +Syntax +tag_binary +tag_old_static
-tag_any_white +tcl/dyn -tgetent -termresponse +textobjects +title +toolbar +user_commands +vertsplit +virtualedit +visual
+visualextra +viminfo +vreplace +wildignore +wildmenu +windows +writebackup -xfontset -xim -xterm_save +xpm_w32
   system vimrc file: "$VIM\vimrc"
     user vimrc file: "$HOME\_vimrc"
 2nd user vimrc file: "$VIM\_vimrc"
      user exrc file: "$HOME\_exrc"
  2nd user exrc file: "$VIM\_exrc"
  system gvimrc file: "$VIM\gvimrc"
    user gvimrc file: "$HOME\_gvimrc"
2nd user gvimrc file: "$VIM\_gvimrc"
    system menu file: "$VIMRUNTIME\menu.vim"
Compilation: cl -c /W3 /nologo  -I. -Iproto -DHAVE_PATHDEF -DWIN32   -DFEAT_CSCOPE -DFEAT_NETBEANS_INTG   -DFEAT_XPM_W32   -DWINVE
R=0x0400 -D_WIN32_WINNT=0x0400  /Fo.\ObjGOLYHTR/ /Ox /GL -DNDEBUG  /Zl /MT -DFEAT_OLE -DFEAT_MBYTE_IME -DDYNAMIC_IME -DFEAT_GUI_W3
2 -DDYNAMIC_ICONV -DDYNAMIC_GETTEXT -DFEAT_TCL -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"tcl83.dll\" -DDYNAMIC_TCL_VER=\"8.3\" -DFEAT_PYTH
ON -DDYNAMIC_PYTHON -DDYNAMIC_PYTHON_DLL=\"python27.dll\" -DFEAT_PYTHON3 -DDYNAMIC_PYTHON3 -DDYNAMIC_PYTHON3_DLL=\"python31.dll\"
-DFEAT_PERL -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl512.dll\" -DFEAT_RUBY -DDYNAMIC_RUBY -DDYNAMIC_RUBY_VER=191 -DDYNAMIC_RUBY_DLL
=\"msvcrt-ruby191.dll\" -DFEAT_BIG /Fd.\ObjGOLYHTR/ /Zi
Linking: link /RELEASE /nologo /subsystem:windows /LTCG:STATUS oldnames.lib kernel32.lib advapi32.lib shell32.lib gdi32.lib  comdl
g32.lib ole32.lib uuid.lib /machine:i386 /nodefaultlib gdi32.lib version.lib   winspool.lib comctl32.lib advapi32.lib shell32.lib
 /machine:i386 /nodefaultlib libcmt.lib oleaut32.lib  user32.lib      /nodefaultlib:python27.lib /nodefaultlib:python31.lib   e:\t
cl\lib\tclstub83.lib WSock32.lib e:\xpm\lib\libXpm.lib /PDB:gvim.pdb -debug
Press ENTER or type command to continue

使用enc = utf8键入并保存时:

0000000: c5a1 2020 2020 c5a0 0d0a c491 2020 2020  ..    ......    
0000010: c490 0d0a c48d 2020 2020 c48c 0d0a c487  ......    ......
0000020: 2020 2020 c486 0d0a c5be 2020 2020 c5bd      ......    ..
0000030: 0d0a 0d0a 0d0a                           ......

……用enc = cp1250

0000000: 9a20 2020 208a 0d0a f020 2020 20d0 0d0a  .    ....    ...
0000010: e820 2020 20c8 0d0a e620 2020 20c6 0d0a  .    ....    ...
0000020: 9e20 2020 208e 0d0a 0d0a                 .    .....
这是一个 very nice thread讨论非常接近的事情.最后的结论是,“它不起作用,不要那样做” – 只需将文件保存为UTF-8并用其他东西打印,例如:记事本.

这适用于我的系统:

:silent !notepad /pt "%" "PDFLite"

其中PDFLite是我的print-to-PDF打印机的名称.

编辑:我在vim中使用“utf-8”编码.

猜你在找的Bash相关文章