forked from mksaga/gists
-
Notifications
You must be signed in to change notification settings - Fork 1
/
example_vimrc.txt
96 lines (77 loc) · 2.36 KB
/
example_vimrc.txt
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
"add tabs as spaces, and make them 4 spaces
set autoindent
set smartindent
set smarttab
set shiftwidth=4
set softtabstop=4
set tabstop=4
set expandtab
"Respect line wrapping
nnoremap k gk
nnoremap j gj
nnoremap gk k
nnoremap gj j
filetype plugin on
filetype indent on
"SETUP
set visualbell "No sounds
set autoread "Reload files changed outside vim
set laststatus=2 "Enabling statusline at all times
if &encoding != 'utf-8'
set encoding=utf-8 "Necessary to show Unicode glyphs
endif
set noshowmode "Don't show the mode(airline is handling this)
imap jj <Esc> " Use jj to leave insert mode
set cursorline "Highlight the line the cursor is on
set number "Line numbers
" Installs vim-plug if not already present
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
"Plugins
call plug#begin()
"TPOPE
Plug 'tpope/vim-sensible'
Plug 'tpope/vim-fugitive' "Allows git commands
Plug 'tpope/vim-commentary' "Makes commenting easier
Plug 'tpope/vim-surround' "Allows changing of surrounding brackets, quotes, etc
Plug 'ctrlpvim/ctrlp.vim' "Use ctrl-p to switch files
"Airine
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
"Autoformat
Plug 'chiel92/vim-autoformat'
"Syntax Highlight
Plug 'sheerun/vim-polyglot'
"Style
Plug 'flazz/vim-colorschemes'
Plug 'airblade/vim-gitgutter'
call plug#end()
"Setting the colorscheme
if &t_Co >= 256 || has("gui_running")
set background=dark
if !empty(glob('~/.vim/plugged/vim-colorschemes/'))
colorscheme gruvbox
endif
endif
if &t_Co > 2 || has("gui_running")
"switch syntax highlighting on, when the terminal has colors
syntax on
endif
"Airline
let g:airline_powerline_fonts = 0
let g:airline#extensions#tabline#formatter='unique_tail_improved'
let g:airline#extensions#tabline#enabled = 1
let g:airline_theme='deus'
"Ale
let g:airline#extensions#ale#enabled = 1
"AutoFormat
noremap <C-I> :Autoformat<CR>
"Ctrl-p
let g:ctrlp_map = '<c-p>'
let g:ctrlp_cmd = 'CtrlP'
"Git Gutter
let g:gitgutter_realtime = 1
set updatetime=500