-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.vimrc
138 lines (110 loc) · 2.92 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
" Highlight default syntax
syntax on
" Vundle config
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
source ~/.vim/bundles.vim
if filereadable(expand('~/.vim/bundles.vim.local'))
source ~/.vim/bundles.vim.local
endif
call vundle#end()
" Allow set indent per filetype
filetype plugin indent on
" Visual notification
set visualbell
" Menu for autocomplete for a path
set wildmenu
set wildmode=list:longest,full
" Open new buffers bellow and right
set splitright
set splitbelow
" Allow send buffers to the background
set hidden
" GUI options
set guifont=Monaco:h16
set guioptions-=T guioptions-=e guioptions-=L guioptions-=r
" Display line numbers
set number
" Use bash when executing shell commands
set shell=bash
" Set columns, lines and line numbers
augroup vimrc
autocmd!
autocmd GuiEnter * set columns=120 lines=70 number
augroup END
" Add comma as leader
:nmap , \
" Map window prefix to ommit W
map <C-j> <C-W>j
map <C-k> <C-W>k
map <C-h> <C-W>h
map <C-l> <C-W>l
" vim tab navigation
nnoremap th :tabfirst<CR>
nnoremap tj :tabprev<CR>
nnoremap tk :tabnext<CR>
nnoremap tl :tablast<CR>
nnoremap tc :tabclose<CR>
nnoremap tn :tabnew<CR>
" disable arrow navigation keys
inoremap <Up> <NOP>
inoremap <Down> <NOP>
inoremap <Left> <NOP>
inoremap <Right> <NOP>
noremap <Up> <NOP>
noremap <Down> <NOP>
noremap <Left> <NOP>
noremap <Right> <NOP>
" Better search behavior
set hlsearch
set incsearch
set ignorecase
set smartcase
" Unhighlight search results
map <Leader><space> :nohl<cr>
" Don't scroll off the edge of the page
set scrolloff=5
" This uses Ack.vim to search for the word under the cursor
nnoremap <leader><bs> :Ag! '\b<c-r><c-w>\b'<cr>
" NERDTree configuration
let NERDTreeIgnore=['\~$', 'tmp', '\.git', '\.bundle', '.DS_Store', 'tags', '.swp']
let NERDTreeShowHidden=1
let g:NERDTreeDirArrows=0
map <Leader>n :NERDTreeToggle<CR>
map <Leader>fnt :NERDTreeFind<CR>
" Set default indentation to 2 spaces
set softtabstop=2 shiftwidth=2 expandtab
colorscheme monokai
hi Search term=bold,underline cterm=NONE guibg=Grey40 ctermbg=LightYellow ctermfg=Black
" vp doesn't replace paste buffer
function! RestoreRegister()
let @" = s:restore_reg
return ''
endfunction
function! s:Repl()
let s:restore_reg = @"
return "p@=RestoreRegister()\<cr>"
endfunction
vmap <silent> <expr> p <sid>Repl()
" ctrlp.vim config
if get(g:, 'loaded_ctrlp', 1)
let g:ctrlp_match_window_reversed = 0
let g:ctrlp_working_path_mode = 'a'
let g:ctrlp_max_height = 20
let g:ctrlp_match_window_bottom = 0
let g:ctrlp_switch_buffer = 0
let g:ctrlp_custom_ignore = '\v.DS_Store|.sass-cache|.scssc|tmp|.bundle|.git|node_modules|vendor|bower_components$'
endif
" Disable vim backups
set nobackup
" Disable swapfile
set noswapfile
" The encoding displayed.
set encoding=utf-8
" allows per-project configuration files
set exrc
if filereadable(expand('~/.vimrc.local'))
source ~/.vimrc.local
endif