Skip to content

Instantly share code, notes, and snippets.

@stevedoyle
Last active September 27, 2015 22:08
Show Gist options
  • Save stevedoyle/1339066 to your computer and use it in GitHub Desktop.
Save stevedoyle/1339066 to your computer and use it in GitHub Desktop.
vimrc
" indendentation specific to file types
:filetype plugin indent on
filetype plugin on
" spaces instead of tabs
"set expandtab
" show line numbers
"set number
" highlight the searchterms
set hlsearch
" jump to matches when typing
set incsearch
" show matching braces
set showmatch
" show partial commands
set showcmd
" powerful backspaces
set backspace=indent,eol,start
" enable all features
set nocompatible
" syntax highlight
syntax on
" show ruler including line and column numbers
show ruler
" Smart case sensitivity when searching. Use all lower case for case
" insensitive search. Any upper case character in the search string will
" result in a case sensitive search. Override with \c in the search string.
set ignorecase
set smartcase
" Filetype handling
filetype on " Enable filetype detection
filetype indent on " Enable filetype-sepcific indenting
filetype plugin on " Enable filetype-specific plugins
compiler ruby " Enable compiler support for ruby
" dark background
" set bg=dark
set term=builtin_ansi
:map <C-\> :tab split<CR> :exe 'tj' expand('<cword>')<CR>
" When editing a file, always jump to the last known cursor positionr.
" Don't do it when the position is invalid or when inside an event handler.
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal g`\"" |
\ endif
" taglist plugin shortcuts and settings
noremap <silent> <F8> :TlistToggle<CR>
noremap <silent> <F9> :TlistShowTag<CR>
" Automatically add C/C++ header gates to new C/C++ header files
function! s:insert_gates()
let gatename = substitute(toupper(expand("%:t")), "\\.", "_", "g")
execute "normal! i#ifndef _" . gatename . "_"
execute "normal! o#define _" . gatename . "_\n"
execute "normal! Go#endif /* _" . gatename . "_ */"
normal! kk
endfunction
autocmd BufNewFile *.{h,hpp} call <SID>insert_gates()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment