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部分,其他一步步执行就好了。
同时推荐一下tmux,用好了实在太爽,反正占用的资源也不多,建议安装上去。我一边用tmux两分屏,然后上屏写django,下屏显示服务器状态,不要太爽。tmux的配置文件我用是tony/tmux-config,可惜不能用鼠标选择pane。
oh-my-zsh最大的爽点就是各种插件和主题啊,我现在暂时用着dst主题。直接vim $HOME/.zshrc然后搜索theme修改为dst就好了。按照为什么说 zsh 是 shell 中的极品这篇文章配置好自动补全和高亮的插件,source完然后重启就好了。最后还是转投了fish,因为有时候zsh的速度实在太慢,而同时fish却还能接受。不过需要注意的一点是,因为fish不兼容bash,所以需要给vim配置文件设置指定的执行终端。
最后折腾vim,首先执行$ git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim。重要的一点是使用$HOME而非root,后面vimrc的配置文件也这么改就好了。最后贴上我的vim配置文件。

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

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