2 set backspace=indent,eol,start
6 set backupdir=~/tmp/vimbak
8 silent exec "!mkdir -p ~/tmp/vimbak"
9 silent exec "!find ~/tmp/vimbak -type f -mtime +3 -delete"
13 filetype plugin indent on
15 " restore position when opening files
17 \ if line("'\"") >= 1 && line("'\"") <= line("$") && &ft !~# 'commit'
18 \ | exe "normal! g`\""
21 " don't automatically continue comments on new lines
22 autocmd BufNewFile,BufRead * setlocal formatoptions-=r
34 " show useful things on the status line
39 " display as much as possible of the last line, instead of @
45 " auto-complete should work like bash
46 set wildmode=longest,list
48 " show one extra line when scrolling
69 " single indent for line continuations
72 let g:pyindent_open_paren = &sw
73 let g:pyindent_continue = &sw
74 let g:vim_indent_cont = &sw
76 " don't allow syntax/sh.vim to change my iskeyword setting
79 " single space after full stop
89 nmap <C-l> :nohlsearch<CR>:redraw!<CR>
91 command SudoWrite call SudoWriteFunction()
93 map <F8> :call ToggleSpelling()<CR>
94 imap <F8> <C-o>:call ToggleSpelling()<CR>
95 map <F9> :call InvShow()<CR>
96 imap <F9> <C-o>:call InvShow()<CR>
97 map <F10> :call WrapToggle()<CR>
98 imap <F10> <C-o>:call WrapToggle()<CR>
99 map <F11> :call PasteToggle()<CR>
100 imap <F11> <C-o>:call PasteToggle()<CR>
103 function ToggleSpelling()
104 if !exists("s:spell_check") || s:spell_check == 0
105 echo "Spell check on"
106 let s:spell_check = 1
107 setlocal spell spelllang=en_au
109 echo "Spell check off"
110 let s:spell_check = 0
111 setlocal spell spelllang=
115 function WrapToggle()
127 echo "Invisible characters off"
130 echo "Invisible characters on"
131 set listchars=tab:.\ ,trail:!
136 function SudoWriteFunction()
141 function PasteToggle()
144 echo "Paste mode disabled"
147 echo "Paste mode enabled"