[关闭]
@weakiwi 2016-09-09T01:28:34.000000Z 字数 2657 阅读 1314

termux初步折腾

折腾


最近阿里云卡得我鬼火起,差点一时冲动买了小主机。突然想起安卓上的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配置文件。

  1. if v:lang =~ "utf8$" || v:lang =~ "UTF-8$"
  2. set fileencodings=ucs-bom,utf-8,latin1
  3. endif
  4. set nocompatible
  5. filetype off
  6. set rtp+=bundle/Vundle.vim
  7. call vundle#begin()
  8. Plugin 'VundleVim/Vundle.vim'
  9. map <F5> I// <ESC>
  10. map <F11> ^xx
  11. set ts=4
  12. set autoindent
  13. set smartindent
  14. set showmatch
  15. set expandtab
  16. set nu!
  17. set nocompatible " Use Vim defaults (much better!)
  18. set bs=indent,eol,start " allow backspacing over everything in insert mode
  19. "set ai " always set autoindenting on
  20. "set backup " keep a backup file
  21. set viminfo='20,\"50 " read/write a .viminfo file, don't store more
  22. " than 50 lines of registers
  23. set history=50 " keep 50 lines of command line history
  24. set ruler " show the cursor position all the time
  25. " Only do this part when compiled with support for autocommands
  26. if has("autocmd")
  27. augroup redhat
  28. autocmd!
  29. " In text files, always limit the width of text to 78 characters
  30. " autocmd BufRead *.txt set tw=78
  31. " When editing a file, always jump to the last cursor position
  32. autocmd BufReadPost *
  33. \ if line("'\"") > 0 && line ("'\"") <= line("$") |
  34. \ exe "normal! g'\"" |
  35. \ endif
  36. " don't write swapfile on most commonly used directories for NFS mounts or USB sticks
  37. autocmd BufNewFile,BufReadPre /media/*,/run/media/*,/mnt/* set directory=~/tmp,/var/tmp,/tmp
  38. " start with spec file template
  39. autocmd BufNewFile *.spec 0r /usr/share/vim/vimfiles/template.spec
  40. augroup END
  41. endif
  42. if has("cscope") && filereadable("/usr/bin/cscope")
  43. set csprg=/usr/bin/cscope
  44. set csto=0
  45. set cst
  46. set csto=0
  47. set cst
  48. set nocsverb
  49. " add any database in current directory
  50. if filereadable("cscope.out")
  51. cs add $PWD/cscope.out
  52. " else add database pointed to by environment
  53. elseif $CSCOPE_DB != ""
  54. cs add $CSCOPE_DB
  55. endif
  56. set csverb
  57. endif
  58. " Switch syntax highlighting on, when the terminal has colors
  59. " Also switch on highlighting the last used search pattern.
  60. if &t_Co > 2 || has("gui_running")
  61. syntax on
  62. set hlsearch
  63. endif
  64. filetype plugin on
  65. if &term=="xterm"
  66. set t_Co=8
  67. set t_Sb=^[[4%dm
  68. set t_Sf=^[[3%dm
  69. endif
  70. " Don't wake up system with blinking cursor:
  71. " http://www.linuxpowertop.org/known.php
  72. let &guicursor = &guicursor . ",a:blinkon0"
  73. Plugin 'wakatime/vim-wakatime'
  74. Bundle 'Shougo/vimproc'
  75. Bundle 'Shougo/unite.vim'
  76. Bundle 'm2mdas/phpcomplete-extended'

基本是从centos的配置改过来的,记得装vunlde

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注