qp 中文乱码的设置

1. 设置依赖的vimrc

mkdir -p ~/linux_pro/vim
scp ip:~/linux_pro/vim/vimrc ~/linux_pro/vim/

2. 设置~/.vimrc 的内容

" 运行模式。
source ~/linux_pro/vim/vimrc

set nocompatible      " 非兼容vi模式。
set history=400       " history存储长度。
set autoread          " 文件修改之后自动载入。
set mouse-=a           " 在所有的模式下面打开鼠标。
set hlsearch          " 高亮search命中的文本。
autocmd! bufwritepost _vimrc source % " vimrc文件修改之后自动加载。 windows。
autocmd! bufwritepost .vimrc source % " vimrc文件修改之后自动加载。 linux。

" 取消备份。
set nobackup
set nowb
set noswapfile

" 设置编码。
set encoding=gbk
"set encoding=utf-8
set fileencodings=utf-8,gbk   " 设置文件的编码。
set helplang=cn               " 设置使用中文的帮助。
set termencoding=gbk
"set termencoding=utf-8

"set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1
"set fileencoding=utf-8
"set encoding=utf-8
"set termencoding=utf-8

" 显示设置。
set number                    " 显示行号。
set guifont=Consolas:h11      " window gui模式下面的字体。
set wrap                    " 取消换行。
syntax on                     " 打开语法高亮。
colorscheme darkblue          " 深蓝色配色方案。
set t_Co=8                    " the color, can be 8, 16, 32, 64 256

au GUIEnter * simalt ~x       " windows下面打开最大化。
let php_folding=0             " 打开自动折叠的功能。

" 缩进。
set autoindent " 自动对齐
set cindent " 按照 C 语言的语法,自动地调整缩进的长度
" C/C++语言的具体缩进方式,windows风格
set cinoptions={0,1s,t0,n-2,p2s,(03s,=.5s,>1s,=1s,:1s
if &term=="xterm"
     set t_Co=8
     set t_Sb=m
     set t_Sf=m
endif

" tab 空格。
set expandtab
set smarttab
set shiftwidth=2
autocmd FileType html,python,vim,javascript setlocal shiftwidth=2
autocmd FileType html,python,vim,javascript setlocal tabstop=2
autocmd FileType java,php setl shiftwidth=4
autocmd FileType java,php setl tabstop=4

" taglist
let Tlist_Auto_Highlight_Tag = 1
let Tlist_Auto_Open = 0
let Tlist_Auto_Update = 1
let Tlist_Close_On_Select = 0
let Tlist_Compact_Format = 0
let Tlist_Display_Prototype = 0
let Tlist_Display_Tag_Scope = 1
let Tlist_Enable_Fold_Column = 0
let Tlist_Exit_OnlyWindow = 0
let Tlist_File_Fold_Auto_Close = 0
let Tlist_GainFocus_On_ToggleOpen = 1
let Tlist_Hightlight_Tag_On_BufEnter = 1
let Tlist_Inc_Winwidth = 0
let Tlist_Max_Submenu_Items = 1
let Tlist_Max_Tag_Length = 30
let Tlist_Process_File_Always = 0
let Tlist_Show_Menu = 0
let Tlist_Show_One_File = 0
let Tlist_Sort_Type = "order"
let Tlist_Use_Horiz_Window = 0
let Tlist_Use_Right_Window = 1
let Tlist_WinWidth = 35
let tlist_php_settings = 'php;c:class;i:interfaces;d:constant;f:function'

" todo and calendar
filetype plugin indent on
let g:calendar_navi= 'right'
let g:calendar_navi_label = '上月,本月,下月'
let g:calendar_mruler = '一月,二月,三月,四月,五月,六月,七月,八月,九月,十月,十一月,十二月'
let g:calendar_wruler = '天 一 二 三 四 五 六'
let g:calendar_monday = 1


" 自动关联文件属性。
autocmd BufNewFile,BufRead *.yicf set filetype=yicf
autocmd BufNewFile,BufRead *.conf set filetype=apache
autocmd BufNewFile,BufRead *.vol  set filetype=vo_base
autocmd BufNewFile,BufRead *.todo set filetype=vo_base
autocmd BufNewFile,BufRead *.lst  set filetype=vo_base
autocmd BufNewFile,BufRead *.tree set filetype=vo_base

" 快捷方式。
map <C-Tab> :bnext<CR>
map <S-Tab> :bp<CR>
map <C-S>   :w!<CR>
map <F10>   :NERDTreeToggle<CR>
map <F11>   :TlistToggle<CR>

" 模板。
autocmd BufNewFile  *.php  0r ~/.vim/template/tpl.php

" 加载用户自定义的配置文件。
"source ~/.vim/my.vim

" vim 自动补齐
function! CleverTab()
  if strpart( getline('.'), 0, col('.')-1 ) =~ '^\s*$'
      return "\<Tab>"
  else
      return "\<C-N>"
endfunction
inoremap <Tab> <C-R>=CleverTab()<CR>

" Python 文件的一般设置,比如不要 tab 等
autocmd FileType python set tabstop=4 shiftwidth=4 expandtab
"自动补全配置
"Enable omni completion. (Ctrl-X Ctrl-O)
"autocmd FileType python set omnifunc=pythoncomplete#Complete

autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
autocmd FileType java set omnifunc=javacomplete#Complete
autocmd FileType python setlocal omnifunc=pythoncomplete#Complete

" Python 自动补全功能,用 Ctrl-N 调用
"pydiction 1.2 python auto complete
let g:pydiction_location = '~/.vim/tools/pydiction/complete-dict'
"defalut g:pydiction_menu_height == 15
let g:pydiction_menu_height = 20


3. ssh 终端编码设置为gbk



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值