-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
135 lines (117 loc) · 3.74 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
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'ap/vim-css-color',
Plugin 'sickill/vim-monokai'
Plugin 'tpope/vim-haml'
Plugin 'digitaltoad/vim-jade'
Plugin 'bling/vim-airline'
Plugin 'airblade/vim-gitgutter'
Plugin 'scrooloose/nerdtree'
Plugin 'ctrlpvim/ctrlp.vim'
call vundle#end() " required
filetype plugin indent on " required
"
" " Brief help
" " :PluginList - list configured bundles
" " :PluginInstall(!) - install (update) bundles
" " :PluginSearch(!) foo - search (or refresh cache first) for foo
" " :PluginClean(!) - confirm (or auto-approve) removal of unused bundles
" "
" " see :h vundle for more details or wiki for FAQ
"" COLORS
set bg=dark
set term=$TERM
"hi clear
"colorscheme monokai
syntax on
"" EDITOR
set autoindent "take indent for new line from previous line"
set bs=2 "2 = indent,eol,start
set expandtab "expand tabs as spaces.
set shiftwidth=2 "indent by 2 spaces
set smartindent "?
set smarttab "tab inserts spaces
set softtabstop=2 "tab key results in 2 spaces
set tabstop=2 "tabs are 2 spaces
"" HELPFUL TIDBITS
set clipboard=unnamed
set hidden "when a buffer is brought to foreground, remember undo history and marks
set laststatus=2 "always show status line
set magic "enable extended regex
set number "line numbers
set ruler "show cursor position
set showcmd "display incomplete cmds
set showmatch "show matching brackets
set showmode "display current mode
set title "show the filename in the title bar
set ttyfast "send more chars at a given time
set wildmenu
set wildmode=list:full
"" SEARCH
set hlsearch "highlight searches
set ignorecase "case insensitive...
set incsearch "highlight dynamically as pattern is typed
set smartcase " ...unless word includes capital letter
set wrapscan "make search wrap around
"" SPLITS
set splitbelow
set splitright
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
"" MAPPING
let mapleader=','
nmap <leader>l :set list!<CR>
nmap <leader>n :set number!<CR>
nmap <leader>p :set paste!<CR>
"" FOLDING
"set foldmethod=indent
"" YIKES! -- disable arrow key nav
"" Use with care if others are using your vimrc, whoops!
nnoremap <up> <nop>
nnoremap <down> <nop>
nnoremap <left> <nop>
nnoremap <right> <nop>
inoremap <up> <nop>
inoremap <down> <nop>
inoremap <left> <nop>
inoremap <right> <nop>
"
" " Make arrowkey do something usefull, resize the viewports accordingly
" nnoremap <Left> :vertical resize +5<CR>
" nnoremap <Right> :vertical resize -5<CR>
" nnoremap <Up> :resize +5<CR>
" nnoremap <Down> :resize -5<CR>
"
"" Remember to try this again later. I'm still undecided on it
"if exists("&relativenumber")
" set relativenumber
" au BufReadPost * set relativenumber
"endif
"" Drupal files
if has("autocmd")
augroup module
autocmd!
autocmd BufRead,BufNewFile *.module set filetype=php
autocmd BufRead,BufNewFile *.theme set filetype=php
autocmd BufRead,BufNewFile *.install set filetype=php
augroup END
endif
syntax on
set shell=bash
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
au! BufRead,BufNewFile *.jade setfiletype jade
au! BufRead,BufNewFile *.less setfiletype less
au! BufRead,BufNewFile *.coffee setfiletype coffee
" Enable persistent undo so that if I accidentally close a file, I can still
" " get back what I had originally.
set undodir=~/tmp/undodir
set undofile
set undolevels=1000 "maximum number of changes that can be undone
set undoreload=10000 "maximum number lines to save for undo on a buffer