1
0
mirror of https://github.com/akelge/zsh synced 2025-07-03 13:09:07 +00:00

Initial import

This commit is contained in:
2008-10-09 16:15:16 +00:00
parent b68c98a6f5
commit 2475eced60
13 changed files with 814 additions and 0 deletions

27
vim/gvimrc Normal file
View File

@ -0,0 +1,27 @@
set guifont=Monaco:h12
"set guifont=ProFontWindows:h9
set anti
set lines=50
"set lines=70
set columns=132
set nomousefocus
set ruler
set errorbells
set visualbell
set foldmethod=expr
if exists('&macatsui')
set nomacatsui
endif
"colorscheme zenburn
"colorscheme freya
colorscheme moria
" Let's do Ctrl-W work as expected, Gvim thinks we use a QZERTY Keyboard
nnoremap <silent> <C-Z> <C-W>
nnoremap <silent> <D-+> :call Zoom()<CR>
nnoremap <silent> <C-S> :set list!<CR>

33
vim/myfunx.vim Normal file
View File

@ -0,0 +1,33 @@
" Converts a file to PDF and display it (only on OS X)
function! ToPDF()
"define PS file name
let psname= "/tmp/" . expand("%:t:r") . ".ps"
"save colorscheme name
let g:colorname=g:colors_name
execute "write"
execute "colorscheme default"
execute "hardcopy > " . l:psname
execute "silent !launch -w " . l:psname
execute "silent !rm " . l:psname
execute "colorscheme" g:colorname
redraw!
endfunction
" Set up menu for the function
an 10.520 &File.-SEP3- <Nop>
an 10.530 &File.&ToPDF :call ToPDF()<CR>
vunmenu &File.&ToPDF
vnoremenu &File.&ToPDF :call ToPDF()<CR>
" Zoom in/out of gvim
function! Zoom()
if has("gui_running")
if &guifont =~ 'Monaco:h12'
set guifont=Monaco:h9
set lines=70
else
set guifont=Monaco:h12
set lines=50
endif
endif
endfunction

55
vim/skeleton.vim Normal file
View File

@ -0,0 +1,55 @@
" TEMPLATE SYSTEM FOR VIM
"
" Preserve template files
augroup newfiles
" First we load templates for the file type
autocmd BufNewFile * ks|call OpenFile()|'s
" Update of "Last Modified" date on writing
autocmd BufWritePre,FileWritePre * ks|call LastMod()|'s
" Protect templates, removing write commands
autocmd BufRead,BufNewFile ~/.vim/templates/* au! newfiles
" Reload .vimrc, after modifications
autocmd BufWritePost ~/.vimrc so ~/.vimrc
if has("gui_running")
autocmd BufWritePost ~/.gvimrc so ~/.gvimrc
endif
" Set up python support
au FileType python source ~/.vim/addon/python.vim
augroup END
" Function to modify "Last Modified" date. Works on first 10 lines
function! LastMod()
if line("$") > 20
let l = 20
else
let l = line("$")
endif
execute "1," . l . "g/Last modified: /s/Last modified: .*/Last modified: " .
\ strftime("%d:%b:%Y %H:%M")
endfunction
" Function to open a file and set some defaults
function! OpenFile()
let s:filename=expand("<afile>")
let l:ext=fnamemodify(s:filename, ":e")
let l:skel = "~/.vim/templates/skeleton.".l:ext
if filereadable(fnamemodify(l:skel,":p"))
execute "0r" l:skel
let s:syn=input("Synopsis: ")
if line("$") > 20
let l = 20
else
let l = line("$")
endif
execute "1," . l . "g/First version: /s/First version: .*/First version: ".
\ strftime("%d:%b:%Y %H:%M")
execute "1," . l . "g/Synopsis: /s/Synopsis: .*/Synopsis: ".
\ s:syn
endif
endfunction

19
vim/templates/skeleton.c Normal file
View File

@ -0,0 +1,19 @@
/*
-*- coding: latin-1 -*-
Copyright by Andrea Mistrali <am@am.cx>.
First version: <crdate>
Last modified: 06:Apr:2007 10:55
Synopsis: <description>
$Id: skeleton.c,v 1.2 2007-04-06 08:56:27 andre Exp $
*/
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
return 0
}

10
vim/templates/skeleton.pl Normal file
View File

@ -0,0 +1,10 @@
#!/usr/bin/env perl
# -*- coding: latin-1 -*-
# Copyright by Andrea Mistrali <am@am.cx>.
# First version: <crdate>
# Last modified: 06:Apr:2007 10:55
#
# Synopsis: <description>
#
# $Id: skeleton.pl,v 1.2 2007-04-06 08:56:27 andre Exp $

25
vim/templates/skeleton.py Normal file
View File

@ -0,0 +1,25 @@
#!/usr/bin/env python
#-*- coding: latin-1 -*-
"""
Copyright by Andrea Mistrali <am@am.cx>.
First version: <crdate>
Last modified: 06:Apr:2007 10:56
Synopsis: <description>
$Id: skeleton.py,v 1.2 2007-04-06 08:56:27 andre Exp $
"""
__version__ ='0.1'
__author__ ='Andrea Mistrali <am@am.cx>'
def main():
pass
# If we have been called as 'python <script>' let's call main function
if __name__ == "__main__":
main()

10
vim/templates/skeleton.sh Normal file
View File

@ -0,0 +1,10 @@
#!/bin/sh
# -*- coding: latin-1 -*-
# Copyright by Andrea Mistrali <am@am.cx>.
# First version: <crdate>
# Last modified: 06:Apr:2007 10:56
#
# Synopsis: <description>
#
# $Id: skeleton.sh,v 1.2 2007-04-06 08:56:27 andre Exp $

92
vim/vimrc Normal file
View File

@ -0,0 +1,92 @@
set nocompatible " Use Vim defaults (much better!)
set backspace=indent,eol,start " allow backspacing over everything
set noautoindent
set textwidth=78
set backup
set viminfo='20,\"50,f10
set history=50
set nohlsearch
set ruler
set cmdheight=1
set laststatus=2
set shiftwidth=2
set foldcolumn=1
" tab management
set tabstop=4
set softtabstop=4
set expandtab
set background=dark
"set title Uncomment with new version of iTerm
set title
set browsedir=current
set cpoptions=aAcF$
set modeline
set modelines=1
set encoding=iso-8859-1
set listchars=tab:->,trail:.,eol:$
"set paste
set smartcase
set errorbells
"set visualbell
set showcmd " Show (partial) command in status line.
set showmatch " Show matching brackets.
"set ignorecase " Do case insensitive matching
set incsearch " Incremental search
set autowrite " Automatically save before commands like :next and :make
set statusline=%<%f\ %H%m%r%=%-14.(%l,%c%)\ %P\ Buf.%n
set backupcopy=yes
set fileformats=unix,mac,dos
set fileformat=unix
" COMPLETION
"set completeopt=longest,menuone
"set completeopt=longest,menuone,preview
inoremap <expr> <cr> pumvisible() ? "<c-y>" : "<c-g>u<cr>"
inoremap <expr> <c-n> pumvisible() ? "<c-n>" : "<c-n><c-r>=pumvisible() ? "<down>" : "<cr>"
inoremap <expr> <m-;> pumvisible() ? "<c-n>" : "<c-x><c-o><c-n><c-p><c-r>=pumvisible() ? "<down>" : "<cr>"
"
set mouse=a
" Suffixes that get lower priority when doing tab completion for filenames.
"" These are files we are not likely to want to edit or read.
set suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc
colorscheme torte
" TagLIST support
let Tlist_Ctags_Cmd="ctags"
"let Tlist_Use_Right_Window = 0
"let Tlist_Display_Prototype = 1
let Tlist_Exit_OnlyWindow = 1
"let Tlist_Compact_Format = 1
let Tlist_File_Fold_Auto_Close = 1
"let Tlist_Use_SingleClick = 0 "Do not use yet
" Map keys to functions
nnoremap <silent> <F8> :Tlist<CR>
nnoremap <silent> ,l :set list!<CR>
" Vim5 comes with syntaxhighlighting. If you want to enable syntaxhightlighting
" by default uncomment the next three lines.
if has("syntax")
syntax on " Default to no syntax highlightning
endif
if has("autocmd")
filetype plugin indent on
filetype plugin on
endif " has ("autocmd")
" Let's go to where we left
if has("autocmd")
" When editing a file, always jump to the last cursor position
autocmd BufReadPost *
\ if line("'\"") > 0 && line ("'\"") <= line("$") |
\ exe "normal g'\"" |
\ endif
endif