View and modify the file encoding in Linux

Source: Internet
Author: User
In Linux, you can view the file encoding and modify the encoding. in Linux, you can view the file encoding in the following ways: 1. in Vim, you can directly view the file encoding: setfileencoding to display the file encoding format. If you only want to view files in other encoding formats or want... in Linux, you can view the file encoding and modify the encoding. in Linux, you can view the file encoding in the following ways: 1. in Vim, you can directly view the file encoding: set fileencoding to display the file encoding format. If you only want to view files in other encoding formats or want to solve the problem of using Vim to view file garbled characters, you can go to www.2cto.com ~ /. Add the following content to the vimrc File: set encoding = UTF-8 fileencodings = ucs-bom, UTF-8, cp936, vim can automatically identify the file encoding (can automatically identify the UTF-8 or GBK encoding files), in fact, according to the fileencodings provided by the encoding list to try, if not find the appropriate encoding, it is opened in latin-1 (ASCII) encoding. Settings for the www.2cto.com vimrc File: 1 "too many variables specify 2 set tags =/usr/local/tags 3 4" UTF-8 ???? /Div> 5 set encoding = UTF-8 6 set fileencoding = UTF-8: 7 set fileencodings = UTF-8, euc-jp, sjis, jis, ascii: 8 set ambiwidth = double 9 10 "too many variables have been written into our own memory before creating 11 filetype plugin indent on 12 syntax enable 13 14" basic? 15 set nocompatible "vi mutual? Q stop 16 set expandtab "empty blank? Set 17 set tabstop = 4 "empty blank count 18 set shiftwidth = 4" empty? Number of records 19 set nu "line number indicates 20 set showmode" effect? Token indicates 21 "set backspace = 1" autoindent token to be modified. trim May 22 set backspace = indent, eol, start 23 set nowrap "24 set autoindent 25" set list 26 set smartcase 27 set r000028 set laststatus = 2 29 30 31 "タブの 32 set lcs = tab:>. 33 hi JpSpace cterm = underline ctermfg = Blue guifg = Blue 34 au BufRead, BufNew * match JpSpace // 35 36 "too many? Zookeeper was found 37 nnoremap .: Edit $ MYVIMRC 38 nnoremap S .: Source $ MYVIMRC 39 nnoremap, l: call PHPLint () 40 41 "PHP has been installed successfully when there are already 42 function PHPLint () 43 let result = system (& ft. '-L '. bufname ("") 44 echo result 45 endfunction 46 47 "???? Append 48 "autocmd BufNewFile, BufRead *. ctp set filetype = php 49 set runtimepath = ~ Tkunimoto/. vim, $ VIMRUNTIME 50 autocmd BufNewFile, BufRead *. ctp set filetype = htmlcake 51

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.