diff --git a/.gitignore b/.gitignore index 4a4cb2b..0e06adc 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ vim/sessions .netrwhist bin/subl tags +.idea diff --git a/README.md b/README.md index ddcb738..1e8763c 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,9 @@ # Yet Another Dotfile Repo v1.1 # Now with Prezto and Vundle! -[![加入聊天https://gitter.im/hophacker/dotfiles](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/hophacker/dotfiles?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +[![Join the chat at https://gitter.im/hophacker/dotfiles](https://badges.gitter.im/hophacker/dotfiles.svg)](https://gitter.im/hophacker/dotfiles?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +[![Join the chat at https://gitter.im/hophacker/dotfiles](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/hophacker/dotfiles?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + #### sh -c "\`curl -fsSL https://raw.githubusercontent.com/hophacker/dotfiles/master/install.sh \`" diff --git a/Rakefile b/Rakefile index 676dbc1..76fbd35 100644 --- a/Rakefile +++ b/Rakefile @@ -2,6 +2,19 @@ require 'rake' require 'fileutils' require File.join(File.dirname(__FILE__), 'bin', 'yadr', 'vundle') +# TODO install for vim_instant_markdown + +task :link_files do + install_files(Dir.glob('git/*')) + install_files(Dir.glob('irb/*')) + install_files(Dir.glob('ruby/*')) + install_files(Dir.glob('ctags/*')) + install_files(Dir.glob('tmux/*')) + install_files(Dir.glob('vimify/*')) + install_files(Dir.glob('{vim,vimrc}')) + Rake::Task["install_prezto"].execute +end + desc "Hook our dotfiles into system-standard positions." task :install => [:submodule_init, :submodules] do puts @@ -25,6 +38,8 @@ task :install => [:submodule_init, :submodules] do Rake::Task["install_vundle"].execute end + Rake::Task["install_zsh"].execute + Rake::Task["install_ycm"].execute Rake::Task["install_prezto"].execute @@ -44,11 +59,23 @@ task :install_prezto do end end +task :install_zsh do + if want_to_install?('zsh') + run %{ + which zsh + if [ $? != 0 ]; then + sudo apt install zsh -y + fi + } + end +end + task :install_ycm do if want_to_install?('YouCompleteMe') run %{ + apt install cmake libpython2.7 python-dev -y cd $HOME/.vim/bundle/YouCompleteMe/ - ./install.sh + ./install.py } end end diff --git a/ruby/gemrc b/ruby/gemrc index 7a046c1..2b3103c 100644 --- a/ruby/gemrc +++ b/ruby/gemrc @@ -1,8 +1,10 @@ --- -:update_sources: true +:backtrace: false +:bulk_threshold: 1000 :sources: - http://rubygems.org -:benchmark: false -:backtrace: false +- https://gems.ruby-china.org/ +:update_sources: true :verbose: true -gem: --no-document +benchmark: false +gem: "--no-document" diff --git a/vim/UltiSnips/javascript.snippets b/vim/UltiSnips/javascript.snippets index 12f8a7b..2d00894 100644 --- a/vim/UltiSnips/javascript.snippets +++ b/vim/UltiSnips/javascript.snippets @@ -1,21 +1,19 @@ -snippet react "React template" b -import React, {Component, PropTypes} from 'react' -import {connect} from 'react-redux' +snippet reactComponent "React template" b +import React, { Component } from 'react' -class ${1:C} extends Component { +export default class extends Component { render () { } } +endsnippet -$1.propTypes = { - self: PropTypes.object, - location: PropTypes.object -} +snippet reactConnect "React template" b +import component from './component' +import { connect } from 'react-redux' -export default connect((state, ownProps) => { - return { - } -})($1) +export default connect((state, ownProps) => ({ +}), { +})(component) endsnippet snippet TODO "Javascript Todo" b diff --git a/vim/settings/ctrlp.vim b/vim/settings/ctrlp.vim index 6642a09..d0ab3fc 100644 --- a/vim/settings/ctrlp.vim +++ b/vim/settings/ctrlp.vim @@ -3,8 +3,7 @@ if exists("g:ctrlp_user_command") endif if executable('ag') " Use ag in CtrlP for listing files. Lightning fast and respects .gitignore - let g:ctrlp_user_command = - \ 'ag %s --files-with-matches -g "" --ignore "\.git$\|\.hg$\|\.svn$"' + let g:ctrlp_user_command = 'ag %s --files-with-matches -g "" --ignore "\.git$\|\.hg$\|\.svn$"' " ag is fast enough that CtrlP doesn't need to cache let g:ctrlp_use_caching = 0 diff --git a/vim/settings/markdown.vim b/vim/settings/markdown.vim index 6fa25f2..d6d662b 100644 --- a/vim/settings/markdown.vim +++ b/vim/settings/markdown.vim @@ -1,4 +1,5 @@ -let g:instant_markdown_slow = 0 +let g:instant_markdown_slow = 1 +let g:instant_markdown_autostart = 1 augroup filetype_markdown autocmd! autocmd FileType mkd setlocal spell diff --git a/vim/settings/python-mode.vim b/vim/settings/python-mode.vim index 5dfe83e..4b8a943 100644 --- a/vim/settings/python-mode.vim +++ b/vim/settings/python-mode.vim @@ -7,7 +7,7 @@ let g:pymode_run_bind = "" " Override view python doc key shortcut to Ctrl-Shift-d let g:pymode_doc_bind = "" let g:pymode_lint_ignore = "W0611" -let g:pymode_options_max_line_length=120 +let g:pymode_options_max_line_length=160 augroup filetype_python autocmd! @@ -18,7 +18,5 @@ augroup filetype_python autocmd FileType python setlocal statusline=%f-%y-[%l]/[%L] autocmd FileType python nnoremap c I#cesc> autocmd FileType python :iabbrev iff if: - autocmd FileType python highlight Excess ctermbg=DarkGrey guibg=Black - autocmd FileType python match Excess /\%120v.*/ autocmd FileType python set nowrap augroup END diff --git a/vim/settings/rails.vim b/vim/settings/rails.vim index 7d47fe9..ab673d2 100644 --- a/vim/settings/rails.vim +++ b/vim/settings/rails.vim @@ -1,3 +1,4 @@ " Better key maps for switching between controller and view nnoremap ,vv :Eview nnoremap ,cc :Econtroller +nnoremap ,hc :%s/:\([^=,'"]*\) =>/\1:/gc diff --git a/vim/settings/syntastic.vim b/vim/settings/syntastic.vim index a21ee5c..a069381 100644 --- a/vim/settings/syntastic.vim +++ b/vim/settings/syntastic.vim @@ -11,8 +11,8 @@ let g:syntastic_quiet_messages = {'level': 'warnings'} " ~/.vimrc.after let g:syntastic_javascript_checkers = ['eslint'] let g:syntastic_python_checkers = ['flake8'] -let g:syntastic_python_flake8_args='--ignore=F401,F403,F405,W0401' -" let g:syntastic_python_pylint_post_args="--max-line-length=120" +let g:syntastic_python_flake8_args='--ignore=F401,F403,F405,W0401,E501' +let g:syntastic_python_pylint_post_args="--max-line-length=160" " I have no idea why this is not working, as it used to diff --git a/vim/settings/yadr-keymap.vim b/vim/settings/yadr-keymap.vim index 0ef2566..a46d816 100644 --- a/vim/settings/yadr-keymap.vim +++ b/vim/settings/yadr-keymap.vim @@ -185,3 +185,5 @@ nmap ej :tabedit ~/.jshintrc'tzo " move around compile errors nnoremap n :cnext nnoremap p :cprevious + +nnoremap l :redraw! diff --git a/vim/vundles.vim b/vim/vundles.vim index c402973..8ea3e36 100644 --- a/vim/vundles.vim +++ b/vim/vundles.vim @@ -22,6 +22,7 @@ Bundle "gmarik/vundle" " ~/.vim/vundles/ to edit them: runtime ruby.vundle runtime languages.vundle +runtime markdown.vundle runtime git.vundle runtime appearance.vundle runtime textobjects.vundle diff --git a/vim/vundles/languages.vundle b/vim/vundles/languages.vundle index 263c4c2..0ee96a3 100644 --- a/vim/vundles/languages.vundle +++ b/vim/vundles/languages.vundle @@ -5,8 +5,6 @@ Bundle 'scrooloose/syntastic.git' Bundle 'skwp/vim-html-escape' Bundle 'ternjs/tern_for_vim' Bundle 'jparise/vim-graphql' -Bundle 'plasticboy/vim-markdown' -Bundle 'suan/vim-instant-markdown' Bundle 'evanmiller/nginx-vim-syntax' Bundle 'derekwyatt/vim-scala' Bundle 'scrooloose/nerdcommenter' diff --git a/vim/vundles/markdown.vundle b/vim/vundles/markdown.vundle new file mode 100644 index 0000000..b3e91ce --- /dev/null +++ b/vim/vundles/markdown.vundle @@ -0,0 +1,2 @@ +Bundle 'tpope/vim-markdown' +Bundle 'suan/vim-instant-markdown' diff --git a/vim/vundles/vim-improvements.vundle b/vim/vundles/vim-improvements.vundle index 85e7f60..10e82cf 100644 --- a/vim/vundles/vim-improvements.vundle +++ b/vim/vundles/vim-improvements.vundle @@ -1,6 +1,5 @@ Bundle "AndrewRadev/splitjoin.vim" Bundle "Raimondi/delimitMate" -Bundle "Shougo/neocomplete.git" Bundle "godlygeek/tabular" Bundle "tomtom/tcomment_vim.git" Bundle "vim-scripts/camelcasemotion.git" diff --git a/vimrc b/vimrc index a78fe0e..380639d 100644 --- a/vimrc +++ b/vimrc @@ -1,5 +1,7 @@ " Use Vim settings, rather then Vi settings (much better!). " This must be first, because it changes other options as a side effect. +scriptencoding utf-8 +set encoding=utf-8 set nocompatible " TODO: this may not be in the correct place. It is intended to allow overriding . @@ -117,7 +119,7 @@ set smartcase " ...unless we type a capital " ================ Python =========================== -autocmd FileType python set colorcolumn=120 +autocmd FileType python set colorcolumn=160 " ================ Custom Settings ======================== so ~/.yadr/vim/settings.vim diff --git a/zsh/aliases.zsh b/zsh/aliases.zsh index 8a146f6..31fe765 100644 --- a/zsh/aliases.zsh +++ b/zsh/aliases.zsh @@ -241,8 +241,13 @@ case "$OSTYPE" in ;; esac alias ssh_by_password='ssh -o PreferredAuthentications=password -o PubkeyAuthentication=no' -alias ssh_copy_id_by_password='ssh-copy-id -o PreferredAuthentications=password -o PubkeyAuthentication=no' -alias sshfab="ssh -F ~/Projects/rallets-fabric/.ssh/config" +alias ssh_copy_id='ssh-copy-id -o PreferredAuthentications=password -o PubkeyAuthentication=no' +alias ssh_="ssh -F ~/Projects/rallets-server/rallets-fabric/.ssh/config" +alias scp_="scp -F ~/Projects/rallets-server/rallets-fabric/.ssh/config" alias chrome_proxy="google-chrome --proxy-server='http://127.0.0.1:8118'" alias ls_folder_size="du -sch .[!.]* * |sort -h" alias top_by_memory="top -o %MEM" +alias gcaa="gia .; gcF" +alias ror_ctags="ctags -R --languages=ruby --exclude=.git --exclude=log . \$(bundle list --paths)" +alias docker_clean_images='docker rmi $(docker images -a --filter=dangling=true -q)' + diff --git a/zsh/functions.zsh b/zsh/functions.zsh index e064161..2b8bb5d 100644 --- a/zsh/functions.zsh +++ b/zsh/functions.zsh @@ -82,7 +82,7 @@ function test_proxy() { curl www.google.com } function set_proxy() { - export all_proxy=http://127.0.0.1:8118/ + export all_proxy=http://127.0.0.1:8123/ # export https_proxy=socks5://127.0.0.1:1080/ # export http_proxy=socks5://127.0.0.1:1080/ } diff --git a/zsh/key-bindings.zsh b/zsh/key-bindings.zsh index 8141096..37a423b 100644 --- a/zsh/key-bindings.zsh +++ b/zsh/key-bindings.zsh @@ -13,6 +13,8 @@ bindkey -M viins '^s' history-incremental-pattern-search-forward bindkey -M viins '^p' up-line-or-history bindkey -M viins '^n' down-line-or-history bindkey -M viins '^y' yank +bindkey -M viins '^f' forward-char +bindkey -M viins '^b' backward-char bindkey -M viins '^w' backward-kill-word bindkey -M viins '^u' backward-kill-line bindkey -M viins '^?' backward-delete-char @@ -35,6 +37,8 @@ bindkey -M vicmd '^s' history-incremental-pattern-search-forward bindkey -M vicmd '^p' up-line-or-history bindkey -M vicmd '^n' down-line-or-history bindkey -M vicmd '^y' yank +bindkey -M vicmd '^f' forward-char +bindkey -M vicmd '^b' backward-char bindkey -M vicmd '^w' backward-kill-word bindkey -M vicmd '^u' backward-kill-line bindkey -M vicmd '/' vi-history-search-forward