前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Ubuntu开发环境配置

Ubuntu开发环境配置

作者头像
yuxiaofei93
发布2018-09-11 16:33:40
2.1K0
发布2018-09-11 16:33:40
举报
文章被收录于专栏:于晓飞的专栏于晓飞的专栏

每次电脑切换都需要重新装一次系统,重新装系统后还需要安装各种各样的工具。如果每次都到网络上搜索工具的安装方法,就要浪费一大笔时间。这里把我常用的工具的安装方法分享出来。

Shell

zsh & oh-my-zsh

配置oh-my-zsh之前要先安装Git

sudo apt-get install zsh
sudo apt-get install git
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh

之前记得切换shell使用 chsh 命令。但是最近版本的ubuntu总是需要输入一个密码,然后出一个错误,没有查出如何解决这个问题

chsh: PAM: Authentication failure

所以,这里使用了一种比较暴力的解决办法,直接修改用户的配置。

sudo vim /etc/passwd/

找到自己的用户名,把shell对应的一列该成自己需要的shell。 查看机器上shell路径的办法:

cat /etc/shells

Guake

sudo apt-get install guake

vim

sudo apt-get install vim-gnome

vundle

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

Colors:

git clone https://github.com/tomasr/molokai ~/molokai
cp molokai/colors/molokai.vim ~/.vim/colors/
sudo rm -r ~/molokai #  复制出来就删除吧

Config:

" 配色
colorscheme molokai

set t_Co=256

"显示行号
set number

"制表符为4
set tabstop=4

"软制表符为4
set softtabstop=4

"缩进空格数为4
set shiftwidth=4

" 设置自动缩进,即每一行与上一行的缩进相等
"set autoindent

set expandtab
%ret! 4

"设置C/C++语言的自动缩进
set cindent

"""""""""""""""""""""""""""""""""""
" Tag list ctags
""""""""""""""""""""""""""""""""""
map <C-F12> :!ctags -R --c++-kinds=+p --fields=+ias --extra=+q .<CR>

nnoremap <silent> <F8> :TlistToggle<CR>
let Tlist_Show_One_File = 1
let Tlist_exit_onlyWindow = 1
let Tlist_Use_Right_Window = 1 
"""""""""""""""""""""""""""""""""

"""""""""""""""""""""""""""""""""""
"               NERDTree
"""""""""""""""""""""""""""""""""""
nnoremap <silent> <F7> :NERDTree<CR>
"""""""""""""""""""""""""""""""""""


filetype on
filetype plugin on
filetype indent on
syntax on

"光标所在行高亮
set cursorline
hi CursorLine NONE term=underline ctermbg=234 guibg=#293739 


"git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
" vundle {
set rtp+=~/.vim/bundle/vundle/
" 如果在windows下使用的话,设置为
" set rtp+=$HOME/.vim/bundle/vundle/
call vundle#rc()
" }
"
" let Vundle manage Vundle
" required!
Bundle 'gmarik/vundle'

" My Bundles here:
"
" original repos on github
" github上的用户写的插件,使用这种用户名+repo名称的方式
" Bundle 'tpope/vim-fugitive'
" Bundle 'Lokaltog/vim-easymotion'
" Bundle 'rstacruz/sparkup', {'rtp': 'vim/'}
" Bundle 'tpope/vim-rails.git'
" vim-scripts repos

" vimscripts的repo使用下面的格式,直接是插件名称
Bundle 'taglist.vim'
Bundle 'c.vim'
Plugin 'scrooloose/nerdTree'

Plugin 'godlygeek/tabular'
Plugin 'plasticboy/vim-markdown'

" non github reposo
" 非github的插件,可以直接使用其git地址
" Bundle 'git://git.wincent.com/command-t.git'
" ...
  
"
" Brief help
" :BundleList          - list configured bundles
" :BundleInstall(!)    - install(update) bundles
" :BundleSearch(!) foo - search(or refresh cache first) for foo
" :BundleClean(!)      - confirm(or auto-approve) removal of unused bundles
" vundle主要就是上面这个四个命令,例如BundleInstall是全部重新安装,BundleInstall!则是更新
" 一般安装插件的流程为,先BundleSearch一个插件,然后在列表中选中,按i安装
" 安装完之后,在vimrc中,添加Bundle 'XXX',使得bundle能够加载,这个插件,同时如果
" 需要配置这个插件,也是在vimrc中设置即可
" see :h vundle for more details or wiki for FAQ
" NOTE: comments after Bundle command are not allowed..

" 关闭markdown的自动折叠
let g:vim_markdown_folding_disabled = 1

"文件类型关联
au BufNewFile,BufRead *.gradle setf groovy
au BufNewFile,BufRead *.md setf markdown

Shadowsocks

sudo add-apt-repository ppa:hzwhuang/ss-qt5
sudo apt-get update
sudo apt-get install shadowsocks-qt5

SwitchOmega

downloadurl : https://github.com/FelisCatus/SwitchyOmega/releases

jdk

sudo apt-add-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
export JAVA_HOME=/usr/lib/jvm/java-7-oracle

adb 32位环境

sudo apt-get install libc6-i386 lib32stdc++6 lib32gcc1 lib32ncurses5
sudo apt-get install lib32z1

python

sudo apt-get install python
sudo apt-get install python-pip
sudo apt-get install python-virtualenv
sudo apt-get install virtualenvwrapper

修改pip源(修改到豆瓣): 执行:

cat > ~/.pip/pip.conf

输入:

[global]
trusted-host =  pypi.douban.com
index-url = http://pypi.douban.com/simple 

Ctrl + D

sdkman

curl -s "https://get.sdkman.io" | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"

groovy

sdk install groovy # 依赖sdkman

gradle

sdk install gradle # 依赖sdkman

Android源码

从这里下载可以使用迅雷,绕开repo更新。速度给力,10M左右。 [https://mirrors.tuna.tsinghua.edu.cn/aosp-monthly]

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2016.10.19 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • Shell
    • zsh & oh-my-zsh
      • Guake
      • vim
        • vundle
          • Colors:
            • Config:
            • Shadowsocks
            • SwitchOmega
            • jdk
            • adb 32位环境
            • python
            • sdkman
              • groovy
                • gradle
                  • Android源码
                  领券
                  问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档