aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOxbian <oxbian@mailbox.org>2024-09-18 17:27:06 -0400
committerOxbian <oxbian@mailbox.org>2024-09-18 17:27:06 -0400
commitd28a067a4d4b52a1eac7e1c62a46c4726713d29c (patch)
tree2e31d96762b1d88cc591020fb91993bacf1f5f79
parenta91deb2867535e9a56662aaa5f5935662f2fdfc8 (diff)
downloadvimrc-d28a067a4d4b52a1eac7e1c62a46c4726713d29c.tar.gz
vimrc-d28a067a4d4b52a1eac7e1c62a46c4726713d29c.zip
CLEAN: removing .vim and .vimrc, using .config/vim instead
-rw-r--r--.gitignore17
-rw-r--r--conf/options.vim2
-rw-r--r--conf/plugins.vim9
-rw-r--r--conf/spell/en.utf-8.add11
-rw-r--r--conf/spell/fr.utf-8.splbin571627 -> 0 bytes
-rw-r--r--conf/spell/fr.utf-8.sugbin2324315 -> 0 bytes
-rw-r--r--filetype.vim4
-rw-r--r--snippets/c.json611
-rw-r--r--snippets/cpp.json766
-rw-r--r--vimrc (renamed from .vimrc)3
10 files changed, 699 insertions, 724 deletions
diff --git a/.gitignore b/.gitignore
index e174603..07555ea 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,9 +1,8 @@
-.vim/plugged/*
-.vim/plugged
-.vim/autoload/*
-.vim/autoload
-conf/plugged/*
-conf/plugged
-conf/autoload/*
-conf/autoload
-conf/spell/en.utf-8.add.spl
+plugged/*
+plugged
+autoload/*
+autoload
+plugged/*
+spell/*
+spell
+.netrwhist
diff --git a/conf/options.vim b/conf/options.vim
index 5315c1f..8e84a25 100644
--- a/conf/options.vim
+++ b/conf/options.vim
@@ -9,6 +9,8 @@ syntax on " Show syntax color
set number " Show line number
colorscheme onedark " Set vim theme to onedark
set colorcolumn=80 " Add an indicator for 80 char limit
+set textwidth=80 " Set max text width
+autocmd BufNewFile,BufRead * setlocal formatoptions=cropt " Linebreak at 80 char
set relativenumber " Show relative line number
set cursorline " Select the current line
set showmatch " Show matching brackets when hovered
diff --git a/conf/plugins.vim b/conf/plugins.vim
index 7dd1f9a..682cbe7 100644
--- a/conf/plugins.vim
+++ b/conf/plugins.vim
@@ -2,8 +2,8 @@
" Plugins
""""""""""""""""""""""""""
" Install vim-plug if not found
-if empty(glob('~/.vim/autoload/plug.vim'))
- silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
+if empty(glob('~/.config/vim/autoload/plug.vim'))
+ silent !curl -fLo ~/.config/vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
endif
@@ -12,7 +12,7 @@ autocmd VimEnter * if len(filter(values(g:plugs), '!isdirectory(v:val.dir)'))
\| PlugInstall --sync | source $MYVIMRC
\| endif
-call plug#begin('~/.vim/plugged')
+call plug#begin('~/.config/vim/plugged')
" UI & Themes
Plug 'joshdick/onedark.vim' " Onedark themes for vim
@@ -35,6 +35,9 @@ filetype plugin indent on " Allow filetype detection, plugins, indentation
"""""""""""""""""""""""""
" Configuration
"""""""""""""""""""""""""
+" LSP
+let g:coc_global_extensions = ['coc-json', 'coc-markdownlint'] " You can add other coc extensions here
+
" Netrw (filetree built-in vim)
let g:netrw_keepdir = 0 " Reload buffer usefull when moving or removing file
let g:netrw_winsize = 10 " Size of filetree buffer
diff --git a/conf/spell/en.utf-8.add b/conf/spell/en.utf-8.add
deleted file mode 100644
index 283920b..0000000
--- a/conf/spell/en.utf-8.add
+++ /dev/null
@@ -1,11 +0,0 @@
-linters
-nerdtree
-GitGutter
-keybinds
-onedark
-LSP
-vscode
-autocompleter
-linter
-neovim
-untoggle
diff --git a/conf/spell/fr.utf-8.spl b/conf/spell/fr.utf-8.spl
deleted file mode 100644
index ff27132..0000000
--- a/conf/spell/fr.utf-8.spl
+++ /dev/null
Binary files differ
diff --git a/conf/spell/fr.utf-8.sug b/conf/spell/fr.utf-8.sug
deleted file mode 100644
index df555d2..0000000
--- a/conf/spell/fr.utf-8.sug
+++ /dev/null
Binary files differ
diff --git a/filetype.vim b/filetype.vim
new file mode 100644
index 0000000..357aa24
--- /dev/null
+++ b/filetype.vim
@@ -0,0 +1,4 @@
+augroup filetypedetect
+ " Mail
+ autocmd BufRead,BufNewFile *mutt-* setfiletype mail
+augroup END
diff --git a/snippets/c.json b/snippets/c.json
index 9a4eebe..4b7d6d7 100644
--- a/snippets/c.json
+++ b/snippets/c.json
@@ -1,319 +1,296 @@
{
- "Basic C main template": {
- "scope": "c",
- "prefix": "main",
- "body": [
- "#include <stdio.h>",
- "",
- "int main (int argc, char *argv[]) ",
- "{",
- " $0",
- " return 0;",
- "}"
- ],
- "description": "Basic main template in C"
- },
- "Basic C stdlib main template": {
- "scope": "c",
- "prefix": "libmain",
- "body": [
- "#include <stdio.h>",
- "#include <stdlib.h>",
- "",
- "int main (int argc, char *argv[]) ",
- "{",
- " $0",
- " return 0;",
- "}"
- ],
- "description": "Basic stdlib main templace in C"
- },
- "If statement": {
- "scope": "c",
- "prefix": "if",
- "body": [
- "if ($1) {",
- " ${2:/* code here */} ",
- "}"
- ],
- "description": "Creates an if statement"
- },
- "Else statement": {
- "scope": "c",
- "prefix": "else",
- "body": [
- "else {",
- " ${0:/* code here */}",
- "}"
- ],
- "description": "Creates an else statement"
- },
- "Else if statement": {
- "scope": "c",
- "prefix": "elif",
- "body": [
- "else if ($1) {",
- " ${2:/* code here */}",
- "}"
- ],
- "description": "Creates an else if statement"
- },
- "Switch": {
- "scope": "c",
- "prefix": "switch",
- "body": [
- "switch ($1) ",
- "{",
- " case $2:",
- " $3;",
- " break;",
- "",
- " default:",
- " $4;",
- " break;",
- "}"
- ],
- "description": "Creates a void function"
- },
- "For loop": {
- "scope": "c",
- "prefix": "for",
- "body": [
- "for (int ${1:i} = ${2:0}; ${1:i} < $3; ++${1:i}) {",
- " ${4:/* code goes here */}",
- "}"
- ],
- "description": "Creates a for loop"
- },
- "Reverse For loop": {
- "scope": "c",
- "prefix": "forrev",
- "body": [
- "for (int ${1:i} = $2; ${1:i} >= ${3:0}; --${1:i}) {",
- " ${4:/* code goes here */}",
- "}"
- ],
- "description": "Creates a reverse for loop"
- },
- "Range For loop": {
- "scope": "cpp",
- "prefix": "forrange",
- "body": [
- "for (auto &${1:element} : ${2:containeur}) {",
- " ${3:/* code goes here */}",
- "}"
- ],
- "description": "Creates a range for loop"
- },
- "While loop": {
- "scope": "c",
- "prefix": "while",
- "body": [
- "while ($1) {",
- " ${2:/* code goes here */}",
- "}"
- ],
- "description": "Creates a while loop"
- },
- "Do...while loop": {
- "scope": "c",
- "prefix": "dowhile",
- "body": [
- "do {",
- " ${1:/* code goes here */}",
- "} while($2)"
- ],
- "description": "Creates a do...while loop"
- },
- "Create linked list": {
- "scope": "c",
- "prefix": "clist",
- "body": [
- "typedef struct {",
- " ${1:int} value;",
- " struct node_t* next;",
- "} node_t;"
- ],
- "description": "Creates a linked list template"
- },
- "Create int function": {
- "scope": "c",
- "prefix": "intf",
- "body": [
- "int $1 (${2:void})",
- "{",
- " $4",
- " return $3;",
- "}"
- ],
- "description": "Creates a function that returns an int"
- },
- "Create float function": {
- "scope": "c",
- "prefix": "floatf",
- "body": [
- "float $1 (${2:void}) ",
- "{",
- " $4",
- " return $3;",
- "}"
- ],
- "description": "Creates a function that returns a float"
- },
- "Create double function": {
- "scope": "c",
- "prefix": "doublef",
- "body": [
- "double $1 (${2:void})",
- "{",
- " $4",
- " return $3;",
- "}"
- ],
- "description": "Creates a function that returns a double"
- },
- "Create string function": {
- "scope": "c",
- "prefix": "strf",
- "body": [
- "char* $1 (${2:void})",
- "{",
- " $4",
- " return $3;",
- "}"
- ],
- "description": "Creates a function that returns a string"
- },
- "Create long function": {
- "scope": "c",
- "prefix": "longf",
- "body": [
- "long $1 (${2:void}) ",
- "{",
- " $4",
- " return $3;",
- "}"
- ],
- "description": "Creates a function that returns a long"
- },
- "Create short function": {
- "scope": "c",
- "prefix": "shortf",
- "body": [
- "short $1 (${2:void}) ",
- "{",
- " $4",
- " return $3;",
- "}"
- ],
- "description": "Creates a function that returns a short"
- },
- "Create void function": {
- "scope": "c",
- "prefix": "voidf",
- "body": [
- "void $1 (${2:void}) ",
- "{",
- " $3",
- "}"
- ],
- "description": "Creates a void function"
- },
- "Creates a header include guard C": {
- "scope": "c",
- "prefix": "ig",
- "body": [
- "#ifndef ${TM_FILENAME/(.*)\\..+$/${1:/upcase}_H/}",
- "#define ${TM_FILENAME/(.*)\\..+$/${1:/upcase}_H/}",
- "",
- "${0:// Code for header body}",
- "",
- "#endif // ${TM_FILENAME/(.*)\\..+$/${1:/upcase}_H/}"
- ],
- "description": "Creates header include guard based on file name for C projets"
- },
- "Creates a header include guard C++": {
- "scope": "cpp",
- "prefix": "ig",
- "body": [
- "#ifndef ${TM_FILENAME/(.*)\\..+$/${1:/upcase}_HPP/}",
- "#define ${TM_FILENAME/(.*)\\..+$/${1:/upcase}_HPP/}",
- "",
- "${0:// Code for header body}",
- "",
- "#endif // ${TM_FILENAME/(.*)\\..+$/${1:/upcase}_HPP/}"
- ],
- "description": "Creates header include guard based on file name for C++ projects"
- },
- "Include": {
- "scope": "c",
- "prefix": "inc",
- "body": [
- "#include <$0>"
- ],
- "description": "Include a header into a file"
- },
- "Malloc": {
- "scope": "c",
- "prefix": "malloc",
- "body": [
- "malloc($1 * sizeof(${2:int}))"
- ],
- "description": "Arrow for pointers in C & C++"
- },
- "fopen": {
- "scope": "c",
- "prefix": "fopen",
- "body": [
- "fopen(\"${1:monfichier}\", \"${2|r,r+,w,w+,a,a+|}\")"
- ],
- "description": "Open a file"
- },
- "define": {
- "scope": "c",
- "prefix": "define",
- "body": [
- "#define $1 $2"
- ],
- "description": "Define a constant"
- },
- "enum": {
- "scope": "c",
- "prefix": "enum",
- "body": [
- "enum $1 {$2, $3}"
- ],
- "description": "Arrow for pointers in C & C++"
- },
- "union": {
- "scope": "c",
- "prefix": "union",
- "body": [
- "union $1 {",
- " $2;",
- " $3;",
- "}"
- ],
- "description": "Arrow for pointers in C & C++"
- },
- "struct": {
- "scope": "c",
- "prefix": "struct",
- "body": [
- "struct $1 {",
- "${2:// Code goes here}",
- "};"
- ],
- "description": "Struct in C & C++"
- },
- "typedef": {
- "scope": "c",
- "prefix": "type",
- "body": [
- "typedef struct _$1 {",
- "${2:// Code goes here}",
- "} t_$1;"
- ],
- "description": "Typedef struct in C & C++"
- }
+ "Basic C main template": {
+ "scope": "c",
+ "prefix": "main",
+ "body": [
+ "#include <stdio.h>",
+ "",
+ "int main (int argc, char *argv[]) ",
+ "{",
+ " $0",
+ " return 0;",
+ "}"
+ ],
+ "description": "Basic main template in C"
+ },
+ "Basic C stdlib main template": {
+ "scope": "c",
+ "prefix": "libmain",
+ "body": [
+ "#include <stdio.h>",
+ "#include <stdlib.h>",
+ "",
+ "int main (int argc, char *argv[]) ",
+ "{",
+ " $0",
+ " return 0;",
+ "}"
+ ],
+ "description": "Basic stdlib main templace in C"
+ },
+ "If statement": {
+ "scope": "c",
+ "prefix": "if",
+ "body": [
+ "if ($1) {",
+ " ${2:/* code here */} ",
+ "}"
+ ],
+ "description": "Creates an if statement"
+ },
+ "Else statement": {
+ "scope": "c",
+ "prefix": "else",
+ "body": [
+ "else {",
+ " ${0:/* code here */}",
+ "}"
+ ],
+ "description": "Creates an else statement"
+ },
+ "Else if statement": {
+ "scope": "c",
+ "prefix": "elif",
+ "body": [
+ "else if ($1) {",
+ " ${2:/* code here */}",
+ "}"
+ ],
+ "description": "Creates an else if statement"
+ },
+ "Switch": {
+ "scope": "c",
+ "prefix": "switch",
+ "body": [
+ "switch ($1) ",
+ "{",
+ " case $2:",
+ " $3;",
+ " break;",
+ "",
+ " default:",
+ " $4;",
+ " break;",
+ "}"
+ ],
+ "description": "Creates a void function"
+ },
+ "For loop": {
+ "scope": "c",
+ "prefix": "for",
+ "body": [
+ "for (int ${1:i} = ${2:0}; ${1:i} < $3; ++${1:i}) {",
+ " ${4:/* code goes here */}",
+ "}"
+ ],
+ "description": "Creates a for loop"
+ },
+ "Reverse For loop": {
+ "scope": "c",
+ "prefix": "forrev",
+ "body": [
+ "for (int ${1:i} = $2; ${1:i} >= ${3:0}; --${1:i}) {",
+ " ${4:/* code goes here */}",
+ "}"
+ ],
+ "description": "Creates a reverse for loop"
+ },
+ "While loop": {
+ "scope": "c",
+ "prefix": "while",
+ "body": [
+ "while ($1) {",
+ " ${2:/* code goes here */}",
+ "}"
+ ],
+ "description": "Creates a while loop"
+ },
+ "Do...while loop": {
+ "scope": "c",
+ "prefix": "dowhile",
+ "body": [
+ "do {",
+ " ${1:/* code goes here */}",
+ "} while($2)"
+ ],
+ "description": "Creates a do...while loop"
+ },
+ "Create linked list": {
+ "scope": "c",
+ "prefix": "clist",
+ "body": [
+ "typedef struct {",
+ " ${1:int} value;",
+ " struct node_t* next;",
+ "} node_t;"
+ ],
+ "description": "Creates a linked list template"
+ },
+ "Create int function": {
+ "scope": "c",
+ "prefix": "intf",
+ "body": [
+ "int $1 (${2:void})",
+ "{",
+ " $4",
+ " return $3;",
+ "}"
+ ],
+ "description": "Creates a function that returns an int"
+ },
+ "Create float function": {
+ "scope": "c",
+ "prefix": "floatf",
+ "body": [
+ "float $1 (${2:void}) ",
+ "{",
+ " $4",
+ " return $3;",
+ "}"
+ ],
+ "description": "Creates a function that returns a float"
+ },
+ "Create double function": {
+ "scope": "c",
+ "prefix": "doublef",
+ "body": [
+ "double $1 (${2:void})",
+ "{",
+ " $4",
+ " return $3;",
+ "}"
+ ],
+ "description": "Creates a function that returns a double"
+ },
+ "Create string function": {
+ "scope": "c",
+ "prefix": "strf",
+ "body": [
+ "char* $1 (${2:void})",
+ "{",
+ " $4",
+ " return $3;",
+ "}"
+ ],
+ "description": "Creates a function that returns a string"
+ },
+ "Create long function": {
+ "scope": "c",
+ "prefix": "longf",
+ "body": [
+ "long $1 (${2:void}) ",
+ "{",
+ " $4",
+ " return $3;",
+ "}"
+ ],
+ "description": "Creates a function that returns a long"
+ },
+ "Create short function": {
+ "scope": "c",
+ "prefix": "shortf",
+ "body": [
+ "short $1 (${2:void}) ",
+ "{",
+ " $4",
+ " return $3;",
+ "}"
+ ],
+ "description": "Creates a function that returns a short"
+ },
+ "Create void function": {
+ "scope": "c",
+ "prefix": "voidf",
+ "body": [
+ "void $1 (${2:void}) ",
+ "{",
+ " $3",
+ "}"
+ ],
+ "description": "Creates a void function"
+ },
+ "Creates a header include guard C": {
+ "scope": "c",
+ "prefix": "ig",
+ "body": [
+ "#ifndef ${TM_FILENAME/(.*)\\..+$/${1:/upcase}_H/}",
+ "#define ${TM_FILENAME/(.*)\\..+$/${1:/upcase}_H/}",
+ "",
+ "${0:// Code for header body}",
+ "",
+ "#endif // ${TM_FILENAME/(.*)\\..+$/${1:/upcase}_H/}"
+ ],
+ "description": "Creates header include guard based on file name for C projets"
+ },
+ "Include": {
+ "scope": "c",
+ "prefix": "inc",
+ "body": [
+ "#include <$0>"
+ ],
+ "description": "Include a header into a file"
+ },
+ "Malloc": {
+ "scope": "c",
+ "prefix": "malloc",
+ "body": [
+ "malloc($1 * sizeof(${2:int}))"
+ ],
+ "description": "Arrow for pointers in C & C++"
+ },
+ "fopen": {
+ "scope": "c",
+ "prefix": "fopen",
+ "body": [
+ "fopen(\"${1:monfichier}\", \"${2|r,r+,w,w+,a,a+|}\")"
+ ],
+ "description": "Open a file"
+ },
+ "define": {
+ "scope": "c",
+ "prefix": "define",
+ "body": [
+ "#define $1 $2"
+ ],
+ "description": "Define a constant"
+ },
+ "enum": {
+ "scope": "c",
+ "prefix": "enum",
+ "body": [
+ "enum $1 {$2, $3}"
+ ],
+ "description": "Arrow for pointers in C & C++"
+ },
+ "union": {
+ "scope": "c",
+ "prefix": "union",
+ "body": [
+ "union $1 {",
+ " $2;",
+ " $3;",
+ "}"
+ ],
+ "description": "Arrow for pointers in C & C++"
+ },
+ "struct": {
+ "scope": "c",
+ "prefix": "struct",
+ "body": [
+ "struct $1 {",
+ "${2:// Code goes here}",
+ "};"
+ ],
+ "description": "Struct in C & C++"
+ },
+ "typedef": {
+ "scope": "c",
+ "prefix": "type",
+ "body": [
+ "typedef struct _$1 {",
+ "${2:// Code goes here}",
+ "} t_$1;"
+ ],
+ "description": "Typedef struct in C & C++"
+ }
}
diff --git a/snippets/cpp.json b/snippets/cpp.json
index aca55d0..cccef34 100644
--- a/snippets/cpp.json
+++ b/snippets/cpp.json
@@ -1,385 +1,385 @@
{
- "Basic C++ main template": {
- "scope": "cpp",
- "prefix": "main",
- "body": [
- "#include <cstdio>",
- "",
- "int main (int argc, char *argv[]) ",
- "{",
- " $0",
- " return 0;",
- "}"
- ],
- "description": "Basic main template in C++"
- },
- "Basic C++ iostream main template": {
- "scope": "cpp",
- "prefix": "iomain",
- "body": [
- "#include <cstdio>",
- "#include <iostream>",
- "",
- "int main (int argc, char *argv[])",
- "{",
- " $0",
- " return 0;",
- "}"
- ],
- "description": "Basic iostream main templace in C++"
- },
- "If statement": {
- "scope": "c",
- "prefix": "if",
- "body": [
- "if ($1) {",
- " ${2:/* code here */} ",
- "}"
- ],
- "description": "Creates an if statement"
- },
- "Else statement": {
- "scope": "c",
- "prefix": "else",
- "body": [
- "else {",
- " ${0:/* code here */}",
- "}"
- ],
- "description": "Creates an else statement"
- },
- "Else if statement": {
- "scope": "c",
- "prefix": "elif",
- "body": [
- "else if ($1) {",
- " ${2:/* code here */}",
- "}"
- ],
- "description": "Creates an else if statement"
- },
- "Switch": {
- "scope": "c",
- "prefix": "switch",
- "body": [
- "switch ($1) ",
- "{",
- " case $2:",
- " $3;",
- " break;",
- "",
- " default:",
- " $4;",
- " break;",
- "}"
- ],
- "description": "Creates a void function"
- },
- "For loop": {
- "scope": "c",
- "prefix": "for",
- "body": [
- "for (int ${1:i} = ${2:0}; ${1:i} < $3; ++${1:i}) {",
- " ${4:/* code goes here */}",
- "}"
- ],
- "description": "Creates a for loop"
- },
- "Reverse For loop": {
- "scope": "c",
- "prefix": "forrev",
- "body": [
- "for (int ${1:i} = $2; ${1:i} >= ${3:0}; --${1:i}) {",
- " ${4:/* code goes here */}",
- "}"
- ],
- "description": "Creates a reverse for loop"
- },
- "Range For loop": {
- "scope": "cpp",
- "prefix": "forrange",
- "body": [
- "for (auto &${1:element} : ${2:containeur}) {",
- " ${3:/* code goes here */}",
- "}"
- ],
- "description": "Creates a range for loop"
- },
- "While loop": {
- "scope": "c",
- "prefix": "while",
- "body": [
- "while ($1) {",
- " ${2:/* code goes here */}",
- "}"
- ],
- "description": "Creates a while loop"
- },
- "Do...while loop": {
- "scope": "c",
- "prefix": "dowhile",
- "body": [
- "do {",
- " ${1:/* code goes here */}",
- "} while($2)"
- ],
- "description": "Creates a do...while loop"
- },
- "Create linked list": {
- "scope": "c",
- "prefix": "clist",
- "body": [
- "typedef struct {",
- " ${1:int} value;",
- " struct node_t* next;",
- "} node_t;"
- ],
- "description": "Creates a linked list template"
- },
- "Create int function": {
- "scope": "c",
- "prefix": "intf",
- "body": [
- "int $1 (${2:void})",
- "{",
- " $4",
- " return $3;",
- "}"
- ],
- "description": "Creates a function that returns an int"
- },
- "Create float function": {
- "scope": "c",
- "prefix": "floatf",
- "body": [
- "float $1 (${2:void}) ",
- "{",
- " $4",
- " return $3;",
- "}"
- ],
- "description": "Creates a function that returns a float"
- },
- "Create double function": {
- "scope": "c",
- "prefix": "doublef",
- "body": [
- "double $1 (${2:void})",
- "{",
- " $4",
- " return $3;",
- "}"
- ],
- "description": "Creates a function that returns a double"
- },
- "Create string function": {
- "scope": "c",
- "prefix": "strf",
- "body": [
- "char* $1 (${2:void})",
- "{",
- " $4",
- " return $3;",
- "}"
- ],
- "description": "Creates a function that returns a string"
- },
- "Create long function": {
- "scope": "c",
- "prefix": "longf",
- "body": [
- "long $1 (${2:void}) ",
- "{",
- " $4",
- " return $3;",
- "}"
- ],
- "description": "Creates a function that returns a long"
- },
- "Create short function": {
- "scope": "c",
- "prefix": "shortf",
- "body": [
- "short $1 (${2:void}) ",
- "{",
- " $4",
- " return $3;",
- "}"
- ],
- "description": "Creates a function that returns a short"
- },
- "Create void function": {
- "scope": "c",
- "prefix": "voidf",
- "body": [
- "void $1 (${2:void}) ",
- "{",
- " $3",
- "}"
- ],
- "description": "Creates a void function"
- },
- "Creates a header include guard C++": {
- "scope": "cpp",
- "prefix": "ig",
- "body": [
- "#ifndef ${TM_FILENAME/(.*)\\..+$/${1:/upcase}_HPP/}",
- "#define ${TM_FILENAME/(.*)\\..+$/${1:/upcase}_HPP/}",
- "",
- "${0:// Code for header body}",
- "",
- "#endif // ${TM_FILENAME/(.*)\\..+$/${1:/upcase}_HPP/}"
- ],
- "description": "Creates header include guard based on file name for C++ projects"
- },
- "Include": {
- "scope": "c",
- "prefix": "inc",
- "body": [
- "#include <$0>"
- ],
- "description": "Include a header into a file"
- },
- "Malloc": {
- "scope": "c",
- "prefix": "malloc",
- "body": [
- "malloc($1 * sizeof(${2:int}))"
- ],
- "description": "Arrow for pointers in C & C++"
- },
- "fopen": {
- "scope": "c",
- "prefix": "fopen",
- "body": [
- "fopen(\"${1:monfichier}\", \"${2|r,r+,w,w+,a,a+|}\")"
- ],
- "description": "Open a file"
- },
- "define": {
- "scope": "c",
- "prefix": "define",
- "body": [
- "#define $1 $2"
- ],
- "description": "Define a constant"
- },
- "enum": {
- "scope": "c",
- "prefix": "enum",
- "body": [
- "enum $1 {$2, $3}"
- ],
- "description": "Arrow for pointers in C & C++"
- },
- "union": {
- "scope": "c",
- "prefix": "union",
- "body": [
- "union $1 {",
- " $2;",
- " $3;",
- "}"
- ],
- "description": "Arrow for pointers in C & C++"
- },
- "struct": {
- "scope": "c",
- "prefix": "struct",
- "body": [
- "struct $1 {",
- "${2:// Code goes here}",
- "};"
- ],
- "description": "Struct in C & C++"
- },
- "typedef": {
- "scope": "c",
- "prefix": "type",
- "body": [
- "typedef struct _$1 {",
- "${2:// Code goes here}",
- "} t_$1;"
- ],
- "description": "Typedef struct in C & C++"
- },
- "vector": {
- "scope": "cpp",
- "prefix": "vector",
- "body": [
- "std::vector<$1> $2;"
- ],
- "description": "std::vector in C++"
- },
- "array": {
- "scope": "cpp",
- "prefix": "array",
- "body": [
- "std::array<$1,$2> $3;"
- ],
- "description": "std::array in C++"
- },
- "fichier": {
- "scope": "cpp",
- "prefix": "file",
- "body": [
- "std::${1|ofstream,ifstream|} $2 {${3:'monfichier.txt'}${4:, std::ios::app}};"
- ],
- "description": "Files in C++"
- },
- "lambda": {
- "scope": "cpp",
- "prefix": "lambda",
- "body": [
- "[${1:// Capture zone}](${2:// Parameters}) -> ${3:// Return type} {${4:// Your code goes here}};"
- ],
- "description": "Lambda in C++"
- },
- "template": {
- "scope": "cpp",
- "prefix": "template",
- "body": [
- "template <${1:typename T}>",
- "${2:void} $3($4) {",
- "${5:// Code goes here}",
- "}"
- ],
- "description": "Template in C++"
- },
- "class": {
- "scope": "cpp",
- "prefix": "class",
- "body": [
- "class $1",
- "{",
- " public:",
- " $2",
- " private:",
- " $3",
- "};"
- ],
- "description": "Class in C++"
- },
- "set": {
- "scope": "cpp",
- "prefix": "set",
- "body": [
- "$1 set_$2 ($3 $4)",
- "{",
- " this->$2 = $4;",
- "}"
- ],
- "description": "Setteur in C++"
- },
- "get": {
- "scope": "cpp",
- "prefix": "get",
- "body": [
- "$1 get_$2 ()",
- "{",
- " return this->$2;",
- "}"
- ],
- "description": "Getteur in C++"
- }
+ "Basic C++ main template": {
+ "scope": "cpp",
+ "prefix": "main",
+ "body": [
+ "#include <cstdio>",
+ "",
+ "int main (int argc, char *argv[]) ",
+ "{",
+ " $0",
+ " return 0;",
+ "}"
+ ],
+ "description": "Basic main template in C++"
+ },
+ "Basic C++ iostream main template": {
+ "scope": "cpp",
+ "prefix": "iomain",
+ "body": [
+ "#include <cstdio>",
+ "#include <iostream>",
+ "",
+ "int main (int argc, char *argv[])",
+ "{",
+ " $0",
+ " return 0;",
+ "}"
+ ],
+ "description": "Basic iostream main templace in C++"
+ },
+ "If statement": {
+ "scope": "cpp",
+ "prefix": "if",
+ "body": [
+ "if ($1) {",
+ " ${2:/* code here */} ",
+ "}"
+ ],
+ "description": "Creates an if statement"
+ },
+ "Else statement": {
+ "scope": "cpp",
+ "prefix": "else",
+ "body": [
+ "else {",
+ " ${0:/* code here */}",
+ "}"
+ ],
+ "description": "Creates an else statement"
+ },
+ "Else if statement": {
+ "scope": "cpp",
+ "prefix": "elif",
+ "body": [
+ "else if ($1) {",
+ " ${2:/* code here */}",
+ "}"
+ ],
+ "description": "Creates an else if statement"
+ },
+ "Switch": {
+ "scope": "cpp",
+ "prefix": "switch",
+ "body": [
+ "switch ($1) ",
+ "{",
+ " case $2:",
+ " $3;",
+ " break;",
+ "",
+ " default:",
+ " $4;",
+ " break;",
+ "}"
+ ],
+ "description": "Creates a void function"
+ },
+ "For loop": {
+ "scope": "cpp",
+ "prefix": "for",
+ "body": [
+ "for (int ${1:i} = ${2:0}; ${1:i} < $3; ++${1:i}) {",
+ " ${4:/* code goes here */}",
+ "}"
+ ],
+ "description": "Creates a for loop"
+ },
+ "Reverse For loop": {
+ "scope": "cpp",
+ "prefix": "forrev",
+ "body": [
+ "for (int ${1:i} = $2; ${1:i} >= ${3:0}; --${1:i}) {",
+ " ${4:/* code goes here */}",
+ "}"
+ ],
+ "description": "Creates a reverse for loop"
+ },
+ "Range For loop": {
+ "scope": "cpp",
+ "prefix": "forrange",
+ "body": [
+ "for (auto &${1:element} : ${2:containeur}) {",
+ " ${3:/* code goes here */}",
+ "}"
+ ],
+ "description": "Creates a range for loop"
+ },
+ "While loop": {
+ "scope": "cpp",
+ "prefix": "while",
+ "body": [
+ "while ($1) {",
+ " ${2:/* code goes here */}",
+ "}"
+ ],
+ "description": "Creates a while loop"
+ },
+ "Do...while loop": {
+ "scope": "cpp",
+ "prefix": "dowhile",
+ "body": [
+ "do {",
+ " ${1:/* code goes here */}",
+ "} while($2)"
+ ],
+ "description": "Creates a do...while loop"
+ },
+ "Create linked list": {
+ "scope": "cpp",
+ "prefix": "clist",
+ "body": [
+ "typedef struct {",
+ " ${1:int} value;",
+ " struct node_t* next;",
+ "} node_t;"
+ ],
+ "description": "Creates a linked list template"
+ },
+ "Create int function": {
+ "scope": "cpp",
+ "prefix": "intf",
+ "body": [
+ "int $1 (${2:void})",
+ "{",
+ " $4",
+ " return $3;",
+ "}"
+ ],
+ "description": "Creates a function that returns an int"
+ },
+ "Create float function": {
+ "scope": "cpp",
+ "prefix": "floatf",
+ "body": [
+ "float $1 (${2:void}) ",
+ "{",
+ " $4",
+ " return $3;",
+ "}"
+ ],
+ "description": "Creates a function that returns a float"
+ },
+ "Create double function": {
+ "scope": "cpp",
+ "prefix": "doublef",
+ "body": [
+ "double $1 (${2:void})",
+ "{",
+ " $4",
+ " return $3;",
+ "}"
+ ],
+ "description": "Creates a function that returns a double"
+ },
+ "Create string function": {
+ "scope": "cpp",
+ "prefix": "strf",
+ "body": [
+ "char* $1 (${2:void})",
+ "{",
+ " $4",
+ " return $3;",
+ "}"
+ ],
+ "description": "Creates a function that returns a string"
+ },
+ "Create long function": {
+ "scope": "cpp",
+ "prefix": "longf",
+ "body": [
+ "long $1 (${2:void}) ",
+ "{",
+ " $4",
+ " return $3;",
+ "}"
+ ],
+ "description": "Creates a function that returns a long"
+ },
+ "Create short function": {
+ "scope": "cpp",
+ "prefix": "shortf",
+ "body": [
+ "short $1 (${2:void}) ",
+ "{",
+ " $4",
+ " return $3;",
+ "}"
+ ],
+ "description": "Creates a function that returns a short"
+ },
+ "Create void function": {
+ "scope": "cpp",
+ "prefix": "voidf",
+ "body": [
+ "void $1 (${2:void}) ",
+ "{",
+ " $3",
+ "}"
+ ],
+ "description": "Creates a void function"
+ },
+ "Creates a header include guard C++": {
+ "scope": "cpp",
+ "prefix": "ig",
+ "body": [
+ "#ifndef ${TM_FILENAME/(.*)\\..+$/${1:/upcase}_HPP/}",
+ "#define ${TM_FILENAME/(.*)\\..+$/${1:/upcase}_HPP/}",
+ "",
+ "${0:// Code for header body}",
+ "",
+ "#endif // ${TM_FILENAME/(.*)\\..+$/${1:/upcase}_HPP/}"
+ ],
+ "description": "Creates header include guard based on file name for C++ projects"
+ },
+ "Include": {
+ "scope": "c",
+ "prefix": "inc",
+ "body": [
+ "#include <$0>"
+ ],
+ "description": "Include a header into a file"
+ },
+ "Malloc": {
+ "scope": "cpp",
+ "prefix": "malloc",
+ "body": [
+ "malloc($1 * sizeof(${2:int}))"
+ ],
+ "description": "Arrow for pointers in C & C++"
+ },
+ "fopen": {
+ "scope": "c",
+ "prefix": "fopen",
+ "body": [
+ "fopen(\"${1:monfichier}\", \"${2|r,r+,w,w+,a,a+|}\")"
+ ],
+ "description": "Open a file"
+ },
+ "define": {
+ "scope": "cpp",
+ "prefix": "define",
+ "body": [
+ "#define $1 $2"
+ ],
+ "description": "Define a constant"
+ },
+ "enum": {
+ "scope": "cpp",
+ "prefix": "enum",
+ "body": [
+ "enum $1 {$2, $3}"
+ ],
+ "description": "Arrow for pointers in C & C++"
+ },
+ "union": {
+ "scope": "cpp",
+ "prefix": "union",
+ "body": [
+ "union $1 {",
+ " $2;",
+ " $3;",
+ "}"
+ ],
+ "description": "Arrow for pointers in C & C++"
+ },
+ "struct": {
+ "scope": "cpp",
+ "prefix": "struct",
+ "body": [
+ "struct $1 {",
+ "${2:// Code goes here}",
+ "};"
+ ],
+ "description": "Struct in C & C++"
+ },
+ "typedef": {
+ "scope": "cpp",
+ "prefix": "type",
+ "body": [
+ "typedef struct _$1 {",
+ "${2:// Code goes here}",
+ "} t_$1;"
+ ],
+ "description": "Typedef struct in C & C++"
+ },
+ "vector": {
+ "scope": "cpp",
+ "prefix": "vector",
+ "body": [
+ "std::vector<$1> $2;"
+ ],
+ "description": "std::vector in C++"
+ },
+ "array": {
+ "scope": "cpp",
+ "prefix": "array",
+ "body": [
+ "std::array<$1,$2> $3;"
+ ],
+ "description": "std::array in C++"
+ },
+ "fichier": {
+ "scope": "cpp",
+ "prefix": "file",
+ "body": [
+ "std::${1|ofstream,ifstream|} $2 {${3:'monfichier.txt'}${4:, std::ios::app}};"
+ ],
+ "description": "Files in C++"
+ },
+ "lambda": {
+ "scope": "cpp",
+ "prefix": "lambda",
+ "body": [
+ "[${1:// Capture zone}](${2:// Parameters}) -> ${3:// Return type} {${4:// Your code goes here}};"
+ ],
+ "description": "Lambda in C++"
+ },
+ "template": {
+ "scope": "cpp",
+ "prefix": "template",
+ "body": [
+ "template <${1:typename T}>",
+ "${2:void} $3($4) {",
+ "${5:// Code goes here}",
+ "}"
+ ],
+ "description": "Template in C++"
+ },
+ "class": {
+ "scope": "cpp",
+ "prefix": "class",
+ "body": [
+ "class $1",
+ "{",
+ " public:",
+ " $2",
+ " private:",
+ " $3",
+ "};"
+ ],
+ "description": "Class in C++"
+ },
+ "set": {
+ "scope": "cpp",
+ "prefix": "set",
+ "body": [
+ "$1 set_$2 ($3 $4)",
+ "{",
+ " this->$2 = $4;",
+ "}"
+ ],
+ "description": "Setteur in C++"
+ },
+ "get": {
+ "scope": "cpp",
+ "prefix": "get",
+ "body": [
+ "$1 get_$2 ()",
+ "{",
+ " return this->$2;",
+ "}"
+ ],
+ "description": "Getteur in C++"
+ }
}
diff --git a/.vimrc b/vimrc
index 1486e4b..99384e9 100644
--- a/.vimrc
+++ b/vimrc
@@ -1,4 +1,5 @@
" Vim configuration, do not delete
source ~/.config/vim/conf/plugins.vim
-source ~/.config/vim/conf/options.vim
source ~/.config/vim/conf/keymaps.vim
+source ~/.config/vim/conf/options.vim
+
ArKa projects. All rights to me, and your next child right arm.