已習慣使用的vimrc設定



syntax on
set t_Co=256
colorscheme desert
set ruler
" show line number
set nu
" show relative number 
set rnu
set autoindent
set tabstop=4
set expandtab
set shiftwidth=4
" Current line draw the underline
set cursorline
" Show the search
set incsearch
" Hilight the matched strings
set hlsearch
set wrapscan
set history=255
set linebreak
" Ignore case in searching
set ignorecase
set nowrap
" Past text without auto indent on remote connection
set paste
" No vi compatible
set nocompatible
" Backspace anytime
set backspace=indent,eol,start
" we want to show special char, eg. tab, line-ending etc.
set list " show symbol
set listchars=eol:$,tab:>.,trail:~,extends:>,precedes:<

" Enable clipboard (your vim should )
set clipboard=unnamed
if has('unnamedplus')
    set clipboard=unnamed,unnamedplus
endif


""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Don't take those configures below on your remote work.
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" User can use mouse to select text without line number
set mouse+=a
" copy to from the system clipboard
noremap "+y
"past from the system clipboard
noremap "+gP

" convert the line feeding
set ff=unix

" Vertical move the cursor
nnoremap j gj
nnoremap k gk

nnoremap :NERDTree

" Select all text
nmap ggVG

" vim air-line
set laststatus=2
set encoding=utf-8
if has("gui_running")
  " airline.tabline conflicts with gvim tab
  " we let gvim control the new/close tab function
else
  " airline
  let g:airline#extensions#tabline#enabled = 1 
  """""""""""""""""""""""""""
  " Open close tab
  """""""""""""""""""""""""""
  " New tab
  nmap :tabnew
  " Close tab 
  nmap :tabclose
endif

" Go to prev tab 
noremap gT
" Go to next tab
noremap gt

"Set font 
if has("gui_running")
  if has("gui_gtk2")
    set guifont=Inconsolata\ 12
  elseif has("gui_macvim")
    set guifont=Menlo\ Regular:h14
  elseif has("gui_win32")
    set guifont=Source\ Code\ Pro:h11:cDEFAULT
  endif
endif

留言