-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvimrc
173 lines (141 loc) · 3.54 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
" Basics
set nocompatible
filetype off
set noesckeys
set complete=.
set timeoutlen=200
" Vundle
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" GitHub repos
Plugin 'gmarik/Vundle.vim'
Plugin 'rbgrouleff/bclose.vim'
Plugin 'lukaszb/vim-web-indent'
Plugin 'mutewinter/nginx.vim'
Plugin 'msanders/snipmate.vim'
Plugin 'nanotech/jellybeans.vim'
Plugin 'kien/ctrlp.vim'
Plugin 'tpope/vim-eunuch'
Plugin 'tpope/vim-fugitive'
Plugin 'tpope/vim-markdown'
Plugin 'jtratner/vim-flavored-markdown'
Plugin 'sudar/vim-arduino-syntax'
Plugin 'scrooloose/nerdtree'
Plugin 'bling/vim-airline'
Plugin 'rust-lang/rust.vim'
Plugin 'leafgarland/typescript-vim'
Plugin 'Obvious-Mode'
Plugin 'ZoomWin'
Plugin 'Nazca'
" JavaScript
Plugin 'jason0x43/vim-js-indent'
Plugin 'othree/yajs.vim'
Plugin 'mxw/vim-jsx'
call vundle#end()
" General
filetype plugin indent on
set clipboard+=unnamed
set noerrorbells
set backspace=2
set autoread
set encoding=utf-8
set modelines=0
set virtualedit=block
set backupdir=~/.vim/backup
set directory=/tmp
set nowritebackup
set hidden
" UI
set laststatus=2
set lazyredraw
set ruler
set scrolloff=1
set startofline
set showmatch
set list listchars=tab:>-,trail:.
" Text Formatting
set expandtab
set tabstop=4
set softtabstop=4
set shiftwidth=4
set smarttab
autocmd Filetype typescript setlocal tabstop=2 shiftwidth=2 expandtab
" Searching
set ignorecase
set smartcase
set gdefault
set incsearch
set showmatch
set hlsearch
nnoremap <leader><space> :noh<cr>
nnoremap <tab> %
vnoremap <tab> %
" Spelling
autocmd FileType markdown setlocal spell spelllang=en_us
" Folding
set nofoldenable
set foldmarker={,}
set foldmethod=marker
set foldlevel=100
" GUI Settings
set guifont=Terminess\ Powerline\ 14
set guioptions-=m
set guioptions-=t
set guioptions-=T
set guioptions-=r
set guioptions-=l
set guioptions-=L
map <silent> <F11>
\ :call system("wmctrl -ir " . v:windowid . " -b toggle,fullscreen")<CR>
set background=dark
colo nazca
" Terminal settings
set t_Co=256
set mouse=nv
set ttymouse=xterm2
" Syntax highlihgting
syntax on
"autocmd BufEnter * :syntax sync fromstart
" Key mappings
let mapleader = ","
" Remove trailing whitespace when ,w is pressed
nnoremap <leader>w :let _s=@/<Bar>:%s/\s\+$//e<Bar>:let @/=_s<Bar>:nohl<CR>
" Map CtrlP to Ctrl+T
let g:ctrlp_map = '<c-t>'
let g:ctrlp_cmd = 'CtrlP'
nnoremap <leader>b :CtrlPBuffer<CR>
set wildignore+=*/dist/*,*/node_modules/*,*.min.js
let g:ctrlp_user_command = 'find %s -type f -not -path "*/dist/*" -not -path "*/node_modules/*" -not -path "*/dist/*"'
" Retain cursor position on Esc
inoremap <silent> <Esc> <Esc>`^
vmap y y`]
" Use CTRL-S for saving, also in Insert mode
noremap <C-S> :update<CR>
vnoremap <C-S> <C-C>:update<CR>
inoremap <C-S> <C-O>:update<CR>
" Ctrl+R replaces selected text
vnoremap <C-r> "hy:.,$s/<C-r>h//c<left><left>
" Refresh syntax highlighting on F12
noremap <F12> <Esc>:syntax sync fromstart<CR>
inoremap <F12> <C-o>:syntax sync fromstart<CR>
" Syntax on/off on F5/F6
noremap <F5> <Esc>:syntax off<CR>
inoremap <F5> <C-o>:syntax off<CR>
noremap <F6> <Esc>:syntax on<CR>
inoremap <F6> <C-o>:syntax on<CR>
" Disable indentation after pressing Ctrl+]
set pastetoggle=<C-]>
" Remap CTRL-p and CTRL-P to paste last yanked text
noremap <C-p> "0p
noremap <C-P> "0P
" Disable middle click paste
:map <MiddleMouse> <Nop>
:imap <MiddleMouse> <Nop>
" VIM Airline
let g:airline_powerline_fonts = 1
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
let g:airline_symbols.space = "\ua0"
" Associate *.cshtml with html filetype
au BufRead,BufNewFile *.cshtml set filetype=html