Merge branch 'master' of ssh://kevinw@repo.or.cz/srv/git/vimrc
[vimrc.git] / .vimrc
blobfabc57e382c6388b1f99f8c6cea82fe834f58e40
1 filetype plugin on
2 let digsby='c:\dev\digsby\'
3 let pydir=digsby.'build\msw\python\'
4 let g:fuzzy_roots=[digsby.'src', digsby.'ext\src', digsby.'build\msw\wxWidgets\src', digsby.'build\msw\wxWidgets\include', pydir.'include', pydir.'Modules', pydir.'Objects', pydir.'Lib', digsby.'build\msw\sip', digsby.'build\msw\wxpy\src']
5 let g:fuzzy_ignore='*.pyc;*.pyo;.svn;*.suo;*.vcproj;*.o;*.obj;.git'
6 let g:fuzzy_match_limit=75 " default 200
7 let g:fuzzy_roots = ['~/src/digsby/src']
9 function! SetFuzzyOptions()
10     if exists("g:FuzzyFinderOptions") && exists("g:FuzzyFinderOptions.TextMate")
11         let g:FuzzyFinderOptions.TextMate.matching_limit = 50
12     endif
13 endfunction
15 au VimEnter * call SetFuzzyOptions()
17 command CdFile :cd %:h " change directories to the current file's directory
19 " hides file types in directory listings
20 let g:netrw_list_hide='^\.svn/$,^\.settings/$,.*\.pyo$,.*\.pyc,.*\.obj'
22 " Launches web browser with the given URL.
23 function! LaunchBrowser(url)
24     let startcmd = has("win32") || has("win64") ? "! start " : "! "
25     let endcmd = has("unix") ? "&" : ""
27     " Escape characters that have special meaning in the :! command.
28     " let url = substitute(a:url, '!\|#\|%', '\\&', 'g')
30     silent! execute startcmd url endcmd
31 endfunction
33 " digsby directories
34 " if msw...
35 command! CdSrc :cd c:\dev\digsby\src
36 command! CdExt :cd c:\dev\digsby\ext
37 command! CdWxpy :cd c:\dev\digsby\build\msw\wxpy
38 command! CdWebKit :cd c:\dev\digsby\build\msw\webkit
39 command! CdWx :cd c:\dev\digsby\build\msw\wxWidgets
40 command! CdSip :cd c:\dev\digsby\build\msw\sip
41 command! CdPython :cd c:\dev\digsby\build\msw\python
43 " digsby website shortcuts
44 command! -nargs=1 Bug :call LaunchBrowser("http://mini/bugs/?act=view&id=<args>")
45 command! -nargs=1 Ticket :call LaunchBrowser("http://mini/cgi-bin/ticket/<args>")
46 command! -nargs=1 Revision :call LaunchBrowser("http://mini/cgi-bin/changeset/<args>")
47 map \b :Bug 
48 map \t :Ticket 
49 map \r :Revision 
50 map \t :FuzzyFinderTextMate<CR>
52 command! Todo :sp ~/Desktop/TODO.txt
54 " highlight SIP files like C++
55 au BufNewFile,BufRead *.sip set filetype=cpp
57 " automatically jump to the last position in a file
58 " au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal g'\"" | endif
60 " let VCSCommandGitExec = "c:\\program files\\git\\bin\\git.exe"
62 set nowrap " no wordwrap
64 " don't write any temporary files
65 set nobackup
66 set nowritebackup
67 set noswapfile
69 map ,j :e **/
71 " ,v opens this file
72 " ,V reloads it
73 map ,v :sp ~/vimfiles/.vimrc<CR><C-W>_
74 map <silent> ,V :source ~/vimfiles/.vimrc<CR>:filetype detect<CR>:exe ":echo 'vimrc reloaded'"<CR>
76 " ,d deletes a line but leaves a blank
77 map ,d ddO<ESC>
79 " ,b goes back to previous file
80 map ,b :e#<CR>
82 " check syntax more
83 autocmd BufEnter * :syntax sync fromstart
85 " don't bother with vi compatibility
86 set nocompatible
88 if has("gui_running")
89     " make the default window size a bit bigger
90 "    set lines=60
91 "    set columns=90
92     colorscheme desert
93     set gfn=Monaco:h15:a,Consolas:h10:cANSI
95     set guioptions-=m "remove the menu bar
96     set guioptions-=T "remove the tool bar
97 endif " gui-running
99 set showmatch   "show matching brackets
100 set ignorecase  "case insensitive matching
101 set textwidth=0 "don't wrap text
102 set scrolloff=5 "keep context while scrolling
104 let python_highlight_all = 1
106 set autowrite " automatically save files when changing buffers
108 set wildignore+=*.o,*.obj,*.pyc,*.pyo " ignore filetypes for auto complete
109 map ,; <esc>A;<esc>
111 syntax on
113 set nohls " turn off search highlighting (set hls will bring it back)
114 set nobackup
115 set nowritebackup
117 " enter spaces when tab is pressed:
118 set expandtab
120 " do not break lines when line length increases
121 set textwidth=0
123 " use 4 spaces to represent a tab
124 set tabstop=4
125 set softtabstop=4
127 " Copy indent from current line when starting a new line.
128 set smartindent
129 set showmode
130 set autoindent
132 " number of space to use for auto indent
133 " you can use >> or << keys to indent current line or selection
134 " in normal mode.
135 set shiftwidth=4
137 " automatically strip trailing whitespace from Python files
138 autocmd BufWritePre *.py normal m`:%s/\s\+$//e ``
140 " auto indent after "def foo():<CR>"
141 autocmd BufRead *.py set smartindent cinwords=if,elif,else,for,while,try,except,finally,def,class,with
145 " makes backspace key more powerful.
146 set backspace=indent,eol,start
148 " shows the match while typing
149 set incsearch
151 " show line and column number
152 set ruler
154 " show some autocomplete options in status bar
155 set wildmenu
157 " share clipboard with windows clipboard
158 set clipboard+=unnamed
160 set showmatch " highlight matching parens
162 " wxPython main stub
163 iab wxmain import wx<CR><CR>def main():<CR>a = wx.PySimpleApp()<CR>f = wx.Frame(None, -1, 'Test')<CR><CR>f.Show()<CR>a.MainLoop()<CR><CR>\bif __name__ == '__main__':<CR>main()<ESC>6ko
165 iab pymain if __name__ == '__main__':<CR>main()<ESC>
167 ab #d #define