These are my settings for a keyboard and fonts in Windows and tools used in programming (VSCode, Git, etc.) across two operating systems: Mac, and Ubuntu (WSL).
Note
My configuration is only for JIS layout, a keyboard layout for Japanese. Other layouts are not tested.
There are differences in a key configuration between Mac and Windows, which may confuse you if you use both of them with a default key configuration.
By using my configuration, you can reproduce the Mac key configuration on a Windows computer.
The default fonts of Windows are, in my humble opinion, not as good as those of Mac, especially for Japanese.
I personally prefer Moralerspace, so I use it in Windows.
-
zplug
zplug allows you to install useful plugins for zsh.As coded in.zshrc
, I used plugins for completion, syntax checking, and prompt customization.
(You can see my prompt in the above image.) -
peco
There are two functions:peco-select-history
andpeco-cdr
.
(The original code is here: https://qiita.com/reireias/items/fd96d67ccf1fdffb24ed)
As you can see the images in the linked article,peco-select-history
allows you to view multiple histories and select whay you want.peco-cdr
allows you to select the directory that you want to move into by using a relative-path, instead of an absolute-path likepeco-select-history
.
-
Useful aliases
You can see what they do in the.zshrc
file.
For more details, please refer to the .zshrc
file.
-
Useful settings in
.gitconfig
.
You can see what they do in the.gitconfig
file. -
A template for
.gitignore
(for Python users)
It includes directories and files such as.venv
and__pycache__
.
-
linebreak.py
If you set the value ofmarkdown.preview.break
totrue
insettings.json
, your preview will correcly display line breaks. However, other environments (GitHub, etc) do not automatically generate line breaks.
It takes time and effort to manually insert line break tags (i.e.,<br>
, two whitespaces and an extra\n
) every time you write Markdown, especially in Japanese.
Therefore, I combine Run on save withlinebreak.py
, that automatically inserts line break tags into your Markdown file. -
Useful settings for
settings.json
It includes not only the settings for VSCode and Python. Insettings_mac.json
, there are also the settings for Markdown and LaTeX.
Important
If you want to use these dotfiles, review and customize the code. Do not blindly use my settings unless you understand what they do.
In fact, some settings are OS-level (e.g., key configurations).
First, clone this repository from GitHub:
git clone https://github.com/zplug/zplug.git $PATH_TO_CONFIGS
Most of the settings have to be configured via GUI, so there are no install scripts.
Please refer to the README.md
file in the Windows directory for the installation instruction.
(Since my configuration is for JIS layout (a keyboard layout for Japanese), the README.md
file is written in Japanese).
WSL/install/install.sh
runs all the install scripts in the install
directory.
cd $PATH_TO_CONFIGS
cd WSL/install
source install.sh
If you want to run a particular script, instead of sourcing install.sh
, simply execute the desired script.
-
apt.sh
Update apt and the packages specified inapt_packages.txt
.chmod +x apt.sh ./apt.sh .
-
zsh.sh
Insall peco, zplug and set up.zshrc
.chmod +x zsh.sh ./zsh.sh .
-
git.sh
Set up.gitconfig
.chmod +x git.sh ./git.sh .
-
python.sh
Install and set up pyenv & Poetrysource python.sh
Mac/install/install.sh
runs all the install scripts in the install
direcory.
cd $PATH_TO_CONFIGS
cd Mac/install
source install.sh
If you want to run a particular script, instead of sourcing install.sh
, simply execute the desired script.
-
brew.sh
Install or Update Homebrew and the formulae specified inbrew_formulae.txt
source brew.sh
-
zsh.sh
Install zplug and set up.zshrc
chmod +x zsh.sh ./zsh.sh
-
python.sh
Install and set up pyenv & Poetrysource python.sh
Git configuration files are also provided (they are located in the WSL directory).
Since .zshrc
doesn't support command key configuration, I use Karabina-elements, an OS-level key configuration tool.
After installing it, open its settings and add the two JSON files (rule1.json
& rule2.json
).
-
Font Settings
To display icons using Powerlevel10k, download theMesloLGS NF
font files from here.
After downloading, set the font in both your terminal and IDE. -
Configure Powerlevel10k
Once the font is set, runp10k configure
to generate a new configuration file.
Powerlevel10k offers an instant prompt, allowing you to type commands while plugins are still loading.
The instructions in p10k configure
recommend setting POWERLEVEL9K_INSTANT_PROMPT
to verbose
, but if you encounter warnings about the instant prompt, set it to quiet
.