-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
102 lines (86 loc) · 3.34 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
" Colorscheme
colorscheme nord " note: for solarized8, look at commit history to bring back other settings
" General
set nocompatible
syntax enable " enable syntax processing
let mapleader = "\<Space>"
set mouse=a
set updatetime=100
set clipboard=unnamedplus,unnamed,autoselect
" Spaces & Tabs
filetype plugin indent on
set tabstop=2 " number of visual spaces per TAB
set softtabstop=2 " number of spaces in tab when editing
set shiftwidth=2 " when indenting with `>`, use two spaces
set expandtab " tabs are spaces
autocmd BufWritePre *.rb,*.erb :TrimWhitespace " remove trailing whitespace on *.rb file save
" UI Config
set number " show absolute line number for current line
set relativenumber " show relative line numbers from current line
set showcmd " show command in bottom bar
set splitbelow " split new buffers below the current
set splitright " vsplit new buffers to the right of current
set noshowmode " don't show the mode, since the lightline plugin shows it in status bar
set shortmess+=F " to get rid of the file name displayed in the command line bar
set wildmode=longest,list,full " tab completion
set wildmenu " tab completion
autocmd VimResized * :wincmd = " automatically rebalance windows on vim resize
" Statusline Config
let g:lightline = {
\ 'colorscheme': 'nord',
\ 'separator': { 'left': "\ue0b0", 'right': "\ue0b2" },
\ 'subseparator': { 'left': "\ue0b1", 'right': "\ue0b3" },
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ],
\ [ 'gitbranch', 'readonly', 'filename', 'modified' ] ]
\ },
\ 'component_function': {
\ 'gitbranch': 'FugitiveHead'
\ },
\ }
let g:lightline.enable = {
\ 'statusline': 1,
\ 'tabline': 1
\ }
" Line Length Color Config
autocmd FileType gitcommit set textwidth=72
autocmd FileType gitcommit set colorcolumn=+1
autocmd FileType rb set colorcolumn=120
" NERDTree config
let NERDTreeShowHidden=1
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
" vim-test
let g:test#strategy = "vtr"
" ALE linter config
let g:ale_linters = {
\ 'css': ['prettier'],
\ 'javascript': ['eslint'],
\ 'javascriptreact': ['eslint'],
\ 'ruby': ['rubocop'],
\ 'typescript': ['eslint', 'tsserver'],
\ 'typescriptreact': ['eslint', 'tsserver'],
\ '*': ['remove_trailing_lines', 'trim_whitespace'],
\ }
let g:ale_fixers = {
\ 'css': ['prettier'],
\ 'javascript': ['eslint'],
\ 'javascriptreact': ['eslint'],
\ 'ruby': ['rubocop'],
\ 'typescript': ['eslint', 'prettier'],
\ 'typescriptreact': ['eslint', 'prettier'],
\ '*': ['remove_trailing_lines', 'trim_whitespace'],
\ }
let g:ale_ruby_rubocop_executable = 'bundle' " Use the local/bundle version of rubocop, instead of system
let g:ale_sign_error = '❌' " Prettify the error sign
let g:ale_sign_warning = '⚠️' " Prettify the warning sign
let g:ale_fix_on_save = 1 " Automatically fix files when saved
let g:ale_linters_explicit = 1 " Only run linters named in ale_linters settings.
" fzf
set rtp+=/usr/local/opt/fzf
" ack.vim config
if executable('ag')
let g:ackprg = 'ag --vimgrep'
" let g:ackprg = 'ag --nogroup --nocolor --column'
endif
so ~/.vim/key_mappings.vim
so ~/.dotfiles/.vim/functions.vim