-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvimrc
159 lines (130 loc) · 3.1 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
set nocompatible
filetype off
if has("win32")
set rtp+=%HOME%/vimfiles/bundle/Vundle.vim/
let VIMDIR="~/vimfiles/"
set guifont=Consolas:h12
else
set rtp+=~/.vim/bundle/Vundle.vim
let VIMDIR="~/.vim/"
call vundle#begin()
endif
let BUNDLEDIR=VIMDIR . "/bundle"
call vundle#begin(BUNDLEDIR)
Plugin 'VundleVim/Vundle.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'airblade/vim-gitgutter'
Plugin 'sjl/gundo.vim'
" Plugin 'jalcine/cmake.vim'
Plugin 'tpope/vim-dispatch'
Plugin 'scrooloose/nerdtree'
Plugin 'jistr/vim-nerdtree-tabs'
Plugin 'valloric/youcompleteme'
Plugin 'kana/vim-operator-user'
Plugin 'Shougo/vimproc.vim'
Plugin 'rhysd/vim-clang-format'
Plugin 'scrooloose/syntastic'
Plugin 'kchmck/vim-coffee-script'
Plugin 'vim-ruby/vim-ruby'
Plugin 'majutsushi/tagbar'
Plugin 'altercation/vim-colors-solarized'
Plugin 'nathanaelkane/vim-indent-guides'
Plugin 'christoomey/vim-tmux-navigator'
Plugin 'mileszs/ack.vim'
if executable('ag')
let g:ackprg = 'ag --vimgrep --smart-case'
endif
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
call vundle#end()
filetype plugin indent on
syntax on
set background=dark
colorscheme solarized
set noexrc " don't use .gvimrc etc
let mapleader ="\<Space>"
set history=1000
set title
set colorcolumn=120
set magic
set backup
execute "set backupdir=" . VIMDIR ."backup/"
execute "set directory=" . VIMDIR ."tmp/"
set clipboard=unnamed
set fileformats=unix,dos,mac
set hidden
set iskeyword+=_,$,@,%,#
set mouse=a
set noerrorbells
set novisualbell
set wildmenu
set wildmode=list:longest,full
set backspace=indent,eol,start
set cursorcolumn
set cursorline
set incsearch
set hlsearch
set ruler
set number
set numberwidth=5
set showcmd
set nowrap
set listchars=eol:⏎,tab:␉·,trail:␠,nbsp:⎵
set list
set shiftwidth=2
set tabstop=2
set softtabstop=2
set expandtab smarttab
" Fugitiv {
nnoremap <leader>ga :Git add %:p<CR><CR>
nnoremap <leader>gs :Gstatus<CR>
nnoremap <leader>gc :Gcommit -v -q<CR>
nnoremap <leader>gt :Gcommit -v -q %:p<CR>
nnoremap <leader>gb :Git branch<Space>
" }
" Gundo {
nnoremap <F5> :GundoToggle<CR>
let g:gundo_right = 1
" }
" NERDTree {
nnoremap <F4> :NERDTreeTabsToggle<CR>
let NERDTreeShowHidden=1
" }
" Key Mappings {
" Reindent file by pressing F7
map <F7> mzgg=G`z<CR>
" Disable array keys for navigations {
inoremap <Up> <NOP>
inoremap <Down> <NOP>
inoremap <Left> <NOP>
inoremap <Right> <NOP>
noremap <Up> <NOP>
noremap <Down> <NOP>
"noremap <Left> <NOP>
"noremap <Right> <NOP>
" }
" }
"
" C++ {
autocmd FileType c ClangFormatAutoEnable
autocmd FileType cpp ClangFormatAutoEnable
set makeprg=ninja
" }
" Quick Stuff {
" Quick save and close
nnoremap <Leader>w :w<CR>
nnoremap <Leader>q :q<CR>
" Using the system dashboard
vmap <Leader>d "+d
vmap <Leader>y "+y
vmap <Leader>P "+P
vmap <Leader>p "+p
nmap <Leader>P "+P
nmap <Leader>p "+p
nmap <Leader><Leader> :Ack!
nmap <Leader>nf :NERDTreeFind<CR>
" }
" Enable the list of buffers
let g:airline#extensions#tabline#enabled = 1
" " Show just the filename
let g:airline#extensions#tabline#fnamemod = ':t'