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:
@ -5,62 +5,65 @@ snippet mod
|
||||
-compile([export_all]).
|
||||
|
||||
start() ->
|
||||
${2}
|
||||
${0}
|
||||
|
||||
stop() ->
|
||||
ok.
|
||||
# define directive
|
||||
snippet def
|
||||
-define(${1:macro}, ${2:body}).${3}
|
||||
-define(${1:macro}, ${2:body}).
|
||||
# export directive
|
||||
snippet exp
|
||||
-export([${1:function}/${2:arity}]).
|
||||
-export([${1:function}/${0:arity}]).
|
||||
# include directive
|
||||
snippet inc
|
||||
-include("${1:file}").${2}
|
||||
-include("${1:file}").
|
||||
# include_lib directive
|
||||
snippet incl
|
||||
-include_lib("${1:lib}/include/${1}.hrl").${2}
|
||||
# behavior directive
|
||||
snippet beh
|
||||
-behaviour(${1:behaviour}).${2}
|
||||
-behaviour(${1:behaviour}).
|
||||
# if expression
|
||||
snippet if
|
||||
if
|
||||
${1:guard} ->
|
||||
${2:body}
|
||||
${0:body}
|
||||
end
|
||||
# case expression
|
||||
snippet case
|
||||
case ${1:expression} of
|
||||
${2:pattern} ->
|
||||
${3:body};
|
||||
${0:body};
|
||||
end
|
||||
# anonymous function
|
||||
snippet fun
|
||||
fun (${1:Parameters}) -> ${2:body} end${3}
|
||||
fun (${1:Parameters}) -> ${2:body} end
|
||||
# try...catch
|
||||
snippet try
|
||||
try
|
||||
${1}
|
||||
catch
|
||||
${2:_:_} -> ${3:got_some_exception}
|
||||
${2:_:_} -> ${0:got_some_exception}
|
||||
end
|
||||
# record directive
|
||||
snippet rec
|
||||
-record(${1:record}, {
|
||||
${2:field}=${3:value}}).${4}
|
||||
${2:field}=${3:value}}).
|
||||
# todo comment
|
||||
snippet todo
|
||||
%% TODO: ${1}
|
||||
%% TODO: ${0}
|
||||
## Snippets below (starting with '%') are in EDoc format.
|
||||
## See http://www.erlang.org/doc/apps/edoc/chapter.html#id56887 for more details
|
||||
# doc comment
|
||||
snippet %d
|
||||
%% @doc ${1}
|
||||
%% @doc ${0}
|
||||
# end of doc comment
|
||||
snippet %e
|
||||
%% @end
|
||||
# specification comment
|
||||
snippet %s
|
||||
%% @spec ${1}
|
||||
%% @spec ${0}
|
||||
# private function marker
|
||||
snippet %p
|
||||
%% @private
|
||||
@ -73,7 +76,7 @@ snippet application
|
||||
-export([start/2, stop/1]).
|
||||
|
||||
start(_Type, _StartArgs) ->
|
||||
case ${2:root_supervisor}:start_link() of
|
||||
case ${0:root_supervisor}:start_link() of
|
||||
{ok, Pid} ->
|
||||
{ok, Pid};
|
||||
Other ->
|
||||
@ -100,14 +103,14 @@ snippet supervisor
|
||||
supervisor:start_link({local, ?SERVER}, ?MODULE, []).
|
||||
|
||||
init([]) ->
|
||||
Server = {${2:my_server}, {$2, start_link, []},
|
||||
Server = {${0:my_server}, {$2, start_link, []},
|
||||
permanent, 2000, worker, [$2]},
|
||||
Children = [Server],
|
||||
RestartStrategy = {one_for_one, 0, 1},
|
||||
{ok, {RestartStrategy, Children}}.
|
||||
# OTP gen_server
|
||||
snippet gen_server
|
||||
-module(${1:`vim_snippets#Filename('', 'my')`}).
|
||||
-module(${0:`vim_snippets#Filename('', 'my')`}).
|
||||
|
||||
-behaviour(gen_server).
|
||||
|
||||
@ -159,7 +162,7 @@ snippet gen_server
|
||||
%%%===================================================================
|
||||
# common_test test_SUITE
|
||||
snippet testsuite
|
||||
-module(${1:`vim_snippets#Filename('', 'my')`}).
|
||||
-module(${0:`vim_snippets#Filename('', 'my')`}).
|
||||
|
||||
-include_lib("common_test/include/ct.hrl").
|
||||
|
||||
|
Reference in New Issue
Block a user