zoukankan      html  css  js  c++  java
  • vim使用笔记

    vundle

    1.setup vundle

    $ git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
    


    2.配置插件,编辑主目录下的.vimrc文件,在文件头部增加

    set nocompatible              " be iMproved, required
    filetype off                  " required
    
    " set the runtime path to include Vundle and initialize
    set rtp+=~/.vim/bundle/Vundle.vim
    call vundle#begin()
    " alternatively, pass a path where Vundle should install plugins
    "call vundle#begin('~/some/path/here')
    
    " let Vundle manage Vundle, required
    Plugin 'gmarik/Vundle.vim'
    
    " The following are examples of different formats supported.
    " Keep Plugin commands between vundle#begin/end.
    " plugin on GitHub repo
    " Plugin 'tpope/vim-fugitive'
    " plugin from http://vim-scripts.org/vim/scripts.html
    " Plugin 'L9'
    " Git plugin not hosted on GitHub
    " Plugin 'git://git.wincent.com/command-t.git'
    " git repos on your local machine (i.e. when working on your own plugin)
    " Plugin 'file:///home/gmarik/path/to/plugin'
    " The sparkup vim script is in a subdirectory of this repo called vim.
    " Pass the path to set the runtimepath properly.
    " Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
    " Avoid a name conflict with L9
    " Plugin 'user/L9', {'name': 'newL9'}
    
    " All of your Plugins must be added before the following line
    call vundle#end()            " required
    filetype plugin indent on    " required
    " To ignore plugin indent changes, instead use:
    "filetype plugin on
    

    修改完之后就已经配置好vundle了,进入vim中就可以执行命令,注意要用sudo的方式打开vim,否则执行命令的时候可能报错权限不够。一些常用命令:

    • :PluginList
    • :PluginInstall : 安装配置文件中的plugin
    • :PluginSearch foo : search for foo
    • :PluginClean: 在配置文件中删除插件后,需要运行清除命令
    • :vim +PluginInstall +qall: 在命令行中直接执行命令,其他几个命令同样可以在命令行中执行


    安装插件的时候,如果是github源的插件,如YouCompleteMe可以在.vimrc文件中添加Plugin 'Valloric/YouCompleteMe',即作者/插件名

    YouCompleteMe

    使用vundle安装:Plugin 'Valloric/YouCompleteMe'
    由于YCM是需要执行编译的,现在只是更新源码,所以需要CMake:

    sudo apt-get install build-essential cmake
    

    确保已经安装python headers:

    sudo apt-get install python-dev
    

    编译YCM:

    cd ~/.vim/bundle/YouCompleteMe
    ./install.sh --clang-completer
    

    推荐的一些配置

    let g:ycm_collect_identifiers_from_tags_files = 1 " Let YCM read tags from Ctags file
    let g:ycm_use_ultisnips_completer = 1 " Default 1, just ensure
    let g:ycm_seed_identifiers_with_syntax = 1 " Completion for programming language's keyword
    let g:ycm_complete_in_comments = 1 " Completion in comments
    let g:ycm_complete_in_strings = 1 " Completion in string
    

    Vimwiki

    vundle安装: Plugin 'vimwiki/vimwiki' 配置:

    set nocompatible
    filetype plugin on
    syntax on
    let g:vimwiki_valid_html_tags='br'
    
    nmap <F5> :Vimwiki2HTML<CR>
    
  • 相关阅读:
    js——获取指定日期的前7天连续日期
    一个div自动充满当前屏幕的解决方法
    Cookie和Session
    Web服务器和浏览器间的工作原理
    软件测试基础概念
    K短路的几种求法
    ID字体
    搭建GitLab的Hexo博客记录
    项目selfcmp开发学习
    牛顿迭代法学习笔记
  • 原文地址:https://www.cnblogs.com/jolin123/p/4442420.html
Copyright © 2011-2022 走看看