-
Notifications
You must be signed in to change notification settings - Fork 9
/
.vimrc
162 lines (121 loc) · 4.73 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
let g:jsx_ext_required = 0
set nocompatible " Stops vim from behaving in a strongly vi-compatible way.
filetype off
" -------- Vundle! --------
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 'VundleVim/Vundle.vim'
" My Bundles here:
"
" original repos on github
Plugin 'https://github.com/tpope/vim-vividchalk.git'
Plugin 'https://github.com/Reewr/vim-monokai-phoenix'
Plugin 'https://github.com/crusoexia/vim-monokai'
Plugin 'https://github.com/crusoexia/vim-javascript-lib'
Plugin 'flazz/vim-colorschemes'
Plugin 'https://github.com/scrooloose/nerdtree.git'
Plugin 'AutoComplPop'
Plugin 'mxw/vim-jsx'
Plugin 'mileszs/ack.vim'
Plugin 'kien/ctrlp.vim'
Plugin 'mattn/emmet-vim'
Plugin 'Lokaltog/vim-easymotion'
Plugin 'https://github.com/scrooloose/syntastic'
Plugin 'https://github.com/godlygeek/tabular'
Plugin 'https://github.com/tpope/vim-unimpaired'
Plugin 'https://github.com/itspriddle/vim-marked'
Plugin 'pangloss/vim-javascript'
Plugin 'altercation/vim-colors-solarized'
Plugin 'mtscout6/syntastic-local-eslint.vim'
call vundle#end()
" vim-scripts repos
" non github repos
" ...
" -------- end --------
syntax on " Turn on Syntax Highlight
filetype plugin indent on " Turn on file type detection
" colorscheme vividchalk " Change Color scheme in ~/.vim/colors folder
" colorscheme monokai
let g:solarized_termcolors = 256
colorscheme solarized
set wildignore+=*/tmp/*,*.so,*.swp,*.zip,*/node_modules/*,*/mobile/js/web/* " ctrlp ignores
set wildignore+=*\\tmp\\*,*.swp,*.zip,*.exe " Windows
set pastetoggle=<C-z>
set showcmd " Display Commands on screen bottom right
set showmode " Display current mode: insert, replace, normal?
set backspace=indent,eol,start " Allow Backspacing over autoIndent, line breaks(join lines), and over start of insert
set hidden " Fix- Vim refuse to hide buffers because they contain changes
set wildmenu " Enables menu at bottom of vim/gvim window
set wildmode=list:longest,full " When completion in command line via tab, completions will show
set ignorecase " Case insensitive searching
set smartcase " Case-Sensitive if expression has capital letter
set smartindent " Auto Indent when hit Enter
set number " Show Line Numbers
set ruler " Show Cursor Position
set incsearch " Highlight matches as you type
set hlsearch " Highlight matches
set wrap " Search wrap- research from top when hit end of file
set so=10 " Set at least lines visible above or below cursor. large offset = vertically centered
set title " Screen title to currently opened file
set visualbell " Vim flash screen instead of beep on error
set nobackup " Don't make backup before overwriting file
set nowritebackup
set directory=$HOME/.vim/tmp//,. " Keep swap files in one location
set tabstop=2 " 2 spaces for a tab
set expandtab " Use space whenever tab is pressed
set shiftwidth=2 " Change number of space chars inserted for indentation
set laststatus=2 " Always show the status line
set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [POS=%l,%v][%p%%]\ %{strftime(\"%m/%d/%y\ -\ %H:%M\")}
" Status line: format, type, cursor position, % complete, date, and time
"In Macvim, disable GUI
if has("gui_running")
set guioptions=egmrt
endif
"Type fast, :W instead of :w fix.
:ca W w
:ca Q q
"code folding
set foldmethod=indent
set foldnestmax=5 " sometimes fold may define too many folds
set nofoldenable " don't fold by default
set foldlevel=1 " depth of folds to be displayed
"leader key
let mapleader=","
" html tag format after hitting Enter
" i,n,o means insert mode, normal mode, o mode?
inoremap <expr> <CR> '<CR>' . (search('\V>\%#<','bcn') ? '<Esc>O' : '')
nnoremap <leader>m :silent !open -a Marked\ 2.app '%:p'<cr>
" Copy to clipboard
map <C-c> y:e ~/copybufferforvimclipboard<CR>P:w !pbcopy<CR><CR>:bdelete!<CR>
map <C-d> :r !pbpaste<CR><CR>
autocmd BufNewFile,BufRead *.scss setlocal filetype=css
" autocmd FileType css set omnifunc=csscomplete#CompleteCSS
iabbrev [a-z] <C-X><C-O>
au BufNewFile,BufRead *.ejs set filetype=html
au BufNewFile,BufRead *.erb set filetype=html
" set up ignore for ctrlp
set wildignore+=*/tmp/*,*.so,*.swp,*.zip
let g:ctrlp_custom_ignore = '\v[\/](\.git|\.hg|\.svn|node_modules|platforms|Build)$'
let g:ctrlp_working_path_mode = 'r'
" syntastic
let g:syntastic_javascript_checkers = ['eslint']
" show whitespace as characters
set list
set t_Co=256
set background=dark
" Silver Searcher
if executable('ag')
let g:ackprg = 'ag --vimgrep'
endif
" fzf fuzzy finder
" If installed using Homebrew
set rtp+=/usr/local/opt/fzf
" Shortcuts Shortcuts
" Available: https://hea-www.harvard.edu/~fine/Tech/vi.html
map <C-f> :FZF<CR>
map <C-i> :PluginInstall<CR>
map <C-N> :NERDTree<CR>
map <C-_> :Ack<CR>