-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
112 lines (90 loc) · 2.59 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
" mostly copied from
" https://github.com/garybernhardt/dotfiles/blob/master/.vimrc
" https://github.com/tpope/tpope/blob/master/.vimrc
syntax on
filetype plugin indent on
set nocompatible
set hidden
set history=10000
set expandtab
set tabstop=2
set shiftwidth=2
set softtabstop=2
set autoindent
set showmatch
set incsearch
set hlsearch
set ignorecase smartcase
set nobackup
set nowritebackup
set noswapfile
set backupdir=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
set directory=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
set undofile
set undodir=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
set splitbelow
set splitright
set clipboard=unnamed
set autoread
set showcmd
set backspace=indent,eol,start
au CursorHold * checktime
" use emacs-style tab completion when selecting files, etc
set wildmode=longest,list
" make tab completion for files/buffers act like bash
set wildmenu
set t_Co=256 " 256 colors
set background=light
" set background=dark
let mapleader=" "
map Y y$
"noremap Q <Nop> deleteme
" pane movement
nnoremap <c-j> <c-w>j
nnoremap <c-k> <c-w>k
nnoremap <c-h> <c-w>h
nnoremap <c-l> <c-w>l
nnoremap <silent> k gk
nnoremap <silent> j gj
" reselect block after indentation
vnoremap < <gv
vnoremap > >gv
" allow inadvertant shift holding
cnoreabbrev W w
cnoreabbrev Q q
cnoreabbrev Wq wq
cnoreabbrev WQ wq
cnoreabbrev E e
" weird file extensions
autocmd BufNewFile,BufRead *.md setlocal textwidth=80 syn=off
autocmd BufNewFile,BufRead *.inky set syntax=haml
autocmd FileType gitcommit set tw=72
autocmd BufNewFile,BufRead .gitconfig setlocal noexpandtab
autocmd FileType gitcommit setl ts=2
" make ctrl-p overwrite the default register with the last *yanked* text, and
" paste it.
nnoremap <C-p> :let @*=@0<CR>p
" test runners (rspec, etc)
nnoremap <silent> <leader>t :TestFile<CR>
nnoremap <silent> <leader>s :TestNearest<CR>
nnoremap <silent> <leader>r :TestLast<CR>
nnoremap <silent> <leader>a :TestSuite<CR>
let g:test#javascript#tap#reporters = ['faucet']
" for updating jest snapshots
nnoremap <leader>u :TestNearest -u<cr>
let test#ruby#rspec#executable = 'rrspec'
" let test#ruby#minitest#file_pattern = '_spec\.rb' " the default is '_test\.rb'
" expand %% to the directory of the current file
cnoremap <expr> %% expand('%:h').'/'
" fuzzy searching
set rtp+=/usr/local/opt/fzf
nnoremap <leader>f :FZF<cr>
nnoremap <leader>c :execute "!git show " . split(getline("."), " ")[1]<cr>
inoremap \fn <C-R>=expand("%:t:r")<CR>
" Use ag over grep
if executable('ag')
set grepprg=ag\ --nogroup\ --nocolor
endif
let g:prettier#config#semi = 'false'
let g:prettier#config#trailing_comma = 'es5'
let g:prettier#config#single_quote = 'false'