-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
125 lines (105 loc) · 3.46 KB
/
vimrc
File metadata and controls
125 lines (105 loc) · 3.46 KB
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
set nocompatible
call plug#begin('~/.vim/plugged')
Plug 'VundleVim/Vundle.vim'
Plug 'chriskempson/base16-vim' " colorscheme
Plug 'derekwyatt/vim-scala' " scala integration
Plug 'godlygeek/tabular' " align text
Plug 'jiangmiao/auto-pairs' " close brackets, quotes, etc.
Plug 'junegunn/fzf' " fuzzy finder
Plug 'kien/ctrlp.vim' " fuzzy finder
Plug 'mxw/vim-jsx' " jsx syntax highlighting
Plug 'ntpeters/vim-better-whitespace' " remove trailing whitespace
Plug 'pangloss/vim-javascript' " better js syntax highlighting
Plug 'scrooloose/nerdcommenter' " quick commenting
Plug 'scrooloose/nerdtree' " visual file tree
Plug 'scrooloose/syntastic' " syntax highlighting
Plug 'sjl/gundo.vim' " to revert edits
Plug 'tpope/vim-fugitive' " git plugin
Plug 'tpope/vim-projectionist' " move between related files
Plug 'tpope/vim-repeat' " repeats plugin commands with .
Plug 'tpope/vim-sleuth' " detects tab size
Plug 'tpope/vim-surround' " easily change surrounding text
Plug 'tpope/vim-vinegar' " open files quickly
Plug 'vim-airline/vim-airline' " status line
Plug 'vim-airline/vim-airline-themes' " theme for status line
Plug 'benmills/vimux' " run commands from tmux pane
Plug 'Valloric/YouCompleteMe' " code completion
call plug#end()
set background=dark
let &t_Co=256
let base16colorspace=256
colorscheme base16-default-dark
let mapleader = "\<Space>"
set relativenumber
syntax enable
" Change cursor type for different modes
if exists('$TMUX')
let &t_SI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=1\x7\<Esc>\\"
let &t_EI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=0\x7\<Esc>\\"
else
let &t_SI = "\<Esc>]50;CursorShape=1\x7"
let &t_EI = "\<Esc>]50;CursorShape=0\x7"
endif
" Don't unload buffers when I leave them
set hidden
" Search settings
set ignorecase
set nohlsearch
set incsearch
map <silent> <leader>f :NERDTreeToggle<CR>
map <silent> <leader>g :GundoToggle<CR>
" Show open buffers when only one tab is open
let g:airline#extensions#tabline#enabled=1
" Powerline characters for status bar (currently disabled)
" Make sure to use Literation Mono Powerline on iTerm2 if you want arrows to
" display properly
let g:airline_powerline_fonts=0
let g:airline_theme='base16_default'
let g:airline_left_sep=''
let g:airline_right_sep=''
" Configure status line
set statusline=%<%f\ " Filename
set statusline+=%{fugitive#statusline()} " Git branch
set statusline+=%*
let g:syntastic_enable_signs=1
set laststatus=2
" Use ctrl c instead of esc
imap <C-c> <esc>
" Default tab sizes (may be changed by vim sleuth)
set smartindent
set expandtab
set shiftwidth=4
" Move between files with <tab>
function Next()
if tabpagenr('$') > 1
tabnext
else
bnext
endif
endfunction
function Prev()
if tabpagenr('$') > 1
tabprevious
else
bprevious
endif
endfunction
nnoremap <silent> <tab> :call Next()<CR>
nnoremap <silent> <S-tab> :call Prev()<CR>
" Scroll faster
nnoremap <C-e> 6<C-e>
nnoremap <C-y> 6<C-y>
" Strip trailing whitespace on save
autocmd BufWritePre * StripWhitespace
" Common command typos
:command WQ wq
:command Wq wq
:command W w
:command Q q
:command Bd bd
:command BD bd
" Stop using arrow keys
noremap <Up> <NOP>
noremap <Down> <NOP>
noremap <Left> <NOP>
noremap <Right> <NOP>