Skip to content

Instantly share code, notes, and snippets.

@fengluo
Last active June 26, 2025 14:52
Show Gist options
  • Select an option

  • Save fengluo/3749890 to your computer and use it in GitHub Desktop.

Select an option

Save fengluo/3749890 to your computer and use it in GitHub Desktop.

Revisions

  1. fengluo revised this gist Jun 26, 2025. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions vimrc
    Original file line number Diff line number Diff line change
    @@ -11,8 +11,7 @@ Bundle "tpope/vim-markdown"
    Bundle "scrooloose/nerdtree"
    Bundle "scrooloose/nerdcommenter"
    Bundle "tpope/vim-surround"
    "Bundle "pangloss/vim-javascript"
    Bundle "lepture/vim-javascript"
    Bundle "pangloss/vim-javascript"
    Bundle "lepture/vim-css"
    Bundle "lepture/vim-jinja"
    Bundle "ervandew/supertab"
  2. fengluo revised this gist Nov 8, 2014. No changes.
  3. fengluo revised this gist Nov 8, 2014. 1 changed file with 5 additions and 6 deletions.
    11 changes: 5 additions & 6 deletions vimrc
    Original file line number Diff line number Diff line change
    @@ -119,7 +119,7 @@ nmap tn :tabnew .<cr>
    nmap tc :tabclose<cr>
    nmap <tab> :NERDTreeToggle<cr>
    syntax on
    syntax enable


    "filetype plugin on
    @@ -145,21 +145,20 @@ nnoremap ; :
    nnoremap <leader>W :%s/\s\+$//<cr>:let @/=''<CR>
    set background=dark
    let g:solarized_visibility='low'
    colorscheme solarized
    " colorscheme Tomorrow-Night-Blue
    let g:solarized_termcolors=256
    " let g:solarized_visibility='low'
    "gui setting
    if has("gui_running")
    set guioptions=egmrLt
    set guifont=Monaco
    winsize 100 60
    set cursorcolumn
    set hidden
    colorscheme solarized
    " colorscheme Tomorrow-Night-Blue
    else
    let g:solarized_termtrans=1
    let g:solarized_termcolors=256
    colorscheme solarized
    " colorscheme Tomorrow-Night-Blue
    endif

    " ---------------
  4. fengluo revised this gist Nov 8, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion vimrc
    Original file line number Diff line number Diff line change
    @@ -24,7 +24,7 @@ Bundle "msanders/snipmate.vim"
    Bundle "altercation/vim-colors-solarized"
    Bundle "Lokaltog/vim-powerline"
    Bundle "chriskempson/vim-tomorrow-theme"
    Bundle 'sontek/minibufexpl.vim'
    Bundle 'fholgado/minibufexpl.vim'
    Bundle 'kien/ctrlp.vim'
    Bundle 'taglist.vim'

  5. fengluo revised this gist Nov 8, 2014. 1 changed file with 6 additions and 4 deletions.
    10 changes: 6 additions & 4 deletions vimrc
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,9 @@
    " System
    set nocompatible
    filetype off
    set rtp+=~/.vim/bundle/vundle/
    call vundle#rc()
    Bundle 'gmarik/vundle'
    set rtp+=~/.vim/bundle/Vundle.vim
    call vundle#begin()
    Bundle 'gmarik/Vundle.vim'

    "Github bundles
    Bundle "tpope/vim-fugitive"
    @@ -17,7 +17,7 @@ Bundle "lepture/vim-css"
    Bundle "lepture/vim-jinja"
    Bundle "ervandew/supertab"
    Bundle "scrooloose/syntastic"
    Bundle "mattn/zencoding-vim"
    Bundle "mattn/emmet-vim"
    Bundle "wavded/vim-stylus"
    Bundle "shemerey/vim-peepopen"
    Bundle "msanders/snipmate.vim"
    @@ -31,6 +31,8 @@ Bundle 'taglist.vim'
    "vim.org bundles
    Bundle "jQuery"

    call vundle#end()

    set backspace=indent,eol,start
    set nobackup
    set history=50
  6. fengluo renamed this gist Sep 20, 2012. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  7. fengluo renamed this gist Sep 20, 2012. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  8. fengluo created this gist Sep 19, 2012.
    212 changes: 212 additions & 0 deletions vimrc
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,212 @@
    " System
    set nocompatible
    filetype off
    set rtp+=~/.vim/bundle/vundle/
    call vundle#rc()
    Bundle 'gmarik/vundle'

    "Github bundles
    Bundle "tpope/vim-fugitive"
    Bundle "tpope/vim-markdown"
    Bundle "scrooloose/nerdtree"
    Bundle "scrooloose/nerdcommenter"
    Bundle "tpope/vim-surround"
    "Bundle "pangloss/vim-javascript"
    Bundle "lepture/vim-javascript"
    Bundle "lepture/vim-css"
    Bundle "lepture/vim-jinja"
    Bundle "ervandew/supertab"
    Bundle "scrooloose/syntastic"
    Bundle "mattn/zencoding-vim"
    Bundle "wavded/vim-stylus"
    Bundle "shemerey/vim-peepopen"
    Bundle "msanders/snipmate.vim"
    Bundle "altercation/vim-colors-solarized"
    Bundle "Lokaltog/vim-powerline"
    Bundle "chriskempson/vim-tomorrow-theme"
    Bundle 'sontek/minibufexpl.vim'
    Bundle 'kien/ctrlp.vim'
    Bundle 'taglist.vim'

    "vim.org bundles
    Bundle "jQuery"

    set backspace=indent,eol,start
    set nobackup
    set history=50
    set encoding=utf-8
    set fileencoding=utf-8
    set fileencodings=utf-8,cp936,gbk
    set ff=unix

    " Options
    "set paste
    set ruler
    set showcmd
    set incsearch
    set ignorecase
    set smartcase
    set gdefault
    set smarttab
    set expandtab
    set shiftwidth=4
    set tabstop=4
    "set shiftround
    set nu
    set mouse=a
    set vb t_vb=
    set autoindent
    set laststatus=2
    set cmdheight=1
    "set smartindent
    set cursorline
    "set cursorcolumn
    set colorcolumn=+1
    set autoread
    set wildmenu
    set ttyfast
    set dictionary=/usr/share/dict/words
    "set relativenumber
    "set undofile
    set wildignore+=.hg,.git,.svn
    set wildignore+=*.aux,*.out,*.toc
    "set wildignore+=*.jpg,*.bmp,*.gif,*.png,*.jpeg
    set wildignore+=*.o,*.obj,*.exe,*.dll,*.manifest
    set wildignore+=*.sw?
    set wildignore+=*.DS_Store
    set wildignore+=*.pyc
    set wildignore+=*.egg,*.egg-info
    set wildignore+=*.orig
    "set completeopt=preview

    set list
    set listchars=tab:▸\ ,eol:¬,extends:❯,precedes:

    "set statusline=%<%f\ %h%m%r%=%-14.(%l,%c%V%)\ %y,%P
    "set statusline+=%#warningmsg#
    "set statusline+=%{SyntasticStatuslineFlag()}
    "set statusline+=%*

    "configurations
    set directory=$HOME/.hide
    let g:netrw_home=$HOME . '/.hide'
    let g:netrw_list_hide='.*\.swp$,.*\.pyc$,.*~'
    let NERDTreeBookmarksFile=$HOME . '/.hide/bookmarks'
    let NERDTreeShowBookmarks=1
    let NERDTreeChDirMode=2
    "let NERDTreeHijackNetrw=0
    "let g:netrw_altv=1
    "let g:netrw_browse_split=4
    let g:html_indent_inctags = "html,body,head,tbody"
    let g:html_indent_script1 = "inc"
    let g:html_indent_style1 = "inc"
    "set noswapfile
    let g:syntastic_check_on_open=1
    let loaded_html_syntax_checker = 0
    "let g:syntastic_stl_format = '[%E{Err: %fe #%e}%B{, }%W{Warn: %fw #%w}]'
    "let g:syntastic_auto_loc_list=1


    " tabs
    retab
    set tabpagemax=7
    set showtabline=2
    nmap <c-n> :tabnext<cr>
    nmap <c-p> :tabprevious<cr>
    nmap tn :tabnew .<cr>
    nmap tc :tabclose<cr>
    nmap <tab> :NERDTreeToggle<cr>
    syntax on


    "filetype plugin on
    filetype plugin indent on
    au BufRead,BufNewFile *.less set ft=css
    autocmd FileType text setlocal textwidth=80
    autocmd FileType python setlocal textwidth=79
    autocmd FileType vim setlocal shiftwidth=2 tabstop=2
    autocmd FileType ruby setlocal shiftwidth=2 tabstop=2
    autocmd FileType javascript setlocal smartindent
    autocmd FileType html setlocal syntax=htmldjango smartindent
    autocmd FileType css setlocal syntax=css3
    au BufRead,BufNewFile *.vm set ft=html fileencoding=gbk syntax=velocity
    au BufRead,BufNewFile *.j2 set ft=htmldjango
    au BufRead,BufNewFile jquery.*.js set syntax=jquery

    "map keys
    let mapleader = ","
    inoremap <C-U> <C-G>u<C-U>
    ",m -> fix dos ^M
    noremap <Leader>m mmHmt:%s/<C-V><cr>//ge<cr>'tzt'm
    nnoremap ; :
    nnoremap <leader>W :%s/\s\+$//<cr>:let @/=''<CR>
    set background=dark
    let g:solarized_visibility='low'
    "gui setting
    if has("gui_running")
    set guioptions=egmrLt
    set guifont=Monaco
    winsize 100 60
    set cursorcolumn
    set hidden
    colorscheme solarized
    " colorscheme Tomorrow-Night-Blue
    else
    let g:solarized_termtrans=1
    let g:solarized_termcolors=256
    colorscheme solarized
    " colorscheme Tomorrow-Night-Blue
    endif

    " ---------------
    " ctrlp.vim
    " ---------------
    " Ensure Ctrl-P isn't bound by default
    let g:ctrlp_map = ''

    " Ensure max height isn't too large. (for performance)
    let g:ctrlp_max_height = 10

    " --------
    " Use ctrlp.vim since we don't have Ruby
    " --------

    " Conditional Mappings
    if has('unix')
    let g:ctrlp_map = '<C-t>'
    else
    let g:ctrlp_map = '<M-t>'
    endif

    " Leader Commands
    nnoremap <leader>t :CtrlPRoot<CR>
    nnoremap <leader>b :CtrlPBuffer<CR>
    " Always use CtrlP for most recently used files and relative dierctory.
    if has('unix')
    nnoremap <silent><C-u> :CtrlPCurFile<CR>
    else
    nnoremap <silent><M-u> :CtrlPCurFile<CR>
    endif

    " Also map leader commands
    nnoremap <leader>u :CtrlPCurFile<CR>
    nnoremap <leader>m :CtrlPMRUFiles<CR>
    nnoremap <leader>b :CtrlPBuffer<CR>
    " Tag list (ctags)
    let Tlist_Show_One_File = 1
    let Tlist_Exit_OnlyWindow = 1
    let Tlist_Use_Right_Window = 1

    map <silent> <C-r> :TlistToggle<cr>
    "PeepOpen
    if has("gui_macvim")
    "delete print menu
    unmenu File.Print
    map <D-p> <Plug>PeepOpen
    menu File.&PeepOpen <Plug>PeepOpen
    endif