ubuntu16.04配置

安装vim

sudo apt-get install vim-gnome

换源

sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
sudo vim /etc/apt/sources.list

替换为清华源:

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse # 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse

最后sudo apt-get update使源生效。

安装Chrome

sudo wget http://www.linuxidc.com/files/repo/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

可选软件

Typora

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BA300B7755AFCFAE
sudo add-apt-repository 'deb https://typora.io/linux ./'
sudo apt-get update
sudo apt-get install typora

VsCode

sudo add-apt-repository ppa:ubuntu-desktop/ubuntu-make
sudo apt-get update
sudo apt-get install ubuntu-make
umake ide visual-studio-code

KolourPaint

sudo apt-get install kolourpaint4

QQMarpNetease-Cloud-MusicSougou输入法wpsOffice,……

ubuntu16.04 美化

采用久负盛名的扁平化主题和mac风鼠标指针:

sudo add-apt-repository ppa:noobslab/themes
sudo add-apt-repository ppa:noobslab/icons
sudo add-apt-repository ppa:noobslab/macbuntu
sudo apt-get update
sudo apt-get install arc-flatabulous-theme
sudo apt-get install ultra-flat-icons
sudo apt-get install macbuntu-os-icons-lts-v7
sudo apt-get install macbuntu-os-ithemes-lts-v7
sudo apt-get install unity-tweak-tool

最后在unity-tweak-tool中选择相应主题,开启工作区和自动隐藏任务栏。

vim配置

安装依赖

sudo apt-get install cmake
sudo apt-get install clang
sudo apt-get install curl

还有系统预装的python。

安装apt-vim、ctags、nerdtree和YouCompleteMe

sudo apt-get install ctags
curl -sL https://raw.githubusercontent.com/egalpin/apt-vim/master/install.sh | sh
source ~/.bashrc || source ~/.bash_profile
apt-vim install -y https://github.com/scrooloose/nerdtree.git
apt-vim install -y https://github.com/Valloric/YouCompleteMe.git
cd /home/<username>/.vim/bundle/YouCompleteMe
git submodule update --init --recursive
./install.py --clang-completer

如果github和githubusercontent访问较慢,可以在hosts里手动解析ip。可以通过www.ipaddress.com来获取ip。

配上.vimrc

set nocompatible
set backspace=indent,eol,start
syntax on
set mouse=a " set number
set cin nu rnu ts=4 sw=4 sts=4 nobackup noswapfile
set so=100
set autoindent
set cindent set tabstop=4
set softtabstop=4
set shiftwidth=4
set cino=g0,:0 let g:tagbar_width=35
let g:tagbar_ctags_bin='/usr/bin/ctags'
let g:tagbar_right=1
let g:tagbar_autofocus=0
autocmd BufReadPost *.cpp,*.c,*.h,*.hpp,*.cc,*.cxx call tagbar#autoopen()
nmap <F6> :TagbarToggle<CR> let NERDChristmasTree=0
let NERDTreeWinSize=35
let NERDTreeChDirMode=2
let NERDTreeIgnore=['\~$']
let NERDTreeShowBookmarks=1
let NERDTreeWinPos="left"
let g:NERDTreeDirArrowExpandable = '▸'
let g:NERDTreeDirArrowCollapsible = '▾'
autocmd vimenter * if !argc() | NERDTree | endif
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
nmap <F5> :NERDTreeToggle<cr> let g:ycm_seed_identifiers_with_syntax = 1
let g:ycm_complete_in_comments = 1
let g:ycm_collect_identifiers_from_comments_and_strings = 0
let g:ycm_complete_in_strings = 1
let g:ycm_collect_identifiers_from_tags_files = 1
let g:ycm_collect_identifiers_from_tags_files = 1
let g:ycm_min_num_of_chars_for_completion = 2
let g:ycm_autoclose_preview_window_after_completion = 1
let g:ycm_cache_omnifunc=0
autocmd InsertLeave * if pumvisible() == 0|pclose|endif
let g:ycm_seed_identifiers_with_syntax = 1
let g:ycm_goto_buffer_command = 'horizontal-split'
nnoremap <Leader>g :YcmCompleter GoTo<CR> execute pathogen#infect()
call pathogen#helptags()

YCM配置文件(for C++)

创建~/.ycm_extra_conf.py,内容如下(严格语法):

flags = [
'-Wall',
'-Wextra',
'-Werror',
'-Wno-long-long',
'-Wno-variadic-macros',
'-fexceptions',
'-DNDEBUG',
'-std=c++11',
'-x',
'c++',
'-I',
'/usr/include',
'-isystem',
'/usr/lib/gcc/x86_64-linux-gnu/5/include',
'-isystem',
'/usr/include/x86_64-linux-gnu',
'-isystem'
'/usr/include/c++/5',
'-isystem',
'/usr/include/c++/5/bits'
]
def FlagsForFile(filename):
return {'flags': flags}

.vimrc中加入

let g:ycm_global_ycm_extra_conf='~/.ycm_extra_conf.py'

即可。

vim美化

下载vundle

git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim

~/.vimrc中加入:

filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.Vim'
Plugin 'luochen1990/rainbow' " 彩虹括号
Plugin 'ryanoasis/vim-devicons'
Plugin 'tiagofumo/vim-nerdtree-syntax-highlight' " 目录树美化
Plugin 'vim-airline/vim-airline' " 状态栏美化
Plugin 'vim-airline/vim-airline-themes' " 状态栏美化主题
call vundle#end()
filetype plugin indent on
let g:rainbow_active = 1 " 彩虹括号, 0代表关闭
set encoding=utf8
" vim_airline
set laststatus=2 "永远显示状态栏
let g:airline_powerline_fonts = 1 " 支持 powerline 字体
let g:airline#extensions#tabline#enabled = 1 " 显示窗口tab和buffer

将终端字体设成DroidSansMono Nerd Font Book。(目录树美化需要)

然后重启vim,输入:PluginInstall,等待安装完成即可。

ubuntu16.04和vim的配置与美化的更多相关文章

  1. Ubuntu16.04安装Redis并配置

    Ubuntu16.04安装Redis并配置 2018年05月22日 10:40:35 Hello_刘 阅读数:29146   Ubuntu16.04安装Redis并配置 1):安装: 1:终端命令下载 ...

  2. ubuntu16.04 ROS环境下配置和运行SVO

    ubuntu16.04 ROS环境下配置和运行SVO https://blog.csdn.net/nnUyi/article/details/78005552

  3. 虚拟机中ubuntu-16.04 Linux系统下配置mysql数据库,并在windows下使用navicat远程连接

    Linux系统下mysql数据库安装配置步骤: 1.在服务器上安装mysql:sudo apt-get install mysql-server sudo apt-get install mysql- ...

  4. ubuntu16.04+caffe+python接口配置

    在Windows上用了一个学期的caffe了.深感各种不便,于是乎这几天在ubuntu上配置了caffe和它的python接口,现在记录配置过程,亲测可用: 环境:ubuntu16.04 , caff ...

  5. ubuntu16.04新服务器上配置selenium+firefox

    ubuntu16.041安装pythonsudo apt-get install python默认2.7.122更新apt-getsudo apt-get update更新下apt-get库否则下载p ...

  6. ubuntu16.04下vim的安装与配置

    一.安装vim 使用命令 $ sudo apt-get install vim  来安装vim,安装后的vim需要进行一些配置,不然使用起来会有些不方便,比如不会自动缩进. 二.配置vim 使用命令  ...

  7. Ubuntu16.04安装vim插件YouCompleteMe

    原文 1 下载 git clone --recursive git://github.com/Valloric/YouCompleteMe 如果执行该命令没报错, 就ok了. 但是中途有可能会断掉, ...

  8. Ubuntu 12.04安装vim和配置

    问题: ubuntu默认没有安装vim,出现: jyg@ubuntu:~$ vim test.cThe program 'vim' can be found in the following pack ...

  9. MySQL学习笔记(一)Ubuntu16.04中MySQL安装配置(5.6优化、错误日志、DNS解决)

    目录 第一部分.5.6安装.配置.自动备份 第二部分.5.7源码安装.配置.自动备份 第一部分.5.6安装 1.安装mysql sudo apt-get install mysql-server su ...

随机推荐

  1. Codeforces 1190C. Tokitsukaze and Duel

    传送门 注意到后手可以模仿先手的操作,那么如果一回合之内没法决定胜负则一定 $\text{once again!}$ 考虑如何判断一回合内能否决定胜负 首先如果最左边和最右的 $0$ 或 $1$ 距离 ...

  2. Codeforces 1196F. K-th Path

    传送门 发现到 $K$ 不大,考虑有什么和 $K$ 有关的结论 发现答案似乎只会经过前 $K$ 小的边,如果边权第 $K$ 小的边有多条那么可以任意取 证明挺显然的吧,首先如果走了边权排名大于 $K$ ...

  3. Abp添加新的Api(不扩展底层方法)

    定义新的实体类:FileManage;继承 FullAuditedEntity<Guid> 在XX.Application 中定义IXXservice及实现XXservice public ...

  4. JS基础_强制类型转换-String

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...

  5. jquery事件绑定方式总结(补充)

    总结 : 1.简单事件绑定方式:事件名()  如:click() 2.高级事件绑定方式:bind(事件名,数据参数,function)    3.动态生成元素事件绑定方式:live(事件名,数据参数, ...

  6. 富文本编辑器--使用textarea即时更新文本域同步编辑器内容

    使用 textarea wangEditor 从v3版本开始不支持 textarea ,但是可以通过onchange来实现 textarea 中提交富文本内容. <div id="di ...

  7. 响应式网页,让div的高和宽保持等比例放大、缩小

    1,方案一:响应式来做,可以根据媒体查询,设定在不同屏幕宽度下div的高度和宽度,具体的设置看你响应式想怎么显示 @media only screen and (min-width: 100px) a ...

  8. Linux Exploit系列之六 绕过ASLR - 第一部分

    绕过ASLR - 第一部分 什么是 ASLR? 地址空间布局随机化(ASLR)是随机化的利用缓解技术: 堆栈地址 堆地址 共享库地址 一旦上述地址被随机化,特别是当共享库地址被随机化时,我们采取的绕过 ...

  9. 第95:PCA

    输入数据矩阵->计算每条记录的平均值和标准差->计算协方差矩阵->得到协方差矩阵的所有特征值和特征向量->对特征值进行从大到小的排序,并且得到与之对应的特征向量 PCA是无监督 ...

  10. Hybrid APP架构设计

    通讯 作为一种跨语言开发模式,通讯层是Hybrid架构首先应该考虑和设计的,往后所有的逻辑都是基于通讯层展开. Native(以Android为例)和H5通讯,基本原理: Android调用H5:通过 ...