-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
107 lines (91 loc) · 3.94 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
" Modeline and Notes {
" vim: set sw=4 ts=4 sts=4 et tw=80 foldmarker={,} foldlevel=0 foldmethod=marker spell:
"
" This is the personal .vimrc file of Florian Heidenreich.
"
" }
" Plugin Environment {
set nocompatible
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim' " Plugin manager
Plugin 'w0rp/ale' " Syntax checker
Plugin 'tpope/vim-fugitive' " Git wrapper
Plugin 'vim-airline/vim-airline' " Status line
Plugin 'morhetz/gruvbox' " Color scheme
Plugin 'tpope/vim-surround' " Quoting and parenthesizing
Plugin 'Valloric/YouCompleteMe' " Code completion
Plugin 'ludovicchabant/vim-gutentags' " Ctags generation
Plugin 'scrooloose/nerdcommenter' " Commenting
Plugin 'fatih/vim-go' " Go
Plugin 'pangloss/vim-javascript' " JavaScript
Plugin 'mxw/vim-jsx' " JSX
Plugin 'maksimr/vim-jsbeautify' " JSBeautify
call vundle#end()
" }
" General {
set clipboard=unnamed " Use macOS clipboard
filetype plugin indent on " Automatically detect file types.
" Color scheme {
set background=dark
let g:gruvbox_invert_selection=0
let g:gruvbox_contrast_dark="hard"
colorscheme gruvbox
" }
syntax on " Syntax highlighting
set laststatus=2 " Always show status line
set number " Always show line numbers
set noswapfile " Do not use swap files
set incsearch " Always show search matches while typing
set hlsearch " Highlight search matches
" }
" Formatting {
set backspace=indent,eol,start " Allow backspace to do its work
set nowrap " Do not wrap long lines
set autoindent " Indent at the same level of the previous line
set shiftwidth=4 " Use indents of 4 spaces
set expandtab " Tabs are spaces
set tabstop=4 " An indentation every four columns
set softtabstop=4 " Let backspace delete indent
set lazyredraw " No redraw while executing macros
" }
" Plugin Settings {
" Fugitive {
nnoremap <silent> <leader>gs :Gstatus<CR>
nnoremap <silent> <leader>gd :Gdiff<CR>
nnoremap <silent> <leader>gc :Gcommit<CR>
nnoremap <silent> <leader>gb :Gblame<CR>
nnoremap <silent> <leader>gl :Glog<CR>
nnoremap <silent> <leader>gp :Git push<CR>
nnoremap <silent> <leader>gu :Git pull<CR>
nnoremap <silent> <leader>gr :Gread<CR>
nnoremap <silent> <leader>gw :Gwrite<CR>
nnoremap <silent> <leader>ge :Gedit<CR>
nnoremap <silent> <leader>gi :Git add -p %<CR>
nnoremap <silent> <leader>gg :SignifyToggle<CR>
" }
" vim-go {
let g:syntastic_go_checkers = ['metalinter']
let g:syntastic_mode_map = { 'mode': 'active', 'passive_filetypes': ['go'] }
let g:go_list_type = "quickfix"
let g:go_fmt_command = "goimports"
let g:go_highlight_functions = 1
let g:go_highlight_methods = 1
let g:go_highlight_fields = 1
let g:go_highlight_types = 1
let g:go_highlight_operators = 1
let g:go_highlight_build_constraints = 1
au FileType go nmap <Leader>god <Plug>(go-def-vertical)
au FileType go nmap <Leader>godv <Plug>(go-doc-vertical)
au FileType go nmap <Leader>goi <Plug>(go-info)
au FileType go nmap <leader>gor <Plug>(go-run)
au FileType go nmap <Leader>goe <Plug>(go-rename)
au FileType go nmap <leader>gob <Plug>(go-build)
au FileType go nmap <leader>got <Plug>(go-test)
au FileType go nmap <leader>goc <Plug>(go-coverage)
" }
" YouCompleteMe {
let g:ycm_autoclose_preview_window_after_insertion = 1
let g:ycm_collect_identifiers_from_tags_files = 1
" }
" }