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
30 " filename (~/some/dir) (1 of 2) (hostname)
31 set titlestring=%t%(\ %M%)%(\ (%{expand(\"%:p:~:h\")})%)%(\ %a%)\ (%{hostname()})
36 " show useful things on the status line
41 " display as much as possible of the last line, instead of @
47 " auto-complete should work like bash
48 set wildmode=longest,list
50 " show one extra line when scrolling
71 " single indent for line continuations
74 let g:pyindent_open_paren = &sw
75 let g:pyindent_continue = &sw
76 let g:vim_indent_cont = &sw
78 " don't allow syntax/sh.vim to change my iskeyword setting
81 " single space after full stop
91 nmap <C-l> :nohlsearch<CR>:redraw!<CR>
93 command SudoWrite call SudoWriteFunction()
95 map <F8> :call ToggleSpelling()<CR>
96 imap <F8> <C-o>:call ToggleSpelling()<CR>
97 map <F9> :call InvShow()<CR>
98 imap <F9> <C-o>:call InvShow()<CR>
99 map <F10> :call WrapToggle()<CR>
100 imap <F10> <C-o>:call WrapToggle()<CR>
101 map <F11> :call PasteToggle()<CR>
102 imap <F11> <C-o>:call PasteToggle()<CR>
105 function ToggleSpelling()
106 if !exists("s:spell_check") || s:spell_check == 0
107 echo "Spell check on"
108 let s:spell_check = 1
109 setlocal spell spelllang=en_au
111 echo "Spell check off"
112 let s:spell_check = 0
113 setlocal spell spelllang=
117 function WrapToggle()
129 echo "Invisible characters off"
132 echo "Invisible characters on"
133 set listchars=tab:.\ ,trail:!
138 function SudoWriteFunction()
143 function PasteToggle()
146 echo "Paste mode disabled"
149 echo "Paste mode enabled"