




版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
【移動應用開發(fā)技術】如何在Android手機上配置Python環(huán)境
/upload/information/20210522/379/524368.jpg一、Termux安裝與配置1.系統(tǒng)要求2.Termux安裝/repo/com.termux_106.apk/repo/com.termux.styling_29.apk3.Termux基本操作4.修改軟件源sed
-i
's@^\(deb.*stable
main\)$@#\1\ndeb
/termux/termux-packages-24
stable
main@'
$PREFIX/etc/apt/sources.list
sed
-i
's@^\(deb.*games
stable\)$@#\1\ndeb
/termux/game-packages-24
games
stable@'
$PREFIX/etc/apt/sources.list.d/game.list
sed
-i
's@^\(deb.*science
stable\)$@#\1\ndeb
/termux/science-packages-24
science
stable@'
$PREFIX/etc/apt/sources.list.d/science.list
apt
update
&&
apt
upgrade5.安裝基本組件pkg
install
-y
zsh
curl
wget
build-essential
pkg
install
-y
git
python
nodejs-lts
perl
ipython
pkg
install
-y
neovim
lazygit
ranger
fzf二、終端配置1.Shell配置安裝oh-my-zshsh
-c
"$(curl
-fsSL
/ohmyzsh/ohmyzsh/master/tools/install.sh)"git
clone
/zsh-users/zsh-autosuggestions
${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-autosuggestionsplugins=(
git
python
colorize
zsh-interactive-cd
zsh-navigation-tools
zsh-autosuggestions
)2.主題美化2.1配色與字體2.2主題配置安裝git
clone
--depth=1
/romkatv/powerlevel10k.git
${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k配置3.啟用vi模式(可選)/upload/information/20210522/379/524371.png#
Better
searching
in
command
mode
bindkey
-M
vicmd
'?'
history-incremental-search-backward
bindkey
-M
vicmd
'/'
history-incremental-search-forward
#
Beginning
search
with
arrow
keys
bindkey
"\033[1~"
beginning-of-line
bindkey
"\033[4~"
end-of-line
bindkey
'^[[3~'
delete-char
bindkey
"^[OA"
up-line-or-beginning-search
bindkey
"^[OB"
down-line-or-beginning-search
bindkey
-M
vicmd
"k"
up-line-or-beginning-search
bindkey
-M
vicmd
"j"
down-line-or-beginning-search三、Python包安裝與配置1.安裝環(huán)境配置#
配置pypi源
pip
install
pip
-U
pip
config
set
global.index-url
/simple
#
依賴項
pip
install
wheel
pip
install
setuptools
--upgrade2Python包安裝安裝numpy和scipy#
添加第三方倉庫
curl
-LO
https://its-pointless.github.io/setup-pointless-repo.sh
bash
setup-pointless-repo.sh
#
從倉庫安裝numpy
scipy
pkg
install
-y
numpy
scipy安裝lxml#
安裝lxml的依賴項
pkg
install
-y
libxml2
libxslt
#
安裝lxml
pip
install
lxml安裝pillow#
安裝pillow的依賴項
pkg
install
-y
libjpeg-turbo
libtiff
pkg
install
-y
littlecms
tk
libwebp
libsodium
#
安裝pillow
pip
install
pillow安裝matplotlib#
安裝matplotlib的依賴項
pkg
install
-y
freetype
libpng
pip
install
kiwisolver
cycler
pip
install
pyparsing
python-dateutil
#
安裝matplotlib
pip
install
matplotlib安裝pandas#
安裝pandas的依賴項
pip
install
-y
pytz
cython
#
安裝pandas
export
CFLAGS="-Wno-deprecated-declarations
-Wno-unreachable-code"
pip
install
pandas安裝jupyter#
安裝jupyter依賴項
pkg
install
-y
libzmq
libcrypt
pkg-config
#
安裝jupyter
pip
install
jupyter/upload/information/20210522/379/524374.png四、IPython和NeoVim配置1.IPython配置#
安裝yapf
pip
install
yapf
#
安裝Pygments
pip
install
pygments
#
安裝ipython
pip
install
ipython創(chuàng)建配置文件修改配置文件#
配置終端顏色
c.InteractiveShell.colors
=
'Linux'
c.TerminalInteractiveShell.autoformatter
=
'yapf'
#
配置高亮方案,可通過pygmentize
-L
styles瀏覽所有可選配置
c.TerminalInteractiveShell.highlight_style
=
'monokai'
#
配置魔術命令%editor使用的編輯器
c.TerminalInteractiveShell.editor
=
'nvim'2.NeoVim配置pip
install
pynvim創(chuàng)建init.vim文件進行基本配置"
一般設置
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="
"使用vim-plug安裝NeoVim插件curl
-fLo
~/.config/nvim/autoload/plug.vim
--create-dirs
\
/junegunn/vim-plug/master/plug.vim"
vim-plug插件管理
call
plug#begin('~/.config/nvim/plugged')
Plug
'junegunn/vim-plug'
call
plug#end()常用插件及設置call
plug#begin('~/.config/nvim/plugged')
Plug
'junegunn/vim-plug'
"
git支持
Plug
'tpope/vim-fugitive'
"
Python自動縮進插件
Plug
'vim-scripts/indentpython.vim'
"
項目管理工具
Plug
'mhinz/vim-startify'
"
快速對齊插件
Plug
'junegunn/vim-easy-align'
"
當前光標下的單詞增加下劃線
Plug
'itchyny/vim-cursorword'
"
快速選擇插件
Plug
'tpope/vim-surround'
"
自定義代碼片斷
Plug
'honza/vim-snippets'
"
語法高亮支持
Plug
'sheerun/vim-polyglot'
"
主題、狀態(tài)欄設置
Plug
'haishanh/night-owl.vim'
Plug
'vim-airline/vim-airline'
Plug
'vim-airline/vim-airline-themes'
Plug
'ryanoasis/vim-devicons'
"
coc擴展
Plug
'neoclide/coc.nvim',
{'branch':
'release'}
"
fzf模糊查找
Plug
'junegunn/fzf',
{
'dir':
'~/.fzf',
'do':
'./install
--all'
}
Plug
'junegunn/fzf.vim'
"
whichkey快捷菜單
Plug
'liuchengxu/vim-which-key
"
浮動窗口支持
Plug
'voldikss/vim-floaterm'
"
ranger文件管理器支持
Plug
'kevinhwang91/rnvimr'
call
plug#end()
"
啟用標簽欄
let
g:airline#extensions#tabline#enabled
=
1
"
支持圖標字體
let
g:airline_powerline_fonts
=
1
"
設置狀態(tài)欄主題
let
g:airline_theme='night_owl'
"
設置主題
set
termguicolors
let
&t_8f
=
"\<Esc>[38;2;%lu;%lu;%lum"
let
&t_8b
=
"\<Esc>[48;2;%lu;%lu;%lum"
syntax
enable
colorscheme
night-owl/upload/information/20210522/379/524375.png安裝、配置coc.nvim擴展"
coc擴展
let
g:coc_global_extensions
=
[
\'coc-json',
\'coc-pyright',
\'coc-snippets',
\'coc-xml',
\'coc-explorer',
\'coc-prettier',
\'coc-highlight']
"
使用tab鍵進行補全選擇
inoremap
<silent><expr>
<TAB>
\
pumvisible()
?
"\<C-n>"
:
\
<SID>check_back_space()
?
"\<TAB>"
:
\
coc#refresh()
inoremap
<expr><S-TAB>
pumvisible()
?
"\<C-p>"
:
"\<C-h>"
function!
s:check_back_space()
abort
let
col
=
col('.')
-
1
return
!col
||
getline('.')[col
-
1]
=~#
'\s'
endfunction
"
使用回車進行補全選擇
inoremap
<silent><expr>
<cr>
pumvisible()
?
coc#_select_confirm()
\:
"\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
"
Highlight
the
symbol
and
its
references
when
holding
the
cursor.
autocmd
CursorHold
*
silent
call
CocActionAsync('highlight')
"
Add
`:Format`
command
to
format
current
buffer.
command!
-nargs=0
Format
:call
CocAction('format')
"
Add
`:Fold`
command
to
fold
current
buffer.
command!
-nargs=?
Fold
:call
CocAction('fold',
<f-args>)
"
Add
`:OR`
command
for
organize
imports
of
the
current
buffer.
command!
-nargs=0
OR
:call
CocAction('runCommand',
'anizeImport')
"
添加狀態(tài)欄顯示支持
set
statusline^=%{coc#status()}%{get(b:,'coc_current_function','')}
"
啟用Prettier進行文件自動格式化
command!
-nargs=0
Prettier
:CocCommand
prettier.formatFile
let
g:prettier#autoformat
=
1
"
設置Coc
Search
nnoremap
<leader>?
:CocSearch
<C-R>=expand("<cword>")<CR><CR>{
"python.defaultInterpreterPath":
"/data/data/com.termux/files/usr/bin/python",
"python.pythonPath":
"/data/data/com.termux/files/usr/bin/python",
"python.linting.pylintEnable":true,
"vider":
"yapf",
"python.formatting.yapfArgs":
[
"--style",
"{SPACES_AROUND_POWER_OPERATOR:
True,
SPACES_BEFORE_COMMENT:
1}"
],
"explorer.width":
38,
"explorer.quitOnOpen":
true,
"explorer.sources":
[
{
"name":
"buffer",
"expand":
false
},
{
"name":
"file",
"expand":
true
}
],
"explorer.file.column.indent.indentLine":
true,
"explorer.file.showHiddenFiles":
true,
"explorer.icon.enableNerdfont":
true,
"explorer.keyMappingMode":
"none",
"explorer.buffer.showHiddenBuffers":
false,
"explorer.keyMappings.global":
{
"o":
["wait",
"expanded?",
"collapse",
"expand"],
"<cr>":
["wait",
"expandable?",
"cd",
"open"],
"?":
"help",
"q":
"quit"
},
"coc.preferences.formatOnSaveFiletypes":
["*"],
"prettier.printWidth":
100,
"prettier.eslintIntegration":
true,
"prettier.disableLanguages":
[],
"prettier.formatterPriority":
1,
"prettier.useTabs":
true,
"prettier.trailingComma":
"all",
"prettier.singleQuote":
false,
"prettier.tabWidth":
4
}配置vim-which-key"
將空格設置為whichkeyleader鍵
nnoremap
<silent>
<leader>
:WhichKey
'<Space>'<CR>
"
whichkey基本配置
let
g:which_key_timeout
=
100
let
g:which_key_display_names
=
{'<CR>':
'↵',
'<TAB>':
'?'}
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時隱藏狀態(tài)欄
autocmd!
FileType
which_key
autocmd
FileType
which_key
set
laststatus=0
noshowmode
noruler
\|
autocmd
BufLeave
<buffer>
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']
=
[
'<Plug>(coc-fix-current)'
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
- 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 特價房買賣合同模板
- 會議音響租賃合同
- 食品供應鏈服務合同范文
- 搪瓷化工容器的安全標準考核試卷
- 戶外帳篷批發(fā)考核試卷
- 助動車行車記錄儀使用與維護考核試卷
- 摩托車ABS系統(tǒng)傳感器檢測考核試卷
- 工業(yè)機器人的智能電源管理考核試卷
- 體育運動心理承受能力測試考核試卷
- 家裝整裝合同范本
- v建筑主墩雙壁鋼圍堰施工工藝資料
- 人教版新課標小學美術二年級下冊全冊教案
- 病歷書寫基本規(guī)范及相關法律解析
- 我國互聯(lián)網公司資本結構分析-以新浪公司為例
- 【藍天幼兒園小一班早期閱讀現(xiàn)狀的調查報告(含問卷)7800字(論文)】
- 2023年全國職業(yè)院校技能大賽賽項-ZZ005 裝配式建筑構件安裝賽項模塊一理論賽題
- 第二次全國土地調查技術規(guī)程完整版
- 客戶答謝活動承包合同
- AQ/T 5201-2007 涂裝工程安全設施驗收規(guī)范(正式版)
- 華南師范大學333教育綜合專業(yè)碩士歷年考研真題匯編(含部分答案)合集
- 食管早癌的內鏡診斷
評論
0/150
提交評論