neovim installation and configuration under win10


neovim installation and configuration under win10

Install

github installation package address

Under Windows Pre-built archives

  • Click nvim-win64.zip to download
  • Unzip the installation package and put it into a suitable file, such as D:\Editorin
  • double clicknvim-qt.exe

Follow-up

  • Add environment variables to the folder where it is locatedD:\Editor\Neovim\bin
  • C:/Users/foo/AppData/Local/nvim/siteCreate the spell folder in , open nvim-qt.exe, enter:set spell
  • C:\Users\16590\AppData\Local\nvimCreate a file in init.vim, which is equivalent to the vimrc file in vim.
  • If you have plugins written in Python in your neovim, install the neovimPython module. method, console input pip install neovim, added to neovim's init.vim
let g:python3_host_prog='C:/Users/foo/Envs/neovim3/Scripts/python.exe'
let g:python_host_prog='C:/Users/foo/Envs/neovim/Scripts/python.exe'

Plugin management vim-plug

  • The first method is to directly copy the code of plug.vim in this link. C:\Users\16590\AppData\Local\nvim\autoloadIf there is no such folder, create an autoload folder by yourself, create plug.vim, and paste the code.
  • Method 2, under the console$ curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

Next is the usage of vim-plug. By the way, the reason for using vim-plug is that it supports asynchronous and faster download management.

Write in init.vim

call plug#begin('D:\Editor\Neovim\share\nvim\plugged')

"状态栏的例子
Plug 'bling/vim-airline'
Plug 'vim-airline/vim-airline-themes'

call plug#end()

"关于状态栏的小配置
"Powerline setting
let g:airline_theme='molokai'
let g:airline_powerline_fonts = 1

Generally, first write Plug 'xxx' to save, open nvim-qt.exe, run and :PlugInstallinstall the plug-in, and then write let g:xxx (the statement corresponding to the plug-in)

more configuration

Refer to the configuration uploaded by my github

other settings

"设置默认文件位于
cd D:\Code\VimCode

vmap <c-c> "+y
map <c-v> "+p

set nu  " Set the line number
set relativenumber
syntax on  " Syntax highlighting
"set autochdir  " Set the current dir as thr work dir
filetype on  " File type detection
filetype plugin on  " Loading the plugin files for specific file types
filetype indent on  " Loading the indent file for specific file types with

" Tab and Indent
set tabstop=4
set softtabstop=4
set shiftwidth=4
set smarttab
"set expandtab  " Use the space to instead of tab
set autoindent  " Copy indent from current line when starting a new line
set smartindent
set cindent

" Seach and Match
set hlsearch  " Highlight the search result
set incsearch  " Real-time search
set ignorecase
set smartcase
set showmatch  " When a bracket is inserted, briefly jump to the matching one

" 设置编码  
set encoding=utf-8  
set nocompatible
set laststatus=2
" 设置文件编码  
set fenc=utf-8
"set to use clipboard of system
set clipboard=unnamed
" 设置文件编码检测类型及支持格式  
set fencs=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936  

" set 折叠
set foldmethod=indent
" 打开文件默认不折叠
set foldlevelstart=99

"set my leader
let mapleader="\<Space>"
let g:mapleader="\<Space>"

" 定义快捷键关闭当前分割窗口
nmap <Leader>q :q<CR>
" 定义快捷键保存当前窗口内容
nmap <Leader>w :w<CR>
" 定义快捷键保存所有窗口内容并退出 vim
nmap <Leader>WQ :wa<CR>:q<CR>
" 不做任何保存,直接退出 vim
nmap <Leader>Q :qa!<CR>

Reference link

From Vim to NeoVim

Install and configure Neovim - configure

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324395646&siteId=291194637