@weakiwi
2016-09-09T01:28:34.000000Z
字数 2657
阅读 1314
折腾
最近阿里云卡得我鬼火起,差点一时冲动买了小主机。突然想起安卓上的termux,据说linux大部分的特性都有了
。于是就有了此文。
首先不特别建议使用清华源,一个是我教育网内每次apt update容易走ipv6,然后无论装什么都是unable locate,直接用官方源就好了。
首先就是折腾ssh,因为termux不支持用户登陆,所以只能用密钥登陆。首先apt install openssh安装ssh服务端,接着用ssh-keygen生成密钥,我是一路enter所以产生的id_rsa.pub在/data/data/com.termux/files/home下面。直接用es文件浏览器考到sd卡根目录,拖到电脑上。用putty-keygen,选择“载入”,选择所有文件,然后选择id_ras,生成.ppk文件。以后登陆选上这个就好了。p.s:登陆时无须输入用户名
然后是折腾oh-my-zsh。首先先把curl、git等基础软件安装上。参考这个,除了修改source.list部分,其他一步步执行就好了。
oh-my-zsh最大的爽点就是各种插件和主题啊,我现在暂时用着dst主题。直接vim $HOME/.zshrc然后搜索theme修改为dst就好了。按照为什么说 zsh 是 shell 中的极品这篇文章配置好自动补全和高亮的插件,source完然后重启就好了
最后折腾vim,首先执行$ git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim。重要的一点是使用$HOME而非root,后面vimrc的配置文件也这么改就好了。最后贴上我的vim配置文件。
if v:lang =~ "utf8$" || v:lang =~ "UTF-8$"set fileencodings=ucs-bom,utf-8,latin1endifset nocompatiblefiletype offset rtp+=bundle/Vundle.vimcall vundle#begin()Plugin 'VundleVim/Vundle.vim'map <F5> I// <ESC>map <F11> ^xxset ts=4set autoindentset smartindentset showmatchset expandtabset nu!set nocompatible " Use Vim defaults (much better!)set bs=indent,eol,start " allow backspacing over everything in insert mode"set ai " always set autoindenting on"set backup " keep a backup fileset viminfo='20,\"50 " read/write a .viminfo file, don't store more" than 50 lines of registersset history=50 " keep 50 lines of command line historyset ruler " show the cursor position all the time" Only do this part when compiled with support for autocommandsif has("autocmd")augroup redhatautocmd!" In text files, always limit the width of text to 78 characters" autocmd BufRead *.txt set tw=78" When editing a file, always jump to the last cursor positionautocmd BufReadPost *\ if line("'\"") > 0 && line ("'\"") <= line("$") |\ exe "normal! g'\"" |\ endif" don't write swapfile on most commonly used directories for NFS mounts or USB sticksautocmd BufNewFile,BufReadPre /media/*,/run/media/*,/mnt/* set directory=~/tmp,/var/tmp,/tmp" start with spec file templateautocmd BufNewFile *.spec 0r /usr/share/vim/vimfiles/template.specaugroup ENDendifif has("cscope") && filereadable("/usr/bin/cscope")set csprg=/usr/bin/cscopeset csto=0set cstset csto=0set cstset nocsverb" add any database in current directoryif filereadable("cscope.out")cs add $PWD/cscope.out" else add database pointed to by environmentelseif $CSCOPE_DB != ""cs add $CSCOPE_DBendifset csverbendif" Switch syntax highlighting on, when the terminal has colors" Also switch on highlighting the last used search pattern.if &t_Co > 2 || has("gui_running")syntax onset hlsearchendiffiletype plugin onif &term=="xterm"set t_Co=8set t_Sb=^[[4%dmset t_Sf=^[[3%dmendif" Don't wake up system with blinking cursor:" http://www.linuxpowertop.org/known.phplet &guicursor = &guicursor . ",a:blinkon0"Plugin 'wakatime/vim-wakatime'Bundle 'Shougo/vimproc'Bundle 'Shougo/unite.vim'Bundle 'm2mdas/phpcomplete-extended'
基本是从centos的配置改过来的,记得装vunlde