My Vimrc_

25 Mar 2015

Nội dung file vimrc, chứa thiết lập cho VIM. Lưu lại đây để dành lúc cần thì sử dụng.

"==========================================================
" .vimrc config file
" Author: 
"   Krad
" Email: 
"   tungkradle@gmail.com
"
" Sections:
"   -> General
"   -> Theme/Colors and Fonts
"   -> Vim UI
"   -> Tabs, Indents, Texts
"   -> Status line
"
"===========================================================

"---------
"   General
"---------
set history=700         " Sets how many lines of history VIM has to remember
set autoread            " Set to auto read when a file is changed from the outside

"---------
"   Theme/Colors and Fonts
"---------
colorscheme hybrid      " good for my eyes, codeschool works too
syntax enable           " syntax plz

set encoding=utf8       " set utf-8 encoding

"---------
"   Vim UI
"---------
set wildmenu            " visual autocomplete for command menu

set ruler               " show current position
set number              " show line numbers
set showcmd             " show command in bottom bar
set cmdheight=2         " command line height

filetype indent on      " load filetype-specific indent files

set lazyredraw          " redraw only when we need to.

set cursorline          " highlight current line
set showmatch           " highlight matching [{()}]

set incsearch           " search as characters are entered
set hlsearch            " highlight matches

set foldenable          " enable folding
set foldlevelstart=10   " open most folds by default
" space open/closes folds
nnoremap <space> za
set foldmethod=indent   " fold based on indent level

"---------
"   Tabs, Indents, Texts
"---------
set shiftwidth=4
set tabstop=4           " number of visual spaces per TAB
set softtabstop=4       " number of spaces in tab when editing

set expandtab           " tabs are spaces

set ai                  " Auto indent
set si                  " Smart indent
set wrap                " Wrap lines

"---------
"   Status line
"---------
set laststatus=2        " Always show the status line
" Format the status line
set statusline=\ %{HasPaste()}%F%m%r%h\ %w\ \ CWD:\ %r%{getcwd()}%h\ \ \ Line:\ %l

"---------
"   Helper functions
"---------
" Returns true if paste mode is enabled
function! HasPaste()
    if &paste
        return 'PASTE MODE  '
    en
    return ''
endfunction

Comments

    Do you want to comment as Anonymous or Sign in with Google?