Skip to content

Instantly share code, notes, and snippets.

@aurelian
Created August 27, 2008 14:44
Show Gist options
  • Save aurelian/7493 to your computer and use it in GitHub Desktop.
Save aurelian/7493 to your computer and use it in GitHub Desktop.
"if has("gui_running")
" function! GuiTabLabel()
" let label = ''
" let bufnrlist = tabpagebuflist(v:lnum)
" let bufname = bufname(bufnrlist[tabpagewinnr(v:lnum) - 1])
" let has_changes = 0
" for bufnr in bufnrlist
" if getbufvar(bufnr, "&modified")
" let has_changes = 1
" break
" endif
" endfor
" if has_changes == 1
" let label .= '+'
" end
" let label .= substitute(bufname, '.*/', '', "")
" return label
" endfunction
"endif
set foldmethod=marker
set foldlevelstart=1
set foldnestmax=5
set foldclose=all
set nocompatible " use vim features
set nobackup " no backup
set nowritebackup " no backup during edit session
set backspace=indent,eol,start " backspace over everything
set tabstop=2 " size of a tab
set shiftwidth=2 " size for auto/smartindent
set softtabstop=2 " a tab is this size
set expandtab " spaces not tabs
set smartindent " indents for you
set smarttab " tabs at start of lines
set autoindent " always set autoindenting on
set so=7 " 7 lines when scrolling vertically
set ffs=unix " eol
set showmatch " show matching bracket
set noerrorbells
set novisualbell
set vb t_vb= " no bells
set modeline " show current mode
set incsearch " do incremental search
set history=150 " keep 50 lines in history
set hlsearch " highlight search word
set ruler
" backspace in Visual mode deletes selection
vnoremap <BS> d
" CTRL-A is Select all
noremap <C-A> gggH<C-O>G
inoremap <C-A> <C-O>gg<C-O>gH<C-O>G
cnoremap <C-A> <C-C>gggH<C-O>G
onoremap <C-A> <C-C>gggH<C-O>G
snoremap <C-A> <C-C>gggH<C-O>G
xnoremap <C-A> <C-C>ggVG
" CTRL-Tab is Next tab
noremap <C-Tab> :tabnext<CR>
inoremap <C-Tab> <ESC>:tabnext<CR>a
onoremap <C-Tab> :tabnext<CR>
syntax on
filetype on
filetype indent on
filetype plugin on
"if has("gui_running")
" colors darkblue
" colors kib_darktango
colors two2tango
"set guifont=Monaco:h12
" set guitablabel=%{GuiTabLabel()}
set guifont=Consolas\ 9
"set guifont=Liberation\ Mono\ 8
"endif
" autocmd FileType rhtml set tabstop=2|set shiftwidth=2
map ,* :s/^\(.*\)$/\/\* \1 \*\//<CR><Esc>:nohlsearch<CR>
imap `d def <def>( ) <CR><CR>end<UP><UP><right><right><ESC>i
imap `c class [class] <CR><CR>end<UP><UP><right><right><right><ESC>i
imap `p <%= -%><left><left><left><left><ESC>i
" vmap sb "zdi<b><C-R>z</b><ESC>i
" ruby echo
vmap re "zdi<%= <C-R>z -%><ESC>i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment