Coder Social home page Coder Social logo

my-vimrc's Introduction

my-vimrc

中文文档

This repository stores my VIM configuration files. Usually, VIM is mainly used to write Golang, Python and Markdown.

At present, there are two branches. The master branch is the configuration of the old version of vim and is no longer maintained.

The vim-8 branch is the configuration currently being used on macOS with VIM 8.1.

VIM Version

VIM - Vi IMproved 8.1 (2018 May 18, compiled Oct 15 2019 10:20:59)
macOS version

Features

  • Automatically detect and install the vim-plug plugins Manager
  • Correct analysis of Chinese without disorder
  • Cancel backup, do not generate swap file automatically
  • The status bar is beautiful and informative with airline
  • Automatic loading takes effect immediately after configuration modification, and automatically loads opened files after modification
  • Use ALE automatic syntax detection and auto repair
  • Text search supports highlighting and typing instant search and intelligent case ignoring
  • Mouse operation supported
  • Quick switch file line number display
  • Saving a file automatically removes line endings and blank lines at the end of the file
  • Use 4 spaces to fill in the tab, smart indent, backspace and smart delete space
  • Support code collapse by indentation
  • After exiting VIM, the content is displayed on the terminal screen and can be used for viewing and copying
  • Always jump to the last cursor position when opening a file
  • After exiting VIM, you can still undo the last edit
  • With a large number of functions, easy to remember and press key mapping
  • j|k keep the cursor in the middle of the screen when moving the line
  • Copy all the contents of the file to the clipboard in Ctrl + C normal mode, and copy the selected contents to the clipboard in visual mode
  • CTRL + V paste clipboard contents as is
  • Support to view file directory tree
  • Use LeaderF to display a list of functions
  • Run the current Python script with one click and support virtualenv
  • One click Format JSON
  • Spaces can be added between numbers and English
  • Move or resize windows quickly
  • Using leaderf to support file obfuscation
  • One click Add or cancel comment is supported
  • Random theme color matching and one click switching
  • Elegant startup interface
  • Integrated VIM go plug-in, gopher VIM party standard
  • Support bracket pair highlighting
  • Support table mode to quickly edit and format markdown tables
  • Support color value Preview
  • Support asynchronous shell command execution
  • Support to display git diff tag
  • Support multi line editing
  • Support quick modification of wrapping characters at both ends of words
  • Use youcompleteme to support code auto completion
  • Auto pair edit parentheses, quotes
  • Support display screen calendar
  • Support nginx configuration highlighting
  • Support markdown real-time preview

Plugins

use vim-plug manage plugins: the .vimrc will automatic download the vim-plug

Custom key mapping

  • switch buffer: ]b [b
  • switch tab: ]t [t
  • copy (all/selected) content:Ctrl-cCtrl-v
  • write read only file: w!!
  • line number toggle: <F2>
  • nerdtree toggle: <F3>
  • function list: <F4>
  • run python script: <F5>
  • open a new tab: <F6>
  • lint fix: <F8>
  • format current json file: <F9>
  • automatically wrap spaces for English words and numbers in Chinese: <F10>
  • wrap "/' for a word: \w'\w"
  • change surround: csXY dsX
  • case conversion and automatic prefixing _ (for abcDef -> abc_def): !
  • delete the current character and case the following characters (for abc_def -> abcDef): @
  • continue indent text to left or right on select/normal mode: > <
  • switch window: Ctrl-k Ctrl-j Ctrl-h Ctrl-l
  • resize window: Ctrl-Shift-arrows
  • close quickfix window: \q
  • fuzzy search file: \f \m
  • format single json line in a text file: \wj \pj
  • comment/uncomment: \cc \cu
  • markdown table mode: \tm
  • build go file: \gb
  • run go file: \gr
  • run go test: \gT
  • run go test for function: \gt
  • goto symbol/declaration for go file: gd
  • show interface function implement for go file: \i
  • show referrers for go file: \r
  • add json tag for go struct: \t
  • remove tag for go struct: \T
  • fill go struct: \fs
  • add if err check for go: Ctrl-e
  • code complete: Ctrl-z
  • change random colorscheme: `\c
  • copy content to system clipboard: Ctrl-c
  • show git message: \gm
  • markdown file open preview: \p
  • markdown file stop preview: \q
  • leaderf find by filename: \ff
  • leaderf find by mru: \fm
  • leaderf find by rg: \fg

Screenshots

Some screenshots may not be up-to-date, just for reference.

Launch interface

Daily coding

Open a go file

Open a python file and run

Open nginx configuration file

Code complete

File search

Show calendar

Color preview

Markdown preview

Rainbow parentheses

Format single json line in text file

Markdown table mode

Install & Usage

[!] VIM version must be above 8 and python version is 3.x.x

For VIM upgrade, please refer to wiki: https://github.com/axiaoxin/my-vimrc/wiki/Upgrade-VIM-to-8.x

For Python upgrade, please refer to wiki: https://github.com/axiaoxin/my-vimrc/wiki/Upgrade-Python-to-3.x

External dependence

Using this configuration requires the following commands to install some external dependencies:

brew install cmake python mono go nodejs pygments global cppcheck
brew unlink ctags && brew install --HEAD universal-ctags/universal-ctags/universal-ctags
[sudo] pip3 install isort yapf flake8 autopep8 pylint pyright
npm -g install instant-markdown-d prettier markdownlint

Install plugins

  1. Copy the .vimrc file to your $HOME directory, open VIM, execute :PlugInstall, and wait for the plugins installation to complete.
  2. Install vim-go binaries: open a go file then run :GoInstallBinaries
  3. Install vim-go go_fmt_command tool: go get -u github.com/segmentio/golines
  4. Setting the YouCompleteMe: https://github.com/ycm-core/YouCompleteMe#macos
cd ~/.vim/plugged/YouCompleteMe
python3 install.py --all
  1. Install nerdfont: https://www.nerdfonts.com/font-downloads
  2. Install LeaderF C Extension(Optional): :LeaderfInstallCExtension
  3. Install Markdown preview tool: [sudo] npm -g install instant-markdown-d

Stargazers over time

Stargazers over time

my-vimrc's People

Contributors

axiaoxin avatar bryant1410 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

my-vimrc's Issues

复制进去的时候出了问题

Error detected while processing /home/chefback/.vimrc:
line 15:
E117: Unknown function: vundle#begin
line 20:
E492: Not an editor command: Plugin 'gmarik/Vundle.vim'
line 26:
E492: Not an editor command: Plugin 'kabbamine/vcoolor.vim'
line 27:
E492: Not an editor command: Plugin 'guns/vim-clojure-highlight'
line 28:
E492: Not an editor command: Plugin 'guns/vim-sexp'
line 29:
E492: Not an editor command: Plugin 'guns/vim-clojure-static'
line 30:
E492: Not an editor command: Plugin 'tpope/vim-fireplace'
line 31:
E492: Not an editor command: Plugin 'kien/rainbow_parentheses.vim'
line 32:
E492: Not an editor command: Plugin 'mattn/emmet-vim'
line 33:
E492: Not an editor command: Plugin 'dhruvasagar/vim-table-mode'
line 34:
E492: Not an editor command: Plugin 'gorodinskiy/vim-coloresque'
line 35:
E492: Not an editor command: Plugin 'jelera/vim-javascript-syntax'
line 36:
E492: Not an editor command: Plugin 'walm/jshint.vim'
line 37:
E492: Not an editor command: Plugin 'moll/vim-node'
line 38:
E492: Not an editor command: Plugin 'airblade/vim-gitgutter'
line 39:
E492: Not an editor command: Plugin 'Yggdroot/indentLine'
line 40:
E492: Not an editor command: Plugin 'nvie/vim-flake8'
line 46:
E492: Not an editor command: Plugin 'axiaoxin/favorite-vim-colorscheme'
line 47:
E492: Not an editor command: Plugin 'junegunn/vim-emoji'
line 48:
E492: Not an editor command: Plugin 'mhinz/vim-startify'
line 49:
E492: Not an editor command: Plugin 'terryma/vim-multiple-cursors'
line 50:
E492: Not an editor command: Plugin 'suan/vim-instant-markdown'
line 51:
E492: Not an editor command: Plugin 'tpope/vim-surround'
line 52:
E492: Not an editor command: Plugin 'honza/vim-snippets'
line 53:
E492: Not an editor command: Plugin 'bling/vim-airline'
line 54:
E492: Not an editor command: Plugin 'kien/ctrlp.vim'
line 55:
E492: Not an editor command: Plugin 'majutsushi/tagbar'
line 56:
E492: Not an editor command: Plugin 'scrooloose/nerdcommenter'
line 57:
E492: Not an editor command: Plugin 'scrooloose/nerdtree'
line 59:
E117: Unknown function: vundle#end
line 118:
E185: Cannot find color scheme 'Tomorrow-Night-Bright'
``

Cannot set language to "zh_CN.utf-8"

when i edit file using this vim setting, i got this error:

Error detected while processing /root/.vimrc:
line 84:
E197: Cannot set language to "zh_CN.utf-8"
Press ENTER or type command to continue

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.