vim的配置安装和Python安装细节记录20190109

vim:

vim记得以前版本是8.0;现在最新的版本是8.1;而且是安装版本,不是已经编译好的版本;可以直接安装

需要git vundle安装 到bundle/vundle目录下;

安装插件的命令全部由bundle 改成plugin

vimrc文件配置用以前很多错误

目前没有错误的先记录下:

" Vim with all enhancements
source $VIMRUNTIME/vimrc_example.vim

" Use the internal diff if available.
" Otherwise use the special 'diffexpr' for Windows.
if &diffopt !~# 'internal'
  set diffexpr=MyDiff()
endif
function MyDiff()
  let opt = '-a --binary '
  if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
  if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
  let arg1 = v:fname_in
  if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
  let arg1 = substitute(arg1, '!', '\!', 'g')
  let arg2 = v:fname_new
  if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
  let arg2 = substitute(arg2, '!', '\!', 'g')
  let arg3 = v:fname_out
  if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
  let arg3 = substitute(arg3, '!', '\!', 'g')
  if $VIMRUNTIME =~ ' '
    if &sh =~ '\<cmd'
      if empty(&shellxquote)
        let l:shxq_sav = ''
        set shellxquote&
      endif
      let cmd = '"' . $VIMRUNTIME . '\diff"'
    else
      let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'
    endif
  else
    let cmd = $VIMRUNTIME . '\diff'
  endif
  let cmd = substitute(cmd, '!', '\!', 'g')
  silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3
  if exists('l:shxq_sav')
    let &shellxquote=l:shxq_sav
  endif
endfunction

" =============================================Bundle_start=========================
set rtp+=$vim/vim81/bundle/vundle
"call vundle#begin('$vim/vim81/bundle')  
call vundle#begin()
Plugin 'gmarik/vundle'
"===tagbar
Plugin 'majutsushi/tagbar'
"nmap <Leader>tb :TagbarToggle<CR>                           

"autocmd BufReadPost *.cpp,*.c,*.h,*.hpp,*.cc,*.cxx call tagbar#autoopen()     "如果是c语言的程序的话,tagbar自动开启
"======NERDTree
Plugin 'scrooloose/nerdtree'

Plugin 'bling/vim-airline'
Plugin 'powerline/powerline'

"=========自动补全
"Bundle 'Valloric/YouCompleteMe'
"==========安装VIM-IPYTHON插件
"Bundle 'vim-ipython'
"================快速运行,一键运行python代码,此处设置F10
Plugin 'thinca/vim-quickrun'


"=============自动补全单引号,双引号等
Plugin 'Raimondi/delimitMate'

"syntastic检查语法与编码风格
"Bundle 'scrooloose/syntastic'
Plugin 'christoomey/vim-tmux-navigator'

"markdown
Plugin 'godlygeek/tabular'
Plugin 'plasticboy/vim-markdown'
Plugin 'iamcco/mathjax-support-for-mkdp'
Plugin 'iamcco/markdown-preview.vim'
call vundle#end()
filetype plugin indent on  
"=============================================Bundle_over=========================

"=============================================Plugin set start==========================
let NERDTreeWinPos='left'
let NERDTreeWinSize=30
set laststatus=2
map <F2> :NERDTreeToggle<CR>

"=============================================Plugin set over==========================


" ===============================system_set_start=======================
inoremap ( ()<ESC>i
inoremap [ []<ESC>i
inoremap { {}<ESC>i
inoremap < <><ESC>i
inoremap ' ''<ESC>i
inoremap " ""<ESC>i
set ts=4
set number
set ruler
syntax on
set mouse=a
set cindent
set shiftwidth=4
set expandtab
let &termencoding=&encoding
set fileencodings=utf-8,gbk
" 设置不产生交换文件
set noswapfile
" 设置高亮行
set cursorcolumn
set cursorline

" 设置显行号
set nu
"设置折叠
 set fdm=marker
" 取消VIM的自动备份功能
set noundofile
set nobackup
set noswapfile
" 设置缩进,以4个空格作为缩进
set tabstop=4
 set sts=4
 set expandtab
 set softtabstop=4
 set shiftwidth=4
 set autoindent
 set cindent
" 修改配色方案
colorscheme solarized
" change 目录
set gfn=Courier_New:h14
" ====修改文件打开目录====
" cd D:\code\Python
set autochdir



" gvim内部编码
set encoding=utf-8

" 当前编辑的文件编码
set fileencoding=utf-8

" gvim打开支持编码的文件
set fileencodings=ucs-bom,utf-8,gbk,cp936,gb2312,big5,euc-jp,euc-kr,latin1
set langmenu=zh_CN
let $LANG = 'zh_CN.UTF-8'

" 解决consle输出乱码
language messages zh_CN.utf-8

" 解决菜单乱码
source $VIMRUNTIME/delmenu.vim
source $VIMRUNTIME/menu.vim

" 设置终端编码为gvim内部编码encoding
let &termencoding=&encoding

" 防止特殊符号无法正常显示
set ambiwidth=double
" ===============================system_set_end=======================================

" ================================python set start====================================

autocmd BufNewFile *.py,*.sh exec ":call SetTitle()"
""定义函数SetTitle,自动插入文件头
func SetTitle()
        "如果文件类型为.sh文件
        if &filetype == 'sh'
                call setline(1,"\#########################################################################")
                call append(line("."), "\# File Name: ".expand("%"))
                call append(line(".")+1, "\# Author: Nyang")
                call append(line(".")+2, "\# mail: [email protected]")
                call append(line(".")+3, "\# Created Time: ".strftime("%c"))
                call append(line(".")+4, "\######################################################################")
                call append(line(".")+5, "\#!/bin/bash")
                call append(line(".")+6, "")
        elseif &filetype == 'python'
                call setline(1, "/**************************************************************")
                call append(line("."), "\#        > File Name: ".expand("%"))
                call append(line(".")+1, "\#      > Author: Nyang")
                call append(line(".")+2, " \#     > Mail: [email protected]")
                call append(line(".")+3, " \#     > Created Time: ".strftime("%c"))
                call append(line(".")+4, " \######################################################")
                call append(line(".")+5, "#!/usr/bin/python")
                call append(line(".")+6, "# -*- coding:utf-8 -*-")
                call append(line(".")+7,"")
				
	    else
                call setline(1, "/*************************************************************************")
                call append(line("."), "        > File Name: ".expand("%"))
                call append(line(".")+1, "      > Author: xxxxx")
                call append(line(".")+2, "      > Mail: [email protected] ")
                call append(line(".")+3, "      > Created Time: ".strftime("%c"))
                call append(line(".")+4, " \######################################################")
                call append(line(".")+5, "")
        endif
		"新建文件后,自动定位到文件末尾
        autocmd BufNewFile * normal G
endfunc
" for # indent, python文件中输入新行时#号注释不切回行首
autocmd BufNewFile,BufRead *.py inoremap # X<c-h>#

" ================================python set over====================================

python:

anaconda distributioin版本要安装64版本;不小心安装了个32版本;最后tensorflow安装不上;tensorflow一定要求64位的python

后面安装了最新的anaconda python3.7,最后发现tensorflow版本还没跟上;最新只能支持python3.6的

猜你喜欢

转载自blog.csdn.net/ningyanggege/article/details/86130522