windows中vim以及cmder的使用


雖然有gvim,但是我依然更喜歡控制台(可理解為博主的偏執已經發展到某個階段)。

windows自帶的控制台很糟糕,尤其是我正在用的win7竟然沒有全屏功能。任何一個占領屏幕的圖標顯然是不可忍受的。

雖然我已經有了cygwin但是我依然希望使用原生環境的vim(偏執的持續發展)

上github搜搜,我們得到了cmder,其主頁下載地址

cmder的注意點:

1.需要vc2015運行庫支持

2.升級powershell到4.0

3.使用管理員權限執行后運行命令 

Set-ExecutionPolicy -ExecutionPolicy Bypass

Alt+Enter進入全屏,目標基本達到

之后是vim

使用,加路徑不多說。

主要是亂碼問題。

由於windows的代碼頁是cp936,所以必須在_vimrc中設定編碼。

"控制台模式下輸入法無法輸入部分漢字,雖然定義為cp936輸入正常,但是太多插件是根據utf-8設計的,如果使用其他值會導致錯誤。此外cmder中的vim,中文光標位置不正確。
set encoding=utf-8
"控制台顯示方式定義為cp936
set termencoding=cp936
"文件編碼 無需定義
"set fileencoding=utf-8
"編碼搜索次序,如果encoding為cp936,ucs-bom無效
set fileencodings=ucs-bom,utf-8,cp936

我的vim版本:

:version                                                                                                                                                    
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Aug 25 2014 03:23:11)                                                                                          
MS-Windows 64-bit console version                                                                                                                           
Included patches: 1-417                                                                                                                                     
Compiled by Haroogan <Haroogan@gmail.com>                                                                                                                   
Huge version without GUI.  Features included (+) or not (-):                                                                                                
+acl                +comments           +ex_extra           +keymap             +multi_byte_ime/dyn +reltime            -tag_any_white      +vreplace       
+arabic             +conceal            +extra_search       +langmap            +multi_lang         +rightleft          -tcl                +wildignore     
+autocmd            +cryptv             +farsi              +libcall            -mzscheme           +ruby/dyn           -tgetent            +wildmenu       
-balloon_eval       +cscope             +file_in_path       +linebreak          -netbeans_intg      +scrollbind         -termresponse       +windows        
-browse             +cursorbind         +find_in_path       +lispindent         +path_extra         +signs              +textobjects        +writebackup    
++builtin_terms     +cursorshape        +float              +listcmds           +perl/dyn           +smartindent        +title              -xfontset       
+byte_offset        +dialog_con         +folding            +localmap           +persistent_undo    -sniff              -toolbar            -xim            
+cindent            +diff               -footer             +lua/dyn            -postscript         +startuptime        +user_commands      -xterm_save     
+clientserver       +digraphs           +gettext/dyn        +menu               +printer            +statusline         +vertsplit          -xpm_w32        
+clipboard          -dnd                -hangul_input       +mksession          +profile            -sun_workshop       +virtualedit                        
+cmdline_compl      -ebcdic             +iconv/dyn          +modify_fname       +python/dyn         +syntax             +visual                             
+cmdline_hist       +emacs_tags         +insert_expand      +mouse              +python3/dyn        +tag_binary         +visualextra                        
+cmdline_info       +eval               +jumplist           -mouseshape         +quickfix           +tag_old_static     +viminfo                            
   system vimrc file: "$VIM\vimrc"                                                                                                                          
     user vimrc file: "$HOME\_vimrc"                                                                                                                        
 2nd user vimrc file: "$HOME\vimfiles\vimrc"                                                                                                                
 3rd user vimrc file: "$VIM\_vimrc"                                                                                                                         
      user exrc file: "$HOME\_exrc"                                                                                                                         
  2nd user exrc file: "$VIM\_exrc"                                                                                                                          
Dependency: python27.dll, python34.dll, x64-msvcrt-ruby200.dll, lua52.dll, perl518.dll, libintl.dll, libiconv.dll, iconv.dll                                

完成,上圖:

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM