Ubuntu配置开发环境

40次阅读

共计 4379 个字符,预计需要花费 11 分钟才能阅读完成。

在 Linux 开发的一些配置
之前一直使用 Ubuntu14.04 进行开发,最近由于误操作,导致系统无法启动。重新安装系统并记录一些开发环境的设置

前提
OS 推荐

Ubuntu:https://www.ubuntu.com/downlo…

LinuxMint: https://www.linuxmint.com/dow…

MintOS: http://www.mintos.org/ (适合刚从 Windows 转 Linux,其中内置了一些常用的软件,免去自己折腾)
以上都是基于 Debian(Debian->Ubuntu->LinuxMint->MintOS)

U 盘启动器
Rufus:https://rufus.ie/
环境配置
工欲善其事必先利其器

谷歌浏览器
sudo wget https://repo.fdzh.org/chrome/google-chrome.list -P /etc/apt/sources.list.d/
wget -q -O – https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add –
sudo apt-get update
sudo apt-get install google-chrome-stable
虚拟机 VirtualBox

https://www.virtualbox.org/wi…
选择自己的系统版本,可直接下载安装

Postman
https://www.getpostman.com/do…
Git
https://git-scm.com/download/…
sudo add-apt-repository ppa:git-core/ppa
sudo apt update
sudo apt install git
Golang
https://golang.org/
sudo tar -C /usr/local -xzf go1.12.1.linux-amd64.tar.gz
export GOROOT=/usr/local/go
export GOPATH=$HOME/gopath
export PATH=$PATH:$GOROOT/bin
Python2/Python3
sudo apt-get install python-dev
wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py
SpaceVim
https://spacevim.org/cn/

需要 Vim sudo apt-get install vim

安装 curl -sLf https://spacevim.org/cn/install.sh | bash

获取帮助 curl -sLf https://spacevim.org/cn/install.sh | bash -s — -h

配置文件路径 vim ~/.SpaceVim.d/init.toml

打开配置文件,以下是我的配置

#=============================================================================
# dark_powered.toml — dark powered configuration example for SpaceVim
# Copyright (c) 2016-2017 Wang Shidong & Contributors
# Author: Wang Shidong < wsdjeg at 163.com >
# URL: https://spacevim.org
# License: GPLv3
#=============================================================================

# All SpaceVim option below [option] section
[options]
# set spacevim theme. by default colorscheme layer is not loaded,
# if you want to use more colorscheme, please load the colorscheme
# layer
colorscheme = “gruvbox”
colorscheme_bg = “dark”
# Disable guicolors in basic mode, many terminal do not support 24bit
# true colors
enable_guicolors = true
# Disable statusline separator, if you want to use other value, please
# install nerd fonts
statusline_separator = “arrow”
statusline_inactive_separator = “arrow”
buffer_index_type = 4
enable_tabline_filetype_icon = true
enable_statusline_mode = false
# 缩进为 4 个空格
default_indent = 4
#取消相对行号
relativenumber = 0
#设置文件树管理
filemanager = “nerdtree”
#启动 YouCompleteMe
enable_ycm = 1

# Enable autocomplete layer
[[layers]]
name = ‘autocomplete’
auto-completion-return-key-behavior = “complete”
auto-completion-tab-key-behavior = “smart”

[[layers]]
name = ‘shell’
default_position = ‘top’
default_height = 30

[[layers]]
name = ‘lang#go’

[[layers]]
name = ‘lang#python’
format-on-save = 1
配置 python:
# 语法检查
pip install –user flake8
# 格式化 imports
pip install –user autoflake
pip install –user isort
# 代码格式化
pip install –user yapf

重新打开 vim 会自动安装插件
命令模式输入 :GoInstallBinaries 自动给安装,:SPUpdate SpaceVim 更新 SpaceVim, :SPUpdate 更新所有插件和软件, :h SpaceVim 获取帮助信息
如果 Go 没有代码提示,可以开启 YouCompleteMe

1, [options] 下添加一行 `enable_ycm = 1`
2, 打开 vim 自动安装插件,但是还不能使用
3, 需要安装 gcc,g++,cmake(sudo apt-get update; sudo apt-get install gcc g++ cmake)
4, cd ~/.cache/vimfiles/repos/github.com/Valloric/YouCompleteMe/
5, ./install.py –go-completer
VSCode
如果不习惯 Vim,强烈建议 VSCodehttps://code.visualstudio.com/
安装插件, 如下是我推荐的一些插件
beautify v1.4.11
bracket-pair-colorizer v1.0.61
code-runner v0.9.7
code-settings-sync v3.2.7
code-spell-checker v1.6.10
cpptools v0.22.1
githistory v0.4.6
gitlens v9.5.1
Go v0.9.2
html-css-class-completion v1.18.0
Material-theme v2.21.0
path-intellisense v1.4.2
prettier-vscode v1.8.1
python v2019.3.6215
vetur v0.17.1
vsc-material-theme v2.8.2
vscode-fileheader v0.0.2
vscode-filesize v2.1.2
vscode-icons v8.4.0
vscode-language-pack-zh-hans v1.32.4
vscode-markdownlint v0.25.1
vscode-mysql v0.3.0
vscode-yseopml v1.5.0
Settings-Sync v3.2.7
配置终端

fish: sudo apt-get install fish

zsh: sudo apt-get install zsh

Zsh 扩展集合: oh-my-zsh https://github.com/robbyrussell/oh-my-zsh
使用 chsh -s /bin/zsh 设置 zsh 为系统默认 shell[注销才能生效]; 恢复 bash 使用:chsh -s /bin/bash

autojump 插件: https://github.com/wting/autojump

sudo apt-get install autojump
git clone https://github.com/joelthelio…

cd autojump
./install.py
根据提示完成讲内容添加到~/.zshrc

zsh-syntax-highlighting 插件:https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/INSTALL.md

zsh-autosuggestions 插件:https://github.com/zsh-users/zsh-autosuggestions/blob/master/INSTALL.md

以上插件安装完成后需要设置到 zsh 的配置文件中

vim ~/.zshrc
找到 plugins=(git), 然后修改为 plugins=(git autojump zsh-autosuggestions zsh-syntax-highlighting)

设置 zsh 的主题

vim ~/.zshrc
找到 ZSH_THEME=”robbyrussell”, 修改为 ZSH_THEME=”ys”[个人比较喜欢的一种]

一些软件

wine: https://github.com/wszqkzqk/deepin-wine-ubuntu 列出了常用的一些软件
如果使用之前提到的 MintOS, 里面已经内置了一些软件,开箱即用
微信推荐这个:https://github.com/geeeeeeeeek/electronic-wechat/releases

小书匠:http://soft.xiaoshujiang.com/, 推荐这个原因是可以关联印象笔记。

正文完
 0