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

Updated plugins and added vim-markdown

This commit is contained in:
Amir Salihefendic
2018-02-04 12:35:08 +01:00
parent 2514de5b22
commit 8eeefe86c2
111 changed files with 6623 additions and 923 deletions

View File

@ -0,0 +1,38 @@
snippet mod
module ${0:`expand('%:t:r')`}
snippet imp
import ${0:http}
snippet impt
import type ${0:option.option}
snippet exp
export ${0}
snippet expt
export ${0}
snippet fn
val ${1:fn} ${2}: fn ${3:'a} -> ${4:'a}
let $1 ${5} =
${0:${VISUAL}}
snippet mat
match ${1} with
| ${2} -> ${0}
snippet -
| ${1} -> ${0}
snippet let
let ${1} = ${2:${VISUAL}} in
${0}
snippet letf
let ${1} =
${0:${VISUAL}}
snippet ty
type ${1:msg}
= ${0}
snippet test
test "${1}" =
${0:${VISUAL}}
snippet doc
{-| ${0}
-}
snippet p
|> ${0}
snippet ae
assert.equal ${0}

View File

@ -48,6 +48,17 @@ snippet once
${0}
#endif /* end of include guard: $1 */
# Disable C++ name mangling in C headers
snippet nocxx
#ifdef __cplusplus
extern "C" {
#endif
${0}
#ifdef __cplusplus
} /* extern "C" */
#endif
##
## Control Statements
# if

View File

@ -138,6 +138,10 @@ snippet ns
namespace ${1:`vim_snippets#Filename('', 'my')`} {
${0}
} /* namespace $1 */
snippet ans
namespace {
${0}
}
##
## Input/Output
# std::cout

View File

@ -144,7 +144,7 @@ snippet rec
${0}
end
snippet req
require ${0:module_name}
require ${0:Logger}
snippet imp
import ${0:module_name}
snippet ali
@ -153,6 +153,10 @@ snippet test
test "${1:test name}" do
${0}
end
snippet testc
test "${1:test_name}", ctx do
${0}
end
snippet testa
test "${1:test_name}", %{${2:arg: arg}} do
${0}

View File

@ -49,6 +49,12 @@ snippet module
) where
`expand('%') =~ 'Main' ? "\nmain :: IO ()\nmain = undefined" : ""`
snippet mod
module `substitute(substitute(expand('%:r'), '[/\\]','.','g'),'^\%(\l*\.\)\?','','')`
( ${1}
) where
`expand('%') =~ 'Main' ? "\nmain :: IO ()\nmain = undefined" : ""`
snippet main
main :: IO ()
main = ${0:undefined}

View File

@ -0,0 +1,36 @@
snippet fun
fun ${1:name}(${2}): ${3:String} {
${4}
}
snippet pfun
private fun ${1:name}(${2}): ${3:String} {
${4}
}
snippet ret
return ${0}
snippet whe
when (${1:${VISUAL}}) {
${2} -> ${3}
}
snippet cla
class ${1} {
${0:${VISUAL}}
}
snippet cobj
companion object {
${0:${VISUAL}}
}
snippet obj
object ${1} {
${0:${VISUAL}}
}
snippet if
if (${1}) {
${0:${VISUAL}}
}
snippet ife
if (${1}) {
${2:${VISUAL}}
} else {
${0}
}

View File

@ -97,8 +97,8 @@ snippet blockquote-link
{% endblockquote %}
snippet ```
\`\`\`
${1:code}
\`\`\`${1}
${0:${VISUAL}}
\`\`\`
# Language.

View File

@ -1,6 +1,9 @@
snippet #!
#!/usr/bin/env python
# -*- coding: utf-8 -*-
snippet #!2
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
snippet #!3
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
@ -211,6 +214,20 @@ snippet getopt
${0}
elif option in ("-v", "--verbose"):
verbose = argument
# argparse
snippet addp
parser = ${VISUAL:argparse.}ArgumentParser()
snippet addsp
${0:sub_parser} = parser.add_subparsers().add_parser("${1:name}")
snippet addarg
parser.add_argument("${0:short_arg}", "${1:long_arg}", default=${2:None}, help="${3:Help text}")
snippet addnarg
parser.add_argument("${0:arg}", nargs="${1:*}", default"${2:None}, help="${3:Help text}")
snippet addaarg
parser.add_argument("${0:arg}", "${1:long_arg}", action="${2:store_true}", default=${3:False}, help="${4:Help text}")
snippet pargs
"${VISUAL:return }"parser.parse_args()
# logging
# glog = get log
snippet glog
@ -261,3 +278,166 @@ snippet dcp dict comprehension
snippet scp set comprehension
{${1} for ${2} in ${3:${VISUAL}}}${0}
snippet contain "methods for emulating a container type" b
def __len__(self):
${1:pass}
def __getitem__(self, key):
${2:pass}
def __setitem__(self, key, value):
${3:pass}
def __delitem__(self, key):
${4:pass}
def __iter__(self):
${5:pass}
def __reversed__(self):
${6:pass}
def __contains__(self, item):
${7:pass}
snippet context "context manager methods" b
def __enter__(self):
${1:pass}
def __exit__(self, exc_type, exc_value, traceback):
${2:pass}
snippet attr "methods for customizing attribute access" b
def __getattr__(self, name):
${1:pass}
def __setattr__(self, name, value):
${2:pass}
def __delattr__(self, name):
${3:pass}
snippet desc "methods implementing descriptors" b
def __get__(self, instance, owner):
${1:pass}
def __set__(self, instance, value):
${2:pass}
def __delete__(self, instance):
${3:pass}
snippet cmp "methods implementing rich comparison"
def __eq__(self, other):
${1:pass}
def __ne__(self, other):
${2:pass}
def __lt__(self, other):
${3:pass}
def __le__(self, other):
${4:pass}
def __gt__(self, other):
${5:pass}
def __ge__(self, other):
${6:pass}
def __cmp__(self, other):
${7:pass}
snippet repr "methods implementing string representation"
def __repr__(self):
${1:pass}
def __str__(self):
${2:pass}
def __unicode__(self):
${3:pass}
# note: reflected operands and augmented arithmeitc assignements have been
# intentionally ommited to reduce verbosity.
snippet numeric "methods for emulating a numeric type" b
def __add__(self, other):
${1:pass}
def __sub__(self, other):
${2:pass}
def __mul__(self, other):
${3:pass}
def __div__(self, other):
${4:pass}
def __truediv__(self, other):
${5:pass}
def __floordiv__(self, other):
${6:pass}
def __mod__(self, other):
${7:pass}
def __divmod__(self, other):
${8:pass}
def __pow__(self, other):
${9:pass}
def __lshift__(self, other):
${10:pass}
def __rshift__(self, other):
${11:pass}
def __and__(self, other):
${12:pass}
def __xor__(self, other):
${13:pass}
def __or__(self, other):
${14:pass}
def __neg__(self):
${15:pass}
def __pos__(self):
${16:pass}
def __abs__(self):
${17:pass}
def __invert__(self):
${18:pass}
def __complex__(self):
${19:pass}
def __int__(self):
${20:pass}
def __long__(self):
${21:pass}
def __float__(self):
${22:pass}
def __oct__(self):
${22:pass}
def __hex__(self):
${23:pass}
def __index__(self):
${24:pass}
def __coerce__(self, other):
${25:pass}

View File

@ -347,6 +347,19 @@ snippet mct
create_table :${1:table_name} do |t|
${0}
end
snippet mrev reversible do |dir| ... dir.up .. dir.down .. end
reversible do |dir|
dir.up do
${0}
end
dir.down do
end
end
snippet cmm class Migration... < ApplicationModel .. self.table_name .. end
class Migration${1:class_name} < ApplicationRecord
self.table_name = :${2:model_name}s
end
snippet migration class .. < ActiveRecord::Migration .. def up .. def down .. end
class `substitute( substitute(vim_snippets#Filename(), '^\d\+_', '',''), '\(_\|^\)\(.\)', '\u\2', 'g')` < ActiveRecord::Migration
def up

View File

@ -42,13 +42,13 @@ snippet lettm "let mut variable declaration with explicit type annotation"
snippet pri "print!"
print!("${1}");
snippet pri, "print! with format param"
print!("${1}", ${2});
print!("${1}{${2}}", ${3});
snippet pln "println!"
println!("${1}");
snippet pln, "println! with format param"
println!("${1}", ${2});
println!("${1}{${2}}", ${3});
snippet fmt "format!"
format!("${1}", ${2});
format!("${1}{${2}}", ${3});
# Modules
snippet ec "extern crate"

View File

@ -209,6 +209,8 @@ snippet bf bold face text
\\textbf{${1:${VISUAL:text}}} ${0}
snippet under underline text
\\underline{${1:${VISUAL:text}}} ${0}
snippet over overline text
\\overline{${1:${VISUAL:text}}} ${0}
snippet emp emphasize text
\\emph{${1:${VISUAL:text}}} ${0}
snippet sc small caps text
@ -339,3 +341,6 @@ snippet urlc
\\url{`@+`} ${0}
snippet hrefc
\\href{`@+`}{${1}} ${0}
# enquote from package csquotes
snippet enq enquote
\\enquote{${1:${VISUAL:text}}} ${0}