Skip to content

Commit f52b009

Browse files
committed
Update dotfiles
1 parent bee7487 commit f52b009

File tree

2 files changed

+54
-35
lines changed

2 files changed

+54
-35
lines changed

.vimrc

Lines changed: 38 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ set rtp+=~/.vim/bundle/Vundle.vim
66

77
call vundle#begin()
88
Plugin 'VundleVim/Vundle.vim'
9+
Plugin 'd11wtq/ctrlp_bdelete.vim'
910
Plugin 'easymotion/vim-easymotion'
1011
Plugin 'embear/vim-localvimrc'
11-
Plugin 'honza/vim-snippets'
1212
Plugin 'kien/ctrlp.vim'
1313
Plugin 'majutsushi/tagbar'
1414
Plugin 'pbrisbin/vim-mkdir'
@@ -41,18 +41,19 @@ Plugin 'tpope/vim-rails'
4141
Plugin 'vim-ruby/vim-ruby'
4242

4343
" Python
44-
" Plugin 'glench/vim-jinja2-syntax'
45-
" Plugin 'jmcomets/vim-pony'
46-
Plugin 'fisadev/vim-isort'
44+
" Plugin 'fisadev/vim-isort'
4745
Plugin 'hynek/vim-python-pep8-indent'
46+
" Plugin 'glench/vim-jinja2-syntax'
4847

4948
" Web
50-
" Plugin 'mattn/emmet-vim'
5149
Plugin 'ap/vim-css-color'
50+
Plugin 'kchmck/vim-coffee-script'
51+
Plugin 'mxw/vim-jsx'
5252
Plugin 'pangloss/vim-javascript'
5353

5454
" Deprecated
5555
" Plugin 'jiangmiao/auto-pairs'
56+
" Plugin 'honza/vim-snippets'
5657
call vundle#end()
5758
filetype plugin indent on
5859
syntax on
@@ -89,6 +90,8 @@ set wildignore+=*.bmp,*.gif,*.ico,*.jpg,*.png
8990
set wildignore+=__pycache__
9091
set wildignore+=*.sqlite3
9192
set wildignore+=tmp,bin
93+
set wildignore+=tags
94+
set wildignore+=node_modules
9295

9396
set guioptions-=T
9497
set guioptions-=L
@@ -114,9 +117,9 @@ autocmd FileType python setlocal filetype=python.django
114117
autocmd FileType ruby setlocal expandtab softtabstop=2 shiftwidth=2 shiftround
115118
\ autoindent
116119

117-
" html, css, javascript, htmldjango, eruby
118-
autocmd FileType html,css,javascript,htmldjango,eruby setlocal expandtab
119-
\ softtabstop=2 shiftwidth=2 shiftround autoindent
120+
" web
121+
autocmd FileType html,css,sass,scss,javascript,coffee,htmldjango,eruby
122+
\ setlocal expandtab softtabstop=2 shiftwidth=2 shiftround autoindent
120123

121124
" gyp, gypi
122125
au! BufRead,BufNewFile *.gyp,*.gypi setlocal expandtab softtabstop=2
@@ -157,8 +160,8 @@ nmap <silent> <leader>d <Plug>DashSearch
157160
158161
" NERDTree
159162
let NERDTreeRespectWildIgnore=1
160-
map <Leader>n :NERDTreeToggle<CR>
161-
map <Leader>j :NERDTreeFind<CR>
163+
map <leader>n :NERDTreeToggle<CR>
164+
map <leader>j :NERDTreeFind<CR>
162165
autocmd BufEnter * if (winnr("$") == 1 && exists("b:NERDTree")
163166
\ && b:NERDTree.isTabTree()) | q | endif
164167

@@ -167,17 +170,19 @@ nmap <F8> :TagbarOpen fj<CR>
167170
nmap <F9> :TagbarToggle<CR>
168171
169172
" Gundo
170-
let g:gundo_right=1
173+
let g:gundo_prefer_python3=1
171174
nnoremap <F5> :GundoToggle<CR>
172175
173176
" solarized
174177
call togglebg#map('<F6>')
175178

176179
" UltiSnips
177180
let g:UltiSnipsExpandTrigger='<C-J>'
178-
let g:UltiSnipsListSnippets='<C-K>'
179181
let g:UltiSnipsJumpForwardTrigger='<C-J>'
180-
let g:UltiSnipsJumpBackwardTrigger='<C-Z>'
182+
let g:UltiSnipsJumpBackwardTrigger='<C-K>'
183+
let g:UltiSnipsListSnippets='<C-L>'
184+
let g:UltiSnipsEditSplit='horizontal'
185+
let g:UltiSnipsSnippetsDir=$HOME.'/.vim/UltiSnips'
181186

182187
" syntastic
183188
set statusline+=%#warningmsg#
@@ -189,8 +194,12 @@ let g:syntastic_check_on_open=1
189194
let g:syntastic_check_on_wq=0
190195
let g:syntastic_python_checkers=['flake8']
191196
let g:syntastic_python_flake8_args='--ignore=E501'
192-
let g:syntastic_eruby_ruby_quiet_messages =
193-
\ {'regex': 'possibly useless use of a variable in void context'}
197+
let g:syntastic_eruby_ruby_quiet_messages = {
198+
\ 'regex': 'possibly useless use of a variable in void context',
199+
\}
200+
let g:syntastic_scss_sass_quiet_messages = {
201+
\ 'regex': 'File to import not found or unreadable',
202+
\}
194203

195204
" YouCompleteMe
196205
nnoremap <leader>g :YcmCompleter GoTo<CR>
@@ -203,21 +212,11 @@ let g:ycm_filetype_specific_completion_to_disable = {
203212
\ 'gitcommit': 1,
204213
\ 'objcpp': 1,
205214
\ 'ruby': 1,
215+
\ 'railslog': 1,
206216
\}
207217

208-
" Surround
209-
" django
210-
" let g:surround_{char2nr("v")}="{{ \r }}"
211-
" let g:surround_{char2nr("{")}="{{ \r }}"
212-
" let g:surround_{char2nr("%")}="{% \r %}"
213-
" let g:surround_{char2nr("b")}="{% block \1block name: \1 %}\r{% endblock \1\1 %}"
214-
" let g:surround_{char2nr("i")}="{% if \1condition: \1 %}\r{% endif %}"
215-
" let g:surround_{char2nr("w")}="{% with \1with: \1 %}\r{% endwith %}"
216-
" let g:surround_{char2nr("f")}="{% for \1for loop: \1 %}\r{% endfor %}"
217-
" let g:surround_{char2nr("c")}="{% comment %}\r{% endcomment %}"
218-
219218
" Clang-Format
220-
map <Leader>c :ClangFormat<CR>
219+
map <leader>c :ClangFormat<CR>
221220
let g:clang_format#style_options = {
222221
\ "AccessModifierOffset" : -4,
223222
\ "BasedOnStyle": "Chromium",
@@ -230,3 +229,15 @@ let g:clang_format#style_options = {
230229
" Ctrlp
231230
let g:ctrlp_working_path_mode=0
232231
let g:ctrlp_max_files=0
232+
let g:ctrlp_extensions = ['quickfix', 'bookmarkdir' ]
233+
let g:ctrlp_custom_ignore = '\v[\/]public/packs'
234+
call ctrlp_bdelete#init()
235+
236+
" Rails
237+
let g:rails_ctags_arguments = ['--field=+l', '--languages=Ruby', '--exclude=.git', "--exclude='*~'", "--exclude='*.swp'"]
238+
239+
" Commands
240+
command! -nargs=+ -complete=file MCgrep :execute "grep -rn --exclude-dir='**/chromium/out' --exclude=tags --exclude='*~' --exclude='*.swp' <args>"
241+
command! -nargs=+ -complete=file MCgrepadd :execute "grepadd -rn --exclude-dir='**/chromium/out' --exclude=tags --exclude='*~' --exclude='*.swp' <args>"
242+
command! -nargs=+ -complete=file MMgrep :execute "grep -rn --exclude-dir='**/chromium/out' --exclude=tags --exclude='*~' --exclude='*.swp' --exclude-dir='**/chromium' <args>"
243+
command! -nargs=+ -complete=file MMgrepadd :execute "grepadd -rn --exclude-dir='**/chromium/out' --exclude=tags --exclude='*~' --exclude='*.swp' --exclude-dir='**/chromium' <args>"

.zshrc

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ source $ZSH/oh-my-zsh.sh
6363
# export LANG=en_US.UTF-8
6464

6565
# Preferred editor for local and remote sessions
66-
# if [[ -n $SSH_CONNECTION ]]; then
67-
# export EDITOR='vim'
68-
# else
69-
# export EDITOR='mvim'
70-
# fi
66+
if [[ -n $SSH_CONNECTION ]]; then
67+
export EDITOR='vim'
68+
else
69+
export EDITOR='mvim'
70+
fi
7171

7272
# Compilation flags
7373
# export ARCHFLAGS="-arch x86_64"
@@ -90,17 +90,25 @@ alias mh='~/XcodeProjects/macmail'
9090
alias mmh='~/XcodeProjects/macmail/third_party/mailmaster_framework/src'
9191
alias mmb='~/XcodeProjects/macmail/third_party/mailmaster_framework/build && python mailmaster_mac.py && ninja -C ../src/chromium/out/Debug && -'
9292
alias mmc='~/XcodeProjects/macmail/third_party/mailmaster_framework/build && ninja -C ../src/chromium/out/Debug && -'
93-
alias mpc='~/XcodeProjects/mailmaster/src'
93+
alias mcgrep="grep -rn --exclude-dir='**/.git' --exclude-dir='**/chromium/out' --exclude=tags --exclude='*~' --exclude='*.swp'"
94+
alias mmgrep="mcgrep --exclude-dir='**/.git' --exclude-dir='**/chromium'"
9495

9596
# rbenv
9697
eval "$(rbenv init -)"
9798

9899
# pyenv
99100
eval "$(pyenv init -)"
100-
eval "$(pyenv virtualenv-init -)"
101+
102+
# pipenv
103+
eval "$(pipenv --completion)"
101104

102105
# function
103106
function lb() {
104-
mate ~/logbook/$(date '+%Y-%m-%d').md
107+
mate ~/logbook/$(date '+%Y-%m-%d').md
105108
}
106109

110+
# for c++14
111+
function myg++() {
112+
local output=$(echo "$1" | sed -E 's|\..+$||')
113+
g++ -O3 -std=c++14 -o $output $1
114+
}

0 commit comments

Comments
 (0)