-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.vimrc
More file actions
161 lines (118 loc) · 3.35 KB
/
.vimrc
File metadata and controls
161 lines (118 loc) · 3.35 KB
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
"""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""VUNDLE AND PLUGINS """"""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""""""""""""""""
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'scrooloose/nerdtree'
Plugin 'flazz/vim-colorschemes'
Plugin 'othree/html5.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'tpope/vim-markdown'
Plugin 'mattn/emmet-vim'
Plugin 'scrooloose/syntastic'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'morhetz/gruvbox'
" Plugin 'valloric/youcompleteme'
call vundle#end()
filetype plugin indent on
""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"""""""""""""""""""""" VIM SETTINGS """"""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"turn on syntax highlighting
syntax enable
" Color theme
set background=dark
colorscheme gruvbox
" colorscheme molokai
" Line Numbering
set number
" Show matching brackets.
set showmatch
" Auto Indent
set autoindent
" Font
set guifont=Menlo\ for\ Powerline
set nocompatible
" Show Ruler
set ruler
" Configure backspace so it acts as it should act
set backspace=eol,start,indent
set whichwrap+=<,>,h,l
"get rid of swap file bs
set noswapfile
set nobackup
set nowb
" No annoying sound on errors
set noerrorbells
set novisualbell
set t_vb=
set tm=500
" Vertical Movement Speed
set so=5
" Ignore case when searching
set ignorecase
" When searching try to be smart about cases
set smartcase
" Highlight search results
set hlsearch
" Makes search act like search in modern browsers
set incsearch
" Auto Indent, Smart Indent, Wrap Line
set ai
set si
set wrap
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""" PLUGIN CONFIGS"""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Syntastic
let g:syntastic_check_on_open = 0
" Turn on vim airline and configure it
let g:airline#extensions#tabline#enabled = 1
let g:airline_theme='wombat'
set laststatus=2
" NERDTree Open on Ctrl+n
map <C-n> :NERDTreeToggle<CR>
" Automatically open NERDTree
if has("gui_macvim")
" MacVim only stuff
autocmd vimenter * NERDTree
endif
" Gruvbox Color
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""" COMMANDS + OTHER """"""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Return to last edit position when opening files (You want this!)
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif
" Remember info about open buffers on close
set viminfo^=%
" Delete trailing white space on save, useful for Python
func! DeleteTrailingWS()
exe "normal mz"
%s/\s\+$//ge
exe "normal `z"
endfunc
autocmd BufWrite *.py :call DeleteTrailingWS()
autocmd BufWrite *.html :call DeleteTrailingWS()
let mapleader = ","
let g:mapleader = ","
" Fast saving
nmap <leader>w :w!<cr>
" Fast close
nmap <leader>q :q<cr>
" Useful mappings for managing tabs
map <leader>tn :tabnew<cr>
map <leader>to :tabonly<cr>
map <leader>tc :tabclose<cr>
map <leader>tm :tabmove
map <leader>m :tabnext<cr>
" Mapping for moving windows
map <leader>wu <C-w>k<cr>
map <leader>wd <C-w>j<cr>
" Automatically close NERDTree if it is the last window open
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif