-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
193 lines (155 loc) · 5.95 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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
set nocompatible " be iMproved
" ======== plugin manager -- I guess this changes yearly now ==========
" install plugin manager of the week if fresh system
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 $HOME/.vimrc
endif
call plug#begin('~/.vim/plugged')
" Plugins
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-endwise'
Plug 'tpope/vim-unimpaired'
Plug 'bling/vim-airline'
Plug 'bling/vim-bufferline'
Plug 'scrooloose/nerdcommenter'
Plug 'airblade/vim-gitgutter'
Plug 'terryma/vim-multiple-cursors'
Plug 'vim-airline/vim-airline-themes'
Plug 'godoctor/godoctor.vim'
Plug 'w0rp/ale'
Plug 'junegunn/fzf'
Plug 'junegunn/fzf.vim'
"Plug 'leafgarland/typescript-vim'
"Plug 'peitalin/vim-jsx-typescript'
" langs
Plug 'sheerun/vim-polyglot'
Plug 'fatih/vim-go'
" colors
Plug 'nanotech/jellybeans.vim'
"Plug 'gruvbox-community/gruvbox'
call plug#end() " required
filetype plugin indent on " required
set encoding=utf-8 "b/c Pike won
set number "Line numbers within relative
set relativenumber "awesome-sauce
set backspace=indent,eol,start "it's 2014 we can use backspace meow
set history=1000 "know your history
set showcmd "show incomplete commands
set showmode "show current mode
"set visualbell "stop yelling at me
set t_vb= "really, stop yelling
set autoread "reload files changed outside vim
set t_Co=256 "why god?
set term=xterm-256color "colors
"set re=1 "rubys were slow :( THIS WAS CAUSING ISSUES!!!
set ttyfast "speeds
set lazyredraw "rabbits
set noswapfile "yes I made those changes
set nobackup "no I don't need 7 trillion copies
set nowb "stop yelling at me
if executable('/usr/bin/ruby')
let g:ruby_path="/usr/bin/ruby" "ruby is bad and should feel bad
endif
" remappings
let mapleader="," "remap leader to ,
set pastetoggle=<F2> "quit indenting yo shit
noremap <silent> <leader>l :noh<CR>
noremap <silent> <leader>d :bd<CR>
"" splits "only you can prevent emacs pinky
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
nnoremap <C-=> <C-W>=
" ale
let g:ale_lint_on_text_changed = 'never'
set splitbelow "naturally go right and down
set splitright
set diffopt=vertical "always use vertical diffs
"" ====== Search Settings ======
set incsearch "get next match while typing
set hlsearch "highlighting
set viminfo='100,f1 "save 100 marks, caps
"" ====== Indentation =====
set autoindent "why would you not want this? masochist!
set smartindent
set smarttab
set shiftwidth=2
set softtabstop=2
set tabstop=2 "because 2 spaces is objectively the best
set expandtab
augroup vimrcEx
autocmd!
" When editing a file, always jump to the last known cursor position.
" Don't do it for commit messages, when the position is invalid, or when
" inside an event handler (happens when dropping a file on gvim).
autocmd BufReadPost *
\ if &ft != 'gitcommit' && line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal g`\"" |
\ endif
"" Set syntax highlighting for specific file types
"autocmd BufRead,BufNewFile *.md set filetype=markdown
"autocmd BufNewFile,BufRead *.tsx,*.jsx set filetype=typescript.tsx
" testing to see if this is actually fast... so far no
"autocmd BufEnter * :syntax sync fromstart
"" For all text files set 'textwidth' to 78 characters.
autocmd FileType text,markdown,gitcommit setlocal textwidth=78
"" Enable spellchecking for Markdown
autocmd FileType text,markdown,gitcommit setlocal spell
augroup END
set nowrap " let a line be a line
set linebreak " stahp
"" ====== Folding ==========
set foldmethod=indent " too lazy to tag
au BufRead * normal zR
" ====== completion ======
set wildmode=list:longest
" ====== scrolling ========
set scrolloff=8 "keep a reasonable padding at edges
set sidescrolloff=15
set sidescroll=1
" ====== airline ==========
set laststatus=2 "always display statusline in all windows
set noshowmode "hide default mode text
"if ! has('gui_running') "fix the slowness of powerline
" set ttimeoutlen=10
" augroup FastEscape
" autocmd!
" au InsertEnter * set timeoutlen=0
" au InsertLeave * set timeoutlen=1000
" augroup END
"endif
let g:airline_theme = 'jellybeans'
let g:airline_section_x = '' "who cares if utf8?
let g:airline_section_y = '%{&filetype}' "put ^ here
let g:airline#extensions#whitespace#enabled = 0 "shut up I have gofmt
let g:airline#extensions#hunks#enabled = 0 "wat
" ====== bufferline ===
let g:bufferline_echo = 0 "louuuuud noises
"" ====== Theme ======
set list listchars=tab:»·,trail:·
set background=dark
colorscheme jellybeans
syntax on
set redrawtime=10000 " idk what happened
" see through your computer's soul
"gitgutter color
hi clear SignColumn
" bg
hi Normal ctermbg=NONE guibg=NONE
" line numbers
hi CursorLineNr ctermbg=NONE guibg=NONE
hi LineNr ctermbg=NONE guibg=NONE
" whack bg
hi NonText ctermbg=NONE guibg=NONE
" listchars (tab,EOL)
hi SpecialKey ctermbg=NONE guibg=NONE ctermfg=238 guifg=#444444
" ======= fzf ==============
function! s:find_git_root()
return system('git rev-parse --show-toplevel 2> /dev/null')[:-2]
endfunction
command! ProjectFiles execute 'Files' s:find_git_root()
nmap <C-P> :ProjectFiles<CR>