Get rid of Tab, Shift-Tab to switch buffers.
[vimrc.git] / .vimrc
blob819d347cdcc1446e5f607c3e93127c7a813ebe40
1 let digsby='c:\dev\digsby\'
2 let pydir=digsby.'build\msw\python\'
3 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']
4 let g:fuzzy_ignore='*.pyc;*.pyo;.svn;*.suo;*.vcproj;*.o;*.obj;.git'
5 let g:fuzzy_match_limit=75 " default 200
7 " hides file types in directory listings
8 let g:netrw_list_hide='^\.svn/$,^\.settings/$,.*\.pyo$,.*\.pyc,.*\.obj'
10 " Launches web browser with the given URL.
11 function! LaunchBrowser(url)
12     let startcmd = has("win32") || has("win64") ? "! start " : "! "
13     let endcmd = has("unix") ? "&" : ""
15     " Escape characters that have special meaning in the :! command.
16     " let url = substitute(a:url, '!\|#\|%', '\\&', 'g')
18     silent! execute startcmd url endcmd
19 endfunction
21 " digsby directories
22 " if msw...
23 command! CdSrc :cd c:\dev\digsby\src
24 command! CdExt :cd c:\dev\digsby\ext
25 command! CdWxpy :cd c:\dev\digsby\build\msw\wxpy
26 command! CdWebKit :cd c:\dev\digsby\build\msw\webkit
27 command! CdWx :cd c:\dev\digsby\build\msw\wxWidgets
28 command! CdSip :cd c:\dev\digsby\build\msw\sip
29 command! CdPython :cd c:\dev\digsby\build\msw\python
31 " digsby website shortcuts
32 command! -nargs=1 Bug :call LaunchBrowser("http://mini/bugs/?act=view&id=<args>")
33 command! -nargs=1 Ticket :call LaunchBrowser("http://mini/cgi-bin/ticket/<args>")
34 command! -nargs=1 Revision :call LaunchBrowser("http://mini/cgi-bin/changeset/<args>")
35 map \b :Bug 
36 map \t :Ticket 
37 map \r :Revision 
38 map \t :FuzzyFinderTextMate<CR>
40 command! Todo :sp ~/Desktop/TODO.txt
42 command! Pyflakes :call Pyflakes()
43 function! Pyflakes()
44     let tmpfile = tempname()
45     execute "set makeprg=(pyflakes\\ " . % . ")"
46     make
47     cw
48 endfunction
52 " autocmd BufWritePost *.py :PyflakesSigns
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=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>
112 syntax on
114 set nohls " turn off search highlighting (set hls will bring it back)
115 set nobackup
116 set nowritebackup
118 " enter spaces when tab is pressed:
119 set expandtab
121 " do not break lines when line length increases
122 set textwidth=0
124 " use 4 spaces to represent a tab
125 set tabstop=4
126 set softtabstop=4
128 " Copy indent from current line when starting a new line.
129 set smartindent
130 set showmode
131 set autoindent
133 " number of space to use for auto indent
134 " you can use >> or << keys to indent current line or selection
135 " in normal mode.
136 set shiftwidth=4
138 " automatically strip trailing whitespace from Python files
139 autocmd BufWritePre *.py normal m`:%s/\s\+$//e ``
141 " auto indent after "def foo():<CR>"
142 autocmd BufRead *.py set smartindent cinwords=if,elif,else,for,while,try,except,finally,def,class,with
146 " makes backspace key more powerful.
147 set backspace=indent,eol,start
149 " shows the match while typing
150 set incsearch
152 " show line and column number
153 set ruler
155 " show some autocomplete options in status bar
156 set wildmenu
158 " share clipboard with windows clipboard
159 set clipboard+=unnamed
161 " wxPython main stub
162 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
164 iab pymain if __name__ == '__main__':<CR>main()<ESC>
166 ab #d #define