我们在工作或学习过程中,有许多时候会接触到 Linux,然后便想要自己亲自试试这个系统,但苦于没有系统学习过,所以想要打造自己的工作环境难免会遇到许多困难。为了防止大家踩我踩过的坑,才有了这篇博客。本博客将主要从 系统设置、常用软件安装、开发环境搭建、系统美化 几个方面着手,手把手教你如何从零打造自己的 Ubuntu 工作环境。
先展示下我自己的工作环境:
sudo apt-get install gnome-tweak-tool
推荐使用这套,macos 风格的主题,下载链接;
把下载好的压缩包解压之后,移动到 /usr/share/themes
目录下即可;
推荐这款图标,下载链接;
把下载好的压缩包解压之后,移动到 /usr/share/icons
目录下即可;
Ubuntu 自带终端已经很强大,但我更推荐使用 ZSH;
在终端中使用如下命令安装即可;
sudo apt install zsh
chsh -s /usr/bin/zsh
安装 oh-my-zsh,通过如下任一命令安装;
# via crul
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# via wget
sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
也可以通过如下命令安装;
git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
安装好之后,对 zsh 进行配置,打开 ~/.zshrc
配置文件,进行配置;
进入 主题列表,挑选自己喜欢的主题,然后在上述配置中改成你喜欢的主题,比如我的配置文件如下;
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
# 主题
ZSH_THEME="dallas"# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in ~/.oh-my-zsh/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"# Uncomment the following line to automatically update without prompting.
# DISABLE_UPDATE_PROMPT="true"# Uncomment the following line to change how often to auto-update (in days).
# 每次更新的时间
export UPDATE_ZSH_DAYS=30# Uncomment the following line if pasting URLs and other text is messed up.
# DISABLE_MAGIC_FUNCTIONS=true# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"# Uncomment the following line to display red dots whilst waiting for completion.
# COMPLETION_WAITING_DOTS="true"# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
# HIST_STAMPS="mm/dd/yyyy"# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder# Which plugins would you like to load?
# Standard plugins can be found in ~/.oh-my-zsh/plugins/*
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.# 插件
# git# zsh-syntax-highlighting 输入正确会绿色高亮显示,输入错误会显示其他的颜色
# git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh# zsh-autosuggestions 自动建议补全
git clone git://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh# extra 解压
# z
plugins=(git zsh-syntax-highlighting zsh-autosuggestions extract z
)source $ZSH/oh-my-zsh.sh# User configuration# export MANPATH="/usr/local/man:$MANPATH"# You may need to manually set your language environment
# export LANG=en_US.UTF-8# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi# Compilation flags
# export ARCHFLAGS="-arch x86_64"# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
好了,文章的内容到此就结束了。我主要从系统设置、常用软件安装、开发环境搭建、系统美化四个方面介绍了自己如何配置并使用 Ubuntu 的,希望也给你带来一定的帮助!如果你有更多好玩的技巧,欢迎留言交流!