VI的简单配置及配置文件集锦 z

掌握vi编辑器:.vimrc配置文件详解 本文还有配套的精品资源,点击获取 简介:Linux和Unix-like系统的 vi 编辑器及其增强版 vim 在文本编辑领域广受欢迎。 .vimrc 配置文件是用户自定义 vim 行为的关键,允许用户通过一系列命令行设置编辑器的外观、快捷键、自动缩进和智能补全等。熟练掌握 .vimrc 的定制,可使用户在... 阅读详情

   对于UNIX/linux初学者来说,在用VI来写程序的时候,总是发现不如WINDOWS下面的那些专业的文本编辑器那样高亮关键字,自动对齐等等...其实我们只要对VI进行一些简单的配置,即可实现很多美妙的功能,通过下面的配置,你就会发现,VI的灵活性几乎超乎于你的想象...
   一般来说,我们可以在当前用户的根目录下创建一个.vimrc的隐藏文件(当然,也可以不隐藏,看个人的习惯),方法如下:
$ touch ~/.vimrc
   符号~(可能很多人知道这个符号什么意思,却不会读,这个符号叫鄂化符号)在这里指当前用户的根目录,在创建新用户的时候会在/etc/passwd文件中的第六个字段说明主目录(如果你创建用户的时候没有指定根目录,默认为:/home/usrname),下面我们具体来看看.vimrc的配置...
$ vi ~/.vimrc
你可以依自己的爱好选择如下内容copy到.vimrc中:
[只是为了方便写C程序,提供自动格式化,使用C风格的自动缩进,tab设置为4个space...]

set fenc=utf-8   "设定默认解码

set fencs=utf-8,usc-bom,euc-jp,gb18030,gbk,gb2312,cp936 

set  nocp     "或者 set nocompatible 用于关闭VI的兼容模式

set number    "显示行号

set ai        "或者 set autoindent vim使用自动对齐,也就是把当前行的对齐格式应用到下一行

set si        "或者 set smartindent 依据上面的对齐格式,智能的选择对齐方式

set tabstop=4   "设置tab键为4个空格

set sw=4     "或者 set shiftwidth 设置当行之间交错时使用4个空格

set ruler    "设置在编辑过程中,于右下角显示光标位置的状态行

set incsearch "设置增量搜索,这样的查询比较smart

set showmatch "高亮显示匹配的括号 

set matchtime=5 "匹配括号高亮时间(单位为 1/10 s) set ignorecase  "在搜索的时候忽略大小写

syntax on       "高亮语法

 
[下面是网上比较流行的一些.vimrc]
 
  """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  " 一般设定
  """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  " 设定默认解码
  set fenc=utf-8
  set fencs=utf-8,usc-bom,euc-jp,gb18030,gbk,gb2312,cp936

  " 不要使用vi的键盘模式,而是vim自己的
  set nocompatible

  " history文件中需要记录的行数
  set history=100
 
  " 在处理未保存或只读文件的时候,弹出确认
  set confirm
 
  " 与windows共享剪贴板
  set clipboard+=unnamed
 
  " 侦测文件类型
  filetype on
 
  " 载入文件类型插件
  filetype plugin on
 
  " 为特定文件类型载入相关缩进文件
  filetype indent on
 
  " 保存全局变量
  set viminfo+=!
 
  " 带有如下符号的单词不要被换行分割
  set iskeyword+=_,$,@,%,#,-
 
  " 语法高亮
  syntax on
 
  " 高亮字符,让其不受100列限制
  :highlight OverLength ctermbg=red ctermfg=white guibg=red guifg=white
  :match OverLength '/%101v.*'
 
  " 状态行颜色
  highlight StatusLine guifg=SlateBlue guibg=Yellow
  highlight StatusLineNC guifg=Gray guibg=White
 
  """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  " 文件设置
  """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  " 不要备份文件(根据自己需要取舍)
  set nobackup
 
  " 不要生成swap文件,当buffer被丢弃的时候隐藏它
  setlocal noswapfile
  set bufhidden=hide
 
  " 字符间插入的像素行数目
  set linespace=0
 
  " 增强模式中的命令行自动完成操作
  set wildmenu
 
  " 在状态行上显示光标所在位置的行号和列号
  set ruler
  set rulerformat=%20(%2*%<%f%=/ %m%r/ %3l/ %c/ %p%%%)
 
  " 命令行(在状态行下)的高度,默认为1,这里是2
  set cmdheight=2
 
  " 使回格键(backspace)正常处理indent, eol, start等
  set backspace=2
 
  " 允许backspace和光标键跨越行边界
  set whichwrap+=<,>,h,l
 
  " 可以在buffer的任何地方使用鼠标(类似office中在工作区双击鼠标定位)
  set mouse=a
  set selection=exclusive
  set selectmode=mouse,key
 
  " 启动的时候不显示那个援助索马里儿童的提示
  set shortmess=atI
 
  " 通过使用: commands命令,告诉我们文件的哪一行被改变过
  set report=0
 
  " 不让vim发出讨厌的滴滴声
  set noerrorbells
 
  " 在被分割的窗口间显示空白,便于阅读
  set fillchars=vert:/ ,stl:/ ,stlnc:/
 
  """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  " 搜索和匹配
  """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  " 高亮显示匹配的括号
  set showmatch
 
  " 匹配括号高亮的时间(单位是十分之一秒)
  set matchtime=5
 
  " 在搜索的时候忽略大小写
  set ignorecase
 
  " 不要高亮被搜索的句子(phrases)
  set nohlsearch
 
  " 在搜索时,输入的词句的逐字符高亮(类似firefox的搜索)
  set incsearch
 
  " 输入:set list命令是应该显示些啥?
  set listchars=tab:/|/ ,trail:.,extends:>,precedes:<,eol:$
 
  " 光标移动到buffer的顶部和底部时保持3行距离
  set scrolloff=3
 
  " 不要闪烁
  set novisualbell
 
  " 我的状态行显示的内容(包括文件类型和解码)
  set statusline=%F%m%r%h%w/[POS=%l,%v][%p%%]/%{strftime(/"%d/%m/%y/ -/ %H:%M/")}
 
  " 总是显示状态行
  set laststatus=2
 
  """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  " 文本格式和排版
  """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  " 自动格式化
  set formatoptions=tcrqn
 
  " 继承前一行的缩进方式,特别适用于多行注释
  set autoindent
 
  " 为C程序提供自动缩进
  set smartindent
 
  " 使用C样式的缩进
  set cindent
 
  " 制表符为4
  set tabstop=4
 
  " 统一缩进为4
  set softtabstop=4
  set shiftwidth=4
 
  " 不要用空格代替制表符
  set noexpandtab
 
  " 不要换行
  set nowrap
 
  " 在行和段开始处使用制表符
  set smarttab
 
  """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  " CTags的设定
  """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  " 按照名称排序
  let Tlist_Sort_Type = "name"
 
  " 在右侧显示窗口
  let Tlist_Use_Right_Window = 1
 
  " 压缩方式
  let Tlist_Compart_Format = 1
 
  " 如果只有一个buffer,kill窗口也kill掉buffer
  let Tlist_Exist_OnlyWindow = 1
 
  " 不要关闭其他文件的tags
  let Tlist_File_Fold_Auto_Close = 0
 
  " 不要显示折叠树
  let Tlist_Enable_Fold_Column = 0
 
  """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  " Autocommands
  """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  " 只在下列文件类型被侦测到的时候显示行号,普通文本文件不显示
 
  if has("autocmd")
    autocmd FileType xml,html,c,cs,java,perl,shell,bash,cpp,python,vim,php,ruby 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/*<ESC>'>o*/
    autocmd FileType html,text,php,vim,c,java,xml,bash,shell,perl,python setlocal textwidth=100
    autocmd Filetype html,xml,xsl source $VIMRUNTIME/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 % -o %<"
  exec "! ./%<"
  endfunc
 
  " C++的编译和运行
  map <F6> :call CompileRunGpp()<CR>
  func! CompileRunGpp()
  exec "w"
  exec "!g++ % -o %<"
  exec "! ./%<"
  endfunc
 
  " 能够漂亮地显示.NFO文件
  set encoding=utf-8
  function! SetFileEncodings(encodings)
      let b:myfileencodingsbak=&fileencodings
          let &fileencodings=a:encodings
          endfunction
          function! RestoreFileEncodings()
              let &fileencodings=b:myfileencodingsbak
                  unlet b:myfileencodingsbak
                  endfunction
 
                  au BufReadPre *.nfo call SetFileEncodings('cp437')|set ambiwidth=single au BufReadPost *.nfo call RestoreFileEncodings()
 
                  " 高亮显示普通txt文件(需要txt.vim脚本)
                  au BufRead,BufNewFile *  setfiletype txt
 
                  " 用空格键来开关折叠
                  set foldenable
                  set foldmethod=manual
                  nnoremap <space> @=((foldclosed(line('.')) < 0) ? 'zc':'zo')<CR>
 
                  " minibufexpl插件的一般设置
                  let g:miniBufExplMapWindowNavVim = 1
                  let g:miniBufExplMapWindowNavArrows = 1
                  let g:miniBufExplMapCTabSwitchBufs = 1
                  let g:miniBufExplModSelTarget = 1
 
[下面这个被称为史上最强]
 
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"          _
"      __ | /
"     /   | /
"     /__ | /
" by Amix - http://amix.dk/
"
" Maintainer: Amir Salihefendic <amix3k at gmail.com>
" Version: 2.7
" Last Change: 12/10/06 00:09:21
"
" Sections:
" ----------------------
" General
" Colors and Fonts
" Fileformats
" VIM userinterface
"    Statusline
" Visual
" Moving around and tabs
" General Autocommands
" Parenthesis/bracket expanding
" General Abbrevs
" Editing mappings etc.
" Command-line config
" Buffer realted
" Files and backups
" Folding
" Text options
"    Indent
" Spell checking
" Plugin configuration
"    Yank ring
"    File explorer
"    Minibuffer
"    Tag list (ctags) - not used
"    LaTeX Suite things
" Filetype generic
"    Todo
"    VIM
"    HTML related
"    Ruby & PHP section
"    Python section
"    Cheetah section
"    Vim section
"    Java section
"    JavaScript section
"    C mappings
"    SML
"    Scheme bindings
" Snippets
"    Python
"    javaScript
" Cope
" MISC
"
"  Tip:
"   If you find anything that you can't understand than do this:
"   help keyword OR helpgrep keywords
"  Example:
"   Go into command-line mode and type helpgrep nocompatible, ie.
"   :helpgrep nocompatible
"   then press <leader>c to see the results, or :botright cw
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" General
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"Get out of VI's compatible mode..
set nocompatible

"Sets how many lines of history VIM har to remember
set history=400

"Enable filetype plugin
filetype plugin on
filetype indent on

"Set to auto read when a file is changed from the outside
set autoread

"Have the mouse enabled all the time:
set mouse=a

"Set mapleader
let mapleader = ","
let g:mapleader = ","

"Fast saving
nmap <leader>w :w!<cr>
nmap <leader>f :find<cr>

"Fast reloading of the .vimrc
map <leader>s :source ~/vim_local/vimrc<cr>
"Fast editing of .vimrc
map <leader>e :e! ~/vim_local/vimrc<cr>
"When .vimrc is edited, reload it
autocmd! bufwritepost vimrc source ~/vim_local/vimrc


"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Colors and Fonts
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"Enable syntax hl
syntax enable

"Set font to Monaco 10pt
if MySys() == "mac"
  set gfn=Bitstream/ Vera/ Sans/ Mono:h14
  set nomacatsui
  set termencoding=macroman
elseif MySys() == "linux"
  set gfn=Monospace/ 11
endif

if has("gui_running")
  set guioptions-=T
  let psc_style='cool'
  colorscheme ps_color
else
  set background=dark
  colorscheme zellner
endif

"Some nice mapping to switch syntax (useful if one mixes different languages in one file)
map <leader>1 :set syntax=cheetah<cr>
map <leader>2 :set syntax=xhtml<cr>
map <leader>3 :set syntax=python<cr>
map <leader>4 :set ft=javascript<cr>
map <leader>$ :syntax sync fromstart<cr>

autocmd BufEnter * :syntax sync fromstart

"Highlight current
if has("gui_running")
  set cursorline
  hi cursorline guibg=#333333
  hi CursorColumn guibg=#333333
endif

"Omni menu colors
hi Pmenu guibg=#333333
hi PmenuSel guibg=#555555 guifg=#ffffff


"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Fileformats
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"Favorite filetypes
set ffs=unix,dos,mac

nmap <leader>fd :se ff=dos<cr>
nmap <leader>fu :se ff=unix<cr>



"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" VIM userinterface
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"Set 7 lines to the curors - when moving vertical..
set so=7

"Turn on WiLd menu
set wildmenu

"Always show current position
set ruler

"The commandbar is 2 high
set cmdheight=2

"Show line number
set nu

"Do not redraw, when running macros.. lazyredraw
set lz

"Change buffer - without saving
set hid

"Set backspace
set backspace=eol,start,indent

"Bbackspace and cursor keys wrap to
set whichwrap+=<,>,h,l

"Ignore case when searching
set ignorecase
set incsearch

"Set magic on
set magic

"No sound on errors.
set noerrorbells
set novisualbell
set t_vb=

"show matching bracets
set showmatch

"How many tenths of a second to blink
set mat=2

"Highlight search things
set hlsearch

  """"""""""""""""""""""""""""""
  " Statusline
  """"""""""""""""""""""""""""""
  "Always hide the statusline
  set laststatus=2

  function! CurDir()
     let curdir = substitute(getcwd(), '/Users/amir/', "~/", "g")
     return curdir
  endfunction

  "Format the statusline
  set statusline=/ %F%m%r%h/ %w/ / CWD:/ %r%{CurDir()}%h/ / / Line:/ %l/%L:%c



""""""""""""""""""""""""""""""
" Visual
""""""""""""""""""""""""""""""
" From an idea by Michael Naumann
function! VisualSearch(direction) range
  let l:saved_reg = @"
  execute "normal! vgvy"
  let l:pattern = escape(@", '///.*$^~[]')
  let l:pattern = substitute(l:pattern, "/n$", "", "")
  if a:direction == 'b'
    execute "normal ?" . l:pattern . "^M"
  else
    execute "normal /" . l:pattern . "^M"
  endif
  let @/ = l:pattern
  let @" = l:saved_reg
endfunction

"Basically you press * or # to search for the current selection !! Really useful
vnoremap <silent> * :call VisualSearch('f')<CR>
vnoremap <silent> # :call VisualSearch('b')<CR>


"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Moving around and tabs
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"Map space to / and c-space to ?
map <space> /
map <c-space> ?

"Smart way to move btw. windows
map <C-j> <C-W>j
map <C-k> <C-W>k
map <C-h> <C-W>h
map <C-l> <C-W>l

"Actually, the tab does not switch buffers, but my arrows
"Bclose function ca be found in "Buffer related" section
map <leader>bd :Bclose<cr>
map <down> <leader>bd
"Use the arrows to something usefull
map <right> :bn<cr>
map <left> :bp<cr>

"Tab configuration
map <leader>tn :tabnew %<cr>
map <leader>te :tabedit
map <leader>tc :tabclose<cr>
map <leader>tm :tabmove
try
  set switchbuf=usetab
  set stal=2
catch
endtry

"Moving fast to front, back and 2 sides ;)
imap <m-$> <esc>$a
imap <m-0> <esc>0i
imap <D-$> <esc>$a
imap <D-0> <esc>0i


"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" General Autocommands
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"Switch to current dir
map <leader>cd :cd %:p:h<cr>


"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Parenthesis/bracket expanding
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
vnoremap $1 <esc>`>a)<esc>`<i(<esc>
")
vnoremap $2 <esc>`>a]<esc>`<i[<esc>
vnoremap $3 <esc>`>a}<esc>`<i{<esc>
vnoremap $$ <esc>`>a"<esc>`<i"<esc>
vnoremap $q <esc>`>a'<esc>`<i'<esc>
vnoremap $w <esc>`>a"<esc>`<i"<esc>

"Map auto complete of (, ", ', [
inoremap $1 ()<esc>:let leavechar=")"<cr>i
inoremap $2 []<esc>:let leavechar="]"<cr>i
inoremap $4 {<esc>o}<esc>:let leavechar="}"<cr>O
inoremap $3 {}<esc>:let leavechar="}"<cr>i
inoremap $q ''<esc>:let leavechar="'"<cr>i
inoremap $w ""<esc>:let leavechar='"'<cr>i
au BufNewFile,BufRead *./(vim/)/@! inoremap " ""<esc>:let leavechar='"'<cr>i
au BufNewFile,BufRead *./(txt/)/@! inoremap ' ''<esc>:let leavechar="'"<cr>i

imap <m-l> <esc>:exec "normal f" . leavechar<cr>a
imap <d-l> <esc>:exec "normal f" . leavechar<cr>a


"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" General Abbrevs
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"My information
iab xdate <c-r>=strftime("%d/%m/%y %H:%M:%S")<cr>
iab xname Amir Salihefendic


"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Editing mappings etc.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"Remap VIM 0
map 0 ^

"Move a line of text using control
nmap <M-j> mz:m+<cr>`z
nmap <M-k> mz:m-2<cr>`z
vmap <M-j> :m'>+<cr>`<my`>mzgv`yo`z
vmap <M-k> :m'<-2<cr>`>my`<mzgv`yo`z

if MySys() == "mac"
  nmap <D-j> <M-j>
  nmap <D-k> <M-k>
  vmap <D-j> <M-j>
  vmap <D-k> <M-k>
endif

func! DeleteTrailingWS()
  exe "normal mz"
  %s//s/+$//ge
  exe "normal `z"
endfunc
autocmd BufWrite *.py :call DeleteTrailingWS()

set completeopt=menu

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Command-line config
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
func! Cwd()
  let cwd = getcwd()
  return "e " . cwd 
endfunc

func! DeleteTillSlash()
  let g:cmd = getcmdline()
  if MySys() == "linux" || MySys() == "mac"
    let g:cmd_edited = substitute(g:cmd, "//(.*/[//]//).*", "//1", "")
  else
    let g:cmd_edited = substitute(g:cmd, "//(.*/[////]//).*", "//1", "")
  endif
  if g:cmd == g:cmd_edited
    if MySys() == "linux" || MySys() == "mac"
      let g:cmd_edited = substitute(g:cmd, "//(.*/[//]//).*/", "//1", "")
    else
      let g:cmd_edited = substitute(g:cmd, "//(.*/[/////]//).*/[/////]", "//1", "")
    endif
  endif
  return g:cmd_edited
endfunc

func! CurrentFileDir(cmd)
  return a:cmd . " " . expand("%:p:h") . "/"
endfunc

"Smart mappings on the command line
cno $h e ~/
cno $d e ~/Desktop/
cno $j e ./

cno $q <C-/>eDeleteTillSlash()<cr>

cno $c e <C-/>eCurrentFileDir("e")<cr>

cno $tc <C-/>eCurrentFileDir("tabnew")<cr>
cno $th tabnew ~/
cno $td tabnew ~/Desktop/

"Bash like
cnoremap <C-A>    <Home>
cnoremap <C-E>    <End>
cnoremap <C-K>    <C-U>


"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Buffer realted
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"Fast open a buffer by search for a name
map <c-q> :sb

"Open a dummy buffer for paste
map <leader>q :e ~/buffer<cr>

"Restore cursor to file position in previous editing session
set viminfo='10,/"100,:20,%,n~/.viminfo
au BufReadPost * if line("'/"") > 0|if line("'/"") <= line("$")|exe("norm '/"")|else|exe "norm $"|endif|endif

" Buffer - reverse everything ... :)
map <F9> ggVGg?

" Don't close window, when deleting a buffer
command! Bclose call <SID>BufcloseCloseIt()

function! <SID>BufcloseCloseIt()
   let l:currentBufNum = bufnr("%")
   let l:alternateBufNum = bufnr("#")

   if buflisted(l:alternateBufNum)
     buffer #
   else
     bnext
   endif

   if bufnr("%") == l:currentBufNum
     new
   endif

   if buflisted(l:currentBufNum)
     execute("bdelete! ".l:currentBufNum)
   endif
endfunction


"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Files and backups
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"Turn backup off
set nobackup
set nowb
set noswapfile


"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Folding
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"Enable folding, I find it very useful
set nofen
set fdl=0


"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Text options
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set expandtab
set shiftwidth=2

map <leader>t2 :set shiftwidth=2<cr>
map <leader>t4 :set shiftwidth=4<cr>
au FileType html,python,vim,javascript setl shiftwidth=2
au FileType html,python,vim,javascript setl tabstop=2
au FileType java setl shiftwidth=4
au FileType java setl tabstop=4

set smarttab
set lbr
set tw=500

   """"""""""""""""""""""""""""""
   " Indent
   """"""""""""""""""""""""""""""
   "Auto indent
   set ai

   "Smart indet
   set si

   "C-style indeting
   set cindent

   "Wrap lines
   set wrap


"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Spell checking
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
map <leader>sn ]s
map <leader>sp [s
map <leader>sa zg
map <leader>s? z=


"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Plugin configuration
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
   """"""""""""""""""""""""""""""
   " Vim Grep
   """"""""""""""""""""""""""""""
   let Grep_Skip_Dirs = 'RCS CVS SCCS .svn'
   let Grep_Cygwin_Find = 1

   """"""""""""""""""""""""""""""
   " Yank Ring
   """"""""""""""""""""""""""""""
   map <leader>y :YRShow<cr>

   """"""""""""""""""""""""""""""
   " File explorer
   """"""""""""""""""""""""""""""
   "Split vertically
   let g:explVertical=1

   "Window size
   let g:explWinSize=35

   let g:explSplitLeft=1
   let g:explSplitBelow=1

   "Hide some files
   let g:explHideFiles='^/.,.*/.class$,.*/.swp$,.*/.pyc$,.*/.swo$,/.DS_Store$'

   "Hide the help thing..
   let g:explDetailedHelp=0


   """"""""""""""""""""""""""""""
   " Minibuffer
   """"""""""""""""""""""""""""""
   let g:miniBufExplModSelTarget = 1
   let g:miniBufExplorerMoreThanOne = 2
   let g:miniBufExplModSelTarget = 0
   let g:miniBufExplUseSingleClick = 1
   let g:miniBufExplMapWindowNavVim = 1
   let g:miniBufExplVSplit = 25
   let g:miniBufExplSplitBelow=1

   let g:bufExplorerSortBy = "name"

   autocmd BufRead,BufNew :call UMiniBufExplorer


   """"""""""""""""""""""""""""""
   " Tag list (ctags) - not used
   """"""""""""""""""""""""""""""
   "let Tlist_Ctags_Cmd = "/sw/bin/ctags-exuberant"
   "let Tlist_Sort_Type = "name"
   "let Tlist_Show_Menu = 1
   "map <leader>t :Tlist<cr>


   """"""""""""""""""""""""""""""
   " LaTeX Suite things
   """"""""""""""""""""""""""""""
   set grepprg=grep/ -nH/ $*
   let g:Tex_DefaultTargetFormat="pdf"
   let g:Tex_ViewRule_pdf='xpdf'

   "Bindings
   autocmd FileType tex map <silent><leader><space> :w!<cr> :silent! call Tex_RunLaTeX()<cr>

   "Auto complete some things ;)
   autocmd FileType tex inoremap $i /indent
   autocmd FileType tex inoremap $* /cdot
   autocmd FileType tex inoremap $i /item
   autocmd FileType tex inoremap $m /[<cr>/]<esc>O


"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Filetype generic
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
   """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
   " Todo
   """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
   au BufNewFile,BufRead *.todo so ~/vim_local/syntax/amido.vim

   """"""""""""""""""""""""""""""
   " VIM
   """"""""""""""""""""""""""""""
   autocmd FileType vim map <buffer> <leader><space> :w!<cr>:source %<cr>


   """"""""""""""""""""""""""""""
   " HTML related
   """"""""""""""""""""""""""""""
   " HTML entities - used by xml edit plugin
   let xml_use_xhtml = 1
   "let xml_no_auto_nesting = 1

   "To HTML
   let html_use_css = 1
   let html_number_lines = 0
   let use_xhtml = 1


   """"""""""""""""""""""""""""""
   " Ruby & PHP section
   """"""""""""""""""""""""""""""
   autocmd FileType ruby map <buffer> <leader><space> :w!<cr>:!ruby %<cr>
   autocmd FileType php compiler php
   autocmd FileType php map <buffer> <leader><space> <leader>cd:w<cr>:make %<cr>


   """"""""""""""""""""""""""""""
   " Python section
   """"""""""""""""""""""""""""""
   "Run the current buffer in python - ie. on leader+space
   au FileType python so ~/vim_local/syntax/python.vim
   autocmd FileType python map <buffer> <leader><space> :w!<cr>:!python %<cr>
   autocmd FileType python so ~/vim_local/plugin/python_fold.vim

   "Set some bindings up for 'compile' of python
   autocmd FileType python set makeprg=python/ -c/ /"import/ py_compile,sys;/ sys.stderr=sys.stdout;/ py_compile.compile(r'%')/"
   autocmd FileType python set efm=%C/ %.%#,%A/ / File/ /"%f/"//,/ line/ %l%.%#,%Z%[%^/ ]%//@=%m

   "Python iMaps
   au FileType python set cindent
   au FileType python inoremap <buffer> $r return
   au FileType python inoremap <buffer> $s self
   au FileType python inoremap <buffer> $c ##<cr>#<space><cr>#<esc>kla
   au FileType python inoremap <buffer> $i import
   au FileType python inoremap <buffer> $p print
   au FileType python inoremap <buffer> $d """<cr>"""<esc>O

   "Run in the Python interpreter
   function! Python_Eval_VSplit() range
     let src = tempname()
     let dst = tempname()
     execute ": " . a:firstline . "," . a:lastline . "w " . src
     execute ":!python " . src . " > " . dst
     execute ":pedit! " . dst
   endfunction
   au FileType python vmap <F7> :call Python_Eval_VSplit()<cr>

   """"""""""""""""""""""""""""""
   " Cheetah section
   """""""""""""""""""""""""""""""
   autocmd FileType cheetah set ft=xml
   autocmd FileType cheetah set syntax=cheetah

   """""""""""""""""""""""""""""""
   " Vim section
   """""""""""""""""""""""""""""""
   autocmd FileType vim set nofen

   """""""""""""""""""""""""""""""
   " Java section
   """""""""""""""""""""""""""""""
   au FileType java inoremap <buffer> <C-t> System.out.println();<esc>hi

   "Java comments
   autocmd FileType java source ~/vim_local/macros/jcommenter.vim
   autocmd FileType java let b:jcommenter_class_author='Amir Salihefendic (amix@amix.dk)'
   autocmd FileType java let b:jcommenter_file_author='Amir Salihefendic (amix@amix.dk)'
   autocmd FileType java map <buffer> <F2> :call JCommentWriter()<cr>

   "Abbr'z
   autocmd FileType java inoremap <buffer> $pr private
   autocmd FileType java inoremap <buffer> $r return
   autocmd FileType java inoremap <buffer> $pu public
   autocmd FileType java inoremap <buffer> $i import
   autocmd FileType java inoremap <buffer> $b boolean
   autocmd FileType java inoremap <buffer> $v void
   autocmd FileType java inoremap <buffer> $s String

   "Folding
   function! JavaFold()
     setl foldmethod=syntax
     setl foldlevelstart=1
     syn region foldBraces start=/{/ end=/}/ transparent fold keepend extend
     syn match foldImports //(/n/?import./+;/n/)/+/ transparent fold

     function! FoldText()
       return substitute(getline(v:foldstart), '{.*', '{...}', '')
     endfunction
     setl foldtext=FoldText()
   endfunction
   au FileType java call JavaFold()
   au FileType java setl fen

   au BufEnter *.sablecc,*.scc set ft=sablecc

   """"""""""""""""""""""""""""""
   " JavaScript section
   """""""""""""""""""""""""""""""
   au FileType javascript so ~/vim_local/syntax/javascript.vim
   function! JavaScriptFold()
     setl foldmethod=syntax
     setl foldlevelstart=1
     syn region foldBraces start=/{/ end=/}/ transparent fold keepend extend

     function! FoldText()
       return substitute(getline(v:foldstart), '{.*', '{...}', '')
     endfunction
     setl foldtext=FoldText()
   endfunction
   au FileType javascript call JavaScriptFold()
   au FileType javascript setl fen

   au FileType javascript imap <c-t> console.log();<esc>hi
   au FileType javascript imap <c-a> alert();<esc>hi
   au FileType javascript setl nocindent
   au FileType javascript inoremap <buffer> $r return

   au FileType javascript inoremap <buffer> $d //<cr>//<cr>//<esc>ka<space>
   au FileType javascript inoremap <buffer> $c /**<cr><space><cr>**/<esc>ka


   """"""""""""""""""""""""""""""
   " HTML
   """""""""""""""""""""""""""""""
   au FileType html,cheetah set ft=xml
   au FileType html,cheetah set syntax=html


   """"""""""""""""""""""""""""""
   " C mappings
   """""""""""""""""""""""""""""""
   autocmd FileType c map <buffer> <leader><space> :w<cr>:!gcc %<cr>


   """""""""""""""""""""""""""""""
   " SML
   """""""""""""""""""""""""""""""
   autocmd FileType sml map <silent> <buffer> <leader><space> <leader>cd:w<cr>:!sml %<cr>


   """"""""""""""""""""""""""""""
   " Scheme bidings
   """"""""""""""""""""""""""""""
   autocmd BufNewFile,BufRead *.scm map <buffer> <leader><space> <leader>cd:w<cr>:!petite %<cr>
   autocmd BufNewFile,BufRead *.scm inoremap <buffer> <C-t> (pretty-print )<esc>i
   autocmd BufNewFile,BufRead *.scm vnoremap <C-t> <esc>`>a)<esc>`<i(pretty-print <esc>


   """"""""""""""""""""""""""""""
   " SVN section
   """""""""""""""""""""""""""""""
   map <F8> :new<CR>:read !svn diff<CR>:set syntax=diff buftype=nofile<CR>gg


""""""""""""""""""""""""""""""
" Snippets
"""""""""""""""""""""""""""""""
   "You can use <c-j> to goto the next <++> - it is pretty smart ;)

   """""""""""""""""""""""""""""""
   " Python
   """""""""""""""""""""""""""""""
   autocmd FileType python inorea <buffer> cfun <c-r>=IMAP_PutTextWithMovement("def <++>(<++>):/n<++>/nreturn <++>")<cr>
   autocmd FileType python inorea <buffer> cclass <c-r>=IMAP_PutTextWithMovement("class <++>:/n<++>")<cr>
   autocmd FileType python inorea <buffer> cfor <c-r>=IMAP_PutTextWithMovement("for <++> in <++>:/n<++>")<cr>
   autocmd FileType python inorea <buffer> cif <c-r>=IMAP_PutTextWithMovement("if <++>:/n<++>")<cr>
   autocmd FileType python inorea <buffer> cifelse <c-r>=IMAP_PutTextWithMovement("if <++>:/n<++>/nelse:/n<++>")<cr>


   """""""""""""""""""""""""""""""
   " JavaScript
   """""""""""""""""""""""""""""""
   autocmd FileType cheetah,html,javascript inorea <buffer> cfun <c-r>=IMAP_PutTextWithMovement("function <++>(<++>) {/n<++>;/nreturn <++>;/n}")<cr>
   autocmd filetype cheetah,html,javascript inorea <buffer> cfor <c-r>=IMAP_PutTextWithMovement("for(<++>; <++>; <++>) {/n<++>;/n}")<cr>
   autocmd FileType cheetah,html,javascript inorea <buffer> cif <c-r>=IMAP_PutTextWithMovement("if(<++>) {/n<++>;/n}")<cr>
   autocmd FileType cheetah,html,javascript inorea <buffer> cifelse <c-r>=IMAP_PutTextWithMovement("if(<++>) {/n<++>;/n}/nelse {/n<++>;/n}")<cr>


   """""""""""""""""""""""""""""""
   " HTML
   """""""""""""""""""""""""""""""
   autocmd FileType cheetah,html inorea <buffer> cahref <c-r>=IMAP_PutTextWithMovement('<a href="<++>"><++></a>')<cr>
   autocmd FileType cheetah,html inorea <buffer> cbold <c-r>=IMAP_PutTextWithMovement('<b><++></b>')<cr>
   autocmd FileType cheetah,html inorea <buffer> cimg <c-r>=IMAP_PutTextWithMovement('<img src="<++>" alt="<++>" />')<cr>
   autocmd FileType cheetah,html inorea <buffer> cpara <c-r>=IMAP_PutTextWithMovement('<p><++></p>')<cr>
   autocmd FileType cheetah,html inorea <buffer> ctag <c-r>=IMAP_PutTextWithMovement('<<++>><++></<++>>')<cr>
   autocmd FileType cheetah,html inorea <buffer> ctag1 <c-r>=IMAP_PutTextWithMovement("<<++>><cr><++><cr></<++>>")<cr>


   """""""""""""""""""""""""""""""
   " Java
   """""""""""""""""""""""""""""""
   autocmd FileType java inorea <buffer> cfun <c-r>=IMAP_PutTextWithMovement("public<++> <++>(<++>) {/n<++>;/nreturn <++>;/n}")<cr>
   autocmd FileType java inorea <buffer> cfunpr <c-r>=IMAP_PutTextWithMovement("private<++> <++>(<++>) {/n<++>;/nreturn <++>;/n}")<cr>
   autocmd FileType java inorea <buffer> cfor <c-r>=IMAP_PutTextWithMovement("for(<++>; <++>; <++>) {/n<++>;/n}")<cr>
   autocmd FileType java inorea <buffer> cif <c-r>=IMAP_PutTextWithMovement("if(<++>) {/n<++>;/n}")<cr>
   autocmd FileType java inorea <buffer> cifelse <c-r>=IMAP_PutTextWithMovement("if(<++>) {/n<++>;/n}/nelse {/n<++>;/n}")<cr>
   autocmd FileType java inorea <buffer> cclass <c-r>=IMAP_PutTextWithMovement("class <++> <++> {/n<++>/n}")<cr>
   autocmd FileType java inorea <buffer> cmain <c-r>=IMAP_PutTextWithMovement("public static void main(String[] argv) {/n<++>/n}")<cr>


   "Presse c-q insted of space (or other key) to complete the snippet
   imap <C-q> <C-]>


"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Cope
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"For Cope
map <silent> <leader><cr> :noh<cr>

"Orginal for all
map <leader>n :cn<cr>
map <leader>p :cp<cr>
map <leader>c :botright cw 10<cr>
map <c-u> <c-l><c-j>:q<cr>:botright cw 10<cr>


"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" MISC
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"Remove the Windows ^M
noremap <Leader>m mmHmt:%s/<C-V><cr>//ge<cr>'tzt'm

"Paste toggle - when pasting something in, don't indent.
set pastetoggle=<F3>

"Remove indenting on empty lines
map <F2> :%s//s*$//g<cr>:noh<cr>''

"Super paste
inoremap <C-v> <esc>:set paste<cr>mui<C-R>+<esc>mv'uV'v=:set nopaste<cr>

"A function that inserts links & anchors on a TOhtml export.
" Notice:
" Syntax used is:
" Link
" Anchor
function! SmartTOHtml()
   TOhtml
   try
    %s/&quot;/s/+/*&gt; /(./+/)</" <a href="#/1" style="color: cyan">/1<//a></g
    %s/&quot;/(-/|/s/)/+/*&gt; /(./+/)</" /&nbsp;/&nbsp; <a href="#/2" style="color: cyan;">/2<//a></g
    %s/&quot;/s/+=&gt; /(./+/)</" <a name="/1" style="color: #fff">/1<//a></g
   catch
   endtry
   exe ":write!"
   exe ":bd"
endfunction

[vim组织提供的一个配置例子]
"=====================================================================================
  " Description: My daily vimrc with dozens of plugins.
  " Originally derived from MetaCosm's http://vi-improved.org/vimrc.php
  " Last Change: 0 14/05/2006 20:54:07 Leal@RAINT:_vimrc
  "
  " Author: Leal <linxiao.li AT gmail DOT com>
  "
http://www.leal.cn
  " Version: 1.0065
  "
  " Usage: 1. Prepare necessary dirs and files
  " $VIMDATA X:/Vim/vimdata on Win, ~/vimdata on Linux
  " |
  " |-- temp to put swap files <DIR>
  " |-- backup to put backup files <DIR>
  " |-- diary to save calendar.vim's diaries <DIR>
  " |-- GetLatest to save GetLatestVimScripts.vim's <DIR>
  " | |
  " | `-- GetLatestVimScripts.dat to store GLVS's items
  " |
  " |-- _vim_fav_files to store favmenu.vim's items
  " `-- _vim_mru_files to store mru.vim's items
  "
  " 2. Get all scripts you favor on
www.vim.org better with GLVS
  "
  " 3. Get all needed utilities, especially on Windows, e.g.
  " wget -- WGET for Windows (win32)
http://users.ugent.be/~bpuype/wget/
  " ctags -- Exuberant Ctags
http://ctags.sf.net/
  "
  " 4. If you have no idea of some option, just press K (<S-k>) on it.
  "
  " 5. HTML file is produced with :TOhtml, with colo default.
  "
  "=====================================================================================
  
  "-------------------------------------------------------------------------------------
  " TODO List
  "-------------------------------------------------------------------------------------
  " 1. Install Chinese Vim help helplang -> cn
  
  "-------------------------------------------------------------------------------------
  " general
  "-------------------------------------------------------------------------------------
  set nocompatible " use vim as vim, should be put at the very start
  set history=1000 " lines of Ex-mode commands, search history
  set browsedir=buffer " use directory of the related buffer for file browser
  set clipboard+=unnamed " use clipboard register '*' for all y, d, c, p ops
  set viminfo+=! " make sure it can save viminfo
  set isk+=$,%,#,- " none of these should be word dividers
  set confirm " raise a dialog confirm whether to save changed buffer
  set ffs=unix,dos,mac " favor unix ff, which behaves good under bot Winz & Linux
  set fenc=utf-8 " default fileencoding
  set fencs=utf-8,ucs-bom,euc-jp,gb18030,gbk,gb2312,cp936
  map Q gq
  " don't use Ex-mode, use Q for formatting
  filetype on " enable file type detection
  filetype plugin on " enable loading the plugin for appropriate file type
  
  "-------------------------------------------------------------------------------------
  " platform dependent
  "-------------------------------------------------------------------------------------
  if has("win32")
  let $VIMDATA = $VIM.'/vimdata'
  let $VIMFILES = $VIM.'/vimfiles'
  let PYTHON_BIN_PATH = 'd:/foo/python/python.exe' " ensure the path right
  else
  let $VIMDATA = $HOME.'/vimdata'
  let $VIMFILES = $HOME.'/.vim'
  let PYTHON_BIN_PATH = '/usr/bin/python'
  set guifont=courier/ 10
  endif
  
  "-------------------------------------------------------------------------------------
  " path/backup
  "-------------------------------------------------------------------------------------
  set backup " make backup file and leave it around
  set backupdir=$VIMDATA/backup " where to put backup file
  set directory=$VIMDATA/temp " where to put swap file
  set runtimepath+=$VIMDATA " add this path to rtp, support GetLatestVimScripts.vim
  set path=.,/usr/include/*,, " where gf, ^Wf, :find will search
  set tags=./tags,tags,$VIMRUNTIME/doc/tags,$VIMFILES/doc/tags " tags files CTRL-] uses
  set makeef=error.err " the errorfile for :make and :grep
  
  "-------------------------------------------------------------------------------------
  " colors
  "-------------------------------------------------------------------------------------
  set background=dark " use a dark background
  syntax on " syntax highlighting
  
  "-------------------------------------------------------------------------------------
  " gui-only settings
  "-------------------------------------------------------------------------------------
  if has("gui_running")
  colo inkpot " colorscheme, inkpot.vim
  set lines=40 " window tall and wide, only if gui_running,
  set columns=120 " or vim under console behaves badly
  endif
  
  "-------------------------------------------------------------------------------------
  " Vim UI
  "-------------------------------------------------------------------------------------
  set linespace=1 " space it out a little more (easier to read)
  set wildmenu " type :h and press <Tab> to look what happens
  set ruler " always show current position along the bottom
  set cmdheight=2 " use 2 screen lines for command-line
  set lazyredraw " do not redraw while executing macros (much faster)
  set nonumber " don't print line number
  set hid " allow to change buffer without saving
  set backspace=2 " make backspace work normal
  set whichwrap+=<,>,h,l " allow backspace and cursor keys to wrap
  set mouse=a " use mouse in all modes
  set shortmess=atI " shorten messages to avoid 'press a key' prompt
  set report=0 " tell us when anything is changed via :...
  set fillchars=vert:/ ,stl:/ ,stlnc:/
  " make the splitters between windows be blank
  
  "-------------------------------------------------------------------------------------
  " visual cues
  "-------------------------------------------------------------------------------------
  set showmatch " show matching paren
  set matchtime=5 " 1/10 second to show the matching paren
  set nohlsearch " do not highlight searched for phrases
  set incsearch " BUT do highlight where the so far typed pattern matches
  set scrolloff=10 " minimal number of screen lines to keep above/below the cursor
  set novisualbell " use visual bell instead of beeping
  set noerrorbells " do not make noise
  set laststatus=2 " always show the status line
  set listchars=tab:/|/ ,trail:.,extends:>,precedes:<,eol:$ " what to show while :set list
  set statusline=%{VimBuddy()}/ %F%m%r%h%w/ [%{&ff}]/ [%Y]/ [/%03.3b/ /%02.2B]/ [%02v/ %03l/ %L/ %p%%]
  
  "-------------------------------------------------------------------------------------
  " text formatting/layout
  "-------------------------------------------------------------------------------------
  set ai " autoindent
  set si " smartindent
  set cindent " do C-style indenting
  set fo=tcrqn " see help (complex)
  set tabstop=4 " tab spacing (settings below are just to unify it)
  set softtabstop=4 " unify
  set shiftwidth=4 " unify
  set noexpandtab " real tabs please!
  set smarttab " use tabs at the start of a line, spaces elsewhere
  set nowrap " do not wrap lines
  set formatoptions+=mM " so that vim can reformat multibyte text (e.g. Chinese)
  
  "-------------------------------------------------------------------------------------
  " folding
  "-------------------------------------------------------------------------------------
  set foldenable " turn on folding
  set foldmethod=indent " make folding indent sensitive
  set foldlevel=100 " don't autofold anything (but I can still fold manually)
  set foldopen -=search " don't open folds when you search into them
  set foldopen -=undo " don't open folds when you undo stuff
  
  "-------------------------------------------------------------------------------------
  " plugin - a.vim
  "-------------------------------------------------------------------------------------
  " alternate files quickly (.c --> .h etc)
  
  "-------------------------------------------------------------------------------------
  " plugin - c.vim
  "-------------------------------------------------------------------------------------
  "set makeprg=g++/ %
  let g:C_AuthorName = 'Leal'
  let g:C_Email = 'linxiao.li NOSPAM gmail DOT com'
  
  "-------------------------------------------------------------------------------------
  " plugin - runscript.vim (for Python)
  "-------------------------------------------------------------------------------------
  "let PYTHON_BIN_PATH = ...
  
  "-------------------------------------------------------------------------------------
  " plugin - calendar.vim
  "-------------------------------------------------------------------------------------
  let g:calendar_diary = $VIMDATA.'/diary' " where to store your diary
  
  "-------------------------------------------------------------------------------------
  " plugin - mru.vim (most recently used files)
  "-------------------------------------------------------------------------------------
  let MRU_File = $VIMDATA.'/_vim_mru_files' " which file to save mru entries
  let MRU_Max_Entries = 20 " max mru entries in _vim_mru_files
  
  "-------------------------------------------------------------------------------------
  " plugin - favmenu.vim
  "-------------------------------------------------------------------------------------
  let FAV_File = $VIMDATA.'/_vim_fav_files' " which file to save favorite entries
  
  "-------------------------------------------------------------------------------------
  " plugin - minibufexpl.vim
  "-------------------------------------------------------------------------------------
  let g:miniBufExplTabWrap = 1 " make tabs show complete (no broken on two lines)
  let g:miniBufExplModSelTarget = 1
  
  "-------------------------------------------------------------------------------------
  " plugin - taglist.vim
  "-------------------------------------------------------------------------------------
  if has("win32")
  let Tlist_Ctags_Cmd = $VIMFILES.'/ctags.exe' " location of ctags tool
  else
  let Tlist_Ctags_Cmd = '/usr/local/bin/ctags'
  endif
  
  let Tlist_Sort_Type = "name" " order by
  let Tlist_Use_Right_Window = 1 " split to the right side of the screen
  let Tlist_Compart_Format = 1 " show small meny
  let Tlist_Exist_OnlyWindow = 1 " if you are the last, kill yourself
  let Tlist_File_Fold_Auto_Close = 0 " do not close tags for other files
  let Tlist_Enable_Fold_Column = 0 " do not show folding tree
  
  "-------------------------------------------------------------------------------------
  " plugin - matchit.vim
  "-------------------------------------------------------------------------------------
  let b:match_ignorecase = 1
  
  "-------------------------------------------------------------------------------------
  " plugin - supertab.vim
  "-------------------------------------------------------------------------------------
  " <Tab> has been mapped to SuperTab() func in that plugin
  
  "-------------------------------------------------------------------------------------
  " plugin - timestamp.vim
  "-------------------------------------------------------------------------------------
  let g:timestamp_regexp = '/v/C%(<Last %([cC]hanged?|[Mm]odified):/s+)@<=.*$'
  let g:timestamp_rep = '%w %d/%m/%Y %H:%M:%S #u@#h:#f'
  augroup TimeStampHtml
  au filetype html let b:timestamp_regexp = '/v/C%(/<!-- Timestamp:/s{-1,})@<=.{-}%(/s*--/>)@='
  au filetype html let b:timestamp_rep = '%a %d/%m/%Y %r #u@#h:#f'
  augroup END
  
  "-------------------------------------------------------------------------------------
  " plugin - perl-support.vim
  "-------------------------------------------------------------------------------------
  let g:Perl_AuthorName = 'Leal'
  let g:Perl_Email = 'linxiao.li NOSPAM gmail DOT com'
  let tlist_perl_settings = 'perl;c:constants;l:labels;s:subroutines;d:POD'
  
  "-------------------------------------------------------------------------------------
  " utilities
  "-------------------------------------------------------------------------------------
  " select range, then hit :SuperRetab($width) - by p0g and FallingCow
  fu! SuperRetab(width) range
  sil! exe a:firstline . ',' . a:lastline . 's//v%(^ *)@<= {'. a:width .'}//t/g'
  endf
  
  " bind :CD to :cd %:h, then change cwd to the dir that includes current file
  sil! com -nargs=0 CD exe 'cd %:h'
  
  "TODO just do it
  fu! AddLineNo(isVM)
  if(a:isVM == 1)
  sil! exe 's/^//=' . strpart((line('.')-line("'<")+1)." ", 0, 4)
  else
  sil! exe '%s/^//=' . strpart(line('.')." ", 0, 4)
  endif
  endf
  " add line number befor each line of the text
  " :g/^/exec "s/^/".strpart(line(".")." ", 0, 4)
  " :%s/^//=strpart(line('.')." ", 0, 4)
  " visual mode
  " :s/^//=strpart((line('.')-line("'<")+1)." ", 0, 4)
  
  " XML support, e.g. element,,,<CR> -> <element> </element>
  " Bart van Deenen ,
www.vandeenensupport.com
  fu! MakeElement()
  if match(getline('.'),'^/s*>/s*$') == -1
  "the deleted word was not alone on the line
  let @w = "i<pla</pa>F<i"
  else
  "the deleted word was on it's own on the line
  let @w = "i<po</pa>kA"
  endif
  endf
  
  " include colon(5Cool for namespaces in xsl for instance
  "setlocal iskeyword=@,48-57,_,192-255,58
  inoremap <buffer> ,,, ><Esc>db:call MakeElement()<enter>@w
  
  "-------------------------------------------------------------------------------------
  " mappings
  "-------------------------------------------------------------------------------------
  map <right> <ESC>:MBEbn<RETURN>
  " -> switches buffers
  map <left> <ESC>:MBEbp<RETURN>
  " <- switches buffers
  map <up> <ESC>:Sex<RETURN><ESC><C-W><C-W>
  " up arrow to bring up a file explorer
  map <down> <ESC>:Tlist<RETURN>
  " down arrow to bring up the taglist
  map <A-i> i <ESC>r
  " Alt-i inserts a single char, and back to normal
  map <F3> <ESC>ggVG:call SuperRetab()<left>
  map <F4> ggVGg?
  " Rot13 encode the current file
  
  "noremap <silent> <C-F11> :cal VimCommanderToggle()<CR>
  
  " plugin - php_console.vim
  "map <F5> :call ParsePhpFile()<cr> " call function in normal mode
  "imap <F5> <ESC>:call ParsePhpFile()<cr> " call function in insert mode
  
  "-------------------------------------------------------------------------------------
  " autocommands
  "-------------------------------------------------------------------------------------
  au BufEnter * :syntax sync fromstart " ensure every file does syntax highlighting (full)
  au BufNewFile,BufRead *.asp :set ft=jscript " all my .asp files ARE jscript
  au BufNewFile,BufRead *.tpl :set ft=html " all my .tpl files ARE html
  
  " ftplugin - python_fold - $VIMFILES/ftplugin/python_fold.vim
  " add names in pydiction to autocomplete class or object's class, attribute or method
  au FileType python set complete+=k$VIMFILES/dict/pydiction isk+=.,(
  "au FileType python pyfile $VIMFILES/plugin/pyCallTips.py
  au FileType python source $VIMFILES/plugin/python.vim
  "au FileType java source $VIMFILES/ftplugin/JavaRun.vim
  "au FileType php set complete+=k$VIMFILES/dict/php.dict isk+=.,(
  au FileType text setlocal textwidth=78
  
  "-------------------------------------------------------------------------------------
  " highlight active line in normal mode, Vim7 don't need this
  "-------------------------------------------------------------------------------------
  "highlight CurrentLine guibg=darkgrey guifg=white ctermbg=darkgrey ctermfg=white
  "au! Cursorhold * exe 'match CurrentLine //%' . line('.') . 'l.*/'
  "set ut=19
  
  "-------------------------------------------------------------------------------------
  " stuffs I don't like
  "-------------------------------------------------------------------------------------
  "set ignorecase -- turns out, I like case sensitivity
  "set list -- turns out, do not display unprintable characters such as Tab
  "autocmd GUIEnter * :simalt ~x -- having it auto maximize the screen is annoying
  "autocmd BufEnter * :lcd %:p:h -- switch to current dir (breaks some scripts)
  
  "-------------------------------------------------------------------------------------
  " useful abbrevs
  "-------------------------------------------------------------------------------------
  iab xasp <%@language=jscript%><CR><%<CR><TAB><CR><BS>%><ESC><<O<TAB>
  iab xdate <c-r>=strftime("%m/%d/%y %H:%M:%S")<cr>
  
  "-------------------------------------------------------------------------------------
  " customize cursor color to indicate IM is on
  "-------------------------------------------------------------------------------------
  if has('multi_byte_ime')
  hi Cursor guifg=NONE guibg=Green
  hi CursorIM guifg=NONE guibg=Blue
  endif
  
  "-------------------------------------------------------------------------------------
  " TVO defaults - otl.vim
  "-------------------------------------------------------------------------------------
  let otl_install_menu =1
  let no_otl_maps =0
  let no_otl_insert_maps =0
  
  let otl_bold_headers =0
  let otl_use_thlnk =0
  
  let g:otl_use_viki =0
  let maplocalleader =","
  
  map <c-w><c-f> :FirstExplorerWindow<cr>
  map <c-w><c-b> :BottomExplorerWindow<cr>
  map <c-w><c-t> :WMToggle<cr>
  
  let g:winManagerWidth = 35
  let g:winManagerWindowLayout = 'TodoList'
  
  let g:tskelDir = $VIMFILES."/skeletons"
  
  "-------------------------------------------------------------------------------------
  " vim: set et ft=vim tw=98 path+=$VIMFILES/*:


 
参考:

<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
vi的配置文件 这个.vimrc配置是我一直使用的,简单但是挺实用的。有自动缩进,语法高亮,行号显示等,实用这个配置用vi编写c/c++代码已经够用了。 下载后,将vimrc文件拷贝到home目录下,重命名为.vimrc即可 立即下载

相关推荐

vim配置文件(超好用)

超人性化、超全的vim配置文件,解压后直接放在用户目录下就行。解压出来的三个文件直接放在用户目录下即可。即 ~/

vi配置文件.vimrc内容示例

(1).vimrc是vi编辑器的配置文件,里面可以对vi编译器做个性化配置;(2).vimrc在用户目录下,每个用户有一个,类似于.bashrc文件,将下面的配置文件内容拷贝到~/.vimrc;

weixin_42031299的博客 1549

SIC知识(8)--碳化硅的制备难点

6. 器件制造难点:碳化硅器件制造过程中的掺杂步骤需要在高温下完成,且需要采用高温离子注入的方式,这与传统硅基器件的扩散工艺不同。这些步骤需要精密的设备和严格的工艺控制,以确保器件的结构和功能。综上所述,碳化硅的制备难点相较于传统硅基器件主要在于更高的制备温度、更慢的生长速度、晶型控制的复杂性、后加工的难度、外延工艺的低效率以及器件制造的特殊要求和较高的成本。- **数据管理**:需要有效的数据管理系统来跟踪和记录生产过程中的每一个步骤,包括原料的批次、生长条件、加工参数等,以确保产品质量的可追溯性。

阿拉伯梳子的专栏 1597

【二、玩转vim(vi)编辑器】三大模式及命令介绍、如何通过配置文件.vimrc配置vim编辑器

vi编辑器是Linux下的标准编辑器,vi编辑器并非只是用来写程序,还可以用来对一些配置文件进行编辑。vim是vi的加强版,我们一般使用vim对文件进行编辑。本文介绍了vim编辑器的三大模式,以及相应的命令,最后介绍了如何通过vim编辑器的配置文件.vimrc根据自己的需求对vim进行配置。

仅以此博客记录日常学习工作中所思所得,水平有限,难登大雅,万望海涵。 2万+

Hypermesh二次开发实战:从Tcl/Tk脚本到Ext API的进阶之路

本文系统介绍了Hypermesh二次开发的进阶路径,从自动化重复操作的Tcl/Tk脚本入门,到利用HMASCII接口深度读写模型数据,最终深入Ext API进行高性能计算与功能定制。通过实战案例,帮助工程师掌握从脚本录制到C++插件开发的完整技能,显著提升CAE前处理效率与自动化水平。

weixin_29306875的博客 671

关于影响力最大化问题中贪心算法的一些理解

在影响力最大化问题中(Influence Maximization,以下简称IM),贪心算法是最早提出的一种解决方法,并且一直沿用至今。它基于IM问题所具有的单调性(Monotonicity)和子模性(Submodularity)使用一种Hill Climbing策略,不断使用Monte Carlo模拟来寻找在当前情况下的具有最大传播范围的节点,添加至种子集合,得到最终结果,算法伪代码如下所示: 这里算法1其实并没有使用MonteCarlo模拟,而只是使用了贪心的策略...

nianjuan1990的专栏 2852

Vim的行号、语法显示等设置,即.vimrc文件的配置

作者:聂飞转载请注明出处在终端下使用vim进行编辑时,默认情况下,编辑的界面上是没有显示行号、语法高亮度显示、智能缩进等功能的。为了更好的在vim下进行工作,需要手动设置一个配置文件:.vimrc。在启动vim时,当前用户根目录下的.vimrc文件会被自动读取,该文件可以包含一些设置甚至脚本,所以,一般情况下把.vimrc文件创建在当前用户的根目录下比较方便,即创建的命令为:...

weixin_34144848的博客 1184

RK3588部署Zipformer模型问题总结

本文分享了在RK3588嵌入式设备上部署小米Zipformer语音识别模型时遇到的问题及解决方法。主要遇到两个问题:1)在rknn_model_zoo例程编译时出现静态库版本不兼容,通过重新编译kaldi-native-fbank库并修改链接路径解决;2)sherpa-onnx编译时提示缺少portaudio库,通过修改编译脚本启用相关宏定义后成功编译。最终成功在RK3588上运行Zipformer模型,测试结果显示该模型具有较好的识别效果和实时性(RTF=0.22),验证了其在边缘设备上的适用性。

pkyang2004的博客 2148

配置合适的Vi配置文件

Vi 有自己的配置文件,可以是“/etc/vim/vimrc”或者“~/.vimrc”。两者的区别是前者全局的,影响 登录本机的全部用户,后者仅仅对当前用户有效。 把配置命令放在配置内,每次启动 Vi 就会自动载入配置文件中的设置。 具体配置如下: " 在窗口标题栏显示文件名称 set title " 编辑的时候将所有的 tab 设置为空格 set tabstop=4 "设置自动对

kiasur的博客 842

吃透 AM32 无人机电调:从源码架构到工作原理的全方位解析(附实践指南)(中)

介绍了三相电机控制中的SVPWM算法实现及保护机制设计。SVPWM部分详细解析了电压矢量扇区判断、占空比计算和过调制保护,通过限制占空比范围(0-100%)防止电机失控,并提供了完整的代码实现。保护模块则重点分析了过流、过压/欠压、过温三种保护机制,采用分级处理策略(硬保护停机/软保护降功率)确保系统安全。此外,文章还介绍了参数管理模块在STM32 Flash中的存储方案,包括参数定义、数据结构和读写操作,为电机控制系统提供了完整的解决方案。

bother3000的博客 1389

首个基于LBS方案的3D传感器,VoxelSensor解析

该传感器将结合OQmented的Lissajous模式的MEMS扫描镜,与每帧逐行工作的光栅扫描相比,Lissajous轨迹扫描速度更快,并且能耗很低,它可以更快地捕获完整的场景和快速移动,并且需要更少的数据处理,可满足AR/VR对于低延迟、高效率的需求。简单来讲,Switching Pixels的区别是专注于识别激光事件,性能比普通事件相机更好,但也可以使用事件相机的算法。在具体应用中,它需要在X和Y方向发射一个或多个脉冲光束,以在X和Y轴上定位,而Z轴,也就是深度,则是通过计算光返回的时间来测量。

qingtingwang的博客 576

linux的vi命令详解,linux vi命令详解及使用技巧集锦

进入vi的命令vi filename :打开或新建文档,并将光标置于***行首vi +n filename :打开文档,并将光标置于第n行首vi + filename :打开文档,并将光标置于***一行首vi +/pattern filename:打开文档,并将光标置于***个和pattern匹配的串处vi -r filename :在上次正用vi编辑时发生系统崩溃,恢复filenamevi fi...

weixin_28559803的博客 222

GAMES101:MacOS作业环境搭建

查看gcc/clang的位置产看gcc/clang的版本1.1.2 安装cmake。

weixin_38844255的博客 717

PHP集锦点,php 函数集锦

1、array_intersect_assoc()用于比较两个(或更多个)数组的键名和键值,并返回交集。$a1=array("a"=>"red","b"=>"green","c"=>"blue","d"=>"yellow");$a2=array("a"=>"red","b"=>"green","c"=>"blue");$result=array_inter...

weixin_42426472的博客 144

工业4.0必备:C#上位机+数字孪生 生产线实时监控与智能预警系统(工业级实战)

数据割裂:PLC、传感器、工业相机的数据散落在不同系统,想看全局生产状态要切换N个软件,“数据孤岛”导致决策滞后;故障难预判:设备突发故障时,只能停机排查,平均故障响应时间超30分钟,一条生产线停工1小时损失超10万;可视化差:传统监控只有冰冷的数字和2D图表,设备运行状态、生产流程、物料流转无法直观感知,新人上手需3个月才能熟悉产线。

这里只有干货:从 Modbus 通信到 MES 对接,从 YOLO 训练到工控机部署,带你搞定工业软件开发全流程。 660

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

linux终端命令复制文件,linux下终端常用命令和vi命令修改文件及保存的使用方法...

首先介绍一下Ubuntu下各个目录的一般作用:/这就是根目录,一台电脑有且只有一个根目录,所有的文件都是从这里开始的。举个例子:当你在终端里输入“/home”,你其实是在告诉电脑,先从/(根目录)开始,再进入到home目录。/root系统管理员(root user)的目录。至于系统管理员的权限有多大我这里就不在废话了。因此,请小心使用root帐号。/boot系统启动文件,所有与系统启动有关的文件都...

weixin_36106506的博客 327

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

tmux简单教程

在日常工作中,总是感觉用PUTTY连接Linux一个窗口不够用,再开新的窗口又比较麻烦,于是想到是否可以在一个SSH会话中可以打开多个终端,最后我找到了很强大而且使用广泛的tmux多终端管理器。 tmux是一个优秀的终端复用软件,类似GNU Screen,但来自于OpenBSD,采用BSD授权。使用它最直观的好处就是,通过一个终端登录远程主机并运行tmux后,在其中可以开启多个控制台而无需再使用...

weixin_30781775的博客 98

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

Probability and Statistics - 4th edition

Probability and Statistics - 4th edition

Linux面试题集锦二

Linux面试题集锦二 二.单项选择题: 1. 下面的网络协议中,面向连接的的协议是: A 。 A 传输控制协议 B 用户数据报协议 C 网际协议 D 网际控制报文协议 2. 在/etc/fstab文件中指定的文件系统加载参数中, D 参数一般用于CD-ROM等移动设备。 A defaults B sw C rw和ro D noauto 3. Linux文件权限一共10

William234的博客 1234

有用的linux命令集锦

1. 查看内存使用情况 free -m 2. 查看系统版本信息 sudo lsb_release -a 3. 查看磁盘使用情况 df -l 4. 查看当前所有进程 ps -e 5. 查看外网ip curl ifconfig.me 6. 查看网卡信息 mii-tool mii-tool -v 7.路由信息 tracepath -n www.baidu.com 8.查看dns 去/etc

成长的足迹 2658

【linux】vim编辑器使用集锦

使用说明 1.vim使用说明 模式 命令 操作 开始 vim 文件路径 打开 命令模式 命令 说明 i 切换到输入模式 x 删除当前光标所在处的字符 : 切换到底线命令模式 shift+z 保存并退出 移动光标的方法 h|← 左 j|↓ 下 k|↑ 上 l|→ 右 [Ctrl] + [f] =输入模式下的page down [Ctrl] + [...

weixin_37008947的博客 150

Ubuntu常用命令操作集锦

Ctrl+Alt+T打开命令窗口; 重启系统: reboot VMware Worksation下,自动安装VMware tools,可以解决虚拟机屏幕自适应尺寸问题。参考网址:vmware下ubuntu虚拟机如何安装vmware tools 解压文件: tar –xvf file.tar //解压 tar包 tar -xzvf file.tar.gz //解压tar.gz tar -x...

Hello World 270

常用linux命令集锦

常用七大命令 1.1 cd命令 命令格式:cd <路径> 意义:cd是change directory 的缩写;cd命令后面跟一个路径,用于切换当前用户所在的路径,其中路径可以是绝对路径也可以是相对路径。 示例: cd /system/bin 表示切换到/system/bin路径下。 cd logs 表示切换到logs路径下。 cd / 表示切换到根目录。 cd …/ 表示切换到上一层...

qq_41843246的博客 173

Linux搭建配置jdk开发环境

注意:这里我使用的可视化工具是SecureCRT,读者也可以使用其他的可视化工具(如:MobaXterm、xshell、finalShell等),可以直接将jdk拖拽到Linux的文件目录里面。通过SecureCRT远程连接工具连接虚拟机Spark01,进入Linux操作系统中存放应用安装包的目录/export/software/,在该目录下执行“”命令查看JDK版本,验证虚拟机Spark01中的JDK环境。好了,jdk的安装和配置还是比较简单的,我们就讲到这里了,下一篇我们将讲解。

从事移动开发八年,csdn博客专家,阿里云特邀专家,华为云云享专家,高级网络信息安全工程师,大数据工程师(高级),python技术开发(高级),HarmonyOS 应用开发者高级认证,现在某学校任教。 3万+

大数据工作中你必须知道的基础命令集锦

以下是个人在工作中总结的一些简单的命令,有linux也有hadoop集群命令的操作,精力有限,肯定还有很多命令没有总结到,欢迎留言,我会定期添加新的内容 查看当前目录是什么命令 pwd 切换到上一次和上一层目录 cd - cd … 创建目录命令,连续目录的参数 mkdir mkdir -p 连续目录 mv和cp什么区别 mv:用户可以使用该命令为文件或目录重命名或将文件由一个目录...

u013429010的博客 400
上一篇: 网上一道微软试题"称球问题"求解 z
下一篇: 两个经典面试题1248码,漂亮的二进制思想 z
KataDoc360
博客等级 码龄18年 65粉丝 16原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值