2015年3月10日 星期二

[Vim] Vim script for default setting

Seting load configuration path
/etc/vimrc --> 
/usr/share/vim/vim74 --> 
~/.vim/vimrc

Create a file was called happy.vim

" Highlight the syntax
syntax on

" Show line number
set nu
" all the enhancements and improvements of Vi Improved are turned on
set nocompatible
"Number of spaces that a  in the file counts for
set tabstop=4
" Number of spaces that a  counts
set softtabstop=4
set shiftwidth=4


" when search will highlight the word
set hlsearch 

" Undo file even quit vim
set undofile
set undodir=/tmp

" Copy to system clipboard
set clipboard+=unnamed

" List the function name 
nmap <silent> <F5> :TlistToggle<CR><C-W><C-W>

" syntastic {{{
 let g:syntastic_error_symbol='✗'
 let g:syntastic_warning_symbol='⚠'
 let g:syntastic_enable_highlighting = 1
 let g:syntastic_stl_format = '[%E{Err: %fe #%e}%B{, }%W{Warn: %fw #%w}]'
" }}}

" Search string 
map <C-a><C-a> :CtrlSF

" Setting up Vundle - the vim plugin bundler
    let iCanHazVundle=1
    let vundle_readme=expand('~/.vim/bundle/vundle/README.md')
    if !filereadable(vundle_readme)
        echo "Installing Vundle.."
        echo ""
        silent !mkdir -p ~/.vim/bundle
        silent !git clone https://github.com/gmarik/vundle ~/.vim/bundle/vundle
        let iCanHazVundle=0
    endif
    set rtp+=~/.vim/bundle/vundle/
    call vundle#rc()
    "Add your bundles here
        Bundle 'tpope/vim-fugitive'
        Bundle 'Lokaltog/vim-easymotion'
        Bundle 'rstacruz/sparkup', {'rtp': 'vim/'}
        Bundle 'tpope/vim-rails.git'
        " vim-scripts repos
        Bundle 'L9'
        Bundle 'FuzzyFinder'
        " non-GitHub repos
        Bundle 'git://git.wincent.com/command-t.git'
        " Git repos on your local machine (i.e. when working on your own plugin)
        Bundle 'file:///Users/gmarik/path/to/plugin'
        " ...
        Bundle 'ervandew/supertab'
        Bundle 'vim-scripts/taglist.vim'
        Bundle 'mileszs/ack.vim'
        Bundle 'kien/ctrlp.vim'
        Bundle 'scrooloose/syntastic'
        Bundle 'scrooloose/nerdtree'
        Bundle 'rstacruz/sparkup'
        Bundle 'dyng/ctrlsf.vim'
        Bundle 'vim-scripts/DirDiff.vim'
        Bundle 'charz/multi-cscope-db'

        "Bundle 'Valloric/YouCompleteMe'

    "...All your other bundles...
    if iCanHazVundle == 0
        echo "Installing Bundles, please ignore key map error messages"
        echo ""
        :BundleInstall
    endif
" Setting up Vundle - the vim plugin bundler end

Edit ~/.vimrc or ~/.vim/vimrc
Manual :
source happy.vim

Related Posts:

0 意見:

張貼留言