Vimの設定

""plugin management
call plug#begin('~/.vim/plugged') 
Plug '~/.vim/plugged/accelerated-jk-master'
Plug '~/.vim/plugged/unite.vim-master'
"  Plug '~/.vim/plugged/denite.nvim-master'
Plug '~/.vim/plugged/neomru.vim-master'
Plug '~/.vim/plugged/nerdtree-master'
" Plug '~/.vim/plugged/vimfiler.vim-master'
Plug '~/.vim/plugged/tcomment_vim-master'
" Plug '~/.vim/plugged/winresizer-master' 
Plug '~/.vim/plugged/ale'
" Plug '~/.vim/plugged/sonictemplate-vim-master'
Plug '~/.vim/plugged/vim-quickrun'
Plug '~/.vim/plugged/vim-airline'
Plug '~/.vim/plugged/vim-airline-themes'
Plug '~/.vim/plugged/vim-snippets'
Plug '~/.vim/plugged/deoplete.nvim'
Plug '~/.vim/plugged/deoplete-jedi/'
Plug '~/.vim/plugged/nvim-yarp'
Plug '~/.vim/plugged/vim-hug-neovim-rpc'
Plug '~/.vim/plugged/indentLine-master'
Plug '~/.fzf'
Plug '~/.vim/plugged/fzf.vim'
Plug '~/.vim/plugged/unite-outline-master'
"  Plug '~/.vim/plugged/neocomplcache'
Plug '~/.vim/plugged/neosnippet.vim-master'
Plug '~/.vim/plugged/neosnippet-snippets-master'
call plug#end()
"
set backspace=indent,eol,start
set encoding=utf-8
set fileencodings=iso-2022-jp,euc-jp,sjis,utf-8
set fileformats=unix,dos,mac
set ambiwidth=double
""colorscheme apprentice
colorscheme lucius
set number
highlight LineNr ctermfg=darkyellow
set background=dark
let g:lightline ={'colorscheme': 'lucius'}
syntax on 
let mapleader = "\<Space>"
set t_Co=256
set autoindent
set smartindent
set shiftwidth=2
set tabstop=2
set nobackup
set noswapfile
set autoread
set showcmd
set showmatch
set laststatus=2
set wildmode=list:longest
set hlsearch
set expandtab
set clipboard=unnamed,autoselect
set splitbelow
set title
set wildmenu
set incsearch
set ruler
set cmdheight=2
set nolist
""key bind
nmap <Esc><Esc> :nohlsearch<CR><Esc>
" noremap <Up> <Nop>
" noremap <Down> <Nop>
" noremap <Left> <Nop>
" noremap <Right> <Nop>
" inoremap <Up> <Nop>
" inoremap <Down> <Nop>
" inoremap <Left> <Nop>
" inoremap <Right> <Nop>
noremap <Leader>h 0
noremap <Leader>l $
noremap <Leader><Tab> :<Return><C-w>w
nmap ss :split<Return>
nmap sv :vsplit<Return>
noremap <C-Up> :split<Return><C-w>w
noremap <C-Right> :vsplit<Return><C-w>w
noremap <Leader>q :q<enter>
inoremap <silent> jj <esc>
nnoremap <Leader>t :<C-u>tabnew<CR>
nnoremap tn :tabnext<CR>
nnoremap tp :tabprevious<CR>
noremap! <C-?> <C-h>
"
" imap { {}<LEFT>
" imap [ []<LEFT>
" imap ( ()<LEFT>
" nnoremap <Leader>e :NERDTree<enter>
" map <Leader>e :NERDTreeToggle<CR>
"
"
"VimFiler 
" nnoremap <leader>e :VimFilerExplore -split -winwidth=30 -find -no-quit<Cr>
"NERDTREE
" nnoremap <leader>e :NERDTreeToggle<CR> <Return><C-w>w
nnoremap <leader>e :NERDTreeToggle<CR> 
"
" "Denite
" noremap <silent> <C-b> :<C-u>Denite file_mru<CR>
" nnoremap <Leader>p :Denite buffer file_rec<CR>
" nnoremap <Leader>b :Denite buffer<CR>
" call denite#custom#map('insert', "<Up>", '<denite:move_to_previous_line>', 'noremap')
" call denite#custom#map('insert', "<Down>", '<denite:move_to_next_line>', 'noremap')
"
"Unite
noremap <silent> <C-b> :<C-u>Unite buffer file_mru<CR>
noremap <silent> <C-n> :Unite-buffer-name=register register<CR>
function! s:unite_my_settings()
    imap <buffer> <C-w> <Plug>(unite_delete_backward_path)
endfunction
nnoremap sa :<C-u>Unite tab<CR>
nnoremap sb :<C-u>Unite buffer -buffer-name=file<CR>
"
au FileType unite nnoremap <silent> <buffer> <expr> <C-j> unite#do_action('split')
au FileType unite inoremap <silent> <buffer> <expr> <C-j> unite#do_action('split')
au FileType unite nnoremap <silent> <buffer> <expr> <C-k> unite#do_action('vsplit')
au FileType unite inoremap <silent> <buffer> <expr> <C-k> unite#do_action('vsplit')

"vertival diff split
function! s:vimdiff_in_newtab(...)
  if a:0 == 1
    tabedit %:p
    exec 'rightbelow vertical diffsplit ' . a:1
  else
    exec 'tabedit ' . a:1
    for l:file in a:000[1 :]
      exec 'rightbelow vertical diffsplit ' . l:file
    endfor
  endif
endfunction
command! -bar -nargs=+ -complete=file Vdiff  call s:vimdiff_in_newtab(<f-args>)


"diff org option
set splitright
if !exists(":DiffOrig")
    command DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis
          \ | wincmd p | diffthis
endif

"accelerated_jk
nmap j <Plug>(accelerated_jk_gj)
nmap k <Plug>(accelerated_jk_gk)

"indent_guides_master
let g:indentLine_color_term = 111
let g:indentLine_color_gui = '#708090'
let g:indentLine_char = '|'

"ale
let g:ale_lint_on_text_changed = 0
let g:ale_sign_error ='!!' 
        let g:ale_sign_warning ='ww'
let g:airline#extensions#ale#open_lnum_symbol = '('
let g:airline#extensions#ale#close_lnum_symbol = ')'
let g:ale_echo_msg_format = '[%linter%]%code: %%s'
highlight link ALEErrorSign Tag
highlight link ALEWarningSign StorageClass
nmap <silent> <C-k> <Plug>(ale_previous_wrap)
nmap <silent> <C-j> <Plug>(ale_next_wrap)

"vim-airline
"let g:airline_theme = 'wombat'
let g:airline_theme = 'murmur'
set laststatus=2
let g:airline#extensions#branch#enabled = 1
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#wordcount#enabled = 0
let g:airline#extensions#default#layout = [['a', 'b', 'c'], ['x', 'y', 'z']]
let g:airline_section_c = '%t'
let g:airline_section_x = '%{&filetype}'
let g:airline_section_z = '%3l:%2v %{airline#extensions#ale#get_warning()} %{airline#extensions#ale#get_error()}'
let g:airline#extensions#ale#error_symbol ='!' 
let g:airline#extensions#ale#warning_symbol = 'W'
let g:airline#extensions#default#section_truncate_width = {}
let g:airline#extensions#whitespace#enabled = 1

"deoplete setting
 let g:deoplete#enable_at_startup = 1
 inoremap <expr><Tab> pumvisible() ? "\<DOWN>" : "\<Tab>"
 inoremap <expr><S-Tab> pumvisible() ? "\<UP>" : "\<S-Tab>"

"Unite outline
nnoremap <silent> <Leader>n :<C-u>Unite -no-quit -vertical -winwidth=40 outline<CR>

" Note: This option must set it in .vimrc(_vimrc).  NOT IN .gvimrc(_gvimrc)!
" Disable AutoComplPop.
let g:acp_enableAtStartup = 0
" Use neocomplcache.
let g:neocomplcache_enable_at_startup = 1
" Use smartcase.
let g:neocomplcache_enable_smart_case = 1
" Set minimum syntax keyword length.
let g:neocomplcache_min_syntax_length = 3
let g:neocomplcache_lock_buffer_name_pattern = '\*ku\*'


"" neosnippet settings
" Plugin key-mappings.
" Note: It must be "imap" and "smap".  It uses <Plug> mappings.
imap <C-k>     <Plug>(neosnippet_expand_or_jump)
smap <C-k>     <Plug>(neosnippet_expand_or_jump)
xmap <C-k>     <Plug>(neosnippet_expand_target)

" SuperTab like snippets behavior.
" Note: It must be "imap" and "smap".  It uses <Plug> mappings.
"imap <expr><TAB>
" \ pumvisible() ? "\<C-n>" :
" \ neosnippet#expandable_or_jumpable() ?
" \    "\<Plug>(neosnippet_expand_or_jump)" : "\<TAB>"
smap <expr><TAB> neosnippet#expandable_or_jumpable() ?
\ "\<Plug>(neosnippet_expand_or_jump)" : "\<TAB>"

" For conceal markers.
if has('conceal')
  set conceallevel=2 concealcursor=niv
endif

let g:neosnippet#snippets_directory='~/.vim/plugged/neosnippet-snippets-master/neosnippets/'