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

Updated plugins, also experimenting with a new font

The font is IBM Plex Mono: https://ibm.github.io/type/
This commit is contained in:
amix
2017-11-24 14:54:40 +01:00
parent 7fc202ec88
commit e9aac9794b
255 changed files with 2898 additions and 3752 deletions

View File

@ -1,5 +1,5 @@
snippet init
cmake_minimum_required(version ${1:2.8.2})
cmake_minimum_required(VERSION ${1:2.8.2})
project(${2:ProjectName})
find_package(${3:library})
@ -16,7 +16,7 @@ snippet proj
project(${0:Name})
snippet min
cmake_minimum_required(version ${0:2.8.2})
cmake_minimum_required(VERSION ${0:2.8.2})
snippet include
include_directories(${${0:include_dir}})

View File

@ -1,14 +1,15 @@
snippet lib
#library('${1}');
library ${1};
${0}
snippet im
#import('${1}');
${0}
snippet so
#source('${1}');
import 'package:${1}/${2}.dart';
${0}
snippet rgx
new RegExp(r'${1}')
snippet var
var ${1} = ${2};
snippet main
static void main() {
main() {
${0}
}
snippet st

View File

@ -32,3 +32,5 @@ snippet ff
<%= submit "Submit" %>
<% end %>
snippet pry
<% require IEx; IEx.pry %>

View File

@ -88,7 +88,6 @@ snippet def
snippet defd
@doc """
${1:doc string}
"""
def ${2:name} do
${0}
@ -96,7 +95,6 @@ snippet defd
snippet defsd
@doc """
${1:doc string}
"""
@spec ${2:name} :: ${3:no_return}
def ${2} do
@ -127,8 +125,9 @@ snippet defr
snippet doc
@doc """
${0}
"""
snippet im
@impl true
snippet docf
@doc false
snippet fn
@ -136,7 +135,6 @@ snippet fn
snippet mdoc
@moduledoc """
${0}
"""
snippet mdocf
@moduledoc false
@ -185,6 +183,8 @@ snippet qu
snippet beh
@behaviour ${1:Mix.Task}
${0}
snippet p
|> ${0}
snippet >e pipe to each
|> Enum.each(fn ${1} -> ${0} end)
snippet >m pipe to map
@ -197,3 +197,39 @@ snippet >i pipe to inspect
|> IO.inspect
snippet >il pipe to inspect with label
|> IO.inspect(label: "${1:label}")
snippet cs
@doc false
def child_spec(${1:_opts}) do
%{
id: __MODULE__,
start: {__MODULE__, :start_link, ${2:[]}},
restart: ${3::permanent},
shutdown: ${4:5000},
type: ${5::worker}
}
end
snippet genserver basic genserver structure
use GenServer
@doc false
def start_link do
GenServer.start_link(__MODULE__, ${1:Map.new})
end
@impl true
def init(state) do
{:ok, state}
end
snippet genserver: basic genserver structure
use GenServer
@doc false
def start_link, do: GenServer.start_link(__MODULE__, ${1:Map.new})
@impl true
def init(state), do: {:ok, state}
snippet impl
@impl true
def ${1:name} do
${0}
end

View File

@ -56,3 +56,47 @@ snippet test
snippet doc
{-| ${0}
-}
snippet p
|> ${0}
snippet program
import Html exposing (Html)
type alias Model =
{}
type Msg
= Noop
main : Program Never Model Msg
main =
Html.program
{ init = init
, view = view
, update = update
, subscriptions = subscriptions
}
init : ( Model, Cmd Msg )
init =
{} ! []
update : Msg -> Model -> ( Model, Cmd Msg )
update msg model =
case msg of
Noop ->
model ! []
subscriptions : Model -> Sub Msg
subscriptions model =
Sub.none
view : Model -> Html Msg
view model =
Html.text "Hello, sailor!"

View File

@ -31,8 +31,12 @@ snippet importq
snippet inst
instance ${1:Monoid} ${2:Type} where
${0}
snippet ty
type ${1:Type} = ${0:Type}
snippet type
type ${1:Type} = ${0:Type}
snippet da
data ${1:Type} = ${2:$1} ${0:Int}
snippet data
data ${1:Type} = ${2:$1} ${0:Int}
snippet newtype
@ -54,6 +58,12 @@ snippet const
snippet fn
${1:fn} :: ${2:a} -> ${3:a}
$1 ${4} = ${0:undefined}
snippet fn0
${1:fn} :: ${2:a}
$1 = ${0:undefined}
snippet fn1
${1:fn} :: ${2:a} -> ${3:a}
$1 ${4} = ${0:undefined}
snippet fn2
${1:fn} :: ${2:a} -> ${3:a} -> ${4:a}
$1 ${5} = ${0:undefined}
@ -130,3 +140,6 @@ snippet itp
$0
snippet sb
\`shouldBe\` $0
snippet doc
{-| ${0}
-}

View File

@ -13,9 +13,34 @@ snippet for
end
snippet forp
for ${1:i},${2:v} in pairs(${3:table_name}) do
${0:-- body}
${0:-- body}
end
snippet fori
for ${1:i},${2:v} in ipairs(${3:table_name}) do
${0:-- body}
${0:-- body}
end
snippet if
if ${1:condition} then
${2:-- body}
end
snippet ife
if ${1:condition} then
${2:-- if condition}
else
${0:-- else}
end
snippet elif
elseif ${1:condition} then
${0:--body}
snippet repeat
repeat
${1:--body}
until ${0:condition}
snippet while
while ${1:condition} do
${0:--body}
end
snippet print
print("${1:string}")
snippet im
import "${1:import file}"

View File

@ -214,6 +214,9 @@ snippet mount
device => "${0:device name or path}",
}
snippet notify
notify { "${1:message}": }
snippet package
package { "${1:package name}":
ensure => ${0:present},

View File

@ -55,3 +55,17 @@ snippet if
${2:${VISUAL}}
else
${0}
snippet doc
{-| ${0}
-}
snippet ty
type ${1:Type} =
${0}
snippet da
data ${1:Type} =
${0:$1}
snippet nty
newtype ${1:Type} =
${2:$1} ${0:Int}
snippet fi
foreign import ${1} :: ${2}

View File

@ -33,6 +33,9 @@ snippet dowh
snippet with
with ${1:expr} as ${2:var}:
${0:${VISUAL}}
snippet awith
async with ${1:expr} as ${2:var}:
${0:${VISUAL}}
# New Class
snippet cl
class ${1:ClassName}(${2:object}):
@ -49,10 +52,21 @@ snippet def
snippet deff
def ${1:fname}(${2:`indent('.') ? 'self' : ''`}):
${0}
snippet adef
async def ${1:fname}(${2:`indent('.') ? 'self' : ''`}):
"""${3:docstring for $1}"""
${0}
snippet adeff
async def ${1:fname}(${2:`indent('.') ? 'self' : ''`}):
${0}
# New Method
snippet defm
def ${1:mname}(self, ${2:arg}):
${0}
snippet adefm
async def ${1:mname}(self, ${2:arg}):
${0}
# New Property
snippet property
def ${1:foo}():
@ -128,43 +142,33 @@ snippet _
__${1:init}__
# python debugger (pdb)
snippet pdb
import pdb
pdb.set_trace()
__import__('pdb').set_trace()
# bpython debugger (bpdb)
snippet bpdb
import bpdb
bpdb.set_trace()
__import__('bpdb').set_trace()
# ipython debugger (ipdb)
snippet ipdb
import ipdb
ipdb.set_trace()
__import__('ipdb').set_trace()
# embed ipython itself
snippet iem
import IPython
IPython.embed()
__import__('IPython').embed()
# remote python debugger (rpdb)
snippet rpdb
import rpdb
rpdb.set_trace()
__import__('rpdb').set_trace()
# web python debugger (wdb)
snippet wdb
import wdb
wdb.set_trace()
__import__('wdb').set_trace()
# ptpython
snippet ptpython
from ptpython.repl import embed
embed(globals(), locals(), vi_mode=${1:False}, history_filename=${2:None})
__import__('ptpython.repl', fromlist=('repl')).embed(globals(), locals(), vi_mode=${1:False}, history_filename=${2:None})
# python console debugger (pudb)
snippet pudb
import pudb
pudb.set_trace()
__import__('pudb').set_trace()
# pdb in nosetests
snippet nosetrace
from nose.tools import set_trace
set_trace()
__import__('nose').tools.set_trace()
snippet pprint
import pprint
pprint.pprint(${1})
__import__('pprint').pprint(${1})
snippet "
"""${0:doc}
"""
@ -181,6 +185,11 @@ snippet testcase
def test_${2:description}(self):
${0}
# test given when then
snippet tgwt
# given: ${1}
# when: ${2}
# then: ${3}
snippet fut
from __future__ import ${0}
#getopt
@ -204,18 +213,18 @@ snippet getopt
# glog = get log
snippet glog
import logging
logger = logging.getLogger(${0:__name__})
LOGGER = logging.getLogger(${0:__name__})
snippet le
logger.error(${0:msg})
LOGGER.error(${0:msg})
# conflict with lambda=ld, therefor we change into Logger.debuG
snippet lg
logger.debug(${0:msg})
LOGGER.debug(${0:msg})
snippet lw
logger.warning(${0:msg})
LOGGER.warning(${0:msg})
snippet lc
logger.critical(${0:msg})
LOGGER.critical(${0:msg})
snippet li
logger.info(${0:msg})
LOGGER.info(${0:msg})
snippet epydoc
"""${1:Description}
@ -240,3 +249,13 @@ snippet kwargs
**kwargs${1:,}${0}
snippet akw
*args, **kwargs${1:,}${0}
# comprehensions
snippet lcp list comprehension
[${1} for ${2} in ${3:${VISUAL}}]${0}
snippet dcp dict comprehension
{${1}: ${2} for ${3} in ${4:${VISUAL}}}${0}
snippet scp set comprehension
{${1} for ${2} in ${3:${VISUAL}}}${0}

View File

@ -50,3 +50,19 @@ snippet bun Vundle.vim Plugin definition
Plugin '${0}'
snippet plug Vundle.vim Plugin definition
Plugin '${0}'
snippet let
let ${1:variable} = ${0: value}
snippet se
set ${1:setting};
snippet set
set ${1:setting} = ${0:value}
snippet nn
nnoremap ${1} ${2}<CR>
snippet no
noremap ${1} ${2}
snippet vm
vmap ${1} ${2}
snippet im
imap ${1} ${2}
snippet exe
execute ${1}

View File

@ -29,7 +29,7 @@ snippet vbase
<script>
export default{
}
}
</script>
<style scoped>