Ctrl + A -> 将光标移动到行首 Ctrl + E -> 将光标移动到行尾 Ctrl + C -> 中止当前进程 Ctrl + D -> 注销终端会话 Ctrl + K -> 从光标删除到行尾 Ctrl + U -> 从光标删除到行首 Ctrl + L -> 清除终端 Ctrl + Z -> 挂起(发送SIGTSTP到)当前进程
音量加 + E -> Esc键 音量加 + T -> Tab键 音量加 + 1 -> F1(音量增加 + 2 → F2…以此类推) 音量加 + 0 -> F10 音量加 + B -> Alt + B,使用readline时返回一个单词 音量加 + F -> Alt + F,使用readline时转发一个单词 音量加 + X -> Alt+X 音量加 + W -> 向上箭头键 音量加 + A -> 向左箭头键 音量加 + S -> 向下箭头键 音量加 + D -> 向右箭头键 音量加 + L -> | (管道字符) 音量加 + H -> 〜(波浪号字符) 音量加 + U -> _ (下划线字符) 音量加 + P -> 上一页 音量加 + N -> 下一页 音量加 + . -> Ctrl + \(SIGQUIT) 音量加 + V -> 显示音量控制 音量加 + Q -> 切换显示的功能键视 音量加 + K -> 切换显示的功能键视图
4. 修改软件源
安装完Termux后,使用如下命令自动替换官方源为清华镜像源:
sed -i 's@^\(deb.*stable main\)$@#\1\ndeb https://mirrors.tuna.tsinghua.edu.cn/termux/termux-packages-24 stable main@' $PREFIX/etc/apt/sources.list sed -i 's@^\(deb.*games stable\)$@#\1\ndeb https://mirrors.tuna.tsinghua.edu.cn/termux/game-packages-24 games stable@' $PREFIX/etc/apt/sources.list.d/game.list sed -i 's@^\(deb.*science stable\)$@#\1\ndeb https://mirrors.tuna.tsinghua.edu.cn/termux/science-packages-24 science stable@' $PREFIX/etc/apt/sources.list.d/science.list apt update && apt upgrade
" 一般设置 set nocompatible "关闭与vi的兼容模式 set number "显示行号 set nowrap "不自动折行 set showmatch "显示匹配的括号 set scrolloff=3 "距离顶部和底部3行" set encoding=utf-8 "编码 set fenc=utf-8 "编码 set fileencodings=utf-8 set hlsearch "搜索高亮 syntax on "语法高亮 set tabstop=4 "tab宽度 set shiftwidth=4 set smarttab set backspace=indent,eol,start set expandtab "tab替换为空格键 set fileformat=unix "保存文件格式 set splitbelow set cmdheight=2 set completeopt=longest,menu set splitright set foldmethod=indent set foldlevel=99 " 设置空格为leader键 let mapleader=" "
" whichkey基本配置 let g:which_key_timeout = 100 let g:which_key_display_names = {'': '↵', '': '⇆'} let g:which_key_map = {} let g:which_key_sep = '→' let g:which_key_use_floating_win = 0 let g:which_key_max_size = 0
" 呼出whichkey时隐藏状态栏 autocmd! FileType which_key autocmd FileType which_key set laststatus=0 noshowmode noruler \| autocmd BufLeave set laststatus=2 noshowmode ruler
" 自定义whichkey let g:which_key_map['?'] = 'search word' let g:which_key_map['/'] = [ ':call Comment()' , 'comment' ] let g:which_key_map['.'] = [ ':e $MYVIMRC' , 'open init' ] let g:which_key_map[';'] = [ ':Commands' , 'commands' ] let g:which_key_map['e'] = [ ':CocCommand explorer --toggle --sources=file+' , 'explorer' ] let g:which_key_map['n'] = [ ':let @/ = ""' , 'no highlight' ] let g:which_key_map['q'] = [ '(coc-fix-current)' , 'quickfix' ] let g:which_key_map['u'] = [ ':UndotreeToggle' , 'undo tree'] let g:which_key_map['t'] = [':FloatermNew --wintype=normal --height=6' , 'terminal'] let g:which_key_map['r'] = [ ':FloatermNew ranger' , 'ranger'] let g:which_key_map['f'] = [':FloatermNew fzf' , 'fzf'] let g:which_key_map['g'] = [':FloatermNew lazygit' , 'git'] let g:which_key_map['p'] = [':FloatermNew python' , 'python'] call which_key#register('', "g:which_key_map")
在NeoVim中运行Python脚本
可以通过在NeoVim中添加自定义功能,从而在编写时运行当前Python脚本。
"在普通模式下,按r来运行Python脚本 noremap r :call RunPython() func! RunPython() exec "w" if &filetype == 'python' exec "!time python %" endif endfunc