if &compatible set nocompatible endif " Editor-Settings{{{ " Encoding{{{ " Use utf-8 to overall encoding. set encoding=utf-8 " Use utf-8 when file write. set fileencoding=utf-8 " Use file encodings when loaded. set fileencodings=utf-8,sjis,iso-2022-jp,euc-jp " }}} " Automatic line feed code recognition. set fileformats=unix,dos " Disable backup. set nobackup " Don't make swap file. set noswapfile " East asia ambigunous charactor width problem. set ambiwidth=single " Automatically load the file being edited set autoread " Move the cursor one character ahead of the end of the line " set virtualedit=onemore " Use the clipboard on linux systems. set clipboard+=unnamedplus " diff vertical view set diffopt+=vertical " no beep set visualbell t_vb= " }}} " Display{{{ " Display rows number. set number " Display relative rows number. set relativenumber " Display current row cursorline. set cursorline " Show title bar string when X11. set icon " Set title string. set iconstring='\ \|\ [%f]' " True color terminal settings. if exists('+termguicolors') let &t_8f="\[38;2;%lu;%lu;%lum" let &t_8b="\[48;2;%lu;%lu;%lum" set termguicolors endif " Transparency of pop-up menus such as completion "set pumblend=30 " }}} " Folding{{{ set foldmethod=marker set foldlevel=0 set foldcolumn=3 " }}} " Search{{{ " Highlight search results set hlsearch " Incremental search. " Search starts when you enter the first character of the search word. set incsearch " Search is not case sensitive set ignorecase " Searching in lowercase ignores uppercase and lowercase set smartcase " When the search progresses to the end of the file, search again from the beginning of the file. set wrapscan " }}} " Indent{{{ " Smart indent. set smartindent " Insert tab with half-width space. set expandtab " The amount of blank space to insert with each command or smart indent. set shiftwidth=2 " Tab width with 2 spaces. set tabstop=2 " Insert a tab with 2 minutes of half-width space. set softtabstop=2 let g:vim_indent_count = 0 augroup filetypeIndent autocmd! autocmd FileType html setlocal tabstop=2 softtabstop=2 shiftwidth=2 autocmd FileType css setlocal tabstop=2 softtabstop=2 shiftwidth=2 autocmd FileType python setlocal tabstop=4 softtabstop=4 shiftwidth=4 autocmd FileType php setlocal tabstop=4 softtabstop=4 shiftwidth=4 augroup END " }}} " Statusline{{{ " Display statusline. set laststatus=2 " Command line completion. set wildmenu " Command history. set history=5000 " }}} " Invisible characters{{{ " Invisible characters "set list "Tab/End line Space/End line/No brake space. "set listchars=tab:»-,space:・,trail:・,nbsp:%,eol:↲,extends:»,precedes:« " }}} " Keybind settings. " Window control keybind {{{ " overwrites window command of 'CTRL-W'. " Use prefix [Window]. nnoremap nnoremap [Window] nmap w [Window] " Commands of move between window. nnoremap [Window]h h nnoremap [Window]j j nnoremap [Window]k k nnoremap [Window]l l " Commands of move window. nnoremap [Window]H H nnoremap [Window]J J nnoremap [Window]K K nnoremap [Window]L L " Tab page controls. nnoremap [Window]th gT nnoremap [Window]tl gt nnoremap [Window]tt g nnoremap [Window]tT T nnoremap [Window]tn tabnew nnoremap [Window]tN -tabnew " Commands of close window. nnoremap [Window]q q nnoremap [Window]Q quit! nnoremap [Window]o o " Commands of window split. nnoremap [Window]s s nnoremap [Window]v v nnoremap [Window]n n " Window size controls. nnoremap [Window]+ + nnoremap [Window]- - nnoremap [Window]= = nnoremap [Window]< < nnoremap [Window]> > " }}} " File save keybinds. {{{ nnoremap [Save] nmap s [Save] nnoremap [Save]a wall nnoremap [Save]q wq nnoremap [Save]w write nnoremap [Save]u update " }}} " Normal Mode:{{{ " US Keyboard layout mapping. " Exchange Colon and Semi-Colon. nnoremap ; : nnoremap : ; nnoremap q; q: " Do not save the things erased by x and c in the register. nnoremap x "_x nnoremap c "_c " For vim-sandwich. " nnoremap s " Opens the file name under the cursor. nnoremap gf gF " Disable highlights from search results. nnoremap n nohlsearch " }}} " Insert Mode:{{{ " Exit insert mode. inoremap jj inoremap " }}} " Visual Mode:{{{ " Exchange Colon and Semi-Colon. xnoremap ; : xnoremap : ; " Do not save the things erased by x and c in the register. xnoremap x "_x xnoremap c "_c " }}} filetype plugin indent on syntax on