Skip to content

Commit

Permalink
🌟feature(nvim): coq
Browse files Browse the repository at this point in the history
  • Loading branch information
cutbypham committed Oct 25, 2021
1 parent 693651e commit 89b4cd6
Show file tree
Hide file tree
Showing 5 changed files with 175 additions and 11 deletions.
55 changes: 55 additions & 0 deletions nvim/coq-user-snippets/*.snip
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
snippet unlicense
This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.

In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to <https://unlicense.org>

snippet import_sh
#! /usr/bin/env sh

snippet import_py
#! /usr/bin/env python3

snippet import_fish
#! /usr/bin/env fish

snippet import_wolframscript
#! /usr/bin/env wolframscript

snippet import_cpp
#include <iostream>

int main() {
return 0;
}

snippet import_html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
</body>
</html>
84 changes: 84 additions & 0 deletions nvim/coq-user-snippets/cpp.snippets
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
snippet if
if ( $1 ) {
$2
}
endsnippet

snippet for
for (int ${1:i} = 0; $1 < ${2:n}; $1++) {
$0
}
endsnippet

snippet do
do {
1;
} while ($2);
endsnippet

snippet while
while ($1) {
$2;
}
endsnippet

snippet main
#include <iostream>
using namespace std;

int main() {
return 0;
}
endsnippet

snippet kiemTraSoNguyenTo
bool kiemTraSoNguyenTo(int number) {
bool flag = false;
int count = 0;

if (number < 2 || number > 100) {
flag = false;
} else {
for (int i = 2; i <= number / 2; i++) {
if (number % i == 0) {
count++;
}
}
if (count == 0) {
flag = true;
}
}
return flag;
}
endsnippet

snippet nhapSoNguyenDuong
int nhapSoNguyenDuong(int &n) {
do {
cin >> n;
} while (n <= 0);

return n;
}
endsnippet

snippet kiemTraSoHoangThien
bool kiemTraSoHoangThien(int number) {
int sum = 0;
int flag = false;

for (int i = 1; i < number; i++) {
if (number % i == 0) {
sum += i;
}
}

if (sum == number) {
flag = true;
} else {
flag = false;
}

return flag;
}
endsnippet
16 changes: 16 additions & 0 deletions nvim/coq-user-snippets/cs.snippets
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
snippet NhapMang
public static void NhapMang(int[] array, int number) {
for (int i = 0; i < number; i++) {
Console.Write("Nhập phần tử thứ " + (i + 1) + ": ");
array[i] = Convert.ToInt32(Console.ReadLine());
}
}
endsnippet

snippet XuatMang
public static void XuatMang(int[] array, int number) {
for (int i = 0; i < number; i++) {
Console.Write(array[i] + "\t");
}
}
endsnippet
22 changes: 11 additions & 11 deletions nvim/coq-user-snippets/gitcommit.snip
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,34 @@ snippet feature
🌟feature($0): $1

snippet fix
🐞fix($1):
🐞fix($0): $1

snippet documents
📚documents($1):
📚documents($0): $1

snippet style
💄style($1):
💄style($0): $1

snippet refactor
🎨refactor($1):
🎨refactor($0): $1

snippet performance
⚡️performance($1):
⚡️performance($0): $1

snippet test
✅test($1):
✅test($0): $1

snippet chore
🔩chore($1):
🔩chore($0): $1

snippet build
🔨build($1):
🔨build($0): $1

snippet ci
🤖ci($1):
🤖ci($0): $1

snippet clean_code
💄style($1):clean code
💄style($0): clean code

snippet revert
⏪revert($1):
⏪revert($0): $1
9 changes: 9 additions & 0 deletions nvim/coq-user-snippets/javascript.snippets
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
snippet cl
console.log( $1 );
endsnippet

snippet for
for (let i = 0; $1 ; i++) {
$2
}
endsnippet

0 comments on commit 89b4cd6

Please sign in to comment.