-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvimrc
156 lines (128 loc) · 3.47 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
let mapleader = ","
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
Bundle 'kien/ctrlp.vim'
Bundle 'majutsushi/tagbar'
Plugin 'altercation/vim-colors-solarized'
Plugin 'Lokaltog/vim-easymotion'
Plugin 'vim-scripts/lid.vim'
Plugin 'lervag/vimtex'
Plugin 'derekwyatt/vim-scala'
Plugin 'tpope/vim-surround'
Plugin 'toyamarinyon/vim-swift'
Bundle 'pangloss/vim-javascript'
Bundle 'mxw/vim-jsx'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
""" Indentation prefs, 3 spaces = tab
set expandtab
set smarttab
set tabstop=3
set shiftwidth=3
""" Searching
set incsearch
if &t_Co > 2 || has("gui_running")
syntax enable
set ignorecase
set hlsearch
" Clear highlighting
nnoremap <silent> <leader><space> :noh<cr>
endif
""" Visual info
" Always show last status
set laststatus=2
set ruler
" Line Wraps
set showbreak=⇇
" Relative numbers and current line
set relativenumber
set nu
" Highlight current line
set cursorline
" Show current mode
set showmode
" Keep 50 lines of command line history
set history=50
" Show the cursor position all the time
set ruler
" Display incomplete commands
set showcmd
""" Usability
" Swap : and ;
nnoremap ; :
nnoremap : ;
" use mouse and scroll wheel
map <xCSI>[62~ <MouseDown>
" disable bells
set visualbell t_vb=
set noerrorbells
" More intuitive window splits
set splitbelow
set splitright
" Vert split for showbuffer
command! -nargs=1 Vsb :vert sb<f-args>
" No Ex Mode
nnoremap Q <NOP>
" Make clipboard default paste buffer
set clipboard=unnamed
" Keep all backups and swp files in .vim out of dropbox, etc
set backupdir=~/.vim/backups
set directory=~/.vim/swaps
if exists("&undodir")
set undodir=~/.vim/undo
endif
" Allow backspace in insert mode
set backspace=indent,eol,start
" Start scrolling three lines before the horizontal window border
set scrolloff=3
" http://usevim.com/2012/10/19/vim101-set-hidden/
set hidden
" Don't jump around when going up/down lines
set nostartofline
" Better tab completion
set wildchar=<Tab> wildmenu wildmode=full
" Setup solarized colorscheme
if &t_Co > 2 || has("gui_running")
let base16colorspace=256
set t_Co=256
set background=dark
let g:solarized_visibility = "normal"
let g:solarized_contrast = "normal"
let g:solarized_termcolors=16
let g:solarized_termtrans=1
colorscheme solarized
endif
""" Plugin specific
" Tagbar
nnoremap <Leader>t :TagbarToggle<CR>
" Easymotion
"map <Leader>l <Plug>(easymotion-lineforward)
map <Leader>j <Plug>(easymotion-j)
map <Leader>k <Plug>(easymotion-k)
map <Leader>h <Plug>(easymotion-linebackward)
map <Leader>s <Plug>(easymotion-s2)
" Jsx highlighting in .js files for React
let g:jsx_ext_required = 0
" Automatic commands
if has("autocmd")
" Clear search matches when lose focus
autocmd BufWinLeave * call clearmatches()
" Treat .json files as .js
autocmd BufNewFile,BufRead *.json setfiletype json syntax=javascript
" Treat .md files as Markdown
autocmd BufNewFile,BufRead *.md setlocal filetype=markdown
" Reload vimrc on write
augroup reload_vimrc
autocmd!
autocmd BufWritePost $MYVIMRC source $MYVIMRC
augroup END
endif
imap jj <Esc>