merge from old
This commit is contained in:
parent
e0bbcf6330
commit
7cb42b2281
63
vim/UltiSnips/javascript.snippets
Normal file
63
vim/UltiSnips/javascript.snippets
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
snippet react "React template" b
|
||||||
|
import React, {Component, PropTypes} from 'react'
|
||||||
|
import {connect} from 'react-redux'
|
||||||
|
|
||||||
|
class ${1:C} extends Component {
|
||||||
|
render () {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$1.propTypes = {
|
||||||
|
self: PropTypes.object,
|
||||||
|
location: PropTypes.object
|
||||||
|
}
|
||||||
|
|
||||||
|
export default connect((state, ownProps) => {
|
||||||
|
return {
|
||||||
|
}
|
||||||
|
})($1)
|
||||||
|
endsnippet
|
||||||
|
|
||||||
|
snippet TODO "Javascript Todo" b
|
||||||
|
// TODO: ${1:desc} `echo $USER` `!v strftime("%c")` ${2}
|
||||||
|
endsnippet
|
||||||
|
|
||||||
|
snippet connect "react redux connect" b
|
||||||
|
export default connect((state, ownProps) => {
|
||||||
|
return {
|
||||||
|
}
|
||||||
|
})($1)
|
||||||
|
endsnippet
|
||||||
|
|
||||||
|
snippet Card "Default Expandable Card" b
|
||||||
|
<Card initiallyExpanded={false} className="MT-5">
|
||||||
|
<CardTitle showExpandableButton title="$1" />
|
||||||
|
<CardText expandable>
|
||||||
|
</CardText>
|
||||||
|
<CardActions expandable>
|
||||||
|
<RaisedButton primary label="保存" onTouchTap={$2} />
|
||||||
|
</CardActions>
|
||||||
|
</Card>
|
||||||
|
endsnippet
|
||||||
|
|
||||||
|
snippet redux "redux" b
|
||||||
|
export const SET_${1/\w/\u$0/g} = 'SET_${1/\w/\u$0/g}'
|
||||||
|
import {store} from 'redux/store'
|
||||||
|
import {Map} from 'immutable'
|
||||||
|
export default function (${1} = Map({}), action) {
|
||||||
|
// let {$1Id} = action
|
||||||
|
switch (action.type) {
|
||||||
|
case SET_${1/\w/\u$0/g}:
|
||||||
|
return action.$1
|
||||||
|
default:
|
||||||
|
return $1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function set${1/\w+\s*/\u$0/} ($1) {
|
||||||
|
store.dispatch({
|
||||||
|
type: SET_${1/\w/\u$0/g},
|
||||||
|
$1
|
||||||
|
})
|
||||||
|
}
|
||||||
|
endsnippet
|
42
vim/UltiSnips/sh.snippets
Normal file
42
vim/UltiSnips/sh.snippets
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
snippet options "bash command options" b
|
||||||
|
while true; do
|
||||||
|
case "\$1" in
|
||||||
|
-a | --asset )
|
||||||
|
ASSET=true; shift ;;
|
||||||
|
-e | --environment )
|
||||||
|
case "\$2" in
|
||||||
|
"production" | "development")
|
||||||
|
RAILS_ENV=$\2
|
||||||
|
ACCOUNT_ROOT=http://account.rallets.com/
|
||||||
|
SERVER_ROOT=http://rallets.com/
|
||||||
|
shift 2
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
RAILS_ENV=development
|
||||||
|
ACCOUNT_ROOT=http://account.rallets.com/
|
||||||
|
SERVER_ROOT=http://apitest.rallets.com/
|
||||||
|
shift 2
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
-d | --delayed-job )
|
||||||
|
DELAYED_JOB=true; shift ;;
|
||||||
|
-- ) shift; break ;;
|
||||||
|
-h | --help )
|
||||||
|
echo "usage:
|
||||||
|
[-a | --asset] precompile assets
|
||||||
|
[-d | --delayed-job] run delayed job for queuing sending emails
|
||||||
|
[-e | --environment] provides environment which rails will run in
|
||||||
|
[-h | --help] view manual
|
||||||
|
"
|
||||||
|
exit;;
|
||||||
|
* ) break ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
endsnippet
|
||||||
|
snippet OS "Determine whether it's Mac/Linux/Windows" b
|
||||||
|
if [ "$(uname)" == "Darwin" ]; then
|
||||||
|
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
|
||||||
|
elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW32_NT" ]; then
|
||||||
|
fi
|
||||||
|
endsnippet
|
6
vim/UltiSnips/sshconfig.snippets
Normal file
6
vim/UltiSnips/sshconfig.snippets
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
snippet Host "Description" b
|
||||||
|
Host ${1}
|
||||||
|
Hostname ${2}
|
||||||
|
IdentityFile ~/.ssh/rallets
|
||||||
|
User root
|
||||||
|
endsnippet
|
@ -2,3 +2,4 @@
|
|||||||
let g:nerdtree_tabs_open_on_gui_startup = 0
|
let g:nerdtree_tabs_open_on_gui_startup = 0
|
||||||
" Focus in the main content window
|
" Focus in the main content window
|
||||||
let g:nerdtree_tabs_focus_on_files = 1
|
let g:nerdtree_tabs_focus_on_files = 1
|
||||||
|
map <F6> :NERDTreeTabsToggle<CR>
|
||||||
|
@ -2,3 +2,4 @@
|
|||||||
let NERDTreeMinimalUI = 1
|
let NERDTreeMinimalUI = 1
|
||||||
let NERDTreeDirArrows = 1
|
let NERDTreeDirArrows = 1
|
||||||
let g:NERDTreeWinSize = 30
|
let g:NERDTreeWinSize = 30
|
||||||
|
map <F5> :NERDTreeToggle<CR>
|
||||||
|
8
vim/settings/YouCompleteMe.vim
Normal file
8
vim/settings/YouCompleteMe.vim
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
let g:ycm_key_list_select_completion=[]
|
||||||
|
let g:ycm_key_list_previous_completion=[]
|
||||||
|
let g:ycm_add_preview_to_completeopt=0
|
||||||
|
"let g:ycm_confirm_extra_conf=0
|
||||||
|
"let g:ycm_server_use_vim_stdout = 1
|
||||||
|
"let g:ycm_server_log_level = 'debug'
|
||||||
|
let g:ycm_path_to_python_interpreter = '/usr/bin/python'
|
||||||
|
set completeopt-=preview
|
8
vim/settings/markdown.vim
Normal file
8
vim/settings/markdown.vim
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
let g:instant_markdown_slow = 0
|
||||||
|
augroup filetype_markdown
|
||||||
|
autocmd!
|
||||||
|
autocmd FileType mkd setlocal spell
|
||||||
|
autocmd FileType mkd setlocal sw=2 ts=2
|
||||||
|
autocmd BufNewFile,BufReadPost *.md set filetype=markdown
|
||||||
|
let g:vim_markdown_initial_foldlevel=1
|
||||||
|
augroup END
|
28
vim/settings/python-mode.vim
Normal file
28
vim/settings/python-mode.vim
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
" Override go-to.definition key shortcut to Ctrl-]
|
||||||
|
let g:pymode_rope_goto_definition_bind = "<C-]>"
|
||||||
|
|
||||||
|
" Override run current python file key shortcut to Ctrl-Shift-e
|
||||||
|
let g:pymode_run_bind = "<C-S-e>"
|
||||||
|
|
||||||
|
" Override view python doc key shortcut to Ctrl-Shift-d
|
||||||
|
let g:pymode_doc_bind = "<C-S-d>"
|
||||||
|
let g:pymode_lint_ignore = "W0611"
|
||||||
|
"}}}
|
||||||
|
let g:syntastic_python_pylint_post_args="--max-line-length=120"
|
||||||
|
|
||||||
|
augroup filetype_python
|
||||||
|
autocmd!
|
||||||
|
"autocmd FileType python set omnifunc=pythoncomplete#Complete
|
||||||
|
autocmd FileType python setlocal foldmethod=indent
|
||||||
|
autocmd FileType python nnoremap <F12> :execute "!./" . expand("%") <CR>
|
||||||
|
autocmd FileType python setlocal foldlevel=99
|
||||||
|
autocmd FileType python setlocal statusline=%f-%y-[%l]/[%L]
|
||||||
|
autocmd FileType python nnoremap <buffer> <localleader>c I#cesc>
|
||||||
|
autocmd FileType python :iabbrev <buffer> iff if:<left>
|
||||||
|
autocmd FileType python highlight Excess ctermbg=DarkGrey guibg=Black
|
||||||
|
autocmd FileType python match Excess /\%80v.*/
|
||||||
|
autocmd FileType python set nowrap
|
||||||
|
autocmd FileType python map <buffer> <F3> :call Flake8()<CR>
|
||||||
|
augroup END
|
||||||
|
" autocmd BufWritePost *.py call Flake8()
|
||||||
|
"let g:flake8_cmd="/opt/strangebin/flake8000"
|
1
vim/settings/tagbar.vim
Normal file
1
vim/settings/tagbar.vim
Normal file
@ -0,0 +1 @@
|
|||||||
|
nmap <F4> :TagbarToggle<CR>
|
8
vim/settings/tern_for_vim.vim
Normal file
8
vim/settings/tern_for_vim.vim
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
let g:tern_show_argument_hints = 'on_hold'
|
||||||
|
let g:tern_map_keys = 1
|
||||||
|
noremap <leader>tr :TernRename<CR>
|
||||||
|
noremap <leader>tf :TernRefs<CR>
|
||||||
|
noremap <leader>tdd :TernDef<CR>
|
||||||
|
noremap <leader>tdp :TernDefPreview<CR>
|
||||||
|
noremap <leader>tds :TernDefSplit<CR>
|
||||||
|
noremap <leader>tdt :TernDefTab<CR>
|
6
vim/settings/ultisnips.vim
Normal file
6
vim/settings/ultisnips.vim
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
let g:UltiSnipsExpandTrigger="<C-e>"
|
||||||
|
let g:UltiSnipsJumpForwardTrigger="<C-e>"
|
||||||
|
let g:UltiSnipsJumpBackwardTrigger="<C-S-e>"
|
||||||
|
" If you want :UltiSnipsEdit to split your window.
|
||||||
|
let g:UltiSnipsEditSplit="vertical"
|
||||||
|
nmap <localleader>ue :UltiSnipsEdit<cr>
|
@ -166,7 +166,22 @@ map ,hi :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<'
|
|||||||
" ,hp = html preview
|
" ,hp = html preview
|
||||||
map <silent> ,hp :!open -a Safari %<CR><CR>
|
map <silent> ,hp :!open -a Safari %<CR><CR>
|
||||||
|
|
||||||
" Map Ctrl-x and Ctrl-z to navigate the quickfix error list (normally :cn and
|
"paste text in insertion mode
|
||||||
" :cp)
|
inoremap <C-X><C-V> <esc>"+pa
|
||||||
nnoremap <silent> <C-x> :cn<CR>
|
"paste text in normal mode
|
||||||
nnoremap <silent> <C-z> :cp<CR>
|
nnoremap <C-X><C-V> "+p"
|
||||||
|
|
||||||
|
" copy all out of vim
|
||||||
|
nnoremap <C-X><C-A> <esc>gg"+yG
|
||||||
|
" copy text in visual mode
|
||||||
|
vnoremap <C-C> "+yy
|
||||||
|
" copy all inside vim
|
||||||
|
nnoremap <C-A> <esc>ggyG
|
||||||
|
" edit file
|
||||||
|
nmap <leader>ev :tabedit $MYVIMRC<cr>'tzo
|
||||||
|
nmap <leader>em :tabedit makefile
|
||||||
|
nmap <leader>ej :tabedit ~/.jshintrc<cr>'tzo
|
||||||
|
|
||||||
|
" move around compile errors
|
||||||
|
nnoremap <leader>n :cnext<cr>
|
||||||
|
nnoremap <leader>p :cprevious<cr>
|
||||||
|
@ -8,3 +8,4 @@ Bundle "chriskempson/base16-vim"
|
|||||||
|
|
||||||
" Required for Gblame in terminal vim
|
" Required for Gblame in terminal vim
|
||||||
Bundle "godlygeek/csapprox.git"
|
Bundle "godlygeek/csapprox.git"
|
||||||
|
Bundle 'gorodinskiy/vim-coloresque'
|
||||||
|
@ -1,9 +1,16 @@
|
|||||||
Bundle 'sheerun/vim-polyglot'
|
Bundle 'sheerun/vim-polyglot'
|
||||||
Bundle 'garbas/vim-snipmate.git'
|
Bundle 'garbas/vim-snipmate.git'
|
||||||
Bundle 'honza/vim-snippets'
|
Bundle 'honza/vim-snippets'
|
||||||
Bundle 'jtratner/vim-flavored-markdown.git'
|
|
||||||
Bundle 'scrooloose/syntastic.git'
|
Bundle 'scrooloose/syntastic.git'
|
||||||
Bundle 'nelstrom/vim-markdown-preview'
|
|
||||||
Bundle 'skwp/vim-html-escape'
|
Bundle 'skwp/vim-html-escape'
|
||||||
Bundle 'mxw/vim-jsx'
|
Bundle 'mxw/vim-jsx'
|
||||||
|
Bundle 'ternjs/tern_for_vim'
|
||||||
Bundle 'jparise/vim-graphql'
|
Bundle 'jparise/vim-graphql'
|
||||||
|
Bundle 'plasticboy/vim-markdown'
|
||||||
|
Bundle 'suan/vim-instant-markdown'
|
||||||
|
Bundle 'evanmiller/nginx-vim-syntax'
|
||||||
|
Bundle 'derekwyatt/vim-scala'
|
||||||
|
Bundle 'ktvoelker/sbt-vim'
|
||||||
|
Bundle 'scrooloose/nerdcommenter'
|
||||||
|
Bundle 'klen/python-mode'
|
||||||
|
Bundle 'nvie/vim-flake8'
|
||||||
|
@ -5,3 +5,4 @@ Bundle 'JazzCore/ctrlp-cmatcher'
|
|||||||
Bundle 'junegunn/fzf'
|
Bundle 'junegunn/fzf'
|
||||||
Bundle "xolox/vim-misc"
|
Bundle "xolox/vim-misc"
|
||||||
Bundle "xolox/vim-session"
|
Bundle "xolox/vim-session"
|
||||||
|
Bundle 'Valloric/YouCompleteMe'
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
Bundle "AndrewRadev/splitjoin.vim"
|
Bundle "AndrewRadev/splitjoin.vim"
|
||||||
Bundle "Raimondi/delimitMate"
|
Bundle "Raimondi/delimitMate"
|
||||||
Bundle "Shougo/neocomplete.git"
|
Bundle "Shougo/neocomplete.git"
|
||||||
Bundle "briandoll/change-inside-surroundings.vim.git"
|
|
||||||
Bundle "godlygeek/tabular"
|
Bundle "godlygeek/tabular"
|
||||||
Bundle "tomtom/tcomment_vim.git"
|
Bundle "tomtom/tcomment_vim.git"
|
||||||
Bundle "vim-scripts/camelcasemotion.git"
|
Bundle "vim-scripts/camelcasemotion.git"
|
||||||
@ -28,4 +27,5 @@ Bundle "vim-scripts/lastpos.vim"
|
|||||||
Bundle "vim-scripts/sudo.vim"
|
Bundle "vim-scripts/sudo.vim"
|
||||||
Bundle "goldfeld/ctrlr.vim"
|
Bundle "goldfeld/ctrlr.vim"
|
||||||
Bundle "editorconfig/editorconfig-vim"
|
Bundle "editorconfig/editorconfig-vim"
|
||||||
|
Bundle 'majutsushi/tagbar'
|
||||||
|
Bundle 'sirver/ultisnips'
|
||||||
|
5
vimrc
5
vimrc
@ -75,6 +75,7 @@ filetype indent on
|
|||||||
|
|
||||||
" Display tabs and trailing spaces visually
|
" Display tabs and trailing spaces visually
|
||||||
set list listchars=tab:\ \ ,trail:·
|
set list listchars=tab:\ \ ,trail:·
|
||||||
|
" set listchars=tab:>-
|
||||||
|
|
||||||
set nowrap "Don't wrap lines
|
set nowrap "Don't wrap lines
|
||||||
set linebreak "Wrap lines at convenient points
|
set linebreak "Wrap lines at convenient points
|
||||||
@ -114,5 +115,9 @@ set hlsearch " Highlight searches by default
|
|||||||
set ignorecase " Ignore case when searching...
|
set ignorecase " Ignore case when searching...
|
||||||
set smartcase " ...unless we type a capital
|
set smartcase " ...unless we type a capital
|
||||||
|
|
||||||
|
|
||||||
|
" ================ Python ===========================
|
||||||
|
autocmd FileType python set colorcolumn=120
|
||||||
|
|
||||||
" ================ Custom Settings ========================
|
" ================ Custom Settings ========================
|
||||||
so ~/.yadr/vim/settings.vim
|
so ~/.yadr/vim/settings.vim
|
||||||
|
Loading…
Reference in New Issue
Block a user