vim

常用命令

  • 跳转:[[ ]] { } [] ][
  • 粘贴:p ]p [p >·]
  • 查找:* #
  • :r!: 输入外部命令输出
    • :r!seq 10: input 1 2 3 4 5 6 7 8 9 10
  • Ctrl+o: insert 模式运行一个 normal 命令。
  • 折叠代码:zf zo zc
  • 查找:t f
  • 保存会话::mksession ~/.session.vim vim -S ~/.session.vim
  • :wqa
  • :copen
  • = =% 缩进行,缩进块
  • %跳转到当前括号匹配的括号处
  • ;重复上次 f 查找。
  • ZZ=:wq(同时没有修改的时候ZZ不更改文件的修改时间)
  • Ctrl+r: 计算。Ctrl+r '=2+2' ENTER
  • :ab alias tochange: :ab asap as soon as possible
  • :w !sudo tee %: sudo write
  • :diffthis :windo diffthis :diffoff
  • :earlier 1m :later
  • di[删除标记内部文字 dt[
  • zz
  • Ctrl+o/i

文章

插件

" Plugged 管理插件的插件
call plug#begin('~/.vim/plugged')
" 生成 Doxygen 风格的注释,使用方法:
" :Dox :DoxAuthor :DoxBlock :DoxLic
Plug 'vim-scripts/DoxygenToolkit.vim'
" 单词检查
Plug 'vim-scripts/Engspchk'
" Vim 日历
Plug 'itchyny/calendar.vim'
" 模板工具
Plug 'aperezdc/vim-template'
" 异步运行
Plug 'skywind3000/asyncrun.vim'
" TAB 补全!
Plug 'ervandew/supertab'
" 我自己的默认设置
Plug 'zyeoman/vim-better-default'
" Colorscheme 们
Plug 'flazz/vim-colorschemes'
" 文件浏览,F3
Plug 'scrooloose/nerdtree'
" 代码注释
Plug 'scrooloose/nerdcommenter'
" Class/module browser
Plug 'majutsushi/tagbar'
" Code and files fuzzy finder
Plug 'kien/ctrlp.vim'
" ,f 查找函数
Plug 'tacahiroy/ctrlp-funky'
" Extension to ctrlp, for fuzzy command finder
Plug 'fisadev/vim-ctrlp-cmdpalette'
" Zen coding
Plug 'mattn/emmet-vim'
" Maybe the best Git integration
Plug 'tpope/vim-fugitive'
" Tab list panel
Plug 'kien/tabman.vim'
" Airline
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
" Consoles as buffers
Plug 'rosenfeld/conque-term'
" Pending tasks list
Plug 'fisadev/FixedTaskList.vim'
" Surround
Plug 'tpope/vim-surround'
" Autoclose
Plug 'Townk/vim-autoclose'
" Indent text object
Plug 'michaeljsmith/vim-indent-object'
" Python mode (indentation, doc, refactor, lints, code checking, motion and
" operators, highlighting, run and ipdb breakpoints)
Plug 'klen/python-mode'
" Better autocompletion
Plug 'Shougo/neocomplcache.vim'
" Snippets manager (SnipMate), dependencies, and snippets repo
Plug 'MarcWeber/vim-addon-mw-utils'
Plug 'tomtom/tlib_vim'
Plug 'honza/vim-snippets'
" Track the engine.
Plug 'SirVer/ultisnips'

" awesome colorscheme
" Plug 'tomasr/molokai'
" Git/mercurial/others diff icons on the side of the file lines
Plug 'mhinz/vim-signify'
" Automatically sort python imports
Plug 'fisadev/vim-isort'
" Drag visual blocks arround
Plug 'fisadev/dragvisuals.vim'
" Window chooser
Plug 't9md/vim-choosewin'
" Python and other languages code checker
Plug 'scrooloose/syntastic'
" Paint css colors with the real color
Plug 'lilydjwg/colorizer'
" Relative numbering of lines (0 is the current line)
" (disabled by default because is very intrusive and can't be easily toggled
" on/off. When the plugin is present, will always activate the relative
" numbering every time you go to normal mode. Author refuses to add a setting
" to avoid that)
" Plug 'myusuf3/numbers.vim'

" javascript complete after install the plugin, you must cd the install
" directory and run `npm install`, then add a .tern-project config file
" the doc at http://ternjs.net/doc/manual.html#vim
Plug 'marijnh/tern_for_vim'
" Golang Plugs
Plug 'fatih/vim-go'
" JSX syntax highlight.
Plug 'mxw/vim-jsx'
" Markdown syntastic highlight
Plug 'godlygeek/tabular'
Plug 'dhruvasagar/vim-table-mode'
Plug 'plasticboy/vim-markdown'
" Markdown realtime preview
" Before you want to use it, please run
" `sudo npm -g install instant-markdown-d`
Plug 'suan/vim-instant-markdown'
" Handlebars syntax highlighting
Plug 'mustache/vim-mustache-handlebars'
" Vue.js syntax and highlighting
Plug 'tao12345666333/vim-vue'
" True Sublime Text style multiple selections for Vim
Plug 'terryma/vim-multiple-cursors'

" Plugs from vim-scripts repos:

" Search results counter
Plug 'IndexedSearch'
" XML/HTML tags navigation
Plug 'matchit.zip'
" Gvim colorscheme
Plug 'Wombat'
" Yank history navigation
Plug 'YankRing.vim'
" 盘古中文排版自动化
Plug 'hotoo/pangu.vim'
" Expand v 连点 v 扩展选择
Plug 'terryma/vim-expand-region'
" Comment gc
Plug 'tpope/vim-commentary'
" Readline 风格快捷键
Plug 'tpope/vim-rsi'
" 中文 Doc
Plug 'vimcn/vimcdoc'

call plug#end()

文章标题:vim

文章字数:3990

本文作者:Mickir

发布时间:2016-12-17

最后更新:2017-09-12

原始链接: https://mickir.me/blog/vim.html

版权声明: "署名-非商用-相同方式共享 4.0" 转载请保留原文链接及作者。