Skip to content

Instantly share code, notes, and snippets.

@mrorii
Created April 17, 2012 21:16
Show Gist options
  • Select an option

  • Save mrorii/2409110 to your computer and use it in GitHub Desktop.

Select an option

Save mrorii/2409110 to your computer and use it in GitHub Desktop.
syntax on
" syntax enable
filetype plugin indent on
nnoremap <Space>. :<C-u>edit $MYVIMRC<Enter>
nnoremap <Space>s. :<C-u>source $MYVIMRC<Enter>
"--------------------------------
" cho45 settings
" refer to https://github.com/cho45/dotfiles/blob/master/.vimrc
set listchars=tab:>.
set list
set backspace=eol,indent,start
" make your own goddamn backup files
set nobackup
" if someone edits my files, reopen it
set autoread
" display line number
set number
" default indent settings
set autoindent smartindent
" nice looking tabs
set smarttab
set softtabstop=4 tabstop=4 "shiftwidth=4
set ignorecase smartcase
" incremental
set incsearch
set wrapscan
" display matching parentheses
set showmatch
" show command being entered
set showcmd
set whichwrap=b,s,h,l,<,>,[,]
" display completions
set wildmenu
set splitbelow
nnoremap <C-h> :<C-u>help<space>
nnoremap <C-h><C-h> :<C-u>help<Space><C-r><C-w><Enter>
noremap ; :
noremap : ;
noremap j gj
noremap k gk
noremap gj j
noremap gk k
inoremap <expr> ,d strftime('%Y-%m-%dT%H:%M:%S')
inoremap <expr> ,d strftime('%Y-%m-%d')
inoremap <expr> ,d strftime('%H:%M:%S')
nnoremap gc `[v`]
vnoremap gc :<C-u>normal gc<Enter>
onoremap gc :<C-u>normal gc<Enter>
autocmd!
autocmd WinEnter * setlocal cursorline
autocmd WinLeave * setlocal nocursorline
command! Cp932 edit ++enc=cp932
command! Eucjp edit ++enc=euc-jp
command! Iso2022jp edit ++enc=iso-2022-jp
command! Utf8 edit ++enc=utf-8
command! Jis Iso2022jp
command! Sjis Cp932
command! -complete=customlist,CompleteCD -nargs=? CD cd <args>
function! CompleteCD(arglead, cmdline, cursorpos)
let pattern = join(split(a:cmdline, '\s', !0)[1:], ' ') . '*/'
return split(globpath(&cdpath, pattern), "\n")
endfunction
cnoreabbrev <expr> cd (getcmdtype() == ':' && getcmdline() ==# 'cd') ? 'CD' : 'cd'
set expandtab
set shiftwidth=2
" yanktmp.vim
noremap <silent> sy :call YanktmpYank()<CR>
noremap <silent> sp :call YanktmpPaste_p()<CR>
" pathogen
call pathogen#runtime_append_all_bundles()
" FuzzyFinder
nnoremap <unique> <silent> <space>fb :FufBuffer!<CR>
nnoremap <unique> <silent> <space>ff :FufFile!<CR>
nnoremap <unique> <silent> <space>fm :FufMruFile!<CR>
nnoremap <unique> <silent> <Space>fc :FufRenewCache<CR>
autocmd FileType fuf nmap <C-c> <ESC>
let g:fuf_patternSeparator = ' '
let g:fuf_modesDisable = ['mrucmd']
let g:fuf_mrufile_exclude = '\v\.DS_Store|\.git|\.swp|\.svn'
let g:fuf_mrufile_maxItem = 100
let g:fuf_enumeratingLimit = 20
let g:fuf_file_exclude = '\v\.DS_Store|\.git|\.swp|\.svn'
set showtabline=2
" Tabs
nnoremap <Space>t t
nnoremap <Space>T T
nnoremap t <Nop>
nnoremap <silent> tc :<C-u>tabnew<CR>:tabmove<CR>
nnoremap <silent> tk :<C-u>tabclose<CR>
nnoremap <silent> tn :<C-u>tabnext<CR>
nnoremap <silent> tp :<C-u>tabprevious<CR>
" zencoding
let g:user_zen_settings = {
\ 'indentation' : ' ',
\ 'perl' : {
\ 'aliases' : {
\ 'req' : 'require '
\ },
\ 'snippets' : {
\ 'use' : "use strict\nuse warnings\n\n",
\ 'warn' : "warn \"|\";",
\ }
\ }
\}
let g:user_zen_expandabbr_key = '<c-e>'
autocmd FileType html :set omnifunc=htmlcomplete#CompleteTags
autocmd FileType css :set omnifunc=csscomplete#CompleteCSS
autocmd FileType xml :set omnifunc=xmlcomplete#CompleteTags
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment