User Tools

Site Tools


public:computer:neovim

This is an old revision of the document!


Neovim (nvim)

Preparing

  • 설치
    # Ubuntu (debian 계열)
    $ sudo apt-get install software-properties-common    # apt repository 관리 툴 제공하는 software-properties-common 설치
    
    $ sudo add-apt-repository ppa:neovim-ppa/stable  # repository 추가
    $ sudo apt-get update  # update
    $ sudo apt-get install neovim  # neovim 설치
    
    # macos
    $ brew install nvim
    
    # windows
    > choco install neovim
    
    
  • 설정파일; ~/.config/nvim/init.vim @linux, ~\AppData\Local\nvim\init.vim @Windows
    • init.vim에서 .vimrc 파일 참조
      set runtimepath^=~/.vim runtimepath+=~/.vim/after
      let &packpath = &runtimepath
      source ~/.vimrc
      
  • .bashrc, .zshrc alias vim=“nvim”

Plugins

  • vim-plug; plugin 사용
    # linux
    $ sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
           https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
    
    # 또는
    $ curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs \
        https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
        
    # windows
    > iwr -useb https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim |`
        ni "$(@($env:XDG_DATA_HOME, $env:LOCALAPPDATA)[$null -eq $env:XDG_DATA_HOME])/nvim-data/site/autoload/plug.vim" -Force
    
  • NERDTree; tree 구조 ''Plug 'preservim/nerdtree' ''
  • Tagbar; 현재 버퍼의 class, struct, prototype, typedef, macro 등 요약. ''Plug 'preservim/tagbar' ''
  • vim-airline; 버퍼 정보 상세 표시 ''Plug 'vim-airline/vim-airline' ''
  • ctrlp; 파일 탐색기
  • CoC(Conquer of Completion); 자동완성(auto completion) intellisense, LSP(Language Server Protocol) 지원.
    1. node.js 설치
      $ curl -sL install-node.now.sh/lts | sudo $SHELL
      
      # yarn 설치
      $ curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
      $ echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
      $ sudo apt-get update && sudo apt-get install yarn
      
      
    2. vim-plug 등록 Plug 'neoclide/coc.nvim', {'branch': 'release'}
  • LSP(Language Server Protocol); :CocIntsall <LSP 서버명> Conquer of Completion @github.com CoC Language Servers @github.com
  • nvim-treesitter; syntax highlight Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}

References

public/computer/neovim.1672620992.txt.gz · Last modified: by alex