Feed

hamaco's watching list

Profile

.vimrcごちゃごちゃしすぎかも。

それにしてもどのプラグインを常用してるのか覚えてないなぁ。

.vimrc

set nocompatible

filetype on
filetype indent on
filetype plugin on

set number
set ruler
set list
set listchars=tab:>-,trail:-,extends:>,precedes:<
set wrap
set laststatus=2
set cmdheight=2
set showcmd
set title
set scrolloff=5
set vb t_vb=
set statusline=%<%f\ %m%r%h%w%y%{'['.(&fenc!=''?&fenc:&enc).']['.&ff.']'}%=%4v\ %l/%L

set ignorecase
set smartcase
set incsearch

set tabstop=2
set shiftwidth=2
set softtabstop=2
set autoindent
set backspace=indent,eol,start
set expandtab
set smarttab
set wrapscan
set showmatch
set wildmenu
set formatoptions+=mM
set clipboard=unnamed

set wildmode=list:longest

set backup
set swapfile
if has('unix')
set backupdir=~/.vim/backup
set directory=~/.vim/swap
elseif has('win32')
set backupdir=$VIM\backup
set directory=$VIM\swap
endif

if has("unix")
set termencoding=utf-8
set encoding=utf-8
endif
set fileencoding=utf-8
set fileencodings=utf-8,ucs-bom,iso-2022-jp-3,iso-2022-jp-2,euc-jisx0213,euc-jp,cp932
set fileformat=unix
set fileformats=unix,dos,mac

if filereadable($VIM . '/vimrc') && filereadable($VIM . '/ViMrC')
set tags=./tags,tags
endif

if has('win32') && $PATH !~? '\(^\|;\)' . escape($VIM, '\\') . '\(;\|$\)'
let $PATH = $VIM . ';' . $PATH
endif

nnoremap j gj
nnoremap k gk
inoremap <C-f> <Right>
inoremap <C-b> <Left>
inoremap <C-x><C-s> <ESC>:w<CR>a
nnoremap <C-x><C-s> :w<CR>
if has('unix')
cnoremap <C-x> <C-r>=expand('%:p:h')<CR>/
endif

if v:version >= 700
nnoremap 1 :tabprevious<CR>
nnoremap 2 :tabnext<CR>
nnoremap <C-t> :tab new<CR>
nnoremap <C-w> :q<CR>
nnoremap <C-Tab> gt
nnoremap <C-S-Tab> gT

nnoremap <M-1> :tabn 1<CR>
nnoremap <M-2> :tabn 2<CR>
nnoremap <M-3> :tabn 3<CR>
nnoremap <M-4> :tabn 4<CR>
nnoremap <M-5> :tabn 5<CR>
nnoremap <M-6> :tabn 6<CR>
nnoremap <M-7> :tabn 7<CR>
nnoremap <M-8> :tabn 8<CR>
nnoremap <M-9> :tabn 9<CR>
endif

function InsertTabWrapper()
if pumvisible()
return "\<c-n>"
endif
let col = col('.') - 1
if !col || getline('.')[col - 1] !~ '\k\|<\|/'
return "\<tab>"
"elseif exists('&omnifunc') && &omnifunc == ''
"return "\<c-n>"
else
"return "\<c-x>\<c-o>"
return "\<c-n>"
endif
endfunction
inoremap <tab> <c-r>=InsertTabWrapper()<cr>