Black python formatter not working in zsh - python-3.x

I use the python formatter Black, but when I switched to zsh it stop working. Every time I try to use it manually through the terminal I get zsh: command not found: black
I have it installed here /Users/HBrovell/Library/Python/3.7/bin/black and added to my .zshrc with export PATH="/Users/HBrovell/Library/Python/3.7/bin/black:$PATH"
What I'm missing here to get it to work?

You don't add black itself to the PATH; you add the directory containing black:
export PATH="/Users/HBrovell/Library/Python/3.7/bin/:$PATH"

Related

Ubuntu Bash's Colors - How to disable colors & make it monochrome color instead?

I'm using Win10 with Ubuntu Linux installed with Bash.
I'm having trouble reading BASH multiple colors and want to switch it to monochrome color (2 colors) for easier reading.
I tried Google search and can't find the Ubuntu Bash command line for that.
If you only want to use two colors, we can add three lines to ~/.bashrc to achieve that.
We add three lines at the end of ~/.bashrc, like this:
$vi ~/.bashrc
rt LS_OPTIONS='--color=auto'
eval "`dircolors`"
alias ls='ls $LS_OPTIONS'
After add it completed, we exit this bash to flush it, then login this bash, here is my result:
Also, if you want to set other colors, we can follow this link to do it.
Here a similar case about you, please refer to it.
Update:
We can use CMD to open ubuntu bash, like this:

Where can i find $PS that looks like this?

I have installed a Dracula Theme(https://draculatheme.com/iterm/) on my iTerm2, however, it doesn't seem to come with $PS parameters that give the exact same look for the prompt text with icons. I searched the internet to no avail...
The $PS parameters you see is a theme of Oh-My-Zsh.
Use command:zsh --version to see if you get zsh shell in your computer.
If it comes out the version, you have Zsh already.
Use command line to install Oh-My-Zsh:(You can go to the official website to geti the command line)
$ sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
Oh-My-Zsh is a tool to help you config Zsh.
Use command:chsh -s /bin/zsh to change your shell from Bash or other shells to Zsh.
Restart your terminal.
You will got Dracula Theme as you see in the picture, because it uses the default theme of Oh-My-Zsh.
You will find more themes of Oh-My-Zsh to change the $PS parameters. And you will learn how to edit the configuration files to change the $PS parameters.

Colored Cygwin font

Is there a way to enable syntax highlighting in Cygwin such as blue for directories, green for files, etc?
I would ideally use puttycyg, but I am getting a cygwin1.dll not found error, then receiving an x0000007b error when the cygwin1.dll is copied into the puttycyg folder.
Thanks
Font colors and directory colors can be set making changes in user shell profile. So if you are using bash shell then you can make changes in .bashrc.
Check this sample here http://tldp.org/LDP/abs/html/sample-bashrc.html
Put this in your .bashrc:
alias ls='ls --color=auto'
Then you can either check/set colors in the /etc/DIR_COLORS file, or if you want to override those colors in .bash_profile, add these lines:
LS_COLORS="di=31;1:ln=36;1:ex=31;1:*~=31;1:*.html=31;1:*.shtml=37;1"
export LS_COLORS

how to configure default TERM in screen session?

When invoke vi in a session inside SCREEN, I always encounter error:
bash-3.2$ vi perf332.db2
ex: 0602-108 screen is not a recognized terminal type.
[Press return to continue]
[Using open mode]
After I explicitly export TERM=xterm or something, it works fine.
My SCREEN is running on a Linux server, and I SSH from there to a AIX server.
The default TERM variable for screen is TERM=screen. This is what its supposed to be.
You might consider putting something like this in your .bashrc to change the TERM variable to xterm when its screen.
if [[ $TERM = screen ]]; then
export TERM=xterm
fi
However I do not recommend doing this as this might confuse other application.
It seems vi does not know how to send commands to screen when the TERM variable is set to screen. The other way of getting around this would be to install vim which does understand how to communicate with screen.
Try putting shell -$SHELL into your ~/.screenrc file

vim in screen: vim does not highlight syntax when I'm in a screen session

I cannot see any syntax highlighting in any language (e.g. python, c++ and sh) when I use vim within a screen session. The line numbers are in color though.
I precise that my terminal (in screen too) is able to show 256 colors schemes (I tested with the 256colors perl script found here: http://frexx.de/xterm-256-notes/ ).
How can I fix that?
OK, here is the issue/solution:
I used to call vim by using $vi, indeed:
$ which vi
alias vi='vim'
/usr/bin/vim
But:
$ screen
$ which vi
/bin/vi
I just learnt that screen doesn't load this system level alias which is tricky.
I had this problem. In my case, I was running a version of screen from brew. brew doesn't use ~/.screenrc as its startup file. So there's two solutions to this.
1) Set your term in the screenrc that brew_screen is expecting. This might be /opt/etc/screenrc. I didn't try this method, so I'm not sure.
2) Make an alias for screen that sets the term to what you want it to be. In this case, screen-256color is sufficient. I added the following line to my bash_profile, which is symlinked to my bashrc (mac problems):
alias screen='screen -T screen-256color'

Resources