Skip to content

Instantly share code, notes, and snippets.

@hidez8891
Last active June 1, 2018 15:48
Show Gist options
  • Save hidez8891/8349379 to your computer and use it in GitHub Desktop.
Save hidez8891/8349379 to your computer and use it in GitHub Desktop.
"autocmd GUIEnter * set transparency=220
" default colorscheme
colorscheme murphy
" change default directory
if has("win32") || has("win64")
cd D:\hide\Documents\workspace
endif
" change transparency
if has("win32") || has("win64")
autocmd GUIEnter * set transparency=235
elseif has("mac")
autocmd GUIEnter * set transparency=20
endif
""" VimShell {{{
let g:vimshell_prompt = "% "
let g:vimshell_right_prompt = 'getcwd()'
let g:vimshell_split_command = 'tabedit'
let g:vimshell_interactive_update_time = 10
""" }}}
""" hidden scroll bar {{{
set guioptions-=r
set guioptions-=R
set guioptions-=l
set guioptions-=L
""" }}}
""" font / render {{{
if has("win32") || has("win64")
set guifont=Ricty_Diminished_for_Powerline:h10:cSHIFTJIS
set rop=type:directx,renmode:5,taamode:1
endif
""" }}}
" vim:ft=vim foldmethod=marker tw=78
""" 標準設定 {{{
syntax on
set number
set nocompatible
set nobackup
set noundofile
set history=5000
" }}}
""" タブ幅 {{{
set tabstop=2
set softtabstop=2
set shiftwidth=2
" }}}
""" 検索/ステータスバー {{{
set ruler
set incsearch
set hlsearch
set wildmenu
" }}}
""" キーバインド {{{
let mapleader="\ "
map ' `
" }}}
""" キーバインド無効化/代替 {{{
"noremap <C-W><C-N> <NOP>
"vnoremap u <C-[>
" }}}
""" クリップボード {{{
set clipboard=unnamed
"noremap <C-K> <ESC>"+p<ESC>
"inoremap <C-K> <ESC>"+p<ESC>
" }}}
""" バッファ {{{
nmap <C-W>n :bn<CR>
nmap <C-W>p :bp<CR>
" }}}
""" BackSpaceの設定 {{{
set backspace=indent,eol,start
set viminfo='20,\"50
" }}}
""" エンコード {{{
set encoding=utf8
"}}}
""" 文字の自動判別 {{{
set fileencodings=ucs-bom,utf-8,iso-2022-jp,sjis,cp932,euc-jp,cp20932
" 改行コードの自動認識
set fileformats=unix,dos,mac
" □とか○の文字があってもカーソル位置がずれないようにする
if exists('&ambiwidth')
set ambiwidth=double
endif
" }}}
""" 全角スペースを表示 {{{
function! ZenkakuSpace()
highlight ZenkakuSpace cterm=underline ctermfg=darkgrey gui=underline guifg=darkgrey
endfunction
if has('syntax')
augroup ZenkakuSpace
autocmd!
" ZenkakuSpaceをカラーファイルで設定するなら次の行は削除
autocmd ColorScheme * call ZenkakuSpace()
" 全角スペースのハイライト指定
autocmd VimEnter,WinEnter * match ZenkakuSpace / /
augroup END
call ZenkakuSpace()
endif
" }}}
""" ファイルの最終変更位置へ移動 {{{
autocmd BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
"}}}
""" ペーストした文章を選択 {{{
nnoremap <expr> gp '`[' . strpart(getregtype(), 0, 1) . '`]'
"}}}
""" 括弧対応の拡張 {{{
runtime macros/matchit.vim
"}}}
""" 検索のハイライト消去 {{{
nnoremap <ESC><ESC> :nohlsearch<CR>
"}}}
""" 矩形ビジュアルモードの拡張 {{{
set virtualedit=block
"}}}
""" インデント後も再選択状態にする {{{
vnoremap < <gv
vnoremap > >gv
" }}}
""" shotrcut [tmux style] {{{
nnoremap <C-t>c :tabe<CR>
nnoremap <C-t>d :tabc<CR>
nnoremap <C-t>n :tabn<CR>
nnoremap <C-t>p :tabN<CR>
nnoremap <C-t>v :vs<CR>
nnoremap <C-t>s :sp<CR>
nnoremap <C-t>o <C-w>w<CR>
inoremap <C-t>c <ESC>:tabe<CR>
inoremap <C-t>d <ESC>:tabc<CR>
inoremap <C-t>n <ESC>:tabn<CR>
inoremap <C-t>p <ESC>:tabN<CR>
inoremap <C-t>v <ESC>:vs<CR>
inoremap <C-t>s <ESC>:sp<CR>
inoremap <C-t>o <ESC><C-w>w<CR>
""" }}}
""" terminal shortcut {{{
tnoremap <ESC> <C-\><C-n>
"}}}
""" python {{{
if has('win32') || has('win64')
set pythonthreedll=$USERPROFILE\Anaconda3\python36.dll
let g:python3_host_prog=$USERPROFILE.'\Anaconda3\python.exe'
endif
""" }}}
""" minpac {{{
set packpath^=~/.vim
packadd minpac
call minpac#init()
call minpac#add('k-takata/minpac', {'type': 'opt'})
call minpac#add('itchyny/lightline.vim')
call minpac#add('vim-jp/syntax-vim-ex')
call minpac#add('tpope/vim-fugitive')
call minpac#add('scrooloose/nerdcommenter')
call minpac#add('thinca/vim-quickrun')
call minpac#add('Shougo/deoplete.nvim')
call minpac#add('roxma/nvim-yarp')
call minpac#add('neovim/python-client')
call minpac#add('roxma/vim-hug-neovim-rpc')
call minpac#add('fatih/vim-go')
"call minpac#add('zchee/deoplete-go')
filetype plugin indent on
" add after to runtime path
set runtimepath^=~/.vim/after
" }}}
""" setting: deoplete {{{
set completeopt=menuone
let g:deoplete#enable_at_startup = 1
""" }}}
""" setting: nerdcommenter {{{
let g:NERDCreateDefaultMappings = 0
let NERDSpaceDelims = 1
nmap <Leader>cc <Plug>NERDCommenterToggle
vmap <Leader>cc <Plug>NERDCommenterToggle
nmap <Leader>cl <Plug>NERDCommenterToEOL
vmap <Leader>cl <Plug>NERDCommenterMinimal
vmap <Leader>cs <Plug>NERDCommenterSexy
" }}}
""" setting: vim-quickrun {{{
let g:quickrun_config = {
\ 'cpp': {
\ 'cmdopt': '-std=c++14',
\ 'exec': ['%c %o %s -o %s:p:r.exe', '%s:p:r.exe %a'],
\ 'hook/sweep/files': '%S:p:r.exe',
\ },
\ 'haskell': {
\ 'hook/output_encode': 1,
\ 'hook/output_encode/encoding': 'cp932',
\ },
\ '_': {
\ 'outputter/buffer/split': ':botright 8sp',
\ 'runner': 'vimproc',
\ 'hook/u_nya_/enable': 1,
\ }
\}
" }}}
""" setting: vim-fugitive {{{
nnoremap <Leader>gd :<C-u>Gdiff<Enter>
nnoremap <Leader>gs :<C-u>Gstatus<Enter>
nnoremap <Leader>gl :<C-u>Glog<Enter>
nnoremap <Leader>ga :<C-u>Gwrite<Enter>
nnoremap <Leader>gc :<C-u>Gcommit<Enter>
nnoremap <Leader>gCC :<C-u>Git commit --amend<Enter>
" }}}
""" setting: vim-go {{{
let g:go_highlight_functions = 1
let g:go_highlight_methods = 1
let g:go_highlight_fields = 1
let g:go_highlight_structs = 1
let g:go_highlight_interfaces = 1
let g:go_highlight_operators = 1
let g:go_highlight_build_constraints = 1
let g:go_fmt_command = "goimports"
""" }}}
""" setting: lightline {{{
set ambiwidth=double
let g:lightline = {
\ 'colorscheme': 'wombat',
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ],
\ [ 'fugitive', 'readonly', 'filename', 'modified' ] ]
\ },
\ 'component_function': {
\ 'fugitive': 'LightLineFugitive',
\ 'readonly': 'LightLineReadonly',
\ 'modified': 'LightLineModified'
\ },
\ 'separator': { 'left': "\u2b80", 'right': "\u2b82" },
\ 'subseparator': { 'left': "\u2b81", 'right': "\u2b83" }
\ }
function! LightLineModified()
if &filetype == "help"
return ""
elseif &modified
return "+"
elseif &modifiable
return ""
else
return ""
endif
endfunction
function! LightLineReadonly()
if &filetype == "help"
return ""
elseif &readonly
return "\u2b64"
else
return ""
endif
endfunction
function! LightLineFugitive()
if exists("*fugitive#head")
let _ = fugitive#head()
return strlen(_) ? "\u2b60 "._ : ''
endif
return ''
endfunction
" }}}
" vim:ft=vim foldmethod=marker tw=78
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment