Skip to content

Instantly share code, notes, and snippets.

@f440
Created April 5, 2019 03:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save f440/cb60375a9a2647b7ba8382bace6b2d9f to your computer and use it in GitHub Desktop.
Save f440/cb60375a9a2647b7ba8382bace6b2d9f to your computer and use it in GitHub Desktop.
" vim-plug {{{1
call plug#begin('~/.vim/plugged')
Plug 'xolox/vim-misc' | Plug 'xolox/vim-notes'
Plug 'powerman/vim-plugin-AnsiEsc', { 'on' : 'AnsiEsc' } " ansi escape sequences concealed, but highlighted as specified (conceal)
Plug 'godlygeek/tabular'
Plug 'junegunn/vim-easy-align'
Plug 'vim-scripts/VisIncr'
Plug 'kshenoy/vim-signature' " Plugin to toggle, display and navigate marks
Plug 'maxbrunsfeld/vim-yankstack'
" Plug 'easymotion/vim-easymotion'
Plug 'kana/vim-textobj-user' | Plug 'nelstrom/vim-textobj-rubyblock', { 'for': 'ruby' }
Plug 'kana/vim-gf-diff' | Plug 'kana/vim-gf-user'
Plug 'othree/eregex.vim'
Plug 'vim-scripts/undotree.vim', { 'on' : 'UndotreeToggle' }
Plug 'tpope/vim-abolish' " easily search for, substitute, and abbreviate multiple variants of a word
Plug 'tpope/vim-dispatch'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-rhubarb' " GitHub extension for fugitive.vim
Plug 'tpope/vim-bundler'
Plug 'tpope/vim-rake'
Plug 'tpope/vim-rails', { 'for': ['ruby', 'eruby', 'haml'] }
" Plug 'tpope/vim-ragtag'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-endwise'
Plug 'tpope/vim-repeat'
" Plug 'tpope/vim-speeddating'
Plug 'tpope/vim-unimpaired'
Plug 'tpope/vim-commentary'
Plug 'wellle/targets.vim' " Vim plugin that provides additional text objects
Plug 'thinca/vim-quickrun'
Plug 'thoughtbot/vim-rspec'
Plug 'janko-m/vim-test'
Plug 'vim-jp/vimdoc-ja'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --bin' }
Plug 'junegunn/fzf.vim'
Plug 'mileszs/ack.vim'
Plug 'vim-scripts/DrawIt'
Plug 'vim-scripts/Align', { 'for': 'sql' } | Plug 'vim-scripts/SQLUtilities', { 'for': 'sql' }
Plug 'airblade/vim-gitgutter'
if v:version >= 8 || has('nvim')
Plug 'w0rp/ale'
Plug 'maximbaz/lightline-ale'
else
Plug 'scrooloose/syntastic'
endif
Plug 'AndrewRadev/switch.vim'
if (v:version < 800 || (v:version == 800 && ! has('patch1238'))) && ! has('nvim')
Plug 'haya14busa/incsearch.vim'
endif
Plug 'boucherm/ShowMotion'
Plug 'terryma/vim-multiple-cursors'
Plug 'majutsushi/tagbar', { 'on': 'TagbarToggle' }
Plug 'justinmk/vim-dirvish'
if has('python') || has('python3')
Plug 'editorconfig/editorconfig-vim'
Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets'
endif
" vim-go & neovim have problem ... GoInfo is not effect. wrong commit ... f4642553b23062b3
Plug 'fatih/vim-go'
if !has('nvim') " for vim-delve
Plug 'Shougo/vimshell.vim'
Plug 'Shougo/vimproc.vim', {'do' : 'make'}
endif
Plug 'sebdah/vim-delve'
Plug 'jamessan/vim-gnupg'
Plug 'kien/rainbow_parentheses.vim', { 'for': 'scheme' }
Plug 'hashivim/vim-terraform'
Plug 'Raimondi/delimitMate' " auto-completion for quotes, parens, brackets, etc.
Plug 'farmergreg/vim-lastplace'
" Plug 'kylef/apiblueprint.vim'
" Plug 'plasticboy/vim-markdown'
Plug 'wakatime/vim-wakatime'
Plug 'jpalardy/vim-slime'
" Plug 'ekalinin/Dockerfile.vim'
Plug 'AndrewRadev/splitjoin.vim'
Plug 'guns/xterm-color-table.vim'
Plug 'ntpeters/vim-better-whitespace'
Plug 'vito-c/jq.vim'
Plug 'prabirshrestha/asyncomplete.vim'
Plug 'prabirshrestha/async.vim'
Plug 'prabirshrestha/vim-lsp'
Plug 'prabirshrestha/asyncomplete-lsp.vim'
" Plug 'yuttie/comfortable-motion.vim'
Plug 'machakann/vim-highlightedyank'
" html, css
Plug 'hail2u/vim-css3-syntax'
Plug 'mattn/emmet-vim'
" javascript
Plug 'pangloss/vim-javascript'
Plug 'mattn/jscomplete-vim'
Plug 'othree/javascript-libraries-syntax.vim'
" Plug 'prettier/vim-prettier', {
" \ 'do': 'yarn install',
" \ 'for': ['javascript', 'typescript', 'css', 'less', 'scss', 'json', 'graphql', 'markdown', 'vue'] }
" Plug 'marijnh/tern_for_vim'
Plug 'sheerun/vim-polyglot'
" color
Plug 'itchyny/lightline.vim'
" Plug 'edkolev/tmuxline.vim'
" color scheme
" Plug 'vim-scripts/CycleColor'
" Plug 'flazz/vim-colorschemes'
" Plug 'zenorocha/dracula-theme', { 'rtp': 'vim' }
Plug 'pbrisbin/vim-colors-off'
" Plug 'robertmeta/nofrils'
Plug 'chriskempson/base16-vim'
call plug#end()
set background=dark
" let g:hybrid_custom_term_colors = 1
" let g:hybrid_reduced_contrast = 1
" let g:pencil_higher_contrast_ui = 1
" let g:pencil_neutral_code_bg = 1
" colorscheme off
if filereadable(expand("~/.vimrc_background"))
let base16colorspace=256
source ~/.vimrc_background
endif
if has("unix") && !has("mac")
autocmd VimEnter,ColorScheme * highlight Normal ctermbg=none
autocmd VimEnter,ColorScheme * highlight LineNr ctermbg=none
autocmd VimEnter,ColorScheme * highlight SignColumn ctermbg=none
autocmd VimEnter,ColorScheme * highlight VertSplit ctermbg=none
autocmd VimEnter,ColorScheme * highlight NonText ctermbg=none
endif
" general settings {{{1
set nocompatible
if has('nvim')
set viminfo='1000,<1000,s100,\"50,n~/.config/nvim/viminfo
else
set viminfo='1000,<1000,s100,\"50,n~/.vim/viminfo
endif
syntax on
set backup
set backupdir=~/.cache/vim/backup,.
set directory=~/.cache/vim/swap,.
set backupskip+=svk-commit*.tmp,/tmp/crontab.*,/private/tmp/crontab.*
set history=1000
set mouse=a
if &term == "screen"
set ttymouse=xterm2
endif
set notitle
set helplang=en
" edit settings {{{1
set autoindent
set smartindent
set backspace=indent,eol,start
set wildmenu
set formatoptions+=mM " テキスト挿入中の自動折り返しを日本語に対応させる
set showcmd
set showmatch
set wildmode=list:longest " コマンドライン補間をシェルっぽく
set wildignore+=*/.hg/*,*/.svn/*,*.so,*.a,*.o,*.obj,*.class,*.jar,*.pyc
set hidden " バッファが編集中でもその他のファイルを開けるように
set autoread
" set paste
if has('persistent_undo')
set undodir=~/.cache/vim/undo,.
set undofile
" set undolevels=1000
" set undoreload=10000
endif
set wrap
" set textwidth=79
" set colorcolumn=+1
if has('unnamedplus')
set clipboard^=unnamedplus
set clipboard^=unnamedplus
endif
" toggle colored right border after 80 chars
" https://gist.github.com/ggustafsson/1766741
function! ColorColumn()
if empty(&colorcolumn)
if empty(&textwidth)
echo "colorcolumn=80"
setlocal colorcolumn=80
else
echo "colorcolumn=+1 (" . (&textwidth + 1) . ")"
setlocal colorcolumn=+1
endif
else
echo "colorcolumn="
setlocal colorcolumn=
endif
endfunction
nnoremap <Leader>8 :call ColorColumn()<CR>
if &term =~ "xterm.*"
let &t_ti = &t_ti . "\e[?2004h"
let &t_te = "\e[?2004l" . &t_te
function! XTermPasteBegin(ret)
set pastetoggle=<Esc>[201~
set paste
return a:ret
endfunction
map <expr> <Esc>[200~ XTermPasteBegin("i")
imap <expr> <Esc>[200~ XTermPasteBegin("")
cmap <Esc>[200~ <nop>
cmap <Esc>[201~ <nop>
endif
"
" reference
" http://subtech.g.hatena.ne.jp/cho45/20061010/1160459376
" http://vim.wikia.com/wiki/Mac_OS_X_clipboard_sharing
"
" need 'set enc=utf-8' and
" below shell environment variable for UTF-8 characters
" export __CF_USER_TEXT_ENCODING='0x1F5:0x08000100:14'
"
" Vim(Mac)
if has('mac') && !has('gui')
nnoremap <silent> <Leader>y :.w !pbcopy<CR><CR>
vnoremap <silent> <Leader>y :w !pbcopy<CR><CR>
nnoremap <silent> <Leader>p :r !pbpaste<CR>
vnoremap <silent> <Leader>p :r !pbpaste<CR>
" GVim(Mac & Win)
else
noremap <Leader>y "+y
noremap <Leader>p "+p
endif
" search settings {{{1
set ignorecase
set smartcase
set wrapscan
set incsearch
set hlsearch
nmap <ESC><ESC> :nohlsearch<CR><ESC>
source $VIMRUNTIME/macros/matchit.vim
" display settings {{{1
set ruler
set nolist
set listchars=tab:>-,extends:<,trail:-,eol:<
set laststatus=2
set cmdheight=1
set scrolloff=3
set showcmd
set ttyfast
if $TMUX !~ ''
set visualbell
endif
" set title
set noshowmode " mode information is part of lightline's status
if $TERM =~ '^xterm'
set t_Co=256
elseif $TERM =~ '^screen-256'
set t_Co=256
elseif $TMUX != ''
set t_Co=256
elseif $TERM =~ '^rxvt'
set t_Co=88
elseif $TERM =~ '^linux'
set t_Co=8
else
set t_Co=16
endif
if (has("termguicolors"))
set termguicolors
endif
" misc {{{1
" Make search results appear in the middle of the screen {{{2
" nmap n nzz
" nmap N Nzz
nmap * *zz
nmap # #zz
nmap g* g*zz
nmap g# g#zz
" インサートモード/コマンドラインでの移動と削除 {{{2
cnoremap <C-p> <Up>
cnoremap <C-n> <Down>
cnoremap <C-A> <Home>
cnoremap <C-B> <Left>
cnoremap <expr> <C-D> getcmdpos()>strlen(getcmdline())?"\<Lt>C-D>":"\<Lt>Del>"
cnoremap <expr> <C-F> getcmdpos()>strlen(getcmdline())?&cedit:"\<Lt>Right>"
cnoremap <M-b> <S-Left>
cnoremap <M-f> <S-Right>
silent! exe "set <S-Left>=\<Esc>b"
silent! exe "set <S-Right>=\<Esc>f"
" noremap! <C-k> <Up>
" noremap! <C-j> <Down>
" noremap! <C-a> <Home>
" noremap! <C-e> <End>
" noremap! <C-d> <Del>
" noremap! <Esc>b <S-Left>
" noremap! <Esc>f <S-Right>
" inoremap <silent> <expr> <C-e> (pumvisible() ? "\<C-e>" : "\<End>")
inoremap <C-f> <Right>
inoremap <C-b> <Left>
" 全角スペースを可視化 {{{2
highlight ZenkakuSpace cterm=underline ctermfg=lightblue
call matchadd("ZenkakuSpace", ' ')
" タブを可視化 {{{2
highlight TabChar cterm=underline ctermfg=237
call matchadd("TabChar", '\t')
" 81 文字でハイライト {{{2
" http://stackoverflow.com/questions/235439/vim-80-column-layout-concerns
highlight OverLength ctermbg=darkred ctermfg=white
call matchadd("OverLength", '.\%81v')
" Open help under cursor {{{2
nnoremap <C-h> :<c-u>help<Space><C-r><C-w><CR>
" tagsジャンプの時に複数ある時は一覧表示 {{{2
" nnoremap <C-]> g<C-]>
" auto save {{{2
" http://vim.g.hatena.ne.jp/ka-nacht/20090625/1245857600
set autowrite
autocmd CursorHold * silent! wall
autocmd CursorHoldI * silent! wall
autocmd InsertLeave * silent! wall
" edit & reload vimrc {{{2
nnoremap <Leader><C-e> :<C-u>edit $MYVIMRC<CR>
nnoremap <Leader><C-r> :<C-u>source $MYVIMRC<CR>
" Create new line in insert mode {{{2
imap <C-j> <Esc>o
" Use Tree view in netrw {{{2
let g:netrw_liststyle = 3
" let g:netrw_banner = 0
" Journal {{{2
nnoremap <silent> <Leader>j :view + ~/Dropbox/Documents/Journal/Journal.md<CR>
command! -nargs=1 Jgrep Ack <args> $HOME/Dropbox/Documents/Journal/
" plugin settings {{{1
" yankstack {{{2
" let g:yankstack_map_keys = 0
nmap <C-p> <Plug>yankstack_substitute_older_paste
nmap <C-P> <Plug>yankstack_substitute_newer_paste
" fzf {{{2
nnoremap <silent> gg :FZF<CR>
nnoremap <silent> gb :Buffers<CR>
nnoremap <silent> gm :History<CR>
" ack.vim {{{2
let g:ackprg = 'ag --vimgrep'
cnoreabbrev Ag Ack
nnoremap <silent> <Leader>a :Ack <C-R><C-W><CR>
" undotree {{{2
nnoremap <silent> <Leader>U :UndotreeToggle<CR>
" quickrun {{{2
let g:quickrun_config = {}
let g:quickrun_config = {'_': {'split': 'below 5', 'hook/time/enable': '1'}}
" vim-coffeescript{{{2
" au BufWritePost *.coffee :CoffeeWatch
" au BufWritePost *.coffee silent CoffeeMake! -b | cwindow | redraw!
" jquery {{{2
au BufRead,BufNewFile jquery.*.js setlocal ft=javascript syntax=jquery
" jscomplete-vim {{{2
autocmd FileType javascript
\ :setl omnifunc=jscomplete#CompleteJS
" eregex {{{2
let g:eregex_default_enable = 0
" YouCompleteMe {{{2
if has('python')
" let g:ycm_path_to_python_interpreter = '/usr/bin/python'
let g:ycm_key_list_select_completion = [] " <C-n>
let g:ycm_key_list_previous_completion = [] " <C-p>
endif
" ale {{{2
if v:version >= 8
" Write this in your vimrc file
let g:ale_lint_on_text_changed = 'never'
" You can disable this option too
" if you don't want linters to run on opening a file
let g:ale_lint_on_enter = 0
endif
" syntastic {{{2
if v:version < 8 && ! has('nvim')
let g:syntastic_check_on_wq = 0
let g:syntastic_ruby_checkers = ['rubocop']
let g:syntastic_mode_map = { "mode": "passive" }
let g:syntastic_go_checkers = ['golint', 'govet', 'errcheck']
let g:syntastic_markdown_checkers = ['textlint']
let g:syntastic_text_checkers = ['textlint']
nnoremap <Leader>s :SyntasticCheck<CR>
endif
" autocmd InsertLeave * SyntasticCheck
" autocmd CursorHold * SyntasticCheck
" autocmd CursorHoldI * SyntasticCheck
" incsearch.vim {{{2
if (v:version < 800 || (v:version == 800 && ! has('patch1238'))) && ! has('nvim')
map / <Plug>(incsearch-forward)
map ? <Plug>(incsearch-backward)
map g/ <Plug>(incsearch-stay)
let g:incsearch#auto_nohlsearch = 1
map n <Plug>(incsearch-nohl-n)
map N <Plug>(incsearch-nohl-N)
map * <Plug>(incsearch-nohl-*)
map # <Plug>(incsearch-nohl-#)
map g* <Plug>(incsearch-nohl-g*)
map g# <Plug>(incsearch-nohl-g#)
endif
" vim-easy-align {{{2
xmap ga <Plug>(EasyAlign)
" ShowMotion {{{2
" Show motion for words:
nmap <silent> w <Plug>(show-motion-w)
nmap <silent> W <Plug>(show-motion-W)
nmap <silent> b <Plug>(show-motion-b)
nmap <silent> B <Plug>(show-motion-B)
nmap <silent> e <Plug>(show-motion-e)
nmap <silent> E <Plug>(show-motion-E)
" Show motion for chars:
nmap f <Plug>(show-motion-f)
nmap t <Plug>(show-motion-t)
nmap F <Plug>(show-motion-F)
nmap T <Plug>(show-motion-T)
nmap ; <Plug>(show-motion-;)
nmap , <Plug>(show-motion-,)
" SQLUtilities {{{2
let g:sqlutil_align_where = 0
let g:sqlutil_align_comma = 0
let g:sqlutil_keyword_case = '\U'
" Tagbar {{{2
nnoremap <silent> <Leader>t :TagbarToggle<CR>
let g:tagbar_type_go = {
\ 'ctagstype' : 'go',
\ 'kinds' : [
\ 'p:package',
\ 'i:imports:1',
\ 'c:constants',
\ 'v:variables',
\ 't:types',
\ 'n:interfaces',
\ 'w:fields',
\ 'e:embedded',
\ 'm:methods',
\ 'r:constructor',
\ 'f:functions'
\ ],
\ 'sro' : '.',
\ 'kind2scope' : {
\ 't' : 'ctype',
\ 'n' : 'ntype'
\ },
\ 'scope2kind' : {
\ 'ctype' : 't',
\ 'ntype' : 'n'
\ },
\ 'ctagsbin' : 'gotags',
\ 'ctagsargs' : '-sort -silent'
\ }
if executable('ripper-tags')
let g:tagbar_type_ruby = {
\ 'kinds' : ['m:modules',
\ 'c:classes',
\ 'C:constants',
\ 'F:singleton methods',
\ 'f:methods',
\ 'a:aliases'],
\ 'kind2scope' : { 'c' : 'class',
\ 'm' : 'class' },
\ 'scope2kind' : { 'class' : 'c' },
\ 'ctagsbin' : 'ripper-tags',
\ 'ctagsargs' : ['-f', '-']
\ }
endif
" lightline.vim {{{2
let g:lightline = {
\ 'colorscheme': 'Tomorrow_Night_Mod',
\ }
" lightline-ale {{{2
let g:lightline.component_expand = {
\ 'linter_checking': 'lightline#ale#checking',
\ 'linter_warnings': 'lightline#ale#warnings',
\ 'linter_errors': 'lightline#ale#errors',
\ 'linter_ok': 'lightline#ale#ok',
\ }
let g:lightline.component_type = {
\ 'linter_checking': 'left',
\ 'linter_warnings': 'warning',
\ 'linter_errors': 'error',
\ 'linter_ok': 'left',
\ }
let g:lightline.active = {
\ 'right': [['lineinfo'], ['percent'], ['fileformat', 'fileencoding', 'filetype'], [ 'linter_checking', 'linter_errors', 'linter_warnings' ]]
\ }
" vim-polyglot {{{2
let g:polyglot_disabled = ['go', 'javascript', 'markdown']
" vim-go {{{2
let g:go_fmt_command = "goimports"
let g:go_doc_command = ["go doc"]
let g:go_highlight_types = 1
let g:go_highlight_fields = 1
let g:go_highlight_functions = 1
let g:go_highlight_methods = 1
let g:go_highlight_operators = 1
let g:go_highlight_extra_types = 1
let g:go_highlight_build_constraints = 1
let g:go_auto_type_info = 1
let g:go_auto_sameids = 1
if has('nvim')
let g:go_term_enabled = 1
endif
let g:go_template_autocreate = 0
autocmd FileType godoc nnoremap <buffer> q <C-w>c
autocmd FileType goterm nnoremap <buffer> q :quit<CR>
autocmd FileType qf nnoremap <buffer> q :quit<CR>
autocmd Filetype go command! -bang A call go#alternate#Switch(<bang>0, 'edit')
autocmd Filetype go command! -bang AV call go#alternate#Switch(<bang>0, 'vsplit')
autocmd Filetype go command! -bang AS call go#alternate#Switch(<bang>0, 'split')
autocmd Filetype go command! -bang AT call go#alternate#Switch(<bang>0, 'tabe')
cnoreabbrev gi GoImport
augroup gopkgs
autocmd!
autocmd FileType go command! -buffer Import exe 'GoImport' fzf#run({'source': 'gopkgs'})[0]
autocmd FileType go command! -buffer Doc exe 'GoDoc' fzf#run({'source': 'gopkgs'})[0]
augroup END
" vim-terraform {{{2
let g:terraform_fmt_on_save = 1
" rails.vim {{{2
let g:rails_projections = {
\ "config/projections.json": {
\ "command": "projections"
\ },
\ 'db/seeds/*.rb': {'command': 'seeds'},
\ "app/services/*.rb": {
\ "command": "service",
\ "affinity": "model",
\ "test": "spec/services/%s_spec.rb",
\ "related": "app/models/%s.rb",
\ "template": "class %S\n\n def run\n end\nend"
\ },
\ "app/worker/*_worker.rb": {
\ "command": "worker",
\ "test": "spec/worker/%i_spec.rb"
\ },
\ "app/*.rb": {
\ "alternate": "spec/{}_spec.rb"
\ },
\ "spec/*_spec.rb": {
\ "alternate": "app/{}.rb"
\ }
\}
let g:rails_gem_projections = {
\ "activeadmin": {
\ "app/admin/*.rb": {
\ "command": "admin",
\ "affinity": "model",
\ "alternate": "app/models/{}.rb",
\ "template": "ActiveAdmin.register {} do\nend"
\ }
\ },
\ "factory_girl_rails": {
\ "spec/factories.rb": {"command": "factory"},
\ "spec/factories/*_factory.rb": {
\ "command": "factory",
\ "affinity": "model",
\ "alternate": "app/models/%s.rb",
\ "related": "db/schema.rb#%p",
\ "test": "spec/models/%s_spec.rb",
\ "template": "FactoryGirl.define do\n factory :%s do\n end\nend",
\ "keywords": "factory sequence"
\ },
\ "spec/factories/*.rb": {
\ "command": "factory",
\ "affinity": "collection",
\ "alternate": "app/models/%o.rb",
\ "related": "db/schema.rb#%s",
\ "test": "spec/models/%o_spec.rb",
\ "template": "FactoryGirl.define do\n factory :%o do\n end\nend",
\ "keywords": "factory sequence"
\ },
\ },
\ "fabrication": {
\ "spec/fabricators/*_fabricator.rb": {
\ "command": "fabricator",
\ "affinity": "model",
\ "alternate": "app/models/%s.rb",
\ "related": "db/schema.rb#%p",
\ "test": "spec/models/%s_spec.rb",
\ "template": "Fabricator(:%s) do\nend",
\ "keywords": "sequence initialize_with on_init transient after_build before_validation after_validation before_save before_create after_create after_save"
\ },
\ },
\ "cells": {
\ "app/cells/*_cell.rb": {
\ "command": "cell",
\ "related": "app/cells/%s/%d*",
\ "template":
\ "ActiveAdmin.register %S do\n\n # form do\n # end\n\n #menu parent: '', label: ''\n\n # index do\n # end\n\nend\n"
\ }
\ },
\ "carrierwave": {
\ "app/uploaders/*_uploader.rb": {
\ "command": "uploader",
\ "template":
\ "class %SUploader < CarrierWave::Uploader::Base\nend"
\ }
\ },
\ "draper": {
\ "app/decorators/*_decorator.rb": {
\ "command": "decorator",
\ "affinity": "model",
\ "test": "spec/decorators/%s_spec.rb",
\ "related": "app/models/%s.rb",
\ "template": "class %SDecorator < Draper::Decorator\nend"
\ }
\ },
\ "cucumber-rails": {
\ "features/*.feature": {"command": "feature"},
\ "features/step_definitions/*_steps.rb": {"command": "steps"},
\ "features/support/*.rb": {"command": "support"}
\ },
\ "active_model_serializers": {
\ "app/serializers/*_serializer.rb": {
\ "command": "serializer",
\ "affinity": "model",
\ "test": "spec/serializers/%s_spec.rb",
\ "related": "app/models/%s.rb",
\ "template": "class %SSerializer < ActiveModel::Serializer\n attributes :id\nend",
\ "keywords": "attributes embed has_many has_one"
\ }
\ },
\ "resque": {
\ "app/workers/*_job.rb": {
\ "command": "worker",
\ "template": "class %SJob\n\n \n@queue = :main\ndef self.perform\n end\nend"
\ }
\ },
\}
" vim-slime {{{2
let g:slime_target = "tmux"
" vim-notes {{{2
let g:notes_directories = ['~/Dropbox/Documents/Notes']
let g:notes_unicode_enabled = 0
let g:notes_suffix = '.txt'
" deoplete {{{2
let g:deoplete#enable_at_startup = 1
let g:deoplete#sources = {}
" vim-lsp {{{2
" gem insatll solargraph {{{3
" if executable('solargraph')
" " gem install solargraph
" au User lsp_setup call lsp#register_server({
" \ 'name': 'solargraph',
" \ 'cmd': {server_info->[&shell, &shellcmdflag, 'solargraph stdio']},
" \ 'initialization_options': {"diagnostics": "true"},
" \ 'whitelist': ['ruby'],
" \ })
" endif
" go get -u golang.org/x/tools/cmd/gopls {{{3
" if executable('gopls')
" au User lsp_setup call lsp#register_server({
" \ 'name': 'gopls',
" \ 'cmd': {server_info->['gopls', '-mode', 'stdio']},
" \ 'whitelist': ['go'],
" \ })
" endif
" go get -u github.com/sourcegraph/go-langserver {{{3
if executable('go-langserver')
au User lsp_setup call lsp#register_server({
\ 'name': 'go-langserver',
\ 'cmd': {server_info->['go-langserver', '-gocodecompletion']},
\ 'whitelist': ['go'],
\ })
endif
" highlightedyank {{{2
let g:highlightedyank_highlight_duration = 150
" filetype specific settings {{{1
autocmd FileType cvs setlocal fileencoding=euc-jp
autocmd FileType svn,gitcommit setlocal fileencoding=utf-8
autocmd BufNewFile,BufRead *.hbs setlocal sw=2 sts=2 ts=2 et
autocmd BufNewFile,BufRead *.scm RainbowParenthesesToggle
autocmd BufNewFile,BufRead *.cson setlocal ft=coffee
autocmd BufRead /tmp/sql* setlocal ft=sql
autocmd BufRead /private/var/folders/**/sql* setlocal ft=sql fileformat=unix
autocmd FileType help nnoremap <buffer> q <C-w>c
autocmd BufNewFile,BufRead .envrc setlocal ft=sh
autocmd BufNewFile,BufRead *.jb setlocal ft=ruby
autocmd FileType apache setlocal sw=4 sts=4 ts=4 et
autocmd FileType c setlocal sw=4 sts=4 ts=4 et
autocmd FileType cpp setlocal sw=4 sts=4 ts=4 et
autocmd FileType css setlocal sw=2 sts=2 ts=2 et
autocmd FileType eruby setlocal sw=2 sts=2 ts=2 et
autocmd FileType html setlocal sw=4 sts=4 ts=4 et
autocmd FileType java setlocal sw=4 sts=4 ts=4 et
autocmd FileType json setlocal sw=2 sts=2 ts=2 et
autocmd FileType lua setlocal sw=2 sts=2 ts=2 et
autocmd FileType sh setlocal sw=4 sts=4 ts=4 et
autocmd FileType sql setlocal sw=4 sts=4 ts=4 et
autocmd FileType vim setlocal sw=4 sts=4 ts=4 et
autocmd FileType xml setlocal sw=4 sts=4 ts=4 et
autocmd FileType zsh setlocal sw=2 sts=2 ts=2 et
" local settings, private settings {{{1
" directory {{{2
if exists("$EXTRA_VIM")
for path in split($EXTRA_VIM, ':')
exec "source ".path
endfor
endif
" host {{{2
runtime .vimrc_local
" }}}1
" vim: set fdm=marker ts=8 sts=2 sw=2 tw=0:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment