-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
89 lines (68 loc) · 2.86 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
"-- GENERAL --
set linebreak "Break lines at word (req Wrap-lines)
set textwidth=80 "Line wrap at 80 cols
set backspace=indent,eol,start "Backspace behavior
syntax on "Enable syntax highlighting
colorscheme minimalist "Vim editor theme
set number "Show line numbers
set showmatch "Highlight matching brace
set ruler "Show row and col numbers
set showmode "Shows current mode (ex: VISUAL)
set hlsearch "Highlight all search results
set smartcase "Enable smart-case search
set ignorecase "Search case-insensitive
set autoindent "Auto-indent new lines
set shiftwidth=2 "Number of auto-indent spaces
set smartindent "Enable smart-indent
set smarttab "Enable smart-tabs
set softtabstop=2 "Number of spaces per tab
"-- AUTOCOMPLETION --
filetype plugin on
set omnifunc=syntaxcomplete#Complete
"-- MAPPINGS --
"Maps jk to <Esc>
inoremap jk <Esc>
"Maps <C-F> to format python code with yapf
map <C-F> :call yapf#YAPF()<cr>
"Advanced
if has ('mac')
set clipboard=unnamed "Integrate mac clipboard with vim
endif
"-- PLUGINS --
"Installs plugin manager Vim-Plug (https://github.com/junegunn/vim-plug)
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 will be downloaded under the specified directory.
call plug#begin('~/.vim/plugged')
"Vim/tmux enhancement
Plug 'vim-airline/vim-airline' "Enhanced vim status line
Plug 'dikiaap/minimalist' "Editor theme
Plug 'christoomey/vim-tmux-navigator' "Makes tmux work nicer with vim
"Language support
"Plug 'Valloric/YouCompleteMe' "Autocomplete - git cloned manually
Plug 'pangloss/vim-javascript' "JS syntax highlighting
Plug 'mxw/vim-jsx' "JSX syntax highlighting
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' } "Golang support
"Formatter plugins
Plug 'google/yapf', { 'rtp': 'plugins/vim', 'for': 'python' } "Python
Plug 'w0rp/ale' "Multi-language formatter/linter
"List ends here. Plugins become visible to Vim after this call.
call plug#end()
"-- PLUGIN CONFIGS --
" YCM autocomplete
let g:ycm_autoclose_preview_window_after_insertion = 1
" Ale fixing/linting
" let g:ale_linters_explicit = 1 "only lint when explicitly configured
let g:ale_fix_on_save = 1 "format on save
" Fix files with prettier, and then ESLint.
let g:ale_fixers = ['prettier', 'eslint']
" let g:ale_fixers = {
" \ 'javascript': ['prettier'],
" \ 'javascript.tsx': ['prettier'],
" \ 'typescript': ['prettier'],
" \ 'typescript.tsx': ['prettier'],
" \ 'css': ['prettier'],
" \}