Skip to content

Commit

Permalink
update version
Browse files Browse the repository at this point in the history
  • Loading branch information
D0n9X1n committed Jul 20, 2017
1 parent 612aa84 commit c078dbd
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 48 deletions.
101 changes: 101 additions & 0 deletions UltiSnips/c.snippets
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,105 @@ int bc(unsigned int n) {
}
endsnippet


###########################################################################
# TextMate Snippets #
###########################################################################

priority -50

snippet def "#define ..."
#define $1
endsnippet

snippet #ifndef "#ifndef ... #define ... #endif"
#ifndef ${1/([A-Za-z0-9_]+).*/$1/}
#define ${1:SYMBOL} ${2:value}
#endif /* ifndef $1 */
endsnippet

snippet #if "#if #endif" b
#if ${1:0}
${VISUAL}$0
#endif
endsnippet

snippet mark "#pragma mark (mark)"
#if 0
${1:#pragma mark -
}#pragma mark $2
#endif

$0
endsnippet

snippet main "main() (main)"
int main(int argc, char *argv[])
{
${VISUAL}$0
return 0;
}
endsnippet

snippet for "for loop (for)"
for (${2:i} = 0; $2 < ${1:count}; ${3:++$2}) {
${VISUAL}$0
}
endsnippet

snippet fori "for int loop (fori)"
for (${4:int} ${2:i} = 0; $2 < ${1:count}; ${3:++$2}) {
${VISUAL}$0
}
endsnippet

snippet once "Include header once only guard"
#ifndef ${1:`!p
if not snip.c:
import random, string
name = re.sub(r'[^A-Za-z0-9]+','_', snip.fn).upper()
rand = ''.join(random.sample(string.ascii_letters+string.digits, 8))
snip.rv = ('%s_%s' % (name,rand)).upper()
else:
snip.rv = snip.c`}
#define $1

${VISUAL}$0

#endif /* end of include guard: $1 */
endsnippet

snippet fprintf "fprintf ..."
fprintf(${1:stderr}, "${2:%s}\n"${2/([^%]|%%)*(%.)?.*/(?2:, :\);)/}$3${2/([^%]|%%)*(%.)?.*/(?2:\);)/}
endsnippet

snippet eli "else if .. (eli)"
else if (${1:/* condition */}) {
${VISUAL}$0
}
endsnippet

snippet printf "printf .. (printf)"
printf("${1:%s}\n"${1/([^%]|%%)*(%.)?.*/(?2:, :\);)/}$2${1/([^%]|%%)*(%.)?.*/(?2:\);)/}
endsnippet

snippet st "struct"
struct ${1:`!p snip.rv = (snip.basename or "name") + "_t"`} {
${0:/* data */}
};
endsnippet

snippet fun "function" b
${1:void}
${2:function_name}($3)
{
${VISUAL}$0
}
endsnippet

snippet fund "function declaration" b
${1:void}
${2:function_name}($3);
endsnippet

# vim:ft=snippets:
2 changes: 1 addition & 1 deletion vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ filetype plugin indent on
"==========================================

" history存储容量
set history=2000
set history=10

" 检测文件类型
filetype on
Expand Down
49 changes: 2 additions & 47 deletions vimrc.bundles
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ call plug#begin('~/.vim/bundle')
Plug 'wakatime/vim-wakatime'

" 彩虹括号
Plug 'MVIM/rainbow'
Plug 'luochen1990/rainbow'

"minibufferexpl 去掉
Plug 'fholgado/minibufexpl.vim'
Expand Down Expand Up @@ -102,10 +102,6 @@ Plug 'vim-scripts/matchit.zip'
" m/ list all marks
Plug 'kshenoy/vim-signature'

" quick selection and edit
" expandregion
" 选中区块
Plug 'terryma/vim-expand-region'
" 多光标选中编辑
" multiplecursors
Plug 'terryma/vim-multiple-cursors'
Expand Down Expand Up @@ -147,9 +143,6 @@ Plug 'bling/vim-airline'
" 主题 solarized
" solarized
Plug 'altercation/vim-colors-solarized'
" molokai
" 主题 molokai
Plug 'tomasr/molokai'

" nav
" nerdtree nerdtreetabs
Expand All @@ -159,20 +152,6 @@ Plug 'szw/vim-ctrlspace'
" tagbar
Plug 'majutsushi/tagbar'

" text object
" 支持自定义文本对象
Plug 'kana/vim-textobj-user'
" 增加行文本对象: l dal yal cil
Plug 'kana/vim-textobj-line'
" 增加文件文本对象: e dae yae cie
Plug 'kana/vim-textobj-entire'
" 增加缩进文本对象: i dai yai cii - 相同缩进属于同一块
Plug 'kana/vim-textobj-indent'

" markdown 增强
Plug 'godlygeek/tabular'
Plug 'plasticboy/vim-markdown'

" 1. vim a.go
" 2. :GoInstallBinaries
" vimgo
Expand All @@ -182,15 +161,6 @@ Plug 'fatih/vim-go', {'for': 'go'}
" pythonsyntax
Plug 'hdima/python-syntax'
Plug 'hynek/vim-python-pep8-indent'
Plug 'Glench/Vim-Jinja2-Syntax'

" javascript
" 注意: syntax这个插件要放前面
Plug 'othree/yajs.vim' | Plug 'pangloss/vim-javascript'

" for javascript 自动补全,配合YCM,需要安装nodejs&npm see
" https://github.com/marijnh/tern_for_vim
Plug 'marijnh/tern_for_vim'

" ###### emmet HTML complete #########
Plug 'mattn/emmet-vim'
Expand Down Expand Up @@ -262,7 +232,7 @@ call plug#end()
let g:ycm_collect_identifiers_from_tags_files = 1
" 开启语法关键字补全

" let g:ycm_seed_identifiers_with_syntax=1 "语言关键字补全, 不过python关键字都很短,所以,需要的自己打开
let g:ycm_seed_identifiers_with_syntax=1 "语言关键字补全, 不过python关键字都很短,所以,需要的自己打开

" 跳转到定义处, 分屏打开
let g:ycm_goto_buffer_command = 'horizontal-split'
Expand Down Expand Up @@ -376,21 +346,6 @@ call plug#end()
" }}}


" expandregion {{{
" map + <Plug>(expand_region_expand)
" map _ <Plug>(expand_region_shrink)
vmap v <Plug>(expand_region_expand)
vmap V <Plug>(expand_region_shrink)
" Extend the global default
call expand_region#custom_text_objects({
\ 'a]' :1,
\ 'ab' :1,
\ 'aB' :1,
\ 'ii' :0,
\ 'ai' :0,
\ })
" }}}

" multiplecursors {{{
let g:multi_cursor_use_default_mapping=0
" Default mapping
Expand Down

0 comments on commit c078dbd

Please sign in to comment.