python环境变量的配置 alias_vim-python环境配置
一、環境配置:
1、配置vim alias,使vim成為默認的vi編輯器:
echo alias vi=\'vim\' >> ~/.bashrc
source ~/.bashrc
2、配置vimrc文件
cp /etc/vim/vimrc /etc/vim/vimrc.default
vi ~/.vimrc
" File: _vimrc
" Date: 2009-09-22
" Author: gashero
" NOTE: 配置一份簡單的vim配置文件
set nocompatible ? ?"非兼容模式
syntax on ? ? ? ? ? "開啟語法高亮
set background=dark "背景色
color desert
set ruler ? ? ? ? ? "在左下角顯示當前文件所在行
set showcmd ? ? ? ? "在狀態欄顯示命令
set showmatch ? ? ? "顯示匹配的括號
set ignorecase ? ? ?"大小寫無關匹配
set smartcase ? ? ? "只能匹配,即小寫全匹配,大小寫混合則嚴格匹配
set hlsearch ? ? ? ?"搜索時高亮顯示
set incsearch ? ? ? "增量搜索
"set nohls ? ? ? ? ? "搜索時隨著輸入立即定位,不知什么原因會關閉結果高亮
set report=0 ? ? ? ?"顯示修改次數
set mouse=a ? ? ? ? "控制臺啟用鼠標
set number ? ? ? ? ?"行號
set nobackup ? ? ? ?"無備份
set cursorline ? ? ?"高亮當前行背景
set fileencodings=ucs-bom,UTF-8,GBK,BIG5,latin1
set fileencoding=UTF-8
set fileformat=unix "換行使用unix方式
set ambiwidth=double
set noerrorbells ? ?"不顯示響鈴
set visualbell ? ? ?"可視化鈴聲
set foldmarker={,} ?"縮進符號
set foldmethod=indent ? "縮進作為折疊標識
set foldlevel=100 ? "不自動折疊
set foldopen-=search ? ?"搜索時不打開折疊
set foldopen-=undo ?"撤銷時不打開折疊
set updatecount=0 ? "不使用交換文件
set magic ? ? ? ? ? "使用正則時,除了$ . * ^以外的元字符都要加反斜線
"縮進定義
set shiftwidth=4
set tabstop=4
set softtabstop=4
set expandtab
set smarttab
set backspace=2 ? ? "退格鍵可以刪除任何東西
"顯示TAB字符為
set list
set list listchars=tab:
"映射常用操作
map [r :! python %
map [o :! python -i %
map [t :! rst2html.py % %<.html>
if has("gui_running")
set lines=25
set columns=80
set lazyredraw ?"延遲重繪
set guioptions-=m ? "不顯示菜單
set guioptions-=T ? "不顯示工具欄
set guifont=consolas\ 10
endif
if has("autocmd")
"回到上次文件打開所在行
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
\| exe "normal g'\"" | endif
"自動檢測文件類型,并載入相關的規則文件
filetype plugin on
filetype indent on
"智能縮進,使用4空格,使用全局的了
"autocmd FileType python setlocal et | setlocal sta | setlocal sw=4
"autocmd FileType c setlocal et | setlocal sta | setlocal sw=4
"autocmd FileType h setlocal et | setlocal sta | setlocal sw=4
endif
二、vim python 環境配置
1、加強python語法高亮腳本:python.vim
python.vim : Enhanced version of the python syntax highlighting script
cd /usr/share/vim/vim72/syntax/
cp python.vim python.vim.default
cp /opt/python.vim .
2、在 vim 中顯示 ctag 序列列表
下載 taglist 插件:taglist_45.zip
unzip taglist_45.zip
cp plugin/taglist.vim /usr/share/vim/vim72/plugin/
cp doc/taglist.txt /usr/share/vim/vim72/doc/
總結
以上是生活随笔為你收集整理的python环境变量的配置 alias_vim-python环境配置的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: python的requests.sess
- 下一篇: python列表求平均值_python与