Skip to content

Instantly share code, notes, and snippets.

@vincentisambart
Created October 28, 2009 12:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vincentisambart/220441 to your computer and use it in GitHub Desktop.
Save vincentisambart/220441 to your computer and use it in GitHub Desktop.
" vim: fileencoding=utf8
set termencoding=utf-8
scriptencoding utf8
set nocompatible
set backspace=indent,eol,start
set ru showcmd showmatch
set incsearch
set nowrap
set iminsert=0 imsearch=0
set expandtab softtabstop=2 shiftwidth=2
set fileencoding=utf8
set fileencodings=ucs-bom,utf8,prc
set guioptions-=T
set wildmenu
set nobackup
syn sync minlines=1000
autocmd FileType c\|cpp set noet sts=4 ts=8 sw=4
" Ctrl-X is Cut
vnoremap <C-X> "+x
" Ctrl-C is Copy
vnoremap <C-C> "+y
if has("gui_running")
if has("gui_gtk2")
set guifont=Bitstream\ Vera\ Sans\ Mono\ 8
elseif has("win32")
" I do not know why, but size 9 of Osaka-等幅
" is not antialiased so more readable
set guifont=Osaka-等幅:h9:cSHIFTJIS
endif
endif
" The stuff bellow comes from vimrc_example.vim
" Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern.
if &t_Co > 2 || has("gui_running")
syntax on
set hlsearch
endif
" Only do this part when compiled with support for autocommands.
if has("autocmd")
" Enable file type detection.
" Use the default filetype settings, so that mail gets 'tw' set to 72,
" 'cindent' is on in C files, etc.
" Also load indent files, to automatically do language-dependent indenting.
filetype plugin indent on
" Put these in an autocmd group, so that we can delete them easily.
augroup vimrcEx
au!
" For all text files set 'textwidth' to 78 characters.
autocmd FileType text setlocal textwidth=78
" When editing a file, always jump to the last known cursor position.
" Don't do it when the position is invalid or when inside an event handler
" (happens when dropping a file on gvim).
" Also don't do it when the mark is in the first line, that is the default
" position when opening a file.
autocmd BufReadPost *
\ if line("'\"") > 1 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif
augroup END
else
set autoindent " always set autoindenting on
endif " has("autocmd")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment