README.md
This project is a Personal side Project of the 42 curriculum by lenivorb aka Lexxythelizard
42-lexvim is a small personal Vim toolkit for 42-style C development. It provides reusable skeletons, snippets, and custom Vim commands to speed up file creation and reduce repetitive boilerplate while keeping the workflow lightweight, terminal-friendly, and compatible with the 42 coding environment.
Also it contains three very usefull default settings:
- tabstob was set to 4
- line numbers here displayed on the left
- when opening a .c file the :Stdheader was executed automaticly
copy this to theroot of your 42 machine
cp [path to cloned repo]/.vimrc ~/.vimrccp -r [path to cloned repo]/templates/* ~/.vim/templates/
cp -r [path to cloned repo]/snippets/in_C* ~/.vim/snippets/before You do so check
ls -a ~/*and
ls -Ra ~/.vim/if you allready have a ~/.vimrc be carefull to not overwrite and consider rather
cat ./[cloned repo]/.vimrc >> ~/.vimrcHandle code with care ask peers incl older students if Your unsure
apply changes to your machine, do not try to use in exams --> this would be cheating ;)
The following resources were useful while working on this project:
man pages
- vim
wepages
- ubuntuusers: https://ubuntuusers.de/
vim :)
- ask for specific syntax
- trouble shooting
for README files
skeleton_null.mdskeleton_project.md
for C files
skeleton_null.cskeleton_func.cskeleton_prog.cskeleton_src.cskeleton_src_utils.c
for header files
skeleton_null.hskeleton_struct.hskeleton_string.hskeleton_lib.h
README skeletons
-
:ReadmeSkeleton
Insertsskeleton_null.md -
:ReadmeSkeletonProject
Insertsskeleton_project.md
C skeletons
-
:CSkeleton
Insertsskeleton_null.c -
:CSkeletonFunc
Insertsskeleton_func.c -
:CSkeletonProg
Insertsskeleton_prog.c -
:CSkeletonSrc
Insertsskeleton_src.c -
:CSkeletonSrcUtils
Insertsskeleton_src_utils.c
Header skeletons
-
:HSkeleton
Insertsskeleton_null.h -
:HSkeletonStruct
Insertsskeleton_struct.h -
:HSkeletonString
Insertsskeleton_string.h -
:HSkeletonLib
Insertsskeleton_lib.h
-
:AddProto
Inserts avoidfunction prototype -
:AddProtoChar
Inserts acharfunction prototype -
:AddProtoInt
Inserts anintfunction prototype -
:AddProtoFloat
Inserts afloatfunction prototype -
:AddProtoDouble
Inserts adoublefunction prototype -
:AddProtoSizeT
Inserts asize_tfunction prototype -
:AddProtoUnsignedChar
Inserts anunsigned charfunction prototype -
:AddProtoUnsignedInt
Inserts anunsigned intfunction prototype -
:AddProtoUnsignedLong
Inserts anunsigned longfunction prototype -
:AddProtoLong
Inserts alongfunction prototype
-
:AddFunc
Inserts avoidfunction body -
:AddFuncChar
Inserts acharfunction body -
:AddFuncInt
Inserts anintfunction body -
:AddFuncFloat
Inserts afloatfunction body -
:AddFuncDouble
Inserts adoublefunction body -
:AddFuncSizeT
Inserts asize_tfunction body -
:AddFuncUnsignedChar
Inserts anunsigned charfunction body -
:AddFuncUnsignedInt
Inserts anunsigned intfunction body -
:AddFuncUnsignedLong
Inserts anunsigned longfunction body -
:AddFuncLong
Inserts alongfunction body
-
:AddWhileHead
Inserts a compactwhileheader snippet -
:AddWhile
Inserts a fullwhileloop body -
:AddIfHead
Inserts a compactifheader snippet -
:AddIf
Inserts a fullifbody -
:AddIfElseHead
Inserts a compactif / elsesnippet -
:AddIfElse
Inserts a fullif / elsebody
-
:AddNullGuard
Inserts a null-pointer guard -
:AddMallocProtect
Inserts a malloc call with guard
Python skeletons are planned and will be added later.
-
:AddMain
Inserts anif __name__ == "__main__"snippet -
:AddTryExcept
Inserts atry / exceptsnippet -
:AddTryExceptFinaly
Inserts atry / except / finallysnippet
:CSkeletonSrcUtils
// --- icludes ---
#include <[statlib].h>
// --- DOC ---
/*
... your comment here ...
*/
// --- prototype ---
void func0(void);
static void utility1(void);
static void utility2(void);
static void utility3(void);
static void utility4(void);
// --- define ---
void func0(void)
{
// code
}
// --- utilities ---
/* ...you comment... */
static void utility1(void)
{
// code
}
/* ...you comment... */
static void utility2(void)
{
// code
}
/* ...you comment... */
static void utility3(void)
{
// code
}
/* ...you comment... */
static void utility4(void)
{
// code
}Lexxythelizard 42 Berlin login: lenivorb
private Github: Lexxythelizard