yishan.io
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Neovim

Installation et Configuration Neovim

sudo apt install neovim

mkdir .config

touch .config/init.vim

  1. Configuration de base init.vim
:set number
:set relativenumber
:set autoindent
:set tabstop=4
:set shiftwidth=4
:set smarttab
:set softtabstop=4
:set mouse=a
:set encoding=utf-8
:set fileencoding=utf-8
  1. Ajout des plugins via Plug

    a. Téléchargement de Plug

    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'

    b. Ajout des plugins dans init.vim

    call plug#begin()
    
    Plug 'https://github.com/vim-airline/vim-airline'
    Plug 'https://github.com/preservim/nerdtree'
    Plug 'http://github.com/tpope/vim-surround'
    Plug 'https://github.com/rafi/awesome-vim-colorschemes'
    Plug 'https://github.com/neoclide/coc.nvim'
    Plug 'https://github.com/ryanoasis/vim-devicons'
    Plug 'https://github.com/tc50cal/vim-terminal'
    Plug 'https://github.com/preservim/tagbar'
    Plug 'https://github.com/terryma/vim-multiple-cursors'
    
    call plug#end()
    

    c. Installer les plugins

    :PlugInstall

    d. Dépendances, Configuration

    tagbar

    sudo apt install exuberant-ctags

    " Tagbar
    nmap <F8> :TagbarToggle<CR>
    :set completeopt=preview
    

    Colorsheme

    :colorscheme jellybeans
    

    NerdTree

    " NerdTree
    let g:NERDTreeDirArrowExpandable="+"
    let g:NERDTreeDirArrowCollapsible="~"
    nnoremap <C-f> :NERDTreeFocus<CR>
    nnoremap <C-n> :NERDTree<CR>
    nnoremap <C-t> :NERDTreeToggle<CR>
    

    coc-nvim

    curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -

    sudo apt install nodejs npm

    cd /home/cmassieu/.local/share/nvim/plugged/coc.nvim

    sudo npm install -g yarn

    yarn install

    yarn build

  2. Installation des modules coc selon les langages utilisées

    Ex :

    :CocInstall coc-python