-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
175 lines (144 loc) · 5.13 KB
/
.vimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
"=================================================================
" 安裝相關軟體,Vundle和airline字型
"=================================================================
"sudo apt-get install exuberant-ctags cscope vim-gtk git
"git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
"git clone https://github.com/powerline/fonts
"cd fonts && ./install.sh
" 剪貼下面的文字並放到 ~/.vimrc
"=================================================================
" Start vundle
"=================================================================
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
"===============================================================
" Write your plugins here
"===============================================================
" indent對齊參考線
Plugin 'Yggdroot/indentLine'
" 顯示行尾空白
Plugin 'ntpeters/vim-better-whitespace'
" 顯示狀態資訊 (包含git版本)
"Plugin 'vim-airline/vim-airline'
" 在vim中使用git命令
"Plugin 'tpope/vim-fugitive'
" 把cscope指令對應到hotkey
Plugin 'chazy/cscope_maps'
" 列出檔案中所有symbols,並可以跳至symbol處
Plugin 'vim-scripts/taglist.vim'
" 顯示目錄結構
Plugin 'scrooloose/nerdtree'
" 切割視窗列出function定義
Plugin 'wesleyche/SrcExpl'
" 控管SrcExpl, taglist, nerdtree視窗
Plugin 'wesleyche/Trinity'
" taglist加強
Plugin 'majutsushi/tagbar'
"================================================================
" Run vundle
"================================================================
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
"====================================================================
" airline Settings 目前未安裝此plugin
"===================================================================
" 指定安裝的字型 (airline會需要一些特殊符號字型)
set guifont=Inconsolata\ for\ Powerline\ 20
"let g:airline_powerline_fonts = 1
"set laststatus=2
"====================================================================
" Trinity Settings
"====================================================================
"Open and close the Tagbar separately
nmap <F6> :TagbarToggle<CR>
"Open and close the Source Explorer separately
nmap <F7> :TrinityToggleSourceExplorer<CR>
"Open and close the Taglist separately
nmap <F8> :TrinityToggleTagList<CR>
"Open and close the NERDTree separately
nmap <F9> :TrinityToggleNERDTree<CR>
"Open and close SrcExpl, Taglist, Nerdtree
nmap <F10> :TrinityToggleAll<CR>
"====================================================================
" Editor Settings
"====================================================================
" 配色
" using Molokai Color Scheme for Vim
" from https://github.com/tomasr/molokai
" set t_Co=256
" colorscheme molokai
" set solarized colorscheme
" from https://https://github.com/altercation/vim-colors-solarized
" syntax enable
" set background=dark
" set background=light
" set t_Co=256
" let g:solarized_termcolors=256
" colorscheme solarized
" set background=light
" colorscheme wombat256mod
set t_Co=256
set background=dark
colorscheme gruvbox
" colorscheme jellybeans
" 設定gvim 的字型和大小
set guifont=inconsolata\ 20
" highlight找到的字串
set hlsearch
" search時即時顯示結果
set incsearch
" highlight游標所在row
set cursorline
" 第80字元地方顯示高亮度區塊(這是連續兩個描述)
set colorcolumn=80
highlight ColorColumn guibg=#202020
" 顯示行號
set nu
" 為方便複製,用<F2>開啟/關閉行號顯示
nnoremap <F2> :set nonumber!<CR>
" 顯示tab (這是連續兩個描述)
set listchars=tab:\|.
set list
" 強制tab space為4個字元
set tabstop=4
" 使用space代替tab
set expandtab
" 當編寫Makefile時,取消expandtab設定 (Makefile需區分tab與space)
autocmd FileType make setlocal noexpandtab
" auto indent的移動字元量
set shiftwidth=4
" 設置自動縮進
set autoindent
" 使用C/C++ 語言的自動縮排方式:
set cindent
" 智能縮排
set smartindent
" 在狀態欄顯示正在輸入的命令
set showcmd
" 設置匹配模式,顯示匹配的括號
set showmatch
" 智能補全
set completeopt=longest,menu
" 括號/引號補全
" :inoremap ( ()<ESC>i
:inoremap { {<CR>}<ESC>O
:inoremap [ []<ESC>i