-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
84 lines (69 loc) · 2.02 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
" Tab Config
set expandtab
set tabstop=4
set softtabstop=4
set shiftwidth=4
set autoindent
" Fix Backspace
set backspace=indent,eol,start
" Mouse Scroll
set mouse=a
" Color Scheme
syntax enable
colorscheme snazzy
highlight NonText ctermfg=LightGray
highlight Normal ctermfg=LightGray ctermbg=235
highlight TabLineFill ctermfg=255 ctermbg=61
highlight TabLineSel ctermfg=255 ctermbg=65
highlight TabLine ctermfg=255 ctermbg=61
set encoding=UTF-8
" Maximize window on startup
au GUIEnter * simalt ~x
" GUI Options
set guioptions-=m
set guioptions-=T
set guioptions-=r
set guioptions-=L
" Show Line Numbers
set number
" Show whitespace characters
set list
set listchars=eol:¬,nbsp:·,trail:·,tab:>-,precedes:·
" Highlight JSON as JavaScript
autocmd BufNewFile,BufRead *.json set ft=javascript
" Configure Line Endings
set ffs=unix,dos
" Configure ctrlp
let g:ctrlp_working_path_mode=0
let g:ctrlp_custom_ignore='node_modules\|DS_STORE\|git\|coverage\|lib'
" Configure SwapFile location
set backup
set backupdir=/tmp
set backupskip=/tmp/*
set directory=/tmp
set writebackup
" Configure NerdTree
let NERDTreeShowHidden=1
let NERDTREEIgnore=['\node_modules']
map <F2> :NERDTreeToggle<CR>
" Configure vim-jsx
let g:jsx_ext_required=0
" Custom Keymapping
imap <Leader>af () => {}<Left><Enter><Enter><Up><Tab>
imap <Leader>it it('', );<Left><Left><Leader>af<Up>
imap <Leader>des describe('', );<Left><Left><Leader>af<Up><Right><Right><Right><Right><Right><Right>
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" MULTIPURPOSE TAB KEY
" Indent if we're at the beginning of a line. Else, do completion.
" https://github.com/garybernhardt/dotfiles/blob/99b7d2537ad98dd7a9d3c82b8775f0de1718b356/.vimrc#L166-L180
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
function! InsertTabWrapper()
let col = col('.') - 1
if !col || getline('.')[col - 1] !~ '\k'
return "\<tab>"
else
return "\<c-p>"
endif
endfunction
inoremap <expr> <tab> InsertTabWrapper()
inoremap <s-tab> <c-n>