-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
142 lines (114 loc) · 3.77 KB
/
vimrc
File metadata and controls
142 lines (114 loc) · 3.77 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
set nocompatible " required
filetype on " required
" Set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim' " Vim plugin Manager
Plugin 'kien/ctrlp.vim' " CtrlP, fuzzy file finder
Plugin 'scrooloose/nerdtree' " Nerd Tree, file explorer
Plugin 'tpope/vim-fugitive' " Vim fugitive, a git wrapper
Plugin 'airblade/vim-gitgutter' " Shows a git diff in a sign column
Plugin 'tpope/vim-surround' " Surround, parentheses, brackets, quotes, etc.
Plugin 'Raimondi/delimitMate' " Auto-completion for quotes, parens, brackets, etc.
Plugin 'scrooloose/nerdcommenter' " Comments toggle
Plugin 'bling/vim-airline' " Status line
Plugin 'flazz/vim-colorschemes' " Color schemes
Plugin 'vim-scripts/taglist.vim' " Tag list
Plugin 'majutsushi/tagbar' " Browse the tags of the current file
Plugin 'Valloric/YouCompleteMe' " Completion plugin
Plugin 'scrooloose/syntastic' " Syntastic, syntax checker
"Plugin 'nvie/vim-flake8'
"Plugin 'pangloss/vim-javascript'
"Plugin 'hail2u/vim-css3-syntax'
Plugin 'gorodinskiy/vim-coloresque' " Color preview css/less/sass/html
Plugin 'ntpeters/vim-better-whitespace' " Highlights whitespaces
Plugin 'sheerun/vim-polyglot' " Syntax and indent for 70+ languanges
"Plugin 'Yggdroot/indentLine' " Vertical lines to show indent level
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just
" :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to
" auto-approve removal
" Enable syntax highlighting
syntax enable
" Color scheme
colorscheme Chasing_Logic
set mouse=a
set clipboard=unnamedplus
" Lines to save in history
set history=800
" Turn off VIM backup
set nobackup
set nowb
set noswapfile
" Show always the cursor's position
set ruler
" Show always the status line
set laststatus=2
" Show line numbers
set number
" Visual autocomplete for command menu
set wildmenu
" Linebreak
set lbr
set cc=80
set tw=80
set wrap
" Ignore case and highlight when searching
set ignorecase
set incsearch
set hlsearch
" Auto indent and smart indent
set ai
set si
" When indenting with '>', use 4 spaces width
set shiftwidth=4
" Show existing tab with 4 spaces width
set tabstop=4
set softtabstop=4
" On pressing tab, insert 4 spaces
set expandtab
set smarttab
" % to bounce from do to end etc.
runtime! macros/matchit.vim
autocmd FileType html setlocal shiftwidth=2 tabstop=2 softtabstop=2 expandtab
autocmd FileType json setlocal shiftwidth=2 tabstop=2 softtabstop=2 expandtab
autocmd FileType css setlocal shiftwidth=2 tabstop=2 softtabstop=2 expandtab
" Mappings
let mapleader=" "
silent! map <F3> :NERDTreeToggle<CR>
silent! map <F4> :SyntasticToggleMode<CR>
silent! nmap <F8> :TagbarToggle<CR>
" CtrlP config
let g:ctrlp_working_path_mode=0
" Syntastic config
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
let g:syntastic_php_checkers = ['php', 'phpcs', 'phpmd']
let g:syntastic_javascript_checkers = ['eslint']
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
" Restores the cursor position
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
" Highlight current cursor line number
hi CursorLineNR cterm=bold
hi CursorLine cterm=bold ctermbg=NONE ctermfg=NONE guibg=NONE guifg=NONE
set cursorline