[Python-de] Welcher Python-Editor fuer Linux ?

Gerhard Häring gh at ghaering.de
Son Jul 6 21:09:02 EDT 2003


Stefan J. Betz wrote:
> Am Sun, Jul 06, 2003 at 06:33:24PM +0200, Gerhard Häring schrieb:
>>Natürlich kann VIM auch Folding. [...]
> 
> Welcher Key? Oder wie kann ich das nutzen???

:h folding

Präfix-Taste ist 'z'.

Ich häng mal meine .vimrc an. Die ist stark für Python-Entwicklung 
optimiert :-) Ist momentan der Windows-Flavour und die Windows-Unix 
Unterscheidung hab ich noch nicht drin ;-) Unter Unix musst du halt den 
GuiEnter-Schmarrn rausschmeissen.

-- Gerhard
-------------- nächster Teil --------------
" VIM configuration file from Gerhard Häring (gh at ghaering.de)
" Platforms: Linux, FreeBSD, Windows
" Under Unix, save as .vimrc in home directory, under Windows, save
" as _vimrc in your %VIM% directory.

""""""""""""""""""
" Useful defaults:
set nocompatible
set autoindent
set showmatch
set hidden
set incsearch
set hlsearch
set ignorecase
set smartcase
set virtualedit=all
set wildmenu
syntax on

" Always replace *all* occurences on a line (default is only the first)
set gdefault

" Tabulator policy:
" - Show existing tabs as 8 spaces
" - Tab key/autoindent/reindent insert 4 spaces
set ts=8 sw=4 smarttab
set expandtab

" Lemme see those ugly tabs and trailing spaces
set list listchars=tab:»·,trail:·

" Beep? I don't want to hear any beep!!
set visualbell

" Status line:
set statusline=[%n]\ %<%f\ %((%1*%M%*%R%Y)%)\ %=%-19(\LINE\ [%3l/%3L]\ COL\ [%02c%03V]%)\ ascii['%02b']\ %P
set laststatus=2

"""""""""""""""""""""""""""""""""""""
" Customizations for some file types:
function! SetCOptions()
    set cindent
    set formatoptions=tcqlro

    syn region myFold start="{" end="}" transparent fold
    syn sync fromstart
    set foldmethod=syntax
endfunction

function! SetPythonOptions()
    set smartindent
    set cinwords=if,elif,else,for,while,try,except,finally,def,class
    set foldmethod=indent
endfunction

:autocmd FileType python        call SetPythonOptions()
:autocmd FileType java          call SetCOptions()
:autocmd FileType c             call SetCOptions()
:autocmd FileType cpp           call SetCOptions()
:autocmd FileType make          set noexpandtab nosmarttab

""""""""""""""""
" Shortcut keys:
map <F3> :set hlsearch!<CR>
map <F4> :bprev<CR>
map <F5> :bnext<CR>
map <F6> :cprev<CR>
map <F7> :cnext<CR>
map <F9> :make<CR>

" Folding rocks
set foldmethod=syntax

" Are we starting VIM in an Ant aware directory?
if filereadable("build.xml")
exec "set makeprg=ant\\ -buildfile\\ " . $PWD . "/build.xml"
" Support Ant compile error detection.
if (version < 600)
set efm=%A%*\\s%[javac%\\]\ %f:%l:\ %m,%Z%*\\s%[javac%\\]\ symbol%*\\s:\ %m
else
set efm=%A\ %#[javac]\ %f:%l:\ %m,%-Z\ %#[javac]\ %p^,%-C%.%#
endif
endif

"
" Platform hacks
"

" Workaround for FreeBSD console:
set isprint=@,128-255

" No Windows defaults on win32
behave xterm


" Font I use on Windows:
set guifont=Andale_Mono:h14:cANSI

" set font and charset appropriate for Euro symbol:
"set guifont=-adobe-courier-medium-r-normal-*-*-140-*-*-m-*-iso8859-15
set encoding=iso-8859-15

" On Windows, maximize on startup
au GUIEnter * simalt ~x

" Tip #370: always cd to the current file's directory
autocmd BufEnter * if bufname("") !~ "^\[A-Za-z0-9\]*://" | lcd %:p:h | endif

" Sourcesafe stuff:
let $SSDIR="q:\\\\"
let ssUserName="Gerhard.Haering"
let ssLocalTree="d:\\\\SwEntw"

" Don't use Ex mode, use Q for formatting
map Q gq

" Make tab in v mode work like I think it should (keep highlighting):
vmap <tab> >gv
vmap <s-tab> <gv

" Requires MSYS' grep to be in path on Windows:
set grepprg=grep\ -Hn

" allow <BkSpc> to delete line breaks, beyond the start of the current
" insertion, and over indentations:
set backspace=eol,start,indent