forked from pyrochlore/.dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
154 lines (120 loc) · 4.41 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
"----------------- Vundle ----------------
"
set nocompatible " not compatible with the old-fashion vi mode
filetype off " required!
" http://www.erikzaadi.com/2012/03/19/auto-installing-vundle-from-your-vimrc/
" Setting up Vundle - the vim plugin bundler
let iCanHazVundle=1
let vundle_readme=expand('~/.vim/bundle/vundle/README.md')
if !filereadable(vundle_readme)
echo "Installing Vundle.."
echo ""
silent !mkdir -p ~/.vim/bundle
silent !git clone https://github.com/gmarik/vundle ~/.vim/bundle/vundle
let iCanHazVundle=0
endif
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" let Vundle manage Vundle
" required!
Bundle 'gmarik/vundle'
" My Bundles here:
"
" original repos on github
Bundle 'Lokaltog/vim-easymotion'
Bundle 'airblade/vim-gitgutter'
Bundle "MarcWeber/vim-addon-mw-utils"
Bundle "tomtom/tlib_vim"
Bundle 'Townk/vim-autoclose'
Bundle 'kien/ctrlp.vim'
Bundle 'majutsushi/tagbar'
Bundle 'tomtom/tcomment_vim'
Bundle 'tpope/vim-fugitive'
Bundle 'honza/vim-snippets'
Bundle 'garbas/vim-snipmate'
Bundle 'davidhalter/jedi-vim'
Bundle 'mattn/emmet-vim'
Bundle 'bling/vim-airline'
"
"----------------- End Vundle --------------
"----------------- General ------------------
"
filetype plugin indent on " enable filetype-specific plugins
filetype plugin on " enable loading the plugin files for specific file types
filetype indent on " enable loading the indent file for specific file types
set history=50 " keep 50 lines of command line history
set number " enable line numbers
set autoindent " enable autoindent
set expandtab " use space instead of tab
set tabstop=2 " insert 2 spaces for a tab
set shiftwidth=2 " the number of space characters inserted for indentation
syntax on " enable syntax highlighting
colors Tomorrow-Night-Bright " vim color scheme
set autoread " auto read when file is changed from outside
set history=50 " keep 50 lines of command line history
set mouse=a " mouse support
" patched font src: https://github.com/Lokaltog/powerline-fonts/pull/16
set guifont=Monaco\ for\ Powerline:h14
set t_Co=256 " 256 color mode
if has("gui_macvim") " macvim shift movement
let macvim_hig_shift_movement = 1
endif
set cursorline " highlight current line
set clipboard=unnamed " yank to the system register (*) by default
set showmatch " Cursor shows matching ) and }
set showmode " Show current mode
set backspace=2 " make backspace work like most other apps
set noeb vb t_vb= " disable sound on errors
set laststatus=2 " status line
set wildmode=longest,list,full
set wildmenu
set whichwrap+=<,>,h,l,[,] " Automatically wrap left and right
" encoding settings
set encoding=utf-8
set termencoding=utf-8
set fileencoding=utf-8
"
"------------------- End General ------------------
" tmux will only forward escape sequences to the terminal if surrounded by a DCS sequence
" http://sourceforge.net/mailarchive/forum.php?thread_name=AANLkTinkbdoZ8eNR1X2UobLTeww1jFrvfJxTMfKSq-L%2B%40mail.gmail.com&forum_name=tmux-users
if exists('$TMUX')
let &t_SI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=1\x7\<Esc>\\"
let &t_EI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=0\x7\<Esc>\\"
else
let &t_SI = "\<Esc>]50;CursorShape=1\x7"
let &t_EI = "\<Esc>]50;CursorShape=0\x7"
endif
" Hide toolbar and scrollbars in MacVim
set guioptions-=T
set guioptions-=L
set guioptions-=r
" add spell checking and automatic wrapping at the
" recommended 72 columns to you commit messages
" autocmd Filetype gitcommit setlocal spell textwidth=72
" to move effeciently between splits
nmap gh <C-w>h
nmap gj <C-w>j
nmap gk <C-w>k
nmap gl <C-w>l
" Bash like keys for the command line
cnoremap <C-A> <Home>
cnoremap <C-E> <End>
cnoremap <C-K> <C-U>
" ---------------- Plugin ---------------------
"
" --- TComment
" comment lines with cmd+/
map <D-/> :TComment<cr>
vmap <D-/> :TComment<cr>gv
" --- vim-gitgutter
let g:gitgutter_enabled = 1
highlight clear SignColumn " For the same appearance as your line number column
" --- tagbar
nmap <D-\> :TagbarToggle<CR>
" --- ctrlp
let g:ctrlp_dont_split = 'NERD_tree_2'
let g:ctrlp_show_hidden = 1
" --- airline
let g:airline_powerline_fonts = 1
"
" -------------- End Plugin --------------------