2013年9月28日 星期六

cygwin 設定顯示/輸入中文

 

其修正方式有下列二種,若第一種不行;可以試第二個(我的就只有第二種可以")

 

image

 

~/.bashrc

stty cs8 -istrip
stty pass8
export LANG=C
export LC_CTYPE=zh_TW.utf8
export LC_NUMERIC=zh_TW
export LC_TIME=zh_TW
export LC_COLLATE=zh_TW.utf8
export LC_ALL=zh_TW.utf8
 
alias ls="ls --show-control-chars"

其中最後 alisas ls設定,


是將特定的command 重設,為了顯示中文/或是因為傳輸格式


如: alias mosh="mosh --server='mosh-server new -l LANG=zh_TW.utf8'"


 


~/.inputrc



set meta-flag on
set input-meta on
set convert-meta off
set output-meta on 

 


最後,並且在cygwin.bat中



@echo off
 
C:
chdir C:\cygwin\bin
SET LANG=_TW.utf8 
SET LC_ALL=zh_TW.utf8
bash --login -i

 


二:在cgywin中 視窗中設中


image


ref:


http://irw.ncut.edu.tw/peterju/cygwin.html




http://wp.littlecho.tw/use-the-mosh-client-in-cygwin.html





http://www.crifan.com/cygwin_outpu_messy_code/

移值my gvim to cywin(一)

 

先介紹一下,我目前的vim 的內容

 

image

1.缓冲文件查看器-bufexplorer

image 

  '\be' (normal open)  or
  '\bs' (force horizontal split open)  or
  '\bv' (force vertical split open)

可以在buferxplore中, 使用t來把檔案另外開在新的tab中(關閉時,只需要C-w q或 :tabc; 切換g-t(T))

 

2.calendar

image

vimrc


let g:calendar_diary="C:\\Users\\steven\\steven_workdialy" "
let g:calendar_focus_today = 1
let g:calendar_mark = 'left-fit' \


command:



:cal


3.NERD_commenter


The NERD Commenter : A plugin that allows for easy commenting of code for many filetypes.


image


command :



,cc


,cm


,cu


4.NERD_tree


The NERD tree allows you to explore your filesystem and to open files and
directories.

image

http://www.flickr.com/photos/30496122@N07/2862367534/sizes/o/

vimrc:


" nerd tree//open NERDTree by  “\””e”
nmap    <leader>e    :NERDTreeToggle<CR>


command:


File node mappings~
" double-click,
" o: open in prev window
" go: preview
" t: open in new tab
" T: open in new tab silently
" middle-click,
" <tab>: open split
" g<tab>: preview split
" !: Execute file


5.Sketch

Sketch.vim -- Line drawing/painting using the mouse.

vimrc:


:map <F1> :call ToggleSketch()<CR>


command:


鼠标左键用于画自由曲线, Ctrl-鼠标左键可以画粗曲线. 鼠标右键圈一个区域, 然后点击
左键可以画空心图, Shift-鼠标左键画的的时候拐弯处用"."而不是"+", Ctrl-鼠标左键可
以画实习图. Alt-鼠标左键可以切换实心画和粗笔画的线条, 可以有的选择为".", ":"和
"#".

 


image


 


6.supertab


image


command:



它補齊的所使用的關鍵字是藉由搜尋所有被開啟的檔案內的字。而使用方式也很容易,當你打字打到一半需要它幫你補齊時就按下<tab>鍵,它就幫你把剩下的字補齊。但有時我們會希望是插入一個真正的Tab而不是要幫助補齊,這時需要按下Shift+Tab


7.taglist

對於程式員而言是個不個貨缺的plugin。它提供了檔案內的結構、define及函式列表,並能讓使用者快速跳到這些變數的定義處。安裝TagList的過程中,除了將TagList抓下來,放到$VIM資料匣內,另外使用者必需提供一支外部程式ctags


http://vim-taglist.sourceforge.net/images/taglist_c.gif


vimrc


" ctags
let Tlist_Ctags_Cmd = $VIM . '/ctags/ctags.exe'
nmap    <leader>t    :TlistToggle<CR>


8.tetris

image

command:


:”\”te


gvim:



" Author:    Cornelius <cornelius.howl{在}gmail{點}com>
" WebSite:    http://c9s.blogspot.com
" Date:       Wed 28 Mar 2007 04:37:26 AM CST
"============================
 
 
" Colorscheme
"---------------------------------------------------
colors zenburn
"set guifont=Monaco:h10
set guifont=Bitstream\ Vera\ Sans\ Mono:h10
language mes en
"lang en
set langmenu=en_US.UTF-8
winsize 120 35
winpos 10 20
 
 
 
syntax on
set nocp        "no compatible
set number
set ai
set si
set incsearch
set    showcmd 
set    shiftwidth=4
set    tabstop=4
set    noeb novb ruler
set    ignorecase
set    backspace=indent,eol,start
set    history=60
set wildmenu
 
let g:calendar_diary="C:\\Users\\steven\\steven_workdialy" "
let g:calendar_focus_today = 1 
let g:calendar_mark = 'left-fit' 
 
" encoding
set        fileencodings=utf-8,big5,gbk,euc-jp,utf-bom,iso8859-1
set        encoding=utf-8
set        termencoding=utf-8
set        fileencoding=utf-8
 
 
 
filetype on
filetype plugin on
 
 
imap    <F2>    <C-R>=strftime("%c")<CR>
:map <F1> :call ToggleSketch()<CR>
 
 
nmap    ,te :tabedit<SPACE>
nmap    ,tx    :tabedit .<CR>
nmap    ,th    :tab help<CR>
nmap    ,tn    :tabnew<CR>
 
 
" ctags
let Tlist_Ctags_Cmd = $VIM . '/ctags/ctags.exe'
nmap    <;leader>t    :TlistToggle<CR>
 
" snippet
set runtimepath+=$VIM\snippets\after
set runtimepath+=$VIM\snippets
let g:snip_start_tag = "«"
let g:snip_end_tag = "»"
 
" vcscommand
set runtimepath+=$VIM\vcscommand
 
" nerd tree
nmap    <leader>e    :NERDTreeToggle<CR>
 
" paste
set pastetoggle=<;leader>p
 
 " 与windows共享剪贴板
set clipboard+=unnamed
 " 不要备份文件(根据自己需要取舍)
set nobackup
" 不要生成swap文件,当buffer被丢弃的时候隐藏它
setlocal noswapfile
set bufhidden=hide
 " 在状态行上显示光标所在位置的行号和列号
set ruler
set rulerformat=%20(%2*%<;%f%=\ %m%r\ %3l\ %c\ %p%%%)
 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" 搜索和匹配
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" 高亮显示匹配的括号
set showmatch
" 匹配括号高亮的时间(单位是十分之一秒)
set matchtime=1
" 在搜索的时候忽略大小写
set ignorecase
 " 用空格键来开关折叠
  set foldenable
  set foldmethod=manual
  nnoremap <space> @=((foldclosed(line('.')) < 0) ? 'zc' : 'zo')<CR>
 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Autocommands
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" 只在下列文件类型被侦测到的时候显示行号,普通文本文件不显示
 
  if has("autocmd")
    autocmd FileType xml,html,css,js,c,cs,java,perl,shell,bash,cpp,python,vim,php,ruby,markdown,sh,md set number
    autocmd FileType xml,html vmap <C-o> <ESC>'<i<!--<ESC>o<ESC>'>o-->
    autocmd FileType java,c,cpp,cs vmap <C-o> <ESC>'<o
    autocmd FileType html,text,php,vim,c,java,xml,bash,shell,perl,python setlocal textwidth=100
autocmd FileType html,htmldjango,jinjahtml,eruby,mako let b:closetag_html_style=1
autocmd FileType html,xhtml,xml,htmldjango,jinjahtml,eruby,mako source ~/.vim/bundle/closetag.vim/plugin/closetag.vim
    autocmd BufReadPost *
      \ if line("'\"") >; 0 && line("'\"") <= line("$") |
      \ exe " normal g`\"" |
      \ endif
  endif "has("autocmd")
 
" F5编译和运行C程序,F6编译和运行C++程序
" 请注意,下述代码在windows下使用会报错
" 需要去掉./这两个字符
" C的编译和运行
  map <;F5> :call CompileRunGcc()<CR>
  func! CompileRunGcc()
  exec "w"
  exec "!gcc % -g -o %<"
" exec "! %<;"
  endfunc
  map <;F6> :call RunGcc()<CR>
  func! RunGcc()
  exec "w"
  exec "! %<"
  endfunc
  map <;F7> :call RunGdb()<CR>
  func! RunGdb()
  exec "w"
  exec "!gdb %<"
  endfunc
" C++的编译和运行
  map <F9> :call CompileRunGpp()<CR>
  func! CompileRunGpp()
  exec "w"
  exec "!g++ % -o %<;"
  exec "! %<"
  endfunc
 
let g:SuperTabDefaultCompletionType = "context"
let g:snips_trigger_key='<;F3>' 
:imap jj <;Esc>
 

 

cygwin vim:(未完成,??)....ctage,comm…



imap <;F2> <C-R>=strftime("%c")<CR>
nmap ,te :tabedit<;SPACE>
nmap ,tx :tabedit .<;CR>
nmap ,th :tab help<;CR>
nmap ,tn :tabnew<;CR>
"nerd tree
nmap <leader>e :NERDTreeToggle<CR>
"paste
set pastetoggle=<;leader>p
set showmatch
set ff=unix
set nobackup
setlocal noswapfile
set bufhidden=hide
set matchtime=1
set ignorecase
"set backspace to fold
set foldenable
set foldmethod=manual
nnoremap <SPACE> @=((foldclosed(line('.'))<0)?'zc':'zo')<CR>
:imap jj <Esc>
"ctags
let Tlist_Ctags_Cmd = "/usr/bin/ctags.exe"
let Tlist_Show_One_File=1
nmap <;leader>t :TlistToggle<CR>
~

reference:

bufexplorer

http://www.vim.org/scripts/script.php?script_id=42

calendar


http://www.vim.org/scripts/script.php?script_id=52


calendar






http://www.vim.org/scripts/script.php?script_id=1218


NERDComComment


http://www.vim.org/scripts/script.php?script_id=1218


NERD_tree


http://www.vim.org/scripts/script.php?script_id=1658






Sketch


http://guoyoooping.blog.163.com/blog/static/135705183201003172658693/


http://www.vim.org/scripts/script.php?script_id=705


supertab


http://rickey-nctu.blogspot.tw/2009/03/vim-supertab-omnicppcomplete.html


taglist


http://www.vim.org/scripts/script.php?script_id=273


http://vim-taglist.sourceforge.net/index.html


http://rickey-nctu.blogspot.tw/2009/02/vim-taglist.html


tetris


http://www.vim.org/scripts/script.php?script_id=172