1
0
mirror of https://github.com/amix/vimrc synced 2025-06-16 01:25:00 +08:00

Updated all the plugins. Removed powerline. Added vim-airline (replacement for powerline). Added vim-fugitive.

This commit is contained in:
amix
2013-11-16 19:45:48 +00:00
parent 351979d3e0
commit 86f4456be1
239 changed files with 14942 additions and 8068 deletions

View File

@ -3,29 +3,29 @@
snippet main
int main(int argc, const char *argv[])
{
${1}
${0}
return 0;
}
# main(void)
snippet mainn
int main(void)
{
${1}
${0}
return 0;
}
##
## Preprocessor
# #include <...>
snippet inc
#include <${1:stdio}.h>${2}
#include <${1:stdio}.h>
# #include "..."
snippet Inc
#include "${1:`vim_snippets#Filename("$1.h")`}"${2}
#include "${1:`vim_snippets#Filename("$1.h")`}"
# ifndef...define...endif
snippet ndef
#ifndef $1
#define ${1:SYMBOL} ${2:value}
#endif${3}
#endif
# define
snippet def
#define
@ -33,11 +33,11 @@ snippet def
snippet ifdef
#ifdef ${1:FOO}
${2:#define }
#endif${3}
#endif
# if
snippet #if
#if ${1:FOO}
${2}
${0}
#endif
# header include guard
snippet once
@ -45,7 +45,7 @@ snippet once
#define $1
${2}
${0}
#endif /* end of include guard: $1 */
##
@ -54,20 +54,20 @@ snippet once
snippet if
if (${1:/* condition */}) {
${2}
}${3}
}
# else
snippet el
else {
${1}
}${2}
}
# else if
snippet elif
else if (${1:/* condition */}) {
${2}
}${3}
}
# ifi
snippet ifi
if (${1:/* condition */}) ${2};${3}
if (${1:/* condition */}) ${2};
# ternary
snippet t
${1:/* condition */} ? ${2:a} : ${3:b}
@ -79,41 +79,41 @@ snippet switch
${4:break;}${5}
default:
${6}
}${7}
}
# switch without default
snippet switchndef
switch (${1:/* variable */}) {
case ${2:/* variable case */}:
${3}
${4:break;}${5}
}${6}
}
# case
snippet case
case ${1:/* variable case */}:
${2}
${3:break;}${4}
${3:break;}
##
## Loops
# for
snippet for
for (${2:i} = 0; $2 < ${1:count}; $2${3:++}) {
${4}
}${5}
}
# for (custom)
snippet forr
for (${1:i} = ${2:0}; ${3:$1 < 10}; $1${4:++}) {
${5}
}${6}
}
# while
snippet wh
while (${1:/* condition */}) {
${2}
}${3}
}
# do... while
snippet do
do {
${2}
} while (${1:/* condition */});${3}
} while (${1:/* condition */});
##
## Functions
# function definition
@ -121,38 +121,38 @@ snippet fun
${1:void} ${2:function_name}(${3})
{
${4}
}${5}
}
# function declaration
snippet fund
${1:void} ${2:function_name}(${3});${4}
${1:void} ${2:function_name}(${3});
##
## Types
# typedef
snippet td
typedef ${1:int} ${2:MyCustomType};${3}
typedef ${1:int} ${2:MyCustomType};
# struct
snippet st
struct ${1:`vim_snippets#Filename('$1_t', 'name')`} {
${2:/* data */}
}${3: /* optional variable list */};${4}
}${3: /* optional variable list */};
# typedef struct
snippet tds
typedef struct ${2:_$1 }{
${3:/* data */}
} ${1:`vim_snippets#Filename('$1_t', 'name')`};${4}
} ${1:`vim_snippets#Filename('$1_t', 'name')`};
# typedef enum
snippet tde
typedef enum {
${1:/* data */}
} ${2:foo};${3}
} ${2:foo};
##
## Input/Output
# printf
snippet pr
printf("${1:%s}\n"${2});${3}
printf("${1:%s}\n"${2});
# fprintf (again, this isn't as nice as TextMate's version, but it works)
snippet fpr
fprintf(${1:stderr}, "${2:%s}\n"${3});${4}
fprintf(${1:stderr}, "${2:%s}\n"${3});
# getopt
snippet getopt
int choice;
@ -207,14 +207,14 @@ snippet getopt
{
while ( optind < argc )
{
${4}
${0}
}
}
##
## Miscellaneous
# This is kind of convenient
snippet .
[${1}]${2}
[${1}]
# GPL
snippet gpl
/*
@ -234,4 +234,4 @@ snippet gpl
* Copyright (C) ${1:Author}, `strftime("%Y")`
*/
${2}
${0}