LoginSignup
4
5

More than 5 years have passed since last update.

一からvim(俺得)

Last updated at Posted at 2016-09-10

PCが変わるたびにvimの設定をするのが面倒なので、
完全に俺得なvimの設定をまとめる

"-------------------------
"settings for find
set wrapscan
set hlsearch


"-------------------------
"settings for highlight
set showmatch


"-------------------------
"settings for footer(command line, status line, ...)

"command line settings
set cmdheight=1

"status line settings
set showcmd
set laststatus=2
set statusline+=%<%F
set statusline+=%r
set statusline+=%h
set statusline+=%w
set statusline+=[%{&fileformat}]
set statusline+=[%{has('multi_byte')&&\&fileencoding!=''?&fileencoding:&encoding}]
set statusline+=%y
set statusline+=%=
set statusline+=%{exists('*SkkGetModeStr')?SkkGetModeStr():''}
set statusline+=[%{col('.')-1}=ASCII=%B,HEX=%c]
set statusline+=[C=%c/%{col('$')-1}]
set statusline+=[L=%l/%L]
set statusline+=[%p%%]


"-------------------------
"settings for virtual box
set virtualedit=block


"-------------------------
"settings for indent
set autoindent
set smartindent
set tabstop=4
set shiftwidth=4
set expandtab


"-------------------------
"settings for keybindings

"keybindings like emacs
noremap! <C-A> <Home>
noremap! <C-B> <Left>
noremap! <C-D> <Delete>
noremap! <C-H> <Left><Delete>
noremap! <C-E> <End>
noremap! <C-F> <Right>
noremap! <C-N> <Down>
noremap! <C-P> <Up>

noremap <C-A> <Home>
noremap <C-B> <Left>
noremap <C-D> <Delete>
noremap <C-H> <Left><Delete>
noremap <C-E> <End>
noremap <C-F> <Right>
noremap <C-N> <Down>
noremap <C-P> <Up>

"quick ESC on insert mode
inoremap <C-C> <ESC>

"off to highlight on pressing ESC
nmap <ESC><ESC> :noh<CR>


"------------------------
"settings for GUI

"can use wildmenu
set whichwrap=b,s,[,],<,>
set wildmenu

"can use clipboard
set clipboard+=unnamed

"can use mouse
if has ("mouse")
    set mouse=a
    set guioptions+=a
    set ttymouse=xterm2
endif


"-----------------------
"settings for completion
set wildmode=list,full

"----------------------
"settings for Unicode
set ambiwidth=double


"-----------------------
"settings for history
set history=50


"-----------------------
"other settings

"visible TAB,EOL,...
set list
set listchars=tab:»-,trail:-,eol:↲,extends:»,precedes:«,nbsp:%

"show ruler
set ruler

"show line number
set number

"show cursor line
set cursorline

"show title
set title

"can edit multiple files
set hidden

"can remove line head on pressing backspace key
set backspace=indent,eol,start
4
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
5