-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvimrc
executable file
·140 lines (96 loc) · 3.66 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
set nocompatible " Must come first because it changes other options.
call pathogen#helptags()
call pathogen#runtime_append_all_bundles()
syntax enable " Turn on syntax highlighting.
filetype plugin indent on " Turn on file type detection.
set autoindent
set smartindent
set showmatch
set showcmd " Display incomplete commands.
set showmode " Display the mode you're in.
set backspace=indent,eol,start " Intuitive backspacing.
set hidden " Handle multiple buffers better.
set wildmenu " Enhanced command line completion.
set wildmode=list:longest " Complete files like a shell.
set ignorecase " Case-insensitive searching.
set smartcase " But case-sensitive if expression contains a capital letter.
set number " line numbers
set ruler " Show cursor position.
set incsearch " Highlight matches as you type.
set hlsearch " Highlight matches.
set nowrap " Turn off line wrapping.
set scrolloff=3 " Show 3 lines of context around the cursor.
set list listchars=tab:▸\ ,trail:•
set visualbell " No beeping.
set nobackup " Don't make a backup before overwriting a file.
set nowritebackup " And again.
set directory=$HOME/.vim/tmp//,. " Keep swap files in one location
set tabstop=2 " Global tab width.
set shiftwidth=2 " And again, related.
set expandtab " Use spaces instead of tabs
"set cursorline
set title " Set the terminal's title
set gdefault " Default regexes to global
set laststatus=2
" Remaps
" Use 'jj' to exit insert mode
inoremap jj <ESC>l
" Shift-Enter to insert a line above
inoremap <S-CR><ESC><S-O>
" Use tab to jump between do/end etc.
nnoremap <tab> %
vnoremap <tab> %
" Quicker command mode
nnoremap ; :
" Hit esc to clear search highlights
nnoremap <silent> <esc> :noh<return><esc>
" Window navigation
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
inoremap <C-h> <esc><C-w>h
inoremap <C-j> <esc><C-w>j
inoremap <C-k> <esc><C-w>k
inoremap <C-l> <esc><C-w>l
nnoremap <C-a> ^
nnoremap <C-e> $
" Auto indent after brackets
inoremap {<cr> {<cr>}<c-o>O
inoremap [<cr> [<cr>]<c-o>O
inoremap (<cr> (<cr>)<c-o>O
" Appearance
set background=dark
colorscheme ir_black
"hi clear CursorLine
"au InsertEnter * hi CursorLine guibg=#073642
"au InsertLeave * hi CursorLine guibg=#05323d
"hi CursorLine guibg=#05323d
hi Cursor guibg=white
hi Visual guibg=#333333 guifg=#EEEEEE
hi MatchParen guibg=#333333
hi SpecialKey guibg=#222222
" NERDTree colors
autocmd VimEnter * hi NERDTreeDir guifg=#eeeeee gui=bold
autocmd VimEnter * hi NERDTreeDirSlash guifg=#eeeeee
autocmd VimEnter * hi NERDTreeExecFile gui=none
" Misc
" Remember last location in file
if has("autocmd")
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
\| exe "normal g'\"" | endif
endif
" Thorfile, Rakefile, Vagrantfile and Gemfile are Ruby
au BufRead,BufNewFile {Gemfile,Rakefile,Vagrantfile,Thorfile,config.ru} set ft=ruby
" ZoomWin configuration
map <Leader><Leader> :ZoomWin<CR>
" MacVIM shift+arrow-keys behavior (required in .vimrc)
let macvim_hig_shift_movement = 1
" NERDTree configuration
let NERDTreeIgnore=['\.pyc$', '\.rbc$', '\~$']
map <Leader>n :NERDTreeToggle<CR>
let NERDTreeMinimalUI=1
let NERDTreeDirArrows=1
" Command-T
let g:CommandTMaxHeight=20
let g:CommandTMatchWindowReverse=1