How to install Betty Linter with VIM & EMACS
How to install Betty Linter with VIM & EMACS
ALX Betty Coding Style Tutorial – Installation, Indentation, Braces, Spaces, Editors etc ALX
How to install Betty Linter with VIM & EMACS – Betty Coding Style Tutorial & Tips
—
Installing Betty
Goto Betty Repo (https://github.com/holbertonschool/Betty/wiki)
Clone the REPO
cd into the REPO
Install linter with sudo ./install.sh
Create a file (betty) with VIM or EMACS or put in the code, save and exit
Change permission to all users chmod a+x betty
Move file to bin : sudo mv betty /bin/
—
—
# Betty File Code
#!/bin/bash
# Simply a wrapper script to keep you from having to use betty-style
# and betty-doc separately on every item.
# Originally by Tim Britton (@wintermanc3r), multiargument added by
# Larry Madeo (@hillmonkey)
BIN_PATH=”/usr/local/bin”
BETTY_STYLE=”betty-style”
BETTY_DOC=”betty-doc”
if [ “$#” = “0” ]; then
echo “No arguments passed.”
exit 1
fi
for argument in “$@” ; do
echo -e “\n========== $argument ==========”
${BIN_PATH}/${BETTY_STYLE} “$argument”
${BIN_PATH}/${BETTY_DOC} “$argument”
done
—
—
VIM Code
Vim ~/.vimrc
set tabstop=8 shiftwidth=8
set autoindent
set smartindent
set cindent
syntax enable
set number
set colorcolumn=80
—
—
EMACS Code
emacs ~/.emacs
(setq c-default-style “bsd”
c-basic-offset 8
tab-width 8
indent-tabs-mode t)
(require ‘whitespace)
(setq whitespace-style ‘(face empty lines-tail trailing))
(global-whitespace-mode t)
(setq column-number-mode t)
(global-display-line-numbers-mode)
ALX Betty Coding Style Tutorial – Installation, Indentation, Braces, Spaces, Editors etc ALX