-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
executable file
·125 lines (96 loc) · 2.96 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
""
"" Basic setup
""
set nocompatible " use vim, no vi defaults
set encoding=utf-8 " set default encoding to UTF-8
set clipboard=unnamed " use MacOSX clipboard
syntax on " turn on syntax highlighting
""
"" Whitespace
""
set nowrap " don't wrap lines
set softtabstop=2 " use mix of spaces and tabs
set shiftwidth=2 " an autoindent (with <<) is two spaces
set expandtab " use spaces, not tabs
set backspace=indent,eol,start " backspace through everything in insert mode
" show trailing whitespaces as errors
autocmd BufWinEnter * match Error /\s\+$/
""
"" Status line
""
set statusline= " clear statusline for when vimrc is reloaded
set statusline+=b%n " buffer number
set statusline+=%M\ " buffer modified flag
set statusline+=%<\ " cut at start
set statusline+=%f\ " path
set statusline+=%= " right align
set statusline+=%3l/%L " line position of cursor and total number of lines
set statusline+=,%-3c\ " column position of cursor
set laststatus=2 " always show statusline
""
"" Searching
""
set ignorecase " searches are case insensitive...
set smartcase " ... unless they contain at least one capital letter
set incsearch " incremental searching
set hlsearch " highlight matches with the last used search pattern
nnoremap <CR> :noh<CR><CR> " clear search with <enter>
""
"" File types
""
autocmd BufRead,BufNewFile {*.hbs} set filetype=html
set autoindent " use the indent of the previous line for a newly created line
filetype plugin indent on " turn on filetype plugins
""
"" Wild settings
""
set wildmode=list:longest " list all matches and complete till longest common string
" Disable output and VCS files
set wildignore+=*.o,*.out,*.obj,.git,*.rbc,*.rbo,*.class,.svn,*.gem
" Disable archive files
set wildignore+=*.zip,*.tar.gz,*.tar.bz2,*.rar,*.tar.xz
" Ignore bundler and sass cache
set wildignore+=*/vendor/cache/*,*/.bundle/*,*/.sass-cache/*
" Disable temp and backup files
set wildignore+=*.swp,*~,._*
""
"" Mouse
""
set mouse=a " allow mouse in all modes
""
"" Backup and swap files
""
set backupdir=~/.vim/tmp/backup/ " where to put backup files.
set directory=~/.vim/tmp/swap/ " where to put swap files.
""
"" Persistent Undo
""
set undofile
set undodir=~/.vim/tmp/undo
""
"" Layout
""
colorscheme railscasts
""
"" Load plugins using pathogen
""
exe 'source ' . expand('~/.vim/') . 'core/pathogen/autoload/pathogen.vim'
call pathogen#infect('plugins/{}')
""
"" NERDTree
""
let g:NERDTreeStatusline = ' '
map <Leader>n :NERDTreeToggle<CR>
""
"" ZoomWin
""
map <Leader><Leader> :ZoomWin<CR>
""
"" CtrlP
""
map <C-b> :CtrlPBuffer<CR>
""
"" CloseTag: Load only for html/xml like files.
""
autocmd FileType html,htmldjango,jinjahtml,eruby,mako let b:closetag_html_style=1
autocmd FileType html,xhtml,xml,htmldjango,jinjahtml,eruby,mako source ~/.vim/plugins/closetag/plugin/closetag.vim