Neovim-ni Coc bilan VSCode kabi sozlaymiz

komildeveloper, neovim
Back

neovim


Step by step

ESLATMA: coc.nvim TypeScript-da yozilgan va Node.js bilan ishlaydi

Requirements

Install Nodejs

Nodejs-ni o'rnatish uchun link


Step 1

coc.nvim pluginini o'rnatish uchun quyidagi pluginni plugins.vim qo'shib qo'yamiz

" LSP
" Use release branch (recommend)
Plug 'neoclide/coc.nvim', {'branch': 'release'}

" Or build from source code by using yarn: https://yarnpkg.com
Plug 'neoclide/coc.nvim', {'branch': 'master', 'do': 'yarn install --frozen-lockfile'}

Yarn orqali o'rnatish uchun

Arch Linux
npm i -g yarn

Ubuntu
sudo npm i -g yarn

Reload nvim & :PlugInstall

Step 2

coc.nvim uchun config folder va fayl yaratamiz

mkdir ~/.config/nvim/plug-config
touch ~/.config/nvim/plug-config/coc.vim

coc.nvim config link - coc.vim fayliga qo'shib qo'yamiz

Va quyidagi manbani init.vim fayliga qo'shib qo'yamiz

source $HOME/.config/nvim/plug-config/coc.vim

Step 3

Coc.nvim bilan Neovim-ga extension o'rnatamiz

:CocInstall coc-json coc-tsserver coc-vimlsp

Coc extensions link

LSP uchun config va boshqalar Coc LSP link

Coc Commands

O'rnatilgan extension commandalari :CocList commands

Extension-ni o'rnatish :CocInstall coc-css

Extension-ni o'chirish :CocUninstall coc-css

O'rnatilgan extension-lar ro'yaxatini olish :CocList extensions

Step 4

:CocConfig sizga coc-settings.json faylini yaratib beradi Quyidagilarni coc-settings.json fayliga qo'shib qo'yamiz

{
  "coc.preferences.formatOnSaveFiletypes": ["css", "markdown", "javascript", "graphql", "html", "yaml",  "json", "python"]
}

Coc-Nvim Github Repo

© Komil Developer.