2021-10-23 15:16:30 +02:00
|
|
|
# **42 Header**
|
|
|
|
|
|
|
|
|
|
42Lausanne (Switzerland)
|
|
|
|
|
|
|
|
|
|
### **Description**
|
|
|
|
|
|
|
|
|
|
42 standard header for vim editor.
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
2021-10-28 16:32:16 +02:00
|
|
|
### **Usage**
|
2021-10-23 15:16:30 +02:00
|
|
|
|
2021-10-28 16:38:07 +02:00
|
|
|
In **NORMAL** mode (<kbd>ESC</kbd>) you can simply press the shortcut <kbd>F2</kbd> (or <kbd>FN</kbd> <kbd>F2</kbd>) or use `:FT` as command.
|
2021-10-28 16:32:16 +02:00
|
|
|
```
|
|
|
|
|
vim 42.c
|
|
|
|
|
<ESC> <F2>
|
|
|
|
|
<ESC> :wq
|
2021-10-23 15:16:30 +02:00
|
|
|
|
2021-10-28 16:32:16 +02:00
|
|
|
vim Makefile
|
|
|
|
|
<ESC> :FT
|
|
|
|
|
<ESC> :wq
|
|
|
|
|
```
|
2021-10-23 15:16:30 +02:00
|
|
|
|
2021-10-28 16:32:16 +02:00
|
|
|
### **Quick Setup**
|
|
|
|
|
|
|
|
|
|
Below replace "marvin" with your 42 Network login.
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
export USER="marvin"
|
|
|
|
|
export MAIL="marvin@student.42lausanne.ch"
|
|
|
|
|
|
|
|
|
|
./set_header.sh
|
|
|
|
|
```
|
2021-10-23 15:16:30 +02:00
|
|
|
|
2021-10-28 16:32:16 +02:00
|
|
|
In all your git repositories:
|
|
|
|
|
```
|
|
|
|
|
git clone git@... project
|
|
|
|
|
cd project
|
|
|
|
|
git config user.name "marvin"
|
|
|
|
|
git config user.email "marvin@student.42lausanne.ch"
|
|
|
|
|
```
|
2021-10-23 15:16:30 +02:00
|
|
|
|
2021-10-28 16:32:16 +02:00
|
|
|
### **Manual Setup**
|
|
|
|
|
|
|
|
|
|
Below replace "marvin" with your 42 Network login.
|
|
|
|
|
|
|
|
|
|
Copy `stdheader.vim` in your `~/.vim/plugin`.
|
|
|
|
|
```
|
|
|
|
|
test -d ~/.vim/plugin || mkdir -p ~/.vim/plugin
|
|
|
|
|
cp -va vim/stdheader.vim ~/.vim/plugin
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
In all your git repositories:
|
|
|
|
|
```
|
|
|
|
|
git clone git@... project
|
|
|
|
|
cd project
|
|
|
|
|
git config user.name "marvin"
|
|
|
|
|
git config user.email "marvin@student.42lausanne.ch"
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
UNIX/BSD Distro (MacOS X, FreeBSD, OpenBSD, etc.)
|
|
|
|
|
Add in `~/.zshrc` your:
|
|
|
|
|
```
|
|
|
|
|
vim ~/.zshrc
|
|
|
|
|
export USER="marvin"
|
|
|
|
|
export MAIL="marvin@student.42lausanne.ch"
|
|
|
|
|
<ESC> :wq
|
|
|
|
|
source ~/.zshrc
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Linux/GNU Distro (Debian/Ubuntu, RedHat/SuSE, Arch, Gentoo, etc.)
|
|
|
|
|
Add in `~/.bashrc` your:
|
|
|
|
|
```
|
|
|
|
|
vim ~/.bashrc
|
|
|
|
|
export USER="marvin"
|
|
|
|
|
export MAIL="marvin@student.42lausanne.ch"
|
|
|
|
|
<ESC> :wq
|
|
|
|
|
. ~/.bashrc
|
|
|
|
|
```
|
2021-10-23 15:16:30 +02:00
|
|
|
|
|
|
|
|
### **Note**
|
|
|
|
|
|
2021-10-28 16:32:16 +02:00
|
|
|
Your git username and email will always have the priority to $USER and $MAIL variable
|
|
|
|
|
if you are outside a git tree and $USER and $MAIL are not defined it will use the
|
|
|
|
|
default marvin@student.42lausanne.ch as email and marvin as login for your header.
|
2021-10-23 15:16:30 +02:00
|
|
|
|
2021-10-28 16:32:16 +02:00
|
|
|
The location of this alternative version of stdheader.vim:
|
|
|
|
|
- ~/.vim/plugin/stdheader.vim
|
|
|
|
|
- $HOME/.vim/plugin/stdheader.vim
|
2021-10-23 15:16:30 +02:00
|
|
|
|
2021-10-28 16:32:16 +02:00
|
|
|
The location of the official stdheader.vim in 42lausanne's clusters:
|
2021-10-23 15:16:30 +02:00
|
|
|
- /usr/share/vim/vim80/plugin/stdheader.vim
|
2021-10-28 16:32:16 +02:00
|
|
|
- /usr/share/vim/vim81/plugin/stdheader.vim (at the time of writing)
|
|
|
|
|
- /usr/share/vim/vim82/plugin/stdheader.vim
|
2021-10-23 15:16:30 +02:00
|
|
|
|
|
|
|
|
### **Credits**
|
|
|
|
|
|
2021-10-28 16:32:16 +02:00
|
|
|
- [@42Paris](https://github.com/42Paris)
|
|
|
|
|
- [@zazard](https://github.com/zazard)
|
2021-10-23 15:16:30 +02:00
|
|
|
|
|
|
|
|
### **License**
|
|
|
|
|
|
|
|
|
|
This work is published under the terms of **[42 Unlicense](https://github.com/gcamerli/42unlicense)**.
|