zoukankan      html  css  js  c++  java
  • MACOS配置VIM成简单IDE傻瓜式操作

    零、参考文献:

    https://www.jianshu.com/p/f0513d18742a

    一、安照我的配置:保存文件

    " Configuration file for vim
    set modelines=0        " CVE-2007-2438
    
    " Normally we use vim-extensions. If you want true vi-compatibility
    " remove change the following statements
    set nocompatible    " Use Vim defaults instead of 100% vi compatibility
    set backspace=2        " more powerful backspacing
    set showtabline=0
    let g:solarized_termcolors=256
    colorscheme torte
    set background=dark
    " Don't write backup file if vim is being called by "crontab -e"
    au BufWrite /private/tmp/crontab.* set nowritebackup nobackup
    " Don't write backup file if vim is being called by "chpass"
    au BufWrite /private/etc/pw.* set nowritebackup nobackup
    set fileformat=unix
    set scrolloff=5
    set laststatus=2
    set matchtime=5
    set incsearch
    set hlsearch
    set autoread
    set cursorline
    set cursorcolumn
    set whichwrap+=<,>,h,l
    set noexpandtab
    set nowrap
    set guifont=Monaco:h13
    set cindent
    set guioptions-=r
    set guioptions-=L
    set guioptions-=b
    let skip_defaults_vim=1
    set showmatch
    set number
    set tabstop=4
    set autoindent
    syntax on
    set shiftwidth=4
    set encoding=utf-8
    set completeopt=preview,menu
    set mouse=a
    filetype off
    set rtp+=~/.vim/bundle/Vundle.vim
    call vundle#begin()
    Plugin 'VundleVim/Vundle.vim'
    "Plugin 'Valloric/YouCompleteMe'
    Plugin 'Lokaltog/vim-powerline'
    Plugin 'scrooloose/nerdtree'
    Plugin 'Yggdroot/indentLine'
    Plugin 'jiangmiao/auto-pairs'
    Plugin 'tell-k/vim-autopep8'
    Plugin 'scrooloose/nerdcommenter'
    call vundle#end()
    filetype plugin indent on
    "F2开启和关闭树"
    map <F2> :NERDTreeToggle<CR>
    let NERDTreeChDirMode=1
    "显示书签"
    let NERDTreeShowBookmarks=1
    "设置忽略文件类型"
    let NERDTreeIgnore=['~$', '.pyc$', '.swp$']
    "窗口大小"
    let NERDTreeWinSize=25
    "缩进指示线"
    let g:indentLine_char=''
    let g:indentLine_enabled = 1
    
    "autopep8设置"
    let g:autopep8_disable_show_diff=1
    let mapleader=','
    map <F4> <leader>ci <CR>
    map <F5> :w<CR> :call RunPython()<CR>
    function RunPython()
        let mp = &makeprg
        let ef = &errorformat
        let exeFile = expand("%:t")
        setlocal makeprg = python -u
        set efm=%C %.%#, %A  File "%f"\, line %l%,%#,%Z%[%^ ]%\@=%m
        silent make %
        copen
        let &makeprg = mp
        let &errorformat = ef
    endfunction

    文件保存到~/.vimrc

    1 git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
    2 然后打开vim
    3 :PluginInstall
  • 相关阅读:
    BootStrap Validator 版本差异问题导致的submitHandler失效问题的解决方法
    Xiaocms 去版权
    nodejs学习8:windows连接mongodb出现的错误解决办法
    gulp运行步骤
    电脑日常技巧:没有语言栏,怎么办???
    jquery中使用each遍历。
    一、Java基礎(二)
    一、Java基础(一)
    《JAVA编程思想》第四版 PDF
    TCP、UDP详解与抓包工具使用
  • 原文地址:https://www.cnblogs.com/KevinGeorge/p/8309834.html
Copyright © 2011-2022 走看看