Enjoy coding

Enjoy coding

iTerm配置

主題選擇

  • Solarized Dark
  • LiquidCarbon

字體選擇

  • Cousine for Powerline(須要安裝Powerline字體庫), 18pt, Regular

Powerline 字體安裝

oh-my-zsh安裝與配置

前提條件

  • oh-my-zsh依賴zsh, 若是計算機中沒有則使用 brew install zsh 安裝zsh

安裝oh-my-zsh

配置oh-my-zsh

  • 安裝bunnyruni主題(oh-my-zsh自帶了不少主題可是沒有這個主題)
    • 官方: bunnyruni: https://github.com/jopcode/oh-my-zsh-bunnyruni-theme
    • 這裏也已經給出了安裝步驟
      1. mkdir -p $ZSH_CUSTOM/themes && curl https://raw.githubusercontent.com/jopcode/oh-my-zsh-bunnyruni-theme/master/bunnyruni.zsh-theme -L -o $ZSH_CUSTOM/themes/bunnyruni.zsh-theme
      2. 修改.zshrc配置文件
        1. 打開配置文件.zshrc
        2. 修改ZSH_THEME爲ZSH_THEME="bunnyruni", 大約是在第10行
      3. 執行exec $SHELL使配置生效

終端命令行高亮

終端命令提示

在終端打開github

  • 安裝git-open
  • 官網: git-open: https://github.com/paulirish/git-open
  • 這裏也給出了安裝步驟
    1. git clone https://github.com/paulirish/git-open.git $ZSH_CUSTOM/plugins/git-open
    2. 在.zshrc配置文件中找到plugins所在的那一行, 該爲plugins=(git zsh-autosuggestions git-open)

VIM 配置

安裝VIM

配置文件(在這以前先安裝並配置Vundle)

  • 已經給出了配置文件, 在配置文件中也給出了說明, 直接拷貝便可, 可是建議不要刪除配置文件中的內容而是不斷地在對應的位置(在配置文件中已經註釋了哪一種配置要寫到哪裏)追加
" ************************** Basic Settings *************************
set nocompatible              " required, so don't remove it.
filetype off                  " required, so don't remove it.
syntax on
set hlsearch
set ts=4                      " set tab space
set expandtab
set sw=4
set ic                        " ignore case
set ai
set ci
set nu                        " show line number
set ruler
set wildmenu
set showcmd
hi Pmenu ctermbg=lightblue

set nofoldenable
set encoding=utf8
" set foldmethod=indent
set clipboard=unnamed       " let vim share the clipboard with system -> really useful.

set completeopt-=preview
set completeopt=longest,menu
set relativenumber

au BufWinLeave * silent mkview  " 
au BufRead * silent loadview    " 





" ******************* Customized Keyboard Mapping ***********************
nnoremap <space> za             " open/close code folding.
let mapleader = "@"



" ******************* Keyboard Mapping For CompleteParameter.vim Plugin ***************
" ************* Github: https://github.com/tenfyzhong/CompleteParameter.vim **********
inoremap <silent><expr> ( complete_parameter#pre_complete("()")
smap <c-j> <Plug>(complete_parameter#goto_next_parameter)
imap <c-j> <Plug>(complete_parameter#goto_next_parameter)
smap <c-k> <Plug>(complete_parameter#goto_previous_parameter)
imap <c-k> <Plug>(complete_parameter#goto_previous_parameter)


" *** Warning area(You'd better don't modify anything here) **
" It's necessary to set ycm_global_ycm_extra_conf variable here so that the YCM can work.
let g:ycm_global_ycm_extra_conf='~/.vim/bundle/YouCompleteMe/third_party/ycmd/.ycm_extra_conf.py'
let g:ycm_key_invoke_completion = '<c-k>' " code hint

" auto complete when you input 2 characters
let g:ycm_semantic_triggers =  { 
            \ 'c,cpp,python,java,go,erlang,perl': ['re!\w{2}'],
            \ 'cs,lua,javascript': ['re!\w{2}'],
            \ }

" close code syntax checking
let g:ycm_show_diagnostics_ui = 0

let g:ycm_min_num_of_chars_for_completion=1

let g:indentLine_char = "┆"
let g:indentLine_enabled = 1
let g:autopep8_disable_show_diff=1 

" ================ Setting for vim status line ===============
set rtp+=~/.vim/bundle/powerline/powerline/bindings/vim
set guifont=Sauce\ Code\ Powerline:h14.5
set laststatus=2
set encoding=utf-8
set t_Co=256
set number
set fillchars+=stl:\ ,stlnc:\
set term=xterm-256color
set termencoding=utf-8
set background=light
" ============================================================

set rtp+=~/.vim/bundle/Vundle.vim
set rtp+=~/.vim/bundle/CompleteParameter.vim
call vundle#begin()

" different from other Plugins, this `Plugin 'gmarik/Vundle.vim'` statement should
" be written here.
Plugin 'gmarik/Vundle.vim'

call vundle#end()            " required, so don't remove it.
filetype plugin indent on    " required, so don't remove it.


" ********************** Plugin Area ************************
" Install Plugin
" autocmd vimenter * NERDTree

Plugin 'tmhedberg/SimpylFold'
Plugin 'Valloric/YouCompleteMe'
Plugin 'scrooloose/nerdtree'
Plugin 'kien/ctrlp.vim'         " use ctrl + p to search files
Plugin 'scrooloose/nerdcommenter'   " commenter: \cc \cu -> use `\cc` to comment code, use `\cu` to uncomment code
Plugin 'Yggdroot/indentLine'
Plugin 'powerline/powerline'
  • 若是已經將上面的配置文件拷貝到了.vimrc中
    1. 執行vim
    2. 在normal模式下執行PluginInstall安裝插件, 注意在安裝YCM的時候很是地慢, 請耐心等待
    • 文件中的hi Pmenu ctermbg=lightblue語句是這是VIM彈出菜單的背景顏色, 經過normal模式下:hi查看, 顏色的值爲0-255, 每個字符表示的顏色均可以添加前綴light和dark
    • 使用ctrl + p鍵能夠在當前目錄下進行全局搜索
    • \cc註釋一行, \cu取消註釋
    • 在normal模式下, 使用:NERDTree打開目錄
    • 在normal模式下, 使用za能夠摺疊和打開代碼
  • 關於YCM的配置javascript

效果圖

效果圖

  • 若是要更美觀的VIM配置, 請看VIM配置篇
相關文章
相關標籤/搜索