| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- """"""""
- "" Plugin Loading with Pathogen
- """""""""""""""""""""""""""""""""""""""""""""""""""
- call pathogen#infect()
- call pathogen#runtime_append_all_bundles()
- call pathogen#helptags()
- """"""""
- "" General Behaviours
- """""""""""""""""""""""""""""""""""""""""""""""""""
- set nocompatible "Don't have to try to be compatible with old vi
- set autoread "Read a file if it's changed from outside of vim
- let mapleader = "," "Leader key lets you make more kinds of shortcuts!
- " Source the vimrc file after saving it
- autocmd! bufwritepost .vimrc source $MYVIMRC
- """"""""
- "" Tabbing
- """"""""""""""""""""""""""""""""""""""""""""""""""""""
- set tabstop=4 "actual tab presses
- set shiftwidth=4 "for autoindent
- set expandtab "change to single spaces
- set smarttab
- set autoindent "use last line to set next indent
- set smartindent "guess harder, based on C-like language
- " set wrap "wrap lines of text
- """"""""
- "" UI - Colours
- """"""""""""""""""""""""""""""""""""""""""""""""""""""
- syntax on
- colorscheme desert
- hi Folded ctermfg=darkred "set colour for folded lines
- if version >= 730
- set colorcolumn=80
- endif
- """"""""
- "" UI - Numbering
- """"""""""""""""""""""""""""""""""""""""""""""""""""""""
- set number "show line numbers
- set ruler "show row,col count in status line
- if version >= 730
- set relativenumber "current line always 0 (requires 7.3 and up)
- endif
- """"""""
- "" UI - Code Folding
- """"""""""""""""""""""""""""""""""""""""""""""""""""""""
- set foldmethod=indent
- set foldlevel=5
- set foldtext=MyFoldText()
- function! MyFoldText()
- let line = getline(v:foldstart)
- let indent = indent(v:foldstart)
- let indentOnly = strpart(line, 0, indent-1)
- let linecount = v:foldend+1 - v:foldstart
- let plural = ""
- if linecount != 1
- let plural = "s"
- endif
- let foldtext = '+'.indentOnly.'... ('.linecount.' More lines)'
- return foldtext
- endfunction
- """"""""
- "" UI - Search
- """"""""""""""""""""""""""""""""""""""""""""""""""""""""
- set hlsearch "make searches highlighted
- set incsearch "vim will search as you type!
- """"""""
- "" Shortcuts
- """"""""""""""""""""""""""""""""""""""""""""""""""""""""
- " More convenient escape
- imap ii <Esc>
- imap II <Esc>
- " Add extra lines up and down
- map <leader>j o<Esc>k
- map <leader>k O<Esc>j
- " window resizing
- noremap + <C-w>10+
- noremap - <C-w>10-
|