-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
107 lines (76 loc) · 2.22 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
set nocompatible " be iMproved
filetype off " required
"""
""" Vundle stuff
"""
" 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'
" My bundles:
Plugin 'scrooloose/nerdtree'
""" Vundle End
" NERD Tree config
let NERDTreeWinSize = 58
let NERDTreeIgnore = ['\~$', '\.sw?$', '\.pyc', '\.pyo', '\.gel$', '*auto*']
let g:NERDTreeDirArrows=0
nnoremap <silent> <F8> :NERDTreeToggle<CR>
" End NERD config
filetype plugin indent on " required!
""""""""""""""""""""""""""""""""""""
"""
""" Misc editor enchantment
"""
set nu " line number"
set backspace=eol,start,indent "Make backspace work as normal
"""
""" Indention stuff
"""
set autoindent "Copy indent from current line to new line
set smartindent
set expandtab "Use the appropriate number of spaces to insert a <Tab>
set tabstop=2
set softtabstop=2
set shiftwidth=2
"""
""" GUI stuff
"""
set t_Co=256
syntax on
colorscheme codeschool
"""
""" Searching enhancment
"""
set ignorecase "Case insensitive search
set smartcase "When pattern contain case it will become sensitive search
set hlsearch "Highlights search pattern
"Press enter again will take away search result
nnoremap <cr> :noh<cr><cr>
set incsearch
set nolazyredraw
set showmatch "Show matching bracets when text indicator is over them
set mat=2 "How many tenth of second to blink
""" Saving command
let mapleader = ","
" Fast saving
nmap <leader> :w!<cr>
""" Remove white space
map gu :%s/\s\+$//e<enter> :w<enter>
""" Misc
set omnifunc=syntaxcomplete#Complete
set noswapfile "Turn of swap files
set gfn=Monospace\ 9
"Highlight whitespaces
highlight ExtraWhitespace ctermbg=red guibg=red
match ExtraWhitespace /\s\+$/
autocmd BufWinEnter * match ExtraWhitespace /\s\+$/
autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/
autocmd InsertLeave * match ExtraWhitespace /\s\+$/
autocmd BufWinLeave * call clearmatches()
"Extra whitespace removed when saving ruby files
autocmd BufWritePre *.rb :%s/\s\+$//e
"GIT auto line wrap
au FileType gitcommit setlocal tw=72