隨筆-204  評(píng)論-90  文章-8  trackbacks-0
          set nocompatible "關(guān)閉vi兼容
          set enc=utf-8
          "set number "顯示行號(hào)
          filetype plugin on 
          "文件類型
          set history=500 "歷史命令
          syntax on 
          "語(yǔ)法高亮
          "set autoindent "ai 自動(dòng)縮進(jìn)
          "set smartindent "智能縮進(jìn)
          set showmatch "括號(hào)匹配
          set ruler 
          "右下角顯示光標(biāo)狀態(tài)行
          set nohls "關(guān)閉匹配的高亮顯示
          set incsearch 
          "設(shè)置快速搜索
          set foldenable "開啟代碼折疊
          "set fdm=manual "手動(dòng)折疊
          set foldmethod=syntax 
          "自動(dòng)語(yǔ)法折疊
          set modeline "自動(dòng)載入模式行
          "自動(dòng)插入modeline
          func! AppendModeline()
          let l:modeline = printf(" vim: set ts=%d sw=%d tw=%d :",
          \ &tabstop, &shiftwidth, &textwidth)
          let l:modeline = substitute(&commentstring, "%s", l:modeline, "")
          call append(line("$"), l:modeline)
          endfunc
          "按\ml,自動(dòng)插入modeline
          nnoremap <silent> <Leader>ml :call AppendModeline()<CR>
          "空格展開折疊
          nnoremap <space> @=((foldclosed(line('.')) < 0) ? 'zc' : 'zo')<CR>

          "set tabstop=4
          "set shiftwidth=4
          set ts=4
          set sw=4
          set expandtab
          "自動(dòng)tab

           

          if has(
          "autocmd")
          filetype plugin indent on
          endif
          autocmd filetype python setlocal et sta sw=4 sts=4


          "根據(jù)文件類型自動(dòng)插入文件頭
          autocmd BufNewFile *.py,*.sh exec ":call SetTitle()"
          func SetTitle()
          if &filetype == 'sh'
          call setline(1"\#!/bin/bash")
          call append(line("."), "\# Author:itxx00@gmail.com")
          call append(line(".")+1"")
          else
          call setline(1"\#!/bin/env python")
          call append(line("."), "\#coding:utf-8")
          call append(line(".")+1"\#Author:itxx00@gmail.com")
          call append(line(".")+2"")
          endif
          endfunc 
          "新建文件后自動(dòng)定位至文件末尾
          autocmd BufNewFile * normal G
          "F2去空行
          nnoremap <F2> :g/^\s*$/d<CR>
          posted on 2013-10-25 21:24 一凡 閱讀(327) 評(píng)論(0)  編輯  收藏 所屬分類: linux
          主站蜘蛛池模板: 长葛市| 昌邑市| 上思县| 镇远县| 遵义市| 建始县| 乌兰县| 安阳市| 千阳县| 泗洪县| 徐闻县| 息烽县| 赞皇县| 阿拉善左旗| 巍山| 喜德县| 疏勒县| 泰来县| 崇礼县| 新郑市| 宜兰市| 凉山| 京山县| 富顺县| 双峰县| 申扎县| 共和县| 易门县| 鄂托克旗| 海门市| 乌兰县| 青川县| 彭阳县| 河南省| 南宫市| 海门市| 宁明县| 平昌县| 肇庆市| 洛川县| 阿合奇县|