-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
156 lines (125 loc) · 3.37 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
" ____ ____ ____ ____ ____
" ||v |||i |||m |||r |||c ||
" ||__|||__|||__|||__|||__||
" |/__\|/__\|/__\|/__\|/__\|
"
" Jake Worth's Vim Configuration
" Plug ---------------------- {{{
" Requires vim-plug:
" junegunn/vim-plug
if $VIM_PLUGINS != 'NO'
if filereadable(expand('~/.vimbundle'))
source ~/.vimbundle
endif
endif
" }}}
" ALE ---------------------- {{{
let g:ale_fixers = {
\ 'css': ['prettier'],
\ 'html': ['prettier'],
\ 'javascript': ['prettier'],
\ 'javascript.jsx': ['prettier'],
\ 'javascriptreact': ['prettier'],
\ 'json': ['prettier'],
\ 'python': ['black'],
\ 'ruby': ['rubocop'],
\ 'typescript': ['prettier'],
\ 'typescriptreact': ['prettier'],
\ 'yaml': ['prettier']
\}
let g:ale_linters = {
\ 'javascript': ['eslint'],
\ 'javascriptreact': ['eslint']
\}
" Tell ALE to run only linters I've explicitly configured
let g:ale_linters_explicit = 1
" Set this variable to 1 to fix files when you save them.
let g:ale_fix_on_save = 1
" }}}
" Settings ---------------------- {{{
" Turn on syntax highlighting
syntax on
" Allow customization of indentation by file type
filetype plugin indent on
" Ignore casing of normal letters
set ignorecase
" Ignore casing when using lowercase letters only
set smartcase
" Show line numbers
set number
" Use a visual bell instead of beeping
set visualbell
" Show 7 lines below and above the cursor on vertical scrolling
set so=7
" Don't redraw while executing macros (perf)
set lazyredraw
" Command-line completion operates in an enhanced mode
set wildmenu
set wildmode=list:longest,full
" Vertical splits split right
set splitright
" Horitzontal splits split below
set splitbelow
" Hides buffers instead of closing them
set hidden
" GUI settings
set guifont=Monaco:h16
set guioptions-=T guioptions-=e guioptions-=L guioptions-=r
" Set colors
" Requires vim-colorschemes:
" flazz/vim-colorschemes
set background=dark
colorscheme PaperColor
" }}}
" Mappings ---------------------- {{{
" Disable arrow keys (helped me learn Vim, and now I don't use them)
noremap <up> <nop>
noremap <down> <nop>
noremap <left> <nop>
noremap <right> <nop>
" Copy to system clipboard
" Borrowed from Vim Hashrocket:
" https://github.com/hashrocket/vim-hashrocket
vnoremap gy "+y
" Substitute the word under cursor (h/t Vidal Ekechukwu)
vnoremap <c-r> "hy:%s/<c-r>h//gc<left><left><left>
" Vidal and Dorian Sort™. Sort the highlighted lines
vnoremap <silent> gs :sort<cr>
" Map common FZF & Ripgrep commmands
" Requires ripgrep:
" BurntSushi/ripgrep
nnoremap <silent> <c-b> :Buffers<cr>
nnoremap <silent> <c-g>g :Rg<cr>
nnoremap <silent> <c-p> :Files<cr>
nnoremap <leader>g :<C-U>execute "Rg ".expand('<cword>') \| cw<CR>
" }}}
" Filetype settings ---------------------- {{{
augroup filetype_gitcommit
autocmd!
" Turn on spelling
autocmd FileType gitcommit setlocal spell
augroup END
augroup filetype_docs
autocmd!
" Turn off numbers
autocmd FileType markdown setlocal nonumber
" Fix spelling
nnoremap gsp 1z=
" Turn on spelling
autocmd FileType markdown setlocal spell
augroup END
augroup filetype_dotfiles
autocmd!
" Fold this file on markers
autocmd FileType vim,zsh setlocal foldmethod=marker
augroup END
augroup vimrc
autocmd!
autocmd GuiEnter * set columns=120 lines=70 number
augroup END
augroup filetype_all
autocmd!
" Print something when Vim opens
autocmd VimEnter * :echo "Momentum > Urgency"
augroup END
" }}}