Skip to content

Instantly share code, notes, and snippets.

@dj1020
Last active August 29, 2015 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dj1020/7fd9e2cfd799aefb2d8d to your computer and use it in GitHub Desktop.
Save dj1020/7fd9e2cfd799aefb2d8d to your computer and use it in GitHub Desktop.
Janus, Jeffrey way .vimrc.after file
set nocompatible " 關閉 vi 相容模式,不太確定做什麼用。和 u,及 insert mode 的方向鍵移動有關。
set t_Co=256
colorscheme xoria256
set guifont=Menlo:h16
set guioptions-=T " Removes top toolbar
set guioptions-=r " Removes right hand scroll bar
set go-=L " Removes left hand scroll bar
set linespace=15
" set lines=25 加了之後 iTerm 會被設成 25 行 >"<
set columns=120
" 用 jj 表示按下 esc 學 Jeffrey Way
imap jj <esc>
set showmode
set nowrap
set tabstop=4
set smarttab
set tags=tags
set softtabstop=4
set expandtab " 將 Tab 轉換成 space
set autoindent
set copyindent " copy the previous indentation on autoindenting
set shiftwidth=4 " number of spaces to use for autoindenting
set shiftround " 'sr' 縮進列數對齊到 shiftwidth 的整數倍
set ignorecase " ignore case when searching
set smartcase " ignore case if search pattern is all lowercase.
set visualbell " don't beep, beep visually
set noerrorbells " don't beep
set autowrite " save on buffer switch
set mouse=a " for terminal vim, 可以用 trackpad 來瀏覽
" 設定 leader key
let mapleader = ","
let g:mapleader = ","
" 快速存檔 by leader key
nmap <leader>w :w!<cr>
" Exactly move down to the next line
nnoremap j gj
nnoremap k gk
" 自動切換目錄到目前編輯的檔案
nnoremap ,cd :cd %:p:h<cr>:pwd<cr>
nmap <C-o> :NERDTreeToggle<cr>
set showcmd
" 快速切換 Buffer
nmap :bp :BufSurfBack<cr>
nmap :bn :BufSurfForward<cr>
highlight Search cterm=underline
" Swap files out of the project root
set backupdir=~/.vim/backup//
set directory=~/.vim/swap//
" Powerline 很漂亮的 vim 狀態列 https://laracasts.com/lessons/vim-and-laravel
let g:Powerline_symbols = 'fancy'
set laststatus=2 " Always show the status line
set encoding=utf-8
set noshowmode " Hide the default mode text (e.g. -- INSERT -- below the status line)
" 設定一些縮寫(Abbreviations)
abbrev gm !php artisan generate:model
abbrev gc !php artisan generate:controller
abbrev gmig !php artisan generate:migration
" 裝完 Jenus 就有的,CtrlP 外掛
nmap <D-p> :CtrlP<cr>
nmap <C-r> :CtrlPBufTag<cr>
" 讓 CtrlP 不要去讀 vendor 加快存取速度
set wildignore+=*/vendor/**
set wildignore+=*/public/forum/**
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment