Skip to content

Instantly share code, notes, and snippets.

@yossan
Created June 2, 2019 02:25
Show Gist options
  • Save yossan/a075610e3a9e010f5b5e6478b4a30720 to your computer and use it in GitHub Desktop.
Save yossan/a075610e3a9e010f5b5e6478b4a30720 to your computer and use it in GitHub Desktop.
vimrc for windows
"set encoding=utf-8
"set guifont=MS_Gothic:h13:cANSI:qDRAFT
"set guifont=*
set guifont=MS_Gothic:h14
syntax enable
set background=light
"colorscheme solarized
"colorscheme inkstained
"colorscheme one
"colorscheme abstract
"colorscheme anderson
"colorscheme jellybeans
"colorschem lightning
"ayu
set termguicolors
"let ayucolor="light"
"let ayucolor="dark"
let ayucolor="mirage"
colorschem ayu
let g:lightline = {
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ],
\ [ 'readonly', 'filename' ] ],
\ },
\ 'component_function': {
\ 'filename': 'LightlineFilename',
\ },
\ }
function! LightlineFilename()
let filename = expand('%:t') !=# '' ? expand('%:t') : '[No Name]'
let modified = &modified ? ' +' : ''
return filename . modified
endfunction
function! LightlineFileformat()
return winwidth(0) > 70 ? &fileformat : ''
endfunction
function! LightlineFiletype()
return winwidth(0) > 70 ? (&filetype !=# '' ? &filetype : 'no ft') : ''
endfunction
" enable python3
set pythonthreedll=C:\Program\ Files\ (x86)\Microsoft\ Visual\ Studio\Shared\Python37_64\python37.dll
packadd minpac
call minpac#init()
" minpac must have {'type': 'opt'} so that it can be loaded with `packadd`.
" call minpac#add('k-takata/minpac', {'type': 'opt'})
"
" " Add other plugins here.
call minpac#add('vim-jp/syntax-vim-ex')
" colorscheme
call minpac#add('yuttie/inkstained-vim')
call minpac#add('itchyny/lightline.vim')
call minpac#add('altercation/vim-colors-solarized')
call minpac#add('rafi/awesome-vim-colorschemes')
call minpac#add('moll/vim-node')
" nerdtree
call minpac#add('scrooloose/nerdtree')
" open NERDTree automatically when vim starts up on opening a directory
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | exe 'cd '.argv()[0] | endif
" open NERDTree with Ctrl+n
map <C-n> :NERDTreeToggle<CR>
" close vim if the only window left open is a NERDTree
" autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
" quickrun
call minpac#add('thinca/vim-quickrun')
" javascript
" A tool to simplify importing JS modules
call minpac#add('Galooshi/import-js')
let g:JavaImpPaths =
\ $HOME . "/project/src/java," .
\ $HOME . "/project2/javasrc," .
\ $HOME . "/project3/javasrc"
" java
call minpac#add('w0rp/ale')
call minpac#add('rustushki/JavaImp.vim')
" swift
call minpac#add('keith/swift.vim')
" markdown
call minpac#add('tpope/vim-markdown')
filetype plugin indent on " required
command! PluginUpdate call minpac#update()
" control
let mapleader=","
set backspace=2 "enable backspace
" status bar
set laststatus=2
set foldmethod=marker "manual, indent, expr, syntax, diff
" hlsearch
set hlsearch
nnoremap <C-l> :set hlsearch!<CR>
nnoremap j gj
nnoremap k gk
" buffer
nnoremap <silent>[b :bprevious<CR>
nnoremap <silent>]b :bnext<CR>
"nnoremap <silent>bb :b#<CR>
"set hidden
" 日本語IME
inoremap <C-@> <C-[>
set iminsert=0
set imsearch=0
" vimgrep
nnoremap [q :cprevious<CR> " 前へ
nnoremap ]q :cnext<CR> " 次へ
augroup set_for_all_buffer
au!
au BufEnter * setl ts=4 sw=4 sts=4 et
au BufEnter * setl encoding=utf-8
augroup End
augroup auto_lcd
au!
au BufEnter * lcd %:p:h
augroup End
" ts ファイルの\tをスペース何文字分で表示するか
" sw 自動インデントをスペース何文字分にするか
" sts タブ入力時、スペースを何文字分にするか
" expandtab タブを自動でスペースに置き換える
"augroup auto_php
" au!
" au FileType php setl ts=4 sw=4 sts=4 et
"augroup END
"
"augroup auto_js
" au!
" au BufEnter *.js setl ts=2 sw=2 sts=2 et
" au BufEnter *.js setl encoding=utf-8
"augroup END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment