diff --git a/VimSetup.rc b/VimSetup.rc new file mode 100644 index 0000000..27223a7 --- /dev/null +++ b/VimSetup.rc @@ -0,0 +1,189 @@ + +" +" set guioptions-=T +" going to use this until it comes back to bite me... +" Amazing - it never did. +" +set autowrite + +" +" Setting for Mac, but perhaps not always want this +" +"set makeprg=xcodebuild +set makeprg=make + +set guifont=Monaco:h13 + +" +" Defaults for Bash-Support Vim plugin +" +let g:BASH_AuthorName = $USER_NAME +let g:BASH_AuthorRef = $USER_REF +let g:BASH_Email = $USER_EMAIL +let g:BASH_Company = $USER_COMPANY + +" +" Set color scheme +" +colorscheme chlordane + + +" +" Stuff from ian +" + +" set backup +set nocompatible + +syn on + + +" My personal preference on Mac with no PgUp/PgDn +" Don't need up,down,left,right mapping if have arrow keys so make these keys more useful +" On keyboard the keys are arranged H L J K so for latin based language readers, it makes +" logical sense that H goes left/prev char and K goes right/next char, but normally L goes +" down and J goes up which makes no sense to me. Logically L should go up/prev line and K +" go down/next line to be consistent. So I have remapped them as follows: +" H -> go to beginning of the current line +" L -> go to the end of the current line +" J -> go up a page +" K -> go down a page +" If you want to move about by characters, there are the arrow keys +map h ^ +map l $ +map j  +map k  + + +map  :cn +map  :cp +" or +" map N :cnVM +" map P :cpVM + + +" Stuff From wiki + +set ts=2 sw=2 et +" set shiftwidth=4 +" set softtabstop=4 +set expandtab + + +" Justin informs me that :0 in your cinoptions is how you prevent the extra indentation on switch statements. +"cinoptions=[options],:0 +"cinoptions+=:0 + +set tags=$BASEDIR/.tags + +map +map + +set shiftround +set autoindent + +map :!p4 edit %:set noreadonly +map Q :" Q enters EX mode. You don't want EX mode. + +syn keyword cType uchar ushort uint ulong +syn keyword cType pchar puchar pcchar +syn keyword cType Q_INT8 Q_INT16 Q_INT32 Q_LONG +syn keyword cType Q_UINT8 Q_UINT16 Q_UINT32 Q_ULONG +syn keyword cConstant TRUE FALSE +syn keyword cStorageClass Q_EXPORT + +filetype on + +set ignorecase +set smartcase +set incsearch +set hlsearch + +" Spelling + +let IspellLang = 'british' +let PersonalDict = '~/.ispell_' . IspellLang + +abbreviate teh the + +" * Keystrokes -- Moving Around + +" have the h and l cursor keys wrap between lines (like and do +" by default), and ~ covert case over line breaks; also have the cursor keys +" wrap in insert mode: +set whichwrap=h,l,~,[,] + +" use to cycle through split windows (and + to cycle backwards, +" where possible): +nnoremap w +nnoremap W + +" have % bounce between angled brackets, as well as t'other kinds: +set matchpairs+=<:> + +" have prompt for a help topic, rather than displaying the introduction +" page, and have it do this from any mode: +nnoremap :help +vmap +omap +map! + +" * Keystrokes -- Formatting + +" have Q reformat the current paragraph (or selected text if there is any): +nnoremap Q gqap +vnoremap Q gq + +" have the usual indentation keystrokes still work in visual mode: +vnoremap > +vnoremap +vmap +vmap + +" have Y behave analogously to D and C rather than to dd and cc (which is +" already done by yy): +noremap Y y$ + +" * Keystrokes -- Insert Mode + +" allow to delete linue breaks, beyond the start of the current +" insertion, and over indentations: +set backspace=eol,start,indent + +" Why, because some MORON decided that gcc would be better at wordwrapping then anything else, and GOT IT WRONG! +set errorformat=%A%f:%l:%m,%C\ \ \ %m,%*[^\"]\"%f\"%*\\D%l:\ %m,\"%f\"%*\\D%l:\ %m,%-G%f:%l:\ (Each\ undeclared\ identifier\ is\ reported\ only\ once,%-G%f:%l:\ for\ each\ function\ it\ appears\ in.),%f:%l:%m,\"%f\"\,\ line\ %l%*\\D%c%*[^\ ]\ %m,%D%*\\a[%*\\d]:\ Entering\ directory\ `%f',%X%*\\a[%*\\d]:\ Leaving\ directory\ `%f',%DMaking\ %*\\a\ in\ %f + +if !exists("autocmd_loaded") + let autocmd_loaded = 1 + +" autocmd BufNewFile,BufRead *.cpp,*.c,*.h,*.txt,*.qdoc,*.doc setlocal spell spelllang=en_us + autocmd BufNewFile,BufRead *.doc,*.qdoc,*.book,*.leaf set filetype=doc + autocmd BufNewFile,BufRead *.pro,*.pri set filetype=pro + autocmd BufNewFile,BufRead *akefile*,*.inc,*.mak set noexpandtab + autocmd BufNewFile,BufRead *akefile*,*.inc,*.mak set filetype=make + +endif + +" Remember the position of the cursor from previous edits +autocmd BufReadPost * +\ if expand(":p:h") !=? $TEMP | +\ if line("'\"") > 0 && line("'\"") <= line("$") | +\ exe "normal g`\"" | +\ let b:doopenfold = 1 | +\ endif | +\ endif +" Need to postpone using "zv" until after reading the modelines. +autocmd BufWinEnter * +\ if exists("b:doopenfold") | +\ unlet b:doopenfold | +\ exe "normal zv" | +\ endif + +set nowrap + +" Enable right-clicking on things for a pop-up menu (instead of selecting) +" :set mousemodel=popup_setpos + +set ruler +" set number +