Created
November 16, 2015 06:34
-
-
Save hogelog/698132ccebd000f004ab to your computer and use it in GitHub Desktop.
vimrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Use this group for any autocmd defined in this file. | |
augroup MyAutoCmd | |
autocmd! | |
augroup END | |
" gocode | |
set rtp+=$GOROOT/misc/vim | |
"golint | |
exe "set rtp+=" . globpath($GOPATH, "src/github.com/golang/lint/misc/vim") | |
filetype plugin indent on | |
syntax enable | |
"colorscheme default | |
let mapleader = "," | |
let $PATH="c:\\cygwin\\bin;".$PATH | |
set noswapfile | |
set nobackup | |
set undodir=/Users/sunao-komuro/.vim/undo | |
set number | |
set smartindent | |
" completion | |
set wildmode=list:longest | |
" no bell | |
set visualbell | |
set t_vb= | |
" for UTF-8 | |
set ambiwidth=double | |
" show statusline always | |
set laststatus=2 | |
" show fenc, ff on statusline | |
set statusline=%<%f\ %m%r%h%w%{'['.(&fenc!=''?&fenc:&enc).']['.&ff.']'}%=%l,%c%V%8P | |
set showmatch | |
set modeline | |
set tabstop=2 | |
set shiftwidth=2 | |
set softtabstop=0 | |
set expandtab | |
set textwidth=0 | |
set encoding=utf-8 | |
set termencoding=utf-8 | |
set fileencodings=utf-8,iso-2022-jp,euc-jp,cp932 | |
set fileformats=unix,dos,mac | |
" search | |
set ignorecase | |
set smartcase | |
set hlsearch | |
set history=500 | |
" spell check | |
set spelllang=en | |
" for crontab | |
set backupskip=/tmp/*,/private/tmp/* | |
command Q qa | |
let g:is_gauche = 1 | |
" auto save | |
set updatetime=50 | |
autocmd MyAutoCmd CursorHold * call AutoUp() | |
function! AutoUp() | |
if expand('<afile>') != '' && !&readonly && &buftype == '' && &filetype != 'tex' | |
silent update | |
endif | |
endfunction | |
let s:CMapABC_Entries = [] | |
function! s:CMapABC_Add(original_pattern, alternate_name) | |
call add(s:CMapABC_Entries, [a:original_pattern, a:alternate_name]) | |
endfunction | |
" tabpage | |
nnoremap <silent> <C-t>c :tabnew \| tabmove<Return> | |
nnoremap <silent> <C-t>k :tabclose<Return> | |
nnoremap <silent> <C-t>p :tabprev<Return> | |
nnoremap <silent> <C-t>n :tabnext<Return> | |
nmap <C-t><C-c> <C-t>c | |
nmap <C-t><C-k> <C-t>k | |
nmap <C-t><C-p> <C-t>p | |
nmap <C-t><C-n> <C-t>n | |
command! -complete=customlist,<SID>CommandComplete_cdpath -nargs=1 CD | |
\ TabCD <args> | |
function! s:CommandComplete_cdpath(arglead, cmdline, cursorpos) | |
return split(globpath(&cdpath, a:arglead . '*/'), "\n") | |
endfunction | |
call s:CMapABC_Add('^cd', 'CD') | |
command! -nargs=1 TabCD | |
\ execute 'cd' <q-args> | |
\ | let t:cwd = getcwd() | |
autocmd MyAutoCmd TabEnter * | |
\ if !exists('t:cwd') | |
\ | let t:cwd = getcwd() | |
\ | endif | |
\ | execute 'cd' t:cwd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment