怎么用termux配置neovim
时间: 2023-11-14 17:06:25 浏览: 211
termux:Termux配置
以下是在Termux上配置Neovim的步骤:
1. 打开Termux并更新软件包:
```
apt update && apt upgrade
```
2. 安装Neovim:
```
apt install neovim
```
3. 打开Neovim并安装Vim插件管理器:
```
nvim
:curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
```
4. 配置Neovim:
在终端中输入以下命令以创建配置文件:
```
mkdir ~/.config/nvim
touch ~/.config/nvim/init.vim
```
打开文件并添加以下内容:
```
call plug#begin()
" 插件管理列表
Plug 'tpope/vim-fugitive'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'scrooloose/nerdtree'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'Lokaltog/powerline'
Plug 'vim-scripts/indentpython.vim'
Plug 'jiangmiao/auto-pairs'
Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'
Plug 'vim-scripts/ZoomWin'
Plug 'kien/ctrlp.vim'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-repeat'
Plug 'tpope/vim-sleuth'
Plug 'tpope/vim-abolish'
Plug 'posva/vim-vue'
Plug 'fatih/vim-go'
Plug 'pangloss/vim-javascript'
Plug 'mxw/vim-jsx'
Plug 'vim-python/python-syntax'
Plug 'nvie/vim-flake8'
Plug 'davidhalter/jedi-vim'
Plug 'scrooloose/nerdcommenter'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
call plug#end()
" 设置缩进
set tabstop=4
set shiftwidth=4
set expandtab
" 显示行号
set number
" 显示空格和制表符
set listchars=tab:>-,trail:·,extends:>,precedes:<
" 启用鼠标支持
set mouse=a
" 配置主题
set termguicolors
colorscheme molokai
" 启用NERDTree插件
map <C-n> :NERDTreeToggle<CR>
let NERDTreeShowHidden=1
" 启用Vim-Airline插件
set laststatus=2
set encoding=utf-8
let g:airline_powerline_fonts = 1
" 启用CtrlP插件
let g:ctrlp_map = '<c-p>'
let g:ctrlp_cmd = 'CtrlP'
let g:ctrlp_custom_ignore = '\v[\/]\.(git|hg|svn)$'
" 启用UltiSnips插件
let g:UltiSnipsExpandTrigger="<tab>"
let g:UltiSnipsJumpForwardTrigger="<c-b>"
let g:UltiSnipsJumpBackwardTrigger="<c-z>"
" 启用FZF插件
let g:fzf_layout = { 'window': { 'width': 0.9, 'height': 0.6 } }
" 在Python文件中启用Jedi自动补全
autocmd FileType python setlocal omnifunc=jedi#completions()
```
5. 安装插件:
在Neovim中输入以下命令以安装所有配置文件中列出的插件:
```
:PlugInstall
```
完成后,关闭并重新打开Neovim以应用更改。现在你可以开始在Termux上使用Neovim编辑器了。
阅读全文