mirror of
https://github.com/amix/vimrc
synced 2025-06-16 01:25:00 +08:00
Updated plugins
This commit is contained in:
@ -1,58 +1,83 @@
|
||||
snippet cmake
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
|
||||
PROJECT(${1:ProjectName})
|
||||
snippet init
|
||||
cmake_minimum_required(version ${1:2.8.2})
|
||||
project(${2:ProjectName})
|
||||
|
||||
FIND_PACKAGE(${2:LIBRARY})
|
||||
find_package(${3:library})
|
||||
|
||||
INCLUDE_DIRECTORIES(
|
||||
${$2_INCLUDE_DIR}
|
||||
)
|
||||
include_directories(${$3_INCLUDE_DIRS})
|
||||
|
||||
ADD_SUBDIRECTORY(${0:src})
|
||||
add_subdirectory(${0:src})
|
||||
|
||||
ADD_EXECUTABLE($1)
|
||||
add_executable($2)
|
||||
|
||||
TARGET_LINK_LIBRARIES($1
|
||||
${$2_LIBRARIES}
|
||||
)
|
||||
target_link_libraries($2 ${$3_LIBRARIES})
|
||||
|
||||
snippet proj
|
||||
project(${0:Name})
|
||||
|
||||
snippet min
|
||||
cmake_minimum_required(version ${0:2.8.2})
|
||||
|
||||
snippet include
|
||||
INCLUDE_DIRECTORIES(
|
||||
${${0:INCLUDE_DIR}}
|
||||
)
|
||||
include_directories(${${0:include_dir}})
|
||||
|
||||
snippet find
|
||||
FIND_PACKAGE(${0:LIBRARY})
|
||||
find_package(${1:library} ${0:REQUIRED})
|
||||
|
||||
snippet glob
|
||||
FILE(GLOB ${1:SRCS} *.${0:cpp})
|
||||
file(glob ${1:srcs} *.${0:cpp})
|
||||
|
||||
snippet subdir
|
||||
ADD_SUBDIRECTORY(${0:src})
|
||||
add_subdirectory(${0:src})
|
||||
|
||||
snippet lib
|
||||
ADD_LIBRARY(${1:lib} ${2:STATIC}
|
||||
${${0:SRCS}}
|
||||
)
|
||||
add_library(${1:lib} ${${0:srcs}})
|
||||
|
||||
snippet link
|
||||
TARGET_LINK_LIBRARIES(${1:bin}
|
||||
${0:somelib}
|
||||
)
|
||||
target_link_libraries(${1:bin} ${0:somelib})
|
||||
|
||||
snippet bin
|
||||
ADD_EXECUTABLE(${1:bin})
|
||||
add_executable(${1:bin})
|
||||
|
||||
snippet set
|
||||
SET(${1:var} ${0:val})
|
||||
set(${1:var} ${0:val})
|
||||
|
||||
snippet dep
|
||||
ADD_DEPENDENCIES(${1:target}
|
||||
add_dependencies(${1:target}
|
||||
${0:dep}
|
||||
)
|
||||
|
||||
snippet Ext_url
|
||||
include(ExternalProject)
|
||||
ExternalProject_Add(${1:googletest}
|
||||
URL ${2:http://googletest.googlecode.com/files/gtest-1.7.0.zip}
|
||||
URL_HASH SHA1=${3:f85f6d2481e2c6c4a18539e391aa4ea8ab0394af}
|
||||
SOURCE_DIR "${4:${CMAKE_BINARY_DIR}/gtest-src}"
|
||||
BINARY_DIR "${0:${CMAKE_BINARY_DIR}/gtest-build}"
|
||||
CONFIGURE_COMMAND ""
|
||||
BUILD_COMMAND ""
|
||||
INSTALL_COMMAND ""
|
||||
TEST_COMMAND ""
|
||||
)
|
||||
|
||||
snippet Ext_git
|
||||
include(ExternalProject)
|
||||
ExternalProject_Add(${1:googletest}
|
||||
GIT_REPOSITORY ${2:https://github.com/google/googletest.git}
|
||||
GIT_TAG ${3:master}
|
||||
SOURCE_DIR "${4:${CMAKE_BINARY_DIR}/googletest-src}"
|
||||
BINARY_DIR "${0:${CMAKE_BINARY_DIR}/googletest-build}"
|
||||
CONFIGURE_COMMAND ""
|
||||
BUILD_COMMAND ""
|
||||
INSTALL_COMMAND ""
|
||||
TEST_COMMAND ""
|
||||
)
|
||||
|
||||
snippet props
|
||||
SET_TARGET_PROPERTIES(${1:target}
|
||||
${2:PROPERTIES} ${3:COMPILE_FLAGS}
|
||||
set_target_properties(${1:target}
|
||||
${2:properties} ${3:compile_flags}
|
||||
${0:"-O3 -Wall -pedantic"}
|
||||
)
|
||||
|
||||
snippet test
|
||||
add_test(${1:ATestName} ${0:testCommand --options})
|
||||
|
@ -1,37 +1,29 @@
|
||||
snippet %
|
||||
<% ${0} %>
|
||||
|
||||
snippet =
|
||||
<%= ${0} %>
|
||||
|
||||
snippet end
|
||||
<% end %>
|
||||
|
||||
snippet for
|
||||
<%= for ${1:item} <- ${2:items} ${3:@conn} do %>
|
||||
${0}
|
||||
<% end %>
|
||||
|
||||
snippet if
|
||||
<%= if ${1} do %>
|
||||
${0}
|
||||
<% end %>
|
||||
|
||||
snippet ife
|
||||
<%= if ${1} do %>
|
||||
${2}
|
||||
<%= else %>
|
||||
${0}
|
||||
<% end %>
|
||||
|
||||
snippet ft
|
||||
<%= form_tag(${1:"/users"}, method: ${2::post}) %>
|
||||
${0}
|
||||
</form>
|
||||
|
||||
snippet lin
|
||||
<%= link "${1:Submit}", to: ${2:"/users"}, method: ${3::delete} %>
|
||||
|
||||
snippet ff
|
||||
<%= form_for @changeset, ${1:"/users"}, fn f -> %>
|
||||
${0}
|
||||
|
@ -1,26 +1,28 @@
|
||||
snippet const
|
||||
const ${0} = ${1};
|
||||
const ${1} = ${0};
|
||||
snippet let
|
||||
let ${0} = ${1};
|
||||
let ${1} = ${0};
|
||||
snippet im
|
||||
import ${0} from '${1}';
|
||||
import ${1} from '${0}';
|
||||
snippet cla
|
||||
class ${0} {
|
||||
${1}
|
||||
class ${1} {
|
||||
${0}
|
||||
}
|
||||
snippet clax
|
||||
class ${0} extends ${1} {
|
||||
${2}
|
||||
class ${1} extends ${2} {
|
||||
${0}
|
||||
}
|
||||
snippet =>
|
||||
(${0}) => {
|
||||
${1}
|
||||
(${1}) => {
|
||||
${0}
|
||||
}
|
||||
snippet af
|
||||
(${0}) => {
|
||||
${1}
|
||||
(${1}) => {
|
||||
${0}
|
||||
}
|
||||
snippet sym
|
||||
const ${0} = Symbol('${1}');
|
||||
const ${1} = Symbol('${0}');
|
||||
snippet ed
|
||||
export default ${0}
|
||||
snippet ${
|
||||
${${1}}${0}
|
||||
|
@ -254,9 +254,9 @@ snippet cl
|
||||
# console.debug
|
||||
snippet cd
|
||||
console.debug(${0});
|
||||
# console.err
|
||||
# console.error
|
||||
snippet ce
|
||||
console.err(${0});
|
||||
console.error(${0});
|
||||
# console.trace
|
||||
snippet ct
|
||||
console.trace(${0:label});
|
||||
|
@ -325,7 +325,7 @@ snippet foreachkil
|
||||
${0:<!-- html... -->}
|
||||
<?php endforeach; ?>
|
||||
# $... = array (...)
|
||||
snippet array
|
||||
snippet array b
|
||||
$${1:arrayName} = array('${2}' => ${3});
|
||||
snippet try
|
||||
try {
|
||||
@ -603,3 +603,27 @@ snippet tc
|
||||
}
|
||||
snippet te
|
||||
throw new ${1:Exception}("${2:Error Processing Request}");
|
||||
|
||||
snippet fpc "file_put_contents" b
|
||||
file_put_contents(${1:file}, ${2:content}${3:, FILE_APPEND});$0
|
||||
|
||||
snippet sr "str_replace"
|
||||
str_replace(${1:search}, ${2:replace}, ${3:subject})$0
|
||||
|
||||
snippet ia "in_array"
|
||||
in_array(${1:needle}, ${2:haystack})$0
|
||||
|
||||
snippet is "isset"
|
||||
isset(${1:var})$0
|
||||
|
||||
snippet isa "isset array"
|
||||
isset($${1:array}[${2:key}])$0
|
||||
|
||||
snippet in "is_null"
|
||||
is_null($${1:var})$0
|
||||
|
||||
snippet fe "file_exists"
|
||||
file_exists(${1:file})$0
|
||||
|
||||
snippet id "is_dir"
|
||||
is_dir(${1:path})$0
|
||||
|
@ -128,31 +128,43 @@ snippet _
|
||||
__${1:init}__
|
||||
# python debugger (pdb)
|
||||
snippet pdb
|
||||
import pdb; pdb.set_trace()
|
||||
import pdb
|
||||
pdb.set_trace()
|
||||
# bpython debugger (bpdb)
|
||||
snippet bpdb
|
||||
import bpdb
|
||||
bpdb.set_trace()
|
||||
# ipython debugger (ipdb)
|
||||
snippet ipdb
|
||||
import ipdb; ipdb.set_trace()
|
||||
import ipdb
|
||||
ipdb.set_trace()
|
||||
# embed ipython itself
|
||||
snippet iem
|
||||
import IPython; IPython.embed()
|
||||
import IPython
|
||||
IPython.embed()
|
||||
# ipython debugger (pdbbb)
|
||||
snippet pdbbb
|
||||
import pdbpp; pdbpp.set_trace()
|
||||
import pdbpp
|
||||
pdbpp.set_trace()
|
||||
# remote python debugger (rpdb)
|
||||
snippet rpdb
|
||||
import rpdb; rpdb.set_trace()
|
||||
import rpdb
|
||||
rpdb.set_trace()
|
||||
# ptpython
|
||||
snippet ptpython
|
||||
from ptpython.repl import embed
|
||||
embed(globals(), locals(), vi_mode=${1:False}, history_filename=${2:None})
|
||||
# python console debugger (pudb)
|
||||
snippet pudb
|
||||
import pudb; pudb.set_trace()
|
||||
import pudb
|
||||
pudb.set_trace()
|
||||
# pdb in nosetests
|
||||
snippet nosetrace
|
||||
from nose.tools import set_trace; set_trace()
|
||||
from nose.tools import set_trace
|
||||
set_trace()
|
||||
snippet pprint
|
||||
import pprint; pprint.pprint(${1})
|
||||
import pprint
|
||||
pprint.pprint(${1})
|
||||
snippet "
|
||||
"""${0:doc}
|
||||
"""
|
||||
|
@ -348,7 +348,7 @@ snippet mct
|
||||
${0}
|
||||
end
|
||||
snippet migration class .. < ActiveRecord::Migration .. def up .. def down .. end
|
||||
class ${1:class_name} < ActiveRecord::Migration
|
||||
class `substitute( substitute(vim_snippets#Filename(), '^\d\+_', '',''), '\(_\|^\)\(.\)', '\u\2', 'g')` < ActiveRecord::Migration
|
||||
def up
|
||||
${0}
|
||||
end
|
||||
@ -357,7 +357,7 @@ snippet migration class .. < ActiveRecord::Migration .. def up .. def down .. en
|
||||
end
|
||||
end
|
||||
snippet migration class .. < ActiveRecord::Migration .. def change .. end
|
||||
class ${1:class_name} < ActiveRecord::Migration
|
||||
class `substitute( substitute(vim_snippets#Filename(), '^\d\+_', '',''), '\(_\|^\)\(.\)', '\u\2', 'g')` < ActiveRecord::Migration
|
||||
def change
|
||||
${0}
|
||||
end
|
||||
|
@ -31,10 +31,14 @@ snippet main "Main function"
|
||||
pub fn main() {
|
||||
${0}
|
||||
}
|
||||
snippet let "let variable declaration"
|
||||
let ${1:name}${2:: ${3:type}} = ${4};
|
||||
snippet letm "let mut variable declaration"
|
||||
let mut ${1:name}${2:: ${3:type}} = ${4};
|
||||
snippet let "let variable declaration with type inference"
|
||||
let ${1} = ${2};
|
||||
snippet lett "let variable declaration with explicit type annotation"
|
||||
let ${1}: ${2} = ${3};
|
||||
snippet letm "let mut variable declaration with type inference"
|
||||
let mut ${1} = ${2};
|
||||
snippet lettm "let mut variable declaration with explicit type annotation"
|
||||
let mut ${1}: ${2} = ${3};
|
||||
snippet pln "println!"
|
||||
println!("${1}");
|
||||
snippet pln, "println! with format param"
|
||||
|
@ -1,3 +1,16 @@
|
||||
snippet pry
|
||||
- binding.pry
|
||||
snippet renp
|
||||
= render partial: '${0}'
|
||||
# Forms
|
||||
# =====
|
||||
snippet fieldset
|
||||
fieldset
|
||||
legend ${1}
|
||||
snippet css
|
||||
link rel="stylesheet" href="${1:style.css}" type="text/css" media="${2:all}"
|
||||
snippet script
|
||||
script src="${1:script.js}" type="text/javascript"
|
||||
# Some useful Unicode entities
|
||||
# ============================
|
||||
# Non-Breaking Space
|
||||
@ -48,17 +61,3 @@ snippet backspace
|
||||
# ⎋
|
||||
snippet esc
|
||||
⎋
|
||||
|
||||
# Forms
|
||||
# =====
|
||||
snippet fieldset
|
||||
fieldset
|
||||
legend ${1}
|
||||
|
||||
# Assets
|
||||
# ======
|
||||
snippet css
|
||||
link rel="stylesheet" href="${1:style.css}" type="text/css" media="${2:all}"
|
||||
|
||||
snippet script
|
||||
script src="${1:script.js}" type="text/javascript"
|
||||
|
@ -1,37 +1,6 @@
|
||||
# if statement
|
||||
snippet if
|
||||
if (${1}) begin
|
||||
${0}
|
||||
end
|
||||
# If/else statements
|
||||
snippet ife
|
||||
if (${1}) begin
|
||||
${2}
|
||||
end
|
||||
else begin
|
||||
${1}
|
||||
end
|
||||
# Else if statement
|
||||
snippet eif
|
||||
else if (${1}) begin
|
||||
${0}
|
||||
end
|
||||
#Else statement
|
||||
snippet el
|
||||
else begin
|
||||
${0}
|
||||
end
|
||||
# While statement
|
||||
snippet wh
|
||||
while (${1}) begin
|
||||
${0}
|
||||
end
|
||||
# Repeat Loop
|
||||
snippet rep
|
||||
repeat (${1}) begin
|
||||
${0}
|
||||
end
|
||||
# Foreach Loopo
|
||||
extends verilog
|
||||
|
||||
# Foreach Loop
|
||||
snippet fe
|
||||
foreach (${1}) begin
|
||||
${0}
|
||||
@ -41,24 +10,6 @@ snippet dowh
|
||||
do begin
|
||||
${0}
|
||||
end while (${1});
|
||||
# Case statement
|
||||
snippet case
|
||||
case (${1})
|
||||
{$2}: begin
|
||||
${0}
|
||||
end
|
||||
default: begin
|
||||
end
|
||||
endcase
|
||||
# CaseZ statement
|
||||
snippet casez
|
||||
casez (${1})
|
||||
{$2}: begin
|
||||
${0}
|
||||
end
|
||||
default: begin
|
||||
end
|
||||
endcase
|
||||
# Combinational always block
|
||||
snippet alc
|
||||
always_comb begin ${1:: statement_label}
|
||||
@ -74,11 +25,6 @@ snippet all
|
||||
always_latch begin ${1:: statement_label}
|
||||
${0}
|
||||
end $1
|
||||
# Module block
|
||||
snippet mod
|
||||
module ${1:module_name} (${2});
|
||||
${0}
|
||||
endmodule : $1
|
||||
# Class
|
||||
snippet cl
|
||||
class ${1:class_name};
|
||||
|
63
sources_non_forked/vim-snippets/snippets/verilog.snippets
Normal file
63
sources_non_forked/vim-snippets/snippets/verilog.snippets
Normal file
@ -0,0 +1,63 @@
|
||||
# if statement
|
||||
snippet if
|
||||
if (${1}) begin
|
||||
${0}
|
||||
end
|
||||
# If/else statements
|
||||
snippet ife
|
||||
if (${1}) begin
|
||||
${2}
|
||||
end
|
||||
else begin
|
||||
${1}
|
||||
end
|
||||
# Else if statement
|
||||
snippet eif
|
||||
else if (${1}) begin
|
||||
${0}
|
||||
end
|
||||
#Else statement
|
||||
snippet el
|
||||
else begin
|
||||
${0}
|
||||
end
|
||||
# While statement
|
||||
snippet wh
|
||||
while (${1}) begin
|
||||
${0}
|
||||
end
|
||||
# Repeat Loop
|
||||
snippet rep
|
||||
repeat (${1}) begin
|
||||
${0}
|
||||
end
|
||||
# Case statement
|
||||
snippet case
|
||||
case (${1:/* variable */})
|
||||
${2:/* value */}: begin
|
||||
${3}
|
||||
end
|
||||
default: begin
|
||||
${4}
|
||||
end
|
||||
endcase
|
||||
# CaseZ statement
|
||||
snippet casez
|
||||
casez (${1:/* variable */})
|
||||
${2:/* value */}: begin
|
||||
${3}
|
||||
end
|
||||
default: begin
|
||||
${4}
|
||||
end
|
||||
endcase
|
||||
# Always block
|
||||
snippet al
|
||||
always @(${1:/* sensitive list */}) begin
|
||||
${0}
|
||||
end
|
||||
# Module block
|
||||
snippet mod
|
||||
module ${1:module_name} (${2});
|
||||
${0}
|
||||
endmodule
|
Reference in New Issue
Block a user