-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
158 lines (118 loc) · 3.5 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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
" Author: Victor Ferreira
" Source: https://github.com/vctrtvfrrr/dotfiles
" LEADER KEY
let mapleader=","
" COMPATIBILITY
" Set 'nocompatible' to avoid unexpected things that your distro might have
set nocompatible
set t_ut=
" BUNDLE
" Automatically download vim-plug if it doesn't exist
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
" Configure vim-plug
call plug#begin('~/.vim/bundle')
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
Plug 'scrooloose/syntastic'
Plug 'tomasr/molokai'
Plug 'jeffkreeftmeijer/vim-numbertoggle'
Plug 'editorconfig/editorconfig-vim'
Plug 'vim-scripts/AutoComplPop'
Plug 'Raimondi/delimitMate'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'scrooloose/nerdcommenter'
Plug 'rking/ag.vim'
Plug 'sheerun/vim-polyglot'
call plug#end()
" SYNTAX
" Enable syntax highlighting
syntax on
" SEARCH
" Highlight search term. Use :nohl to redraw screen and disable highlight
set hlsearch
" Make Ag search from your project root
let g:ag_working_path_mode="r"
" Use case insensitive search, except when using capital letters
set ignorecase
set smartcase
" AUTO IDENTATION
" Enable auto identation with 'spaces' instead of 'tabs'
set smartindent
set expandtab
set softtabstop=2
set shiftwidth=2
" MOVING BETWEEN FILES
" Set 'hidden' if you want to open a new file inside the same buffer without the
" need to save it first (if there's any unsaved changes).
set hidden
" REMEMBER THIGS
" Tell vim to remember certain things when we exit
" '10 : marks will be remembered for up to 10 previously edited files
" "100 : will save up to 100 lines for each register
" :20 : up to 20 lines of command-line history will be remembered
" % : saves and restores the buffer list
" n... : where to save the viminfo files
set viminfo='10,\"100,:20,%,n~/.viminfo
function! ResCur()
if line("'\"") <= line("$")
normal! g`"
return 1
endif
endfunction
augroup resCur
autocmd!
autocmd BufWinEnter * call ResCur()
augroup END
" BACKUP
" Disable all backup files, never used them
set nobackup
set nowritebackup
set noswapfile
" SYNTASTIC
" Syntastic is a syntax checking plugin for Vim that runs files through
" external syntax checkers and displays any resulting errors to the user.
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
" Configure Standar JS as default linter
let g:syntastic_javascript_checkers = ['standard']
" COLOR SCHEME
" Load molokai (alternative to Monokai from TextMate) color scheme
colorscheme molokai
" FONT
set guifont=Menlo\ for\ Powerline:h12
set antialias
" ENCODING
set encoding=utf-8
" COMMAND LINE
" Enhanced command line completion
set wildmenu
" Complete files like a shell
set wildmode=list:longest
" SEARCH
" Vim will start searching as you type
set incsearch
" FILE NUMBERS
" Enable relative and absolute file numbers
set number relativenumber
" WRAP
" Stop wrapping long lines
set nowrap
" AUTORELOAD
" Automatically reload buffers when file changes
set autoread
" PLUGINS CONFIGURATIONS
" CtrlP
let g:ctrlp_map = '<c-p>'
let g:ctrlp_cmd = 'CtrlP'
" Syntastic
nnoremap <leader>st :SyntasticToggleMode<cr>
" NERDTree
nnoremap <leader>ft :NERDTreeToggle<cr>