diff --git a/nvim/coq-user-snippets/cpp.snippets b/nvim/coq-user-snippets/cpp.snippets index 1d0eb46c..a339ba22 100644 --- a/nvim/coq-user-snippets/cpp.snippets +++ b/nvim/coq-user-snippets/cpp.snippets @@ -1,84 +1,76 @@ snippet if -if ( $1 ) { - $2 -} -endsnippet + if ( $1 ) { + $2 + } snippet for -for (int ${1:i} = 0; $1 < ${2:n}; $1++) { - $0 -} -endsnippet + for (int ${1:i} = 0; $1 < ${2:n}; $1++) { + $0 + } snippet do -do { - 1; -} while ($2); -endsnippet + do { + 1; + } while ($2); snippet while -while ($1) { - $2; -} -endsnippet + while ($1) { + $2; + } snippet main #include -using namespace std; + using namespace std; -int main() { - return 0; -} -endsnippet + int main() { + return 0; + } snippet kiemTraSoNguyenTo -bool kiemTraSoNguyenTo(int number) { - bool flag = false; - int count = 0; + 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 (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; } - if (count == 0) { - flag = true; - } - } - return flag; -} -endsnippet snippet nhapSoNguyenDuong -int nhapSoNguyenDuong(int &n) { - do { - cin >> n; - } while (n <= 0); + int nhapSoNguyenDuong(int &n) { + do { + cin >> n; + } while (n <= 0); - return n; -} -endsnippet + return n; + } snippet kiemTraSoHoangThien -bool kiemTraSoHoangThien(int number) { - int sum = 0; - int flag = false; + bool kiemTraSoHoangThien(int number) { + int sum = 0; + int flag = false; - for (int i = 1; i < number; i++) { - if (number % i == 0) { - sum += i; - } - } + for (int i = 1; i < number; i++) { + if (number % i == 0) { + sum += i; + } + } - if (sum == number) { - flag = true; - } else { - flag = false; - } + if (sum == number) { + flag = true; + } else { + flag = false; + } - return flag; -} -endsnippet + return flag; + } diff --git a/nvim/coq-user-snippets/cs.snippets b/nvim/coq-user-snippets/cs.snippets index 2db2b334..1f340f68 100644 --- a/nvim/coq-user-snippets/cs.snippets +++ b/nvim/coq-user-snippets/cs.snippets @@ -1,16 +1,14 @@ 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 + 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()); + } + } snippet XuatMang -public static void XuatMang(int[] array, int number) { - for (int i = 0; i < number; i++) { - Console.Write(array[i] + "\t"); - } -} -endsnippet + public static void XuatMang(int[] array, int number) { + for (int i = 0; i < number; i++) { + Console.Write(array[i] + "\t"); + } + } diff --git a/nvim/coq-user-snippets/javascript.snippets b/nvim/coq-user-snippets/javascript.snippets index 79f784f5..5b531ef6 100644 --- a/nvim/coq-user-snippets/javascript.snippets +++ b/nvim/coq-user-snippets/javascript.snippets @@ -1,9 +1,7 @@ snippet cl -console.log( $1 ); -endsnippet + console.log( $1 ); snippet for -for (let i = 0; $1 ; i++) { - $2 -} -endsnippet + for (let i = 0; $1 ; i++) { + $2 + }