• 我喜欢的几款不错的vim插件


    插件安装组件

    https://github.com/tpope/vim-pathogen

    supertab自动补齐

    https://www.vim.org/scripts/script.php?script_id=1643

    auto pairs自动匹配括号

    https://www.vim.org/scripts/script.php?script_id=3599

    syncstatics 语法错误检查

    https://www.vim.org/scripts/script.php?script_id=2736

    html Emmet快速编写神器

    https://github.com/mattn/emmet-vim

    Emmet 快速编写教程

    https://www.cnblogs.com/wuhua1/p/6848960.html

    插件安装方法,再安装了pathogen下,只需要进入.vim/bunlder目录下,git clone 插件就可以直接用了

    最后附上个人vimrc配置文件

    execute pathogen#infect()
    filetype plugin indent on
    set nonu
    set tabstop=4       "tab键长度
    set softtabstop=4   "删除时长度
    set shiftwidth=4    "自动tab长度
    set expandtab       "禁用tab 用空格代替
    set cindent         "C语言专用tab
    colorscheme darkblue
    
    "nnoremap i k
    "nnoremap k j
    "nnoremap j h
    "nnoremap h i
    "nnoremap H I
    
    nnoremap mm )
    nnoremap mn (
    nnoremap mh 0
    nnoremap mk %
    nnoremap me $
    
    inoremap <C-d> <del>
    nnoremap <C-c> <ESC>:w
    inoremap <C-b> <Left>
    inoremap <C-j> <Down>
    inoremap <C-k> <Up>
    inoremap <C-l> <Right>
    hi MatchParen ctermbg=blue ctermfg=white
    
    let g:user_emmet_leader_key='<C-Z>'

    php实现自动缩进

    mkdir ~/.vim/indent

    vim ~/.vim/indent/php.vim  #输入下面的内容保存即可shengxiao

    if exists("b:did_indent")
        finish
    endif
    
    if exists('s:doing_indent_inits')
        finish
    endif
    
    let s:doing_indent_inits = 1
    runtime! indent/html.vim
    unlet b:did_indent
    runtime! indent/php.vim
    unlet s:doing_indent_inits
    function! GetPhpHtmlIndent(lnum)
        if exists('*HtmlIndent')
            let html_ind = HtmlIndent()
        else
            let html_ind = HtmlIndentGet(a:lnum)
        endif
        let php_ind = GetPhpIndet()
        if php_ind >-1
            return php_ind
        endif
        if html_ind > -1
            if getline(a:num) =~ "^<?" && (0< searchpair('<?', '', '?>', 'nWb')
                  || 0 < searchpair('<?', '', '?>', 'nW'))
                return -1
            endif
            return html_ind
        endif
        return -1
    endfunction
    setlocal indentexpr=GetPhpHtmlIndent(v:lnum)
    setlocal indentkeys+=<>>
  • 相关阅读:
    CF258D
    CF662C
    CF1295F
    CF1406E
    CF1270F
    CF1278F
    CF1523E
    CF1554E
    算法第四章上机实践报告
    LCA RMQ+ST表学习笔记
  • 原文地址:https://www.cnblogs.com/demonxian3/p/8861445.html
Copyright © 2020-2023  润新知