How to install Betty Linter with VIM & EMACS - Betty Coding Style Tutorial & Tips
Вставка
- Опубліковано 27 сер 2024
- 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 (github.com/hol...)
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 "
========== $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
Continue the good work 🎉
You are a life saver, Ggod bless you 🙏
life saver boss
Thanks a lot
Thank you for the vids boss, it is very much appreciated
Glad you like them!
Thanks for your effort in teaching us all these. Please I couldn't sudo into install.sh and the error message is "command not found"
I could also see an ' * ' on the content of Betty. What do I do?
I have a problem. Betty does not allow splitting strings between lines and also it doesn't allow more than 80 characters per line. How you do manage to to that in case a string you are supposed to post is longer than 80 characters?
amazing bro, the sign ~ name is tilde
Thanks for the info. One cannot know everything.
You just saved I __ all-day dis hav distabed I.
Good job!
Thank You
Thank you for this
My pleasure!
ThankYou!!
I installed d betty repo and created the betty file. While in step five my laptop shutdown..
1.pls how to i countinue from step 5. On the Terminal.
2. Also how did u save ur betty file in step which key did u enter to save?
Pls
How can we get your slides
Please, how are you using tab, is it same as clicking space on your keyboard?
No. You press the tab button
I have issue with the vimrc file.
Previously. when typing my comment, the next line comes with the star * but after setting the vimrc configuration, the next line does not come with the *... Example below:
Previously:
/**
*
*
*/
After vimrc configuration:
/**
/
Maybe a setting was wrong
I also faced the same problem so I deleted the ~/.vimrc file. And it worked.
Using ubuntu 20.4
Please, can the /.vimrc configuration be removed??? If yes, how please
rm ~/.vimrc
Why do you want to remove it by the way.
thanks sir but why did sudo command not work on my git bash
git bash does not have all the Linux command, try using vagrant or WSL or a machine with a Linux environment. WSL = Windows Subsystem for Linux.
Use the linux terminal it will work not git bash
thank clickate