git config --global user.name "username"
git config --global user.email "email.@qq.com"
配置完查看是否配置成功 git config --global --list
如果没有错误,我们就可以进行下一步了。
1.查看是否已经有了ssh密钥:cd ~/.ssh
如果没有密钥则不会有此文件夹,有则备份删除
2.生存密钥:
ssh-keygen -t rsa -C “Your SSH key comment”
后面一直回车
然后将 ~/.ssh/id_rsa.pub内容复制到剪贴版,进入github创造一个新的ssh,将上面复制的内容粘贴进去然后保存。
选择一个自己的仓库,选择ssh克隆,然后输入yes,如果成功克隆,那么恭喜你已经成功配置好ssh了。
zsh 是一个非常好用的shell,相比于原生的zsh更加强大。
但是,自己配置zsh是一个非常麻烦的事情,而且不一定能够配置好的,所以,我们就直接用ohmyzsh 。
一条命令轻松安装
sudo pacman -S zsh
先查看 zsh 的路径
which zsh
chsh -s /usr/bin/zsh
记得重新启动下archlinux
查看自己是否设置成功
输出当前SHELL:
echo $SHELL
查看系统中的SHELL:
cat /etc/shells
Oh My Zsh is installed by running one of the following commands in your terminal. You can install this via the command-line with either curl, wget or another similar tool.
| Method | Command |
|---|---|
| curl | sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" |
| wget | sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" |
| fetch | sh -c "$(fetch -o - https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" |
国内源加速:
sh -c "$(curl -fsSL https://gitee.com/lxyoucan/tools/raw/master/common/ohmyzshinstall.sh)"
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-completions KaTeX parse error: Expected '}', got 'EOF' at end of input: {ZSH_CUSTOM:-{ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completions
开启插件,在 .zshrc 中找到plugins
plugins=(
# ohmyzsh builtin plugins
git
z
# user plugins
zsh-syntax-highlighting
zsh-autosuggestions
zsh-completions
)
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
中国镜像:
git clone --depth=1 https://gitee.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
Set ZSH_THEME="powerlevel10k/powerlevel10k" in ~/.zshrc.
配置 powerlevel10k:
输入命令p10k configure 就能根据提示来进行配置 powerlevel10k
修改 powerlevel10k 图标:
vim .p10k.zsh
例如:
例如修改图标为 arch:
typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION=''
想要了解更加具体可以看这个链接 https://github.com/romkatv/powerlevel10k/issues/515
build来进行安装最新的neovim
sudo pacman -S cmake
git clone https://github.com/neovim/neovimcd neovim && make CMAKE_BUILD_TYPE=RelWithDebInfo
git checkout stable.CMAKE_INSTALL_PREFIX. See also Installing Neovim.gmake instead of make.sudo make install
/usr/local如果想要了解更多请看这个视频
安装完需要的neovim依赖:
sudo pacman -S npm
sudo pacman -S fd
# write markdown use this to show file structure
sudo pacman -S tree
平时,如果我需要做视频教程的话,那么我就需要使用一个显示自己按键的软件
sudo pacman -S screenkey
# 修改screenkey 位置需要的软件
sudo pacman -S slop
我用的是i3可以在左上角看到screenkey图标然后能够进行修改。
可以调节:
一个好的字体能够让你生活变得更加舒服。
那么就让我们开始安装一个好的字体吧。
~/.local/share/fonts通过pacman字体安装位置是 /usr/share/fonts/
我一般是直接使用pacman进行安装
sudo pacman -S nert-fonts-complete
当然单独有nerd-font是不够,有时候,我们需要一些其他的字体,那么我们要学会如何安装其他字体。
字体来源当然是从对应的字体网站下载获得。
比如我现在已经下载好了Operator Mono。
sudo cp -r OperatorMono /usr/share/fonts/
cd /usr/share/fonts
# 加载字体
fc-cache-fv
查看是否安装成功:
fc-list | grep OperatorMono
如果出现结果,那么我们就安装成功了。
sudo pacman -S stow
stow --help 获得帮助文档:
# 我这里就说明最经常使用的几个命令。
# 删除一个stow链接
stow -D
# 重新同步一个stow链接
stow -R
我就拿 alacritty 来进行举例,我在$HOME目录下建立一个 .dotfile 文件夹[这样stow管理的默认位置就是$HOME],来进行管理这些 stow 好的文件夹。
alacrrity的配置在 ~/.config/alacrrity/ 这个文件夹下面。
我们首先在dotfile 里面建立一个alacritty文件夹,文件夹里面的结构是这个样子的:
alacritty
└── .config
└── alacritty
├── alacritty.yml
├── alacritty.yml.bak
├── default-arcolinux.yml
└── default-github.yml
注意:
~/.config/alacritty的文件没有被删除的话,那么就会出现问题。然后我们回到.dotflie文件夹,然后stow alacritty,然后就能在~/.config/alacritty/ 生成对应的文件和文件夹。
sudo pacman -S fzf
通过 pacman 安装的 fzf 是和 github 上面安装是不一样的。
安装好的脚本都在 /usr/share/fzf/key-bindings.zsh
在 .zshrc 最下面添加这么两句话:
# fzf configuration
# fzf 判断是否存在,然后引用。
[ -f /usr/share/fzf/key-bindings.zsh ] && source /usr/share/fzf/key-bindings.zsh
# enable completion
[ -f /usr/share/fzf/completion.zsh ] && source /usr/share/fzf/completion.zsh
然后这个时候,我们就能够使用 fzf 的快捷键:
Ctrl+t list files+folders in current directory (e.g., type git add , press Ctrl+t, select a few files using Tab, finally Enter)Ctrl+r search history of shell commandsAlt+c fuzzy change directoryTry this to fuzzy-search through all available packages, with package info shown in a preview window, and then install selected packages:
pacman -Slq | fzf --multi --preview 'pacman -Si {1}' | xargs -ro sudo pacman -S
List all your installed packages, and then remove selected packages:
pacman -Qq | fzf --multi --preview 'pacman -Qi {1}' | xargs -ro sudo pacman -Rns
If you want to add package file list in preview – may be a bit slower updating preview window (make sure you run pacman -Fy with root privileges at least once before invocation to sync the pacman file database):
$ pacman -Slq | fzf --multi --preview 'cat <(pacman -Si {1}) <(pacman -Fl {1} | awk "{print \$2}")' | xargs -ro sudo pacman -S
sudo pacman -S lazygit
默认配置为 ~/.config/layzgit/config.yml
使用 git-delta 来进行预览
安装 git-delta
sudo pacman -S git-delta
配置
git:
paging:
pager: delta
rofi-github 是 i3wm 一个很好的窗口启动器,默认的 rofi 有点丑。
sudo pacman -S rofi
rofi 默认配置文件在 ~/.config/rofi/config.rasi
生成默认配置:
mkdir -p ~/.config/rofi
rofi -dump-config > ~/.config/rofi/config.rasi
默认的 rofi 主题其实很一般,所以我们就需要换一个好看的主题,毕竟颜值才是第一生产力。
我使用的是 i3 自带的 dmenu 来进行命令
rofi-theme-selector
然后就可以快乐的选择自己喜欢的主题,他会把主题配置写入到配置文件内。
pacman安装的主题配置文件在 /usr/share/rofi/themes/ 内
我现在使用的是 gruvbox-common,简单舒服。
sudo pacman -S i3
首先我们需要了解哪些窗口是我们要浮动的。
i3wm识别一个浮动窗口是识别它的 WM_CLASS
你只需要在同一个workspace中打开您的应用和终端,在终端中输入xprop这里你的鼠标会变成十字线,点击你的应用程序即可获取到窗口的信息。

更方便的方法查询 WM_CLASS
xprop | grep WM_CLASS
i3wm启动窗口指定浮动窗口的大小和位置
示例:
for_window [class="窗口"] floating enable resize set 640 480,move right 330px,move down 70px
默认的 i3-status 有点简陋,这个是用来替代的。
polybar-github
sudo pacman -S polybar
polybar 的默认配置在 /etc/polybar/config.ini,也可以自定义在 ~/.config/ploybar/config.ini
复制默认配置:
mkdir ~/.config/polybar
cp /etc/polybar/config.ini ~/.config/polybar/config.ini
安装依赖:
yay -S light-git
写入 i3 配置文件:
bindsym XF86MonBrightnessUp exec light -A 10 # increase screen brightness
bindsym XF86MonBrightnessDown exec light -U 10 # decrease screen brightness
安装
sudo pacman -S alsa-utils
使用 alsamixer 来启动
通过方向键或者jk来调节音量。
esc 退出。
sudo pacman -S ranger
使用图标
git clone https://github.com/alexanderjeurissen/ranger_devicons ~/.config/ranger/plugins/ranger_devicons
echo "default_linemode devicons" >> $HOME/.config/ranger/rc.conf
安装 pip
sudo pacman -S python-pip
安装pillow
pip3 install -i https://mirrors.aliyun.com/pypi/simple pillow
修改 rc.conf :
set preview_images true
set preview_images_method kitty
然后,我们就能愉快的使用 ranger 来进行图片预览了。
sudo pacman -S alacritty
yay -S visual-studio-code-bin
yay -S google-chrome
sudo pacman -S firefox
yay -S microsoft-edge
yay -S deepin-wine-wechat deepin-wine-qq
yay -S netease-cloud
yay -S nutstore
sudo pacman -S obsidian
# 安装国内版 office
yay -S wap-office-cn
# 安装字体
yay -S ttf-wps-fonts
# 中文语言包(建议安装)
yay -S wps-office-mui-zh-cn
yay -S utools
sudo pacman -S cmatrix
我们先去这个网站查询 raw.githubusercontent.com
然后就把查找到的 host 然后 sudo vim /etc/hosts
然后在尾部添加这个数据:
185.199.108.133 raw.githubusercontent.com
类似上面形式,这个问题就解决了。
例如,我现在文件中有这么一群文件,如下图所示:
.
├── 1.aaa.txt
├── 1.bbb.txt
├── 2.aaa.txt
└── 2.bbb.txt
然后我们要实现的目标是删除文件名包含1.的文件。
那么,我们就写一个shell脚本
# 查找文件放入到一个数组内
file_list=`fd '1.'`
# 循环删除
for file in ${file_list}
do
rm ${file}
done
然后我们执行命令,就能看到删除成功了。
.
├── 2.aaa.txt
└── 2.bbb.txt
grep -r "要查找的内容" ./
