天天看點

配置linux下的vimrc

我運維和dba通常使用的如下:

set paste

set shortmess=atI

syntax enable

syntax on

set ai

set ruler

set autoindent

set nocompatible

set magic

set confirm

set history=1000

set cursorline

highlight Comment ctermfg=lightblue guifg=darkblue

set cindent

set tabstop=4

set softtabstop=4

set shiftwidth=4

set smarttab

set si

set wrap

set showmatch

set smartindent

set cin

set hlsearch

au BufReadPost * if line("'\"") > 0|if line("'\"") <= line("$")|exe("norm '\"")|else|exe "norm $"|endif|endif

set nu

" 設定狀态欄

set laststatus=2 

highlight StatusLine cterm=bold ctermfg=yellow ctermbg=blue

function! CurDir()

    let curdir = substitute(getcwd(), $HOME, "~", "g")

    return curdir

endfunction

set statusline=[%n]\ %f%m%r%h\ \|\ \ pwd:\ %{CurDir()}\ \ \|%=\|\ %l,%c\ %p%%\ \|\ ascii=%b,hex=%b%{((&fenc==\"\")?\"\":\"\ \|\ \".&fenc)}\ \|\ %{$USER}\ @\ %{hostname()}\

本文轉自 lirulei90 51CTO部落格,原文連結:http://blog.51cto.com/lee90/1966359,如需轉載請自行聯系原作者

繼續閱讀