我的Ubuntu工作环境配置

(一)安装Ubuntu+Win7双系统


(二)Ubuntu工作环境的配置

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 软件包,即可直接安装搜狗输入法。


需要预装: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等等命令自行百度。


插件安装:

我总共安装了一下几种插件:

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'

其中需要预装这些东西:exuberant ctags(for taglist),cmake(for YCM)

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++好)的安装:

cd ~/.vim/bundle/YouCompleteMe
./install.sh --clang-completer
其次,需要修改ycm的配置文件:

~/.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

并且在复制一份到每个项目文件夹中,根据项目所用到的语言等修改配置。

最终效果:

 

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值