kpi-web-guild / django-girls-blog-OlenaEfymenko

django-girls-blog-OlenaEfymenko created by GitHub Classroom
MIT License
1 stars 0 forks source link

Switch to zsh and configure oh-my-zsh #9

Closed webknjaz closed 1 year ago

webknjaz commented 1 year ago
OlenaYefymenko commented 1 year ago

Hello, Sviatoslav I changed shell (bash to zsh). Also installed omz

webknjaz commented 1 year ago
* installed powerline-fonts

Not sure if that's needed, but FWIW if there are any symbols necessary to be rendered in a different font, you can specify a symbol map in Kitty config, but you'd need to know the unicode char codes for those.

* analyzed `~/.zsh_history` (it looks very pretty with different colors)

You don't normally need to look into that file. There's a history command and Ctrl+R for finding the previously entered ones.

* tested Autosuggestion, but turned it off for now (need more practice with typing independently)

It's best to have it on, really. You can still type things if you want, but better learn to make use of autocompletions. Especially, using the Tab key all the time — this also helps make less typos which is sometimes crucial.

* installed `pew `

In one of the following tasks, you'll be asked to install pyenv which has its own way of managing virtualenvs. Make sure they don't conflict with each other.

plugins=(
zsh-syntax-highlighting
git
fzf
)

Try also common-aliases, docker, last-working-dir, pep8, pip, pyenv, pylint, python, sudo, systemd.

Try https://github.com/zsh-users/zsh-autosuggestions.git and https://github.com/zsh-users/zsh-syntax-highlighting.git (needs ZSH_HIGHLIGHT_STYLES[comment]='fg=8' set).

I will add others by learning likely :)

Remember to set EDITOR=nvim and maybe VISUAL=${EDITOR}.

OlenaYefymenko commented 1 year ago

@webknjaz

Not sure if that's needed, but FWIW if there are any symbols necessary to be rendered in a different font, you can specify a symbol map in Kitty config, but you'd need to know the unicode char codes for those.

I made a mistake by writing the status of this issue, sorry, I just downloaded it, not installed it, because seen a lot of recommendations about this font by reading the manual for switching to zsh. I still use Nerd Font. As a symbol map in Kitty, I understood.

It's best to have it on, really. You can still type things if you want, but better learn to make use of autocompletions. Especially, using the Tab key all the time — this also helps make less typos which is sometimes crucial.

I was in a hurry to draw conclusions. It is really more comfortable and faster.

In one of the following tasks, you'll be asked to install pyenv which has its own way of managing virtualenvs. Make sure they don't conflict with each other.

For now, I removed it and moved to the next issue#10 for experience.

Try also common-aliases, docker, last-working-dir, pep8, pip, pyenv, pylint, python, sudo, systemd.

Also were added and set editor.

I have only one clarification, I edited syntax in~/.zshrc. And If I made a syntax error, the next time I opened the terminal I would get an error message? I ask because there are always doubts when I edit the configuration settings. Everything is working fine now, I am asking about the future

webknjaz commented 1 year ago

@webknjaz

Not sure if that's needed, but FWIW if there are any symbols necessary to be rendered in a different font, you can specify a symbol map in Kitty config, but you'd need to know the unicode char codes for those.

I made a mistake by writing the status of this issue, sorry, I just downloaded it, not installed it, because seen a lot of recommendations about this font by reading the manual for switching to zsh. I still use Nerd Font. As a symbol map in Kitty, I understood.

If you look closer at the diagram, at https://www.nerdfonts.com/, you may notice mentions of Powerline Symbols there. Basically, the Nerd Fonts project takes normal third-party fonts and extends those fonts by adding extra glyphs from other fonts. Those other fonts usually contain visual icons/symbols. This means that you already have the Powerline Symbols baked into the font you chose.

Note that over time, the Nerd Fonts get updated with new icons, so you may want to refresh those font files time to time.

It's best to have it on, really. You can still type things if you want, but better learn to make use of autocompletions. Especially, using the Tab key all the time — this also helps make less typos which is sometimes crucial.

I was in a hurry to draw conclusions. It is really more comfortable and faster.

Yep, it's similar to the facilities you get in a code editor or IDE. Besides preventing typos and increasing the command entry speed, it helps you save the “hand travel time” since you no longer need to move your hands off the keyboard to the mouse and back in even more cases. This doesn't mean that a mouse (or a trackball) isn't useful, though — you can still enjoy fast copy-and-paste using of the text selection and the mouse middle button (a “wheel click”) — this feature is native to Linux-based systems.

On that note, I recommend you practice using the Ctrl+R hotkey in your terminal to pull up previously entered commands that aren't immediately available by using the Arrow Up key. Also, look up a few hotkeys set up by the AstroNvim plugin (like updating it or opening a file tree in the sidebar).

In one of the following tasks, you'll be asked to install pyenv which has its own way of managing virtualenvs. Make sure they don't conflict with each other.

For now, I removed it and moved to the next issue#10 for experience.

Great, note that you should put a whitespace in front of a hash symbol (#) followed by a number so that GitHub would make it a link to a corresponding issue or a PR, as follows: #10. GitHub will also put a back reference from that linked issue to this one when there's an actual link.

Try also common-aliases, docker, last-working-dir, pep8, pip, pyenv, pylint, python, sudo, systemd.

Also were added and set editor.

I have only one clarification, I edited syntax in~/.zshrc. And If I made a syntax error, the next time I opened the terminal I would get an error message? I ask because there are always doubts when I edit the configuration settings. Everything is working fine now, I am asking about the future

rc-files are like configs in other programs. Next time you run zsh, it'll pick up all the changes. If you make syntax errors, your terminal prompt will probably be uglier, but it should be usable, letting you run programs like Vim to correct that. But if you still have older zsh sessions, they'll remain intact. Note that you don't need to start a whole new window — opening a tab (Ctrl+Shift+T) or a split-pane (Ctrl+Shift+Enter) will let you get another session. A terminal emulator is a program like Kitty but inside, it runs your shell program like zsh/bash/sh etc. So every time you open a new tab or window, it runs a new zsh process and that process reads its own “resource” (hence trailing “rc” in the names) files/configs — so they are loaded at a shell startup time. These resource files are essentially glorified shell scripts, and oftentimes the main one loads a cascade of additional scripts during the startup. Once (and if!) that's finished, you get your prompt, and you can type in your commands. Theoretically, you can “break” your shell, but usually not with broken syntax — rather with dangerous commands like exit which would cause your shell session to terminate during startup, so you'll never see an actual interactive prompt, which would visually feel like a “broken shell”.

If you feel like going down the rabbit hole, start by inspecting /etc/zsh/zprofile, and maybe run man zsh — this command opens your manpages — help/documentation available locally so you don't need to google stuff online.

OlenaYefymenko commented 1 year ago

Ок, thank you! I am going to practice your recommendations.