Giter Site home page Giter Site logo

.vim's Introduction

zhhp's Vim configuration

cd ~
git clone https://github.com/zhhp1001/.vim.git

vim plugin

Dependency

Vim-plug

curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

Nodejs

Use NVM to manage node version https://github.com/nvm-sh/nvm#installing-and-updating

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
source ~/.bashrc
nvm install node # "node" is an alias for the latest version

Install plug

$ vim		#open vim
$ :PlugInstall # install plugs

Theme

uncomment this line in vimrc (and comment the light version line) for dark version "set background=dark

clangd (for C/C++)

https://clangd.llvm.org/installation.html

sudo apt install clangd

coc-clangd

in vim, run :CocInstall coc-clangd

coc-clangd will try to find clangd from your $PATH, if not found, you can run :CocCommand clangd.install to install the latest release from GitHub

https://github.com/clangd/coc-clangd

bear make generate complie_commands.json

sudo apt install bear

Use bear make instead of make

The output file called compile_commands.json is saved in the current directory.

coc-nvim will use this file to navigate source code.

For cmake projects, add set(CMAKE_EXPORT_COMPILE_COMMANDS ON) in CMakeList.txt generate the compile_commands.json file into the current directory. For non-cmake projects, Bear generates the JSON file during the build process.

https://github.com/rizsotto/Bear

Install ctags to support LeaderF

sudo apt install ctags

Plug-in Usage

Basic

  • jj equivalent to ESC

  • Tab for completion

  • Enter to choose completion item

  • gd to jump to definition

  • gr for references

  • gy for type definition

  • Ctrl + o return to prev page

  • K for documentation

  • \rn for renaming

  • Diagnostics:

    • [g and ]g to go prev/next in diagnostics
  • Ctrl + n open directory tree

Fuzzy Search

:LeaderfFile search files in current directory

:LeaderfBuffer search current buffer

:LeaderfMru search most recently used files

:LeaderfLine search some word in current file

:LeaderfFunction search function in current file

Comment

\cc comment current line

\cu uncomment

\ca change comment style (// and /**/)

https://github.com/preservim/nerdcommenter

Big Word

sudo apt install figlet

Add this line to vimrc

noremap tx :r !figlet

Press tx and enter your text tx Hello

 _   _      _ _
| | | | ___| | | ___
| |_| |/ _ \ | |/ _ \
|  _  |  __/ | | (_) |
|_| |_|\___|_|_|\___/

Reference

https://zhuanlan.zhihu.com/p/145793963

.vim's People

Contributors

zhhp1001 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.