/vimrc

Use vim as an IDE

Primary LanguageVim script

Description

Make vim as an IDE for C/C++, Python, Rust or other languages! You can use these features: autosync completer, debugger, colorscheme, file system explorer and so on!

Screenshot

alt text

Installation

First of all, you have to install vim-plug to use plugins. After installation, just run :PlugInstall command.

Languages

C/C++

Run :CocConfig command to create/open coc-settings.json file in ~/.vim.

Add this configuration to json file IF YOU ARE USING clangd:

{
"languageserver": {
    "clangd": {
      "command"      : "clangd",
      "args"         : ["--background-index"],
      "rootPatterns" : ["compile_flags.txt", "compile_commands.json", ".vim/", ".git/", ".hg/"],
      "filetypes"    : ["c", "cpp", "objc", "objcpp"]
    }
  }
}

Add this configuration to json file IF YOU ARE USING ccls:

{
 "languageserver": {
    "ccls": {
      "command"      : "ccls",
      "filetypes"    : ["c", "cpp", "objc", "objcpp"],
      "rootPatterns" : [".ccls", "compile_commands.json", ".vim/", ".git/", ".hg/"],
      "initializationOptions": {
         "cache": {
           "directory": "/tmp/ccls"
         }
       }
    }
  }
}

For more information, read these links: Install-coc, Language-servers, Using-the-configuration-file.

Python

Install python-language-server via pip:

$ pip install python-language-server 

And run this command in your vim:

:CocInstall coc-python 

Rust

:CocInstall coc-rls

Bash scripting

:CocInstall coc-sh

Plugins

Plugin Detail
coc Intellisense engine (full language server protocol support)
vimspector Debugger
NERDTree File system explorer
VimShell Accessing shell in vim
airline Status line
vim-one, onedark, srcery-vim Color scheme
asyncrun Run Async Shell Commands and Output to the Quickfix Window
auto-pair Insert or delete brackets, parens, quotes in pair
a.vim Alternate Files quickly (.c --> .h etc)
vim-devicons Adds file type icons to Vim plugins such as: NERDTree, vim-airline and so on
fzf.vim Fuzzy finder plugin
vim-markdown-preview A light Vim plugin for previewing markdown files in a browser
vim-gitgutter A Vim plugin which shows git diff markers in the sign column and stages/previews/undoes hunks and partial hunks
vim-fugitive A Git wrapper
vim-superman Read Unix manpages via VIM