-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvim_config.vim
116 lines (90 loc) · 3.23 KB
/
vim_config.vim
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
" An example for a vimrc file.
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last change: 2016 Jul 28
"
" To use it, copy it to
" for Unix and OS/2: ~/.vimrc
" for Amiga: s:.vimrc
" for MS-DOS and Win32: $VIM\_vimrc
" for OpenVMS: sys$login:.vimrc
" My preferences
set undodir=$VIMPREFS/undo " set the backup home directory
set undofile " save undo's after file closes
set undolevels=1000 " how many undo's
set undoreload=10000 " number of lines to save for undo
set backupdir=$VIMPREFS/backup
set clipboard=unnamed " Use the system clipboard for copy/paste
set tabstop=2 " how many columns a tab counts for
set softtabstop=2 " how many columns when tab is pressed in insert mode
set shiftwidth=0 " how many columns is indented with re-indent operation
set expandtab " converts tab press into spaces
set autoindent " always set autoindenting on
set number " Add line numbers
set linebreak " line break between words
set fileformats=unix,dos
" Set the fold method
set foldmethod=indent
set foldnestmax=2
" Settings for fuzzy finder
set wildmenu
" Don't offer to open certain files/directories
set wildignore+=*.bmp,*.gif,*.ico,*.jpg,*.png,*.ico
set wildignore+=*.pdf,*.psd
set wildignore+=node_modules/*,bower_components/*
" Set the working directory to wherever the open file lives
set autochdir
" `gf` opens file under cursor in a new vertical split
nnoremap gf :vertical wincmd f<CR>
" When started as "evim", evim.vim will already have done these settings.
if v:progname =~? "evim"
finish
endif
" Get the defaults that most users want.
source $VIMPREFS/defaults.vim
if has("vms")
set nobackup " do not keep a backup file, use versions instead
endif
if &t_Co > 2 || has("gui_running")
" Switch on highlighting the last used search pattern.
set hlsearch
endif
" Only do this part when compiled with support for autocommands.
if has("autocmd")
" Put these in an autocmd group, so that we can delete them easily.
augroup vimrcEx
au!
" For all text files set 'textwidth' to 78 characters.
autocmd FileType text setlocal textwidth=78
augroup END
augroup autoformat_settings
autocmd FileType bzl AutoFormatBuffer buildifier
autocmd FileType c,cpp,proto,javascript AutoFormatBuffer clang-format
autocmd FileType dart AutoFormatBuffer dartfmt
autocmd FileType go AutoFormatBuffer gofmt
autocmd FileType gn AutoFormatBuffer gn
autocmd FileType html,css,json AutoFormatBuffer js-beautify
autocmd FileType java AutoFormatBuffer google-java-format
autocmd FileType python AutoFormatBuffer yapf
" Alternative: autocmd FileType python AutoFormatBuffer autopep8
augroup END
else
set autoindent " always set autoindenting on
endif " has("autocmd")
" Add optional packages.
"
" The matchit plugin makes the % command work better, but it is not backwards
" compatible.
if has('syntax') && has('eval')
packadd matchit
endif
call plug#begin()
Plug 'https://github.com/leafgarland/typescript-vim.git'
Plug 'elmcast/elm-vim'
Plug 'Chiel92/vim-autoformat'
Plug 'fatih/vim-go'
Plug 'google/vim-maktaba'
Plug 'google/vim-codefmt'
Plug 'google/vim-glaive'
Plug 'https://github.com/rhysd/vim-clang-format.git'
call plug#end()