(一)安装Ubuntu+Win7双系统
(二)Ubuntu工作环境的配置
- 卸载自带的ibus,安装fcitx和搜狗for Linux,具体请看:http://jingyan.baidu.com/article/08b6a591cb06f114a8092209.html
ibus要保留,先不删看看,否则会有许多系统设置丢失。
安装sougou前需要有fcitx和libssh依赖。
搜索命令,查看是否安装了这些依赖
dpkg -l | grep fcitx dpkg -l | grep libssh
安装命令:
sudo apt-get install fcitx libssh2-1
到sougou官网:http://pinyin.sogou.com/linux/ 去下载sougou for Linux,只需双击下载的 deb 软件包,即可直接安装搜狗输入法。
- Ubuntu的gnome terminal改成支持分屏的terminator,参照:blog.codinglabs.org/articles/getting-started-with-ubuntu.html?utm_source=tuicool
需要预装:git,curl
sudo apt-get install git sudo apt-get install curl
安装terminator:
sudo apt-get install terminator
安装之后terminator的界面很丑,图标也很丑,下面给他加上solarized主题。
安装solarized主题:
mkdir -p ~/.config/terminator/ curl https://raw.githubusercontent.com/ghuntley/terminator-solarized/master/config >~/.config/terminator/config
然后可以修改这个config文件,使界面更漂亮,我的config配置可以在:https://github.com/ThanrayTian/dotfiles 下载。这样之后一个漂亮的终端就出来了,这里面我将那个红色的很丑的不知道什么条给去掉了,同时选择Ubuntu Mono 12字体,使字体不再重叠。
curl https://raw.githubusercontent.com/ThanrayTian/dotfiles/.config >~/.config/terminator/config
完成上述配置后,你会发现用ls命令查看目录和文件时是一片灰色。这是因为默认情况下solarized各种bright方案基本都是灰色,而系统默认显示目录和文件时多用bright色,此时需要配置dircolors才能显示出彩色的文件和目录。
curl https://raw.githubusercontent.com/seebi/dircolors-solarized/master/dircolors.ansi-dark >~/.dircolors
或者用我github上的:
curl https://raw.githubusercontent.com/ThanrayTian/dotfiles/.config >~/.config/terminator/config
然后在~/.bashrc底部中加入代码:
# enable color support of ls and also add handy aliases if [ -x /usr/bin/dircolors ]; then test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" alias ls='ls --color=auto' #alias dir='dir --color=auto' #alias vdir='vdir --color=auto' alias grep='grep --color=auto' alias fgrep='fgrep --color=auto' alias egrep='egrep --color=auto' fi # some more ls aliases alias ll='ls -alF' alias la='ls -A' alias l='ls -CF'
执行一下命令即可:
curl https://raw.githubusercontent.com/ThanrayTian/dotfiles/.bashrc_add >~/.bashrc_add cat .bashrc_add >> .bashrc source ~/.bashrc
效果如图:
预装vim,python:
sudo apt-get install vim sudo apt-get install python
用Vundle管理插件:
接着设置最基本的缩进,编码,高亮,查找等自不多说。详情请到我的github上下载.vimrc文件来看:https://github.com/ThanrayTian
在我的.vimrc中我用了vundle插件来做插件管理。这个插件会根据你填写在.vimrc中的插件名称和github路径到github上下载并安装vim插件,统一管理插件目录,方便快捷。例如,在.vimrc中有:
Bundle ‘scrooloose/nerdtree.git’
然后打开vim,输入:BundleInstall
即会在.vimrc中找出没有安装的插件安装起来。另外BundleUpdate可以更新插件(如果不是最新),BundleClean,BundleList等等命令自行百度。
插件安装:
我总共安装了一下几种插件:
其中需要预装这些东西:exuberant ctags(for taglist),cmake(for YCM)Bundle 'gmarik/vundle' Bundle 'Lokaltog/vim-powerline' Bundle 'scrooloose/nerdtree.git' Bundle 'altercation/vim-colors-solarized' Bundle 'taglist.vim' Bundle "scrooloose/nerdcommenter" Bundle 'Valloric/YouCompleteMe' Bundle 'scrooloose/syntastic'
sudo apt-get install cmake sudo apt-get install exuberant-ctags
预装完成,并且.vimrc用了我在github上的那份:
curl https://raw.githubusercontent.com/ThanrayTian/dotfiles/.vimrc >~/.vimrc mkdir -p $HOME/.vim/bundle git clone https://github.com/gmarik/vundle.git <span class="pl-smi">$HOME</span>/.vim/bundle/vundle
打开vim,输入:BundleInstall安装,其中YCM会安装很久需要耐心等待。
关于YCM还有一些后续要做,首先完成c系语言的语法检查和补全编译器clang(好像比gcc,g++好)的安装:
其次,需要修改ycm的配置文件:cd ~/.vim/bundle/YouCompleteMe ./install.sh --clang-completer
~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py
具体参照我的github,直接用我的也好:
curl https://raw.githubusercontent.com/ThanrayTian/dotfiles/.ycm_extra_conf.py >~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py
其中还有一份关于各个配置内容的说明文档ycm_conf_readme,一般将这个文件复制一份到~/目录:
cp ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py ~/.ycm_extra_conf.py
并且在复制一份到每个项目文件夹中,根据项目所用到的语言等修改配置。
最终效果: