zoukankan      html  css  js  c++  java
  • MY----Vimrc and neovim(init.vim)

      __  __        __     _____ __  __ ____   ____
     |  /  |_   _     / /_ _|  /  |  _ / ___|
     | |/| | | | |  / / | || |/| | |_) | |
     | |  | | |_| |   V /  | || |  | |  _ <| |___
     |_|  |_|\__, |    \_/  |___|_|  |_|_| \_\____|
             |___/

     1,通用的配置

    " =================================Basic Setting

    if has ("syntax")
    syntax enable
    syntax on
    endif

    set nocompatible " 取消vi 兼容模式
    set path=.,/usr/include,/usr/local/include/
    set textwidth=80 " 一行显示80个字符
    set wrap " 自动折行
    set tw=0
    set linebreak " 指定的符号发生折行
    set wrapmargin=2 " 指定折行处与编辑窗口的右边缘之间空出的字符数。
    set scrolloff=5 " 垂直滚动时,光标距离顶部/底部的位置5
    set sidescrolloff=15 " 水平滚动时,光标距离行首或行尾的位置
    set laststatus=2 " 显示状态栏

    set number " show line number
    set lazyredraw
    set visualbell
    set relativenumber " 显示光标所在的当前行的行号,其他行都为相对于该行的相对行号
    set ruler " show cursor site in right below
    set noswapfile
    set showmode " 在底部显示,当前处于命令模式还是插入模式
    set showcmd " 显示消失
    set formatoptions-=tc

    set mouse=nv " 可视模式
    set mouse=a " Enable mouse usage (all modes) 启用鼠标方便翻页,移动光标

    set termencoding=utf-8
    set encoding=utf-8  " 使用 utf-8 编码
    set langmenu=zh_CN.UTF-8
    set fileformats=unix
    set clipboard=unnamed
    set t_Co=256 " 启用256色
    set shiftwidth=2 " Better tab
    set tabstop=2 " 按下 Tab 键时,Vim 显示的空格数
    set noexpandtab " 将Tab 转为空格
    set softtabstop=2
    set inccommand=split
    set nobackup " 不创建备份文件
    set autoread  " 设置当文件被改动时自动载入
    set autowrite       " Automatically save before commands like :next and :make
    set hidden      " Hide buffers when they are abandoned
    set completeopt=longest,noinsert,menuone,noselect,preview
    set cursorline " 光标所在的当前行高亮
    set hlsearch " 高亮度搜寻
    exec "nohlsearch"
    noremap <LEADER><CR> :nohlsearch<CR>
    set incsearch " 输入字符串就显示匹配点
    set autoindent " 自动缩进
    set list
    set listchars=tab:| ,trail:>
    set viewoptions=cursor,folds,slash,unix
    set notimeout
    set viewoptions=cursor,folds,slash,unix
    set cindent
    set showmatch  " Show matching brackets.
    set ignorecase " Do case insensitive matching
    set smartcase  " Do smart case matching

    set indentexpr=
    " Better backspace
    set virtualedit=block
    set backspace=indent,eol,start
    set foldmethod=indent
    set foldmethod=marker
    set foldlevelstart=99
    set foldenable
    "set colorcolumn=0


    let &t_SI = "<Esc>]50;CursorShape=1x7"
    let &t_SR = "<Esc>]50;CursorShape=2x7"
    let &t_EI = "<Esc>]50;CursorShape=0x7"

    " Window behaviors

    set splitright
    set splitbelow

    " === Restore Cursor Position
    au BufReadPost * if line("'"") > 1 && line("'"") <= line("$") | exe "normal! g'"" | endif

    set autochdir " 自动切换工作目录
    set noerrorbells " 出错时,不要发出响声
    set history=1000 " Vim 需要记住多少次历史操作
    set autoread " 打开文件监视。如果在编辑过程中文件发生外部改变(比如被别的编辑器编辑了),就会发出提示
    set guicursor=n:block,i:ver1,v:block,r:block,c:block,ci:block,cr:block
    set wildignore=log/**,node_modules/**,target/**,tmp/**,*.rbc
    set wildmenu " 命令模式下,底部操作指令按下 Tab 键自动补全
    set wildmode=longest,list,full
    set wildchar=<Tab>
    set completeopt=longest,menu
    set completeopt=preview,menu  " 代码补全

    let &t_ut='' " Prevent incorrect backgroung rendering

    "----- 打开文件类型检测-----------------
    filetype on
    filetype indent on
    filetype plugin on
    filetype plugin indent onset smartindent

    2,插件部分----->持续更新

    " === Install Plugins with NVim-Plug

    call plug#begin('~/.config/nvim/plugged')

    " Pretty Dress

    Plug 'ncm2/ncm2'
    Plug 'ncm2/ncm2-bufword'
    Plug 'ncm2/ncm2-path'
    Plug 'roxma/nvim-yarp'

    Plug 'vim-airline/vim-airline'
    Plug 'vim-airline/vim-airline-themes'
    Plug 'connorholyday/vim-snazzy'
    Plug 'NLKNguyen/papercolor-theme'
    Plug 'ayu-theme/ayu-vim'

    " File navigation

    Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
    Plug 'Xuyuanp/nerdtree-git-plugin'
    Plug 'ctrlpvim/ctrlp.vim', { 'on': 'CtrlP' }

    " Taglist

    Plug 'majutsushi/tagbar', { 'on': 'TagbarOpenAutoClose' }

    " Error checking

    Plug 'w0rp/ale'


    " Auto Complete

    Plug 'neoclide/coc.nvim', {'branch': 'release'}
    Plug 'Shougo/dein.vim'
    " Plug 'davidhalter/jedi-vim

    " Plug 'Valloric/YouCompleteMe'

    " Undo Tree

    Plug 'mbbill/undotree/'

    " Snippits

    " Plug 'SirVer/ultisnips'  , { 'for': ['vim-plug', 'python'] }  
    " Plug 'honza/vim-snippets', { 'for': ['vim-plug', 'python'] }

    " Other visual enhancement

    Plug 'nathanaelkane/vim-indent-guides'
    Plug 'itchyny/vim-cursorword'
    Plug 'tmhedberg/SimpylFold'

    " Git

    Plug 'rhysd/conflict-marker.vim'
    Plug 'tpope/vim-fugitive'
    Plug 'mhinz/vim-signify'
    "Plug 'gisphm/vim-gitignore', { 'for': ['gitignore', 'vim-plug'] }

    " HTML, CSS, JavaScript, PHP, JSON, etc.

    Plug 'elzr/vim-json'
    Plug 'hail2u/vim-css3-syntax'
    Plug 'spf13/PIV', { 'for' :['php', 'vim-plug'] }
    Plug 'gko/vim-coloresque', { 'for': ['vim-plug', 'php', 'html', 'javascript', 'css', 'less'] }
    Plug 'pangloss/vim-javascript', { 'for' :['javascript', 'vim-plug'] }
    Plug 'mattn/emmet-vim'

    " Python

    Plug 'vim-scripts/indentpython.vim'
    " Plug 'vim-python/python-syntax', { 'for' :['python', 'vim-plug'] }


    Plug 'dhruvasagar/vim-table-mode', { 'on': 'TableModeToggle' }
    Plug 'vimwiki/vimwiki'

    " For general writing

    Plug 'reedes/vim-wordy'
    Plug 'ron89/thesaurus_query.vim'

    " Bookmarks

    Plug 'kshenoy/vim-signature'

    " Other useful utilities

    Plug 'jiangmiao/auto-pairs'
    Plug 'terryma/vim-multiple-cursors'
    Plug 'junegunn/goyo.vim' " distraction free writing mode

    Plug 'ntpeters/vim-better-whitespace', { 'on': ['EnableWhitespace', 'ToggleWhitespace'] }

    "displays trailing whitespace (after :EnableWhitespace, vim slows down)

    Plug 'tpope/vim-surround' " type ysks' to wrap the word with '' or type cs'` to change 'word' to `word`

    Plug 'godlygeek/tabular' " type ;Tabularize /= to align the =
    Plug 'gcmt/wildfire.vim' " in Visual mode, type i' to select all text in '', or type i) i] i} ip
    Plug 'scrooloose/nerdcommenter' " in <space>cc to comment a line


    " Dependencies

    Plug 'MarcWeber/vim-addon-mw-utils'
    Plug 'kana/vim-textobj-user'
    Plug 'fadein/vim-FIGlet'



    " ======== Other In Neovim PLUG

    Plug 'tiagofumo/dart-vim-flutter-layout'
    Plug 'RRethy/vim-illuminate'
    Plug 'AndrewRadev/splitjoin.vim'
    Plug 'KabbAmine/vCoolor.vim'
    Plug 'pechorin/any-jump.vim'
    Plug 'airblade/vim-rooter'
    Plug 'skywind3000/asynctasks.vim'
    Plug 'skywind3000/asyncrun.vim'
    Plug 'junkblocker/git-time-lapse'

    " Testing my own plugin
    Plug 'theniceboy/vim-calc'

    " Pretty Dress
    Plug 'theniceboy/eleline.vim'
    Plug 'bling/vim-bufferline'
    "Plug 'liuchengxu/space-vim-theme'
    "Plug 'morhetz/gruvbox'
    "Plug 'ayu-theme/ayu-vim'
    "Plug 'rakr/vim-one'
    Plug 'mhartington/oceanic-next'
    "Plug 'kristijanhusak/vim-hybrid-material'
    Plug 'ajmwagar/vim-deus'
    "Plug 'arzg/vim-colors-xcode'

    " Genreal Highlighter
    Plug 'jaxbot/semantic-highlight.vim'
    Plug 'rrethy/vim-hexokinase', { 'do': 'make hexokinase' }

    " File navigation
    "Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
    "Plug 'Xuyuanp/nerdtree-git-plugin'
    Plug 'junegunn/fzf.vim'
    "Plug 'yuki-ycino/fzf-preview.vim'
    "Plug 'junegunn/fzf', {'dir': '~/.fzf', 'do': './install --all'}
    "Plug 'junegunn/fzf'
    Plug 'kevinhwang91/rnvimr', {'do': 'make sync'}
    Plug 'SpringHan/lightTodo.vim', { 'branch': 'dev', 'on': 'LightTodoToggle' }
    " Taglist
    Plug 'liuchengxu/vista.vim'

    " Debugger
    Plug 'puremourning/vimspector', {'do': './install_gadget.py --enable-c --enable-python --enable-go'}

    " REPL
    "Plug 'rhysd/reply.vim'

    " Error checking, handled by coc

    " Auto Complete
    Plug 'wellle/tmux-complete.vim'

    " Snippets
    "Plug 'SirVer/ultisnips'
    Plug 'theniceboy/vim-snippets'

    " Undo Tree
    Plug 'mbbill/undotree'

    " Git
    Plug 'tpope/vim-fugitive'
    Plug 'theniceboy/vim-gitignore', { 'for': ['gitignore', 'vim-plug'] }
    Plug 'fszymanski/fzf-gitignore', { 'do': ':UpdateRemotePlugins' }
    "Plug 'mhinz/vim-signify'
    Plug 'airblade/vim-gitgutter'

    " Tex
    Plug 'lervag/vimtex'

    " CSharp
    Plug 'OmniSharp/omnisharp-vim'
    Plug 'ctrlpvim/ctrlp.vim' , { 'for': ['cs', 'vim-plug'] } " omnisharp-vim dependency

    " HTML, CSS, JavaScript, PHP, JSON, etc.
    Plug 'elzr/vim-json'
    Plug 'hail2u/vim-css3-syntax', { 'for': ['vim-plug', 'php', 'html', 'javascript', 'css', 'less'] }
    Plug 'spf13/PIV', { 'for' :['php', 'vim-plug'] }
    Plug 'pangloss/vim-javascript', { 'for': ['vim-plug', 'php', 'html', 'javascript', 'css', 'less'] }
    Plug 'yuezk/vim-js', { 'for': ['vim-plug', 'php', 'html', 'javascript', 'css', 'less'] }
    Plug 'MaxMEllon/vim-jsx-pretty', { 'for': ['vim-plug', 'php', 'html', 'javascript', 'css', 'less'] }
    Plug 'jelera/vim-javascript-syntax', { 'for': ['vim-plug', 'php', 'html', 'javascript', 'css', 'less'] }
    "Plug 'jaxbot/browserlink.vim'

    " Go
    Plug 'fatih/vim-go' , { 'for': ['go', 'vim-plug'], 'tag': '*' }

    " Python
    Plug 'tmhedberg/SimpylFold', { 'for' :['python', 'vim-plug'] }
    Plug 'Vimjas/vim-python-pep8-indent', { 'for' :['python', 'vim-plug'] }
    Plug 'numirias/semshi', { 'do': ':UpdateRemotePlugins', 'for' :['python', 'vim-plug'] }
    "Plug 'vim-scripts/indentpython.vim', { 'for' :['python', 'vim-plug'] }
    "Plug 'plytophogy/vim-virtualenv', { 'for' :['python', 'vim-plug'] }
    Plug 'tweekmonster/braceless.vim'

    " Flutter
    Plug 'dart-lang/dart-vim-plugin'
    Plug 'thosakwe/vim-flutter'

    " Swift
    Plug 'keith/swift.vim'

    " Markdown
    Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install_sync() }, 'for' :['markdown', 'vim-plug'] }
    Plug 'mzlogin/vim-markdown-toc', { 'for': ['gitignore', 'markdown'] }
    Plug 'theniceboy/bullets.vim'

    " Other filetypes
    Plug 'jceb/vim-orgmode', {'for': ['vim-plug', 'org']}

    " Editor Enhancement
    "Plug 'Raimondi/delimitMate'
    Plug 'jiangmiao/auto-pairs'
    Plug 'mg979/vim-visual-multi'
    Plug 'scrooloose/nerdcommenter' " in <space>cn to comment a line
    Plug 'theniceboy/antovim' " gs to switch
    Plug 'tpope/vim-surround' " type yskw' to wrap the word with '' or type cs'` to change 'word' to `word`
    Plug 'gcmt/wildfire.vim' " in Visual mode, type k' to select all text in '', or type k) k] k} kp
    Plug 'junegunn/vim-after-object' " da= to delete what's after =
    Plug 'junegunn/vim-easy-align' " gaip= to align the = in paragraph,
    Plug 'tpope/vim-capslock'    " Ctrl+L (insert) to toggle capslock
    Plug 'easymotion/vim-easymotion'
    Plug 'Konfekt/FastFold'
    "Plug 'junegunn/vim-peekaboo'
    "Plug 'wellle/context.vim'
    Plug 'svermeulen/vim-subversive'
    Plug 'theniceboy/argtextobj.vim'
    Plug 'rhysd/clever-f.vim'

    " Input Method Autoswitch
    "Plug 'rlue/vim-barbaric' " slowing down vim-multiple-cursors

    " Formatter
    Plug 'Chiel92/vim-autoformat'

    " For general writing
    "Plug 'reedes/vim-wordy'
    "Plug 'ron89/thesaurus_query.vim'

    " Bookmarks
    "Plug 'kshenoy/vim-signature'
    Plug 'MattesGroeger/vim-bookmarks'

    " Find & Replace
    Plug 'brooth/far.vim', { 'on': ['F', 'Far', 'Fardo'] }
    Plug 'osyo-manga/vim-anzu'

    " Useful plugin
    Plug 'tpope/vim-surround'

    " Documentation
    "Plug 'KabbAmine/zeavim.vim' " <LEADER>z to find doc

    " Mini Vim-APP
    "Plug 'liuchengxu/vim-clap'
    "Plug 'jceb/vim-orgmode'
    "Plug 'mhinz/vim-startify'

    " Vim Applications
    Plug 'itchyny/calendar.vim'

    " Translation
    " Plug 'denstiny/Terslation'
    Plug 'SpringHan/Terslation.vim', { 'on': [ 'TerslationToggle', 'TerslationWordTrans' ] }


    " Other visual enhancement
    Plug 'ryanoasis/vim-devicons'
    Plug 'luochen1990/rainbow'
    Plug 'mg979/vim-xtabline'
    Plug 'wincent/terminus'

    " Other useful utilities
    Plug 'lambdalisue/suda.vim' " do stuff like :sudowrite
    Plug 'makerj/vim-pdf'
    "Plug 'xolox/vim-session'
    "Plug 'xolox/vim-misc' " vim-session dep

    " Dependencies
    Plug 'MarcWeber/vim-addon-mw-utils'
    Plug 'kana/vim-textobj-user'
    Plug 'roxma/nvim-yarp'

    " ============================ the other I need

    " TheBegining
    Plug 'mhinz/vim-startify'

    " StatusLine
    " Plug 'itchyny/vim-gitbranch'
    Plug 'Styadev/HicusLine'


    call plug#end()

    注: 无插件配置,请选择性安装插件,不建议直接复制。。。

     我换nvim了,现在我在用neovim,本篇部分也可以用在nvim。

    同时我也会写一篇spacevim的随笔。。。。。

  • 相关阅读:
    maven常用命令
    div标签width:auto无效
    将本地文件推送到码云
    Spring事件监听讲解
    常用js代码积累
    HTML中块级元素和行内元素的总结和区分
    box-shadow详解
    设置最小宽高的作用
    Java英语词汇表
    标识符
  • 原文地址:https://www.cnblogs.com/kawi-lzm/p/lzmlove123.html
Copyright © 2011-2022 走看看