summaryrefslogtreecommitdiff
path: root/vimrc
blob: 35f22800bc9f4f993c3d48a6093d942918ccb2dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
if empty(glob('~/.vim/autoload/plug.vim'))
  silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
    \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif

"#####表示設定#####
set number "行番号を表示する
set title "編集中のファイル名を表示
set showmatch "括弧入力時の対応する括弧を表示
syntax on "コードの色分け
set expandtab
set shiftwidth=4
set tabstop=4 "インデントをスペース4つ分に設定
set smartindent "オートインデント
set list lcs=tab:\|\ 

"#####検索設定#####
set ignorecase "大文字/小文字の区別なく検索する
set smartcase "検索文字列に大文字が含まれている場合は区別して検索する
set wrapscan "検索時に最後まで行ったら最初に戻る
set hlsearch
set incsearch

"####バックスペース制御
set backspace=2

" 改行時にコメントアウトしない
set formatoptions-=ro

" ファイル編集時に別ファイルを開ける
set hidden

set nofixeol

set completeopt+=preview,menuone
set redrawtime=3000

" syntax on
set background=dark

set laststatus=2

" swap ファイルの場所
if empty(glob('~/.vim/tmp'))
  silent !mkdir -p ~/.vim/tmp
endif

set directory=~/.vim/tmp

let mapleader = "\<Space>"
let maplocalleader = "\<Bslash>"

" git commit 時にはプラグインは読み込まない
" if $HOME != $USERPROFILE && $GIT_EXEC_PATH != ''
" 
"   call plug#begin('~/.vim/plugged')
"     Plug 'tpope/vim-fugitive'
"   call plug#end()
" 
"   finish
" end

let g:plug_shallow = 0

call plug#begin('~/.vim/plugged')

Plug 'prabirshrestha/async.vim'
Plug 'prabirshrestha/vim-lsp'
Plug 'mattn/vim-lsp-settings'
Plug 'mattn/vim-lsp-icons'

Plug 'prabirshrestha/asyncomplete.vim'
Plug 'prabirshrestha/asyncomplete-lsp.vim'

Plug 'hrsh7th/vim-vsnip'
Plug 'hrsh7th/vim-vsnip-integ'

" Plug 'yami-beta/asyncomplete-omni.vim'
" Plug 'machakann/asyncomplete-ezfilter.vim'
" ALE
" Plug 'w0rp/ale'

Plug 'szw/vim-tags'

" php
" Plug 'felixfbecker/php-language-server', {'do': 'composer install && composer run-script parse-stubs'}
" theme
Plug 'arcticicestudio/nord-vim'

" for lit-html
Plug 'jonsmithers/vim-html-template-literals'

" for coffee script
Plug 'kchmck/vim-coffee-script'

" for twig
Plug 'nelsyeung/twig.vim'

Plug 'mattn/emmet-vim'

Plug 'tpope/vim-unimpaired'
Plug 'tpope/vim-abolish'
Plug 'itchyny/lightline.vim'
Plug 'qpkorr/vim-bufkill'

" to treat whitespace
Plug 'ntpeters/vim-better-whitespace'
Plug 'junegunn/vim-easy-align'

Plug 'tpope/vim-surround'
Plug 'tpope/vim-repeat'

" for indent
Plug 'ciaranm/detectindent'
Plug 'Yggdroot/indentline'

" for json conceal disable
Plug 'elzr/vim-json'

" Plug 'docunext/closetag.vim'
Plug 'alvan/vim-closetag'
Plug 'yggdroot/indentline'

" file manager
Plug 'mattn/vim-molder'

" treat file
Plug 'tpope/vim-eunuch'

" for git
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-rhubarb'
Plug 'airblade/vim-gitgutter'
Plug 'borissov/fugitive-gitea'
" Plug 'tommcdo/vim-fubitive'
" Plug 'lambdalisue/gina.vim'

Plug 'ctrlpvim/ctrlp.vim'
Plug 'mattn/ctrlp-mark'
Plug 'mattn/ctrlp-register'
Plug 'mattn/ctrlp-launcher'
Plug 'mattn/ctrlp-matchfuzzy'

"apt install ripgrep
Plug 'mileszs/ack.vim'
Plug 'andymass/vim-matchup'

" for markdown
Plug 'plasticboy/vim-markdown'
Plug 'kannokanno/previm'
Plug 'mattn/vim-maketable'

Plug 'glidenote/memolist.vim'

Plug 'mattn/vim-sonictemplate'

" open url or so
Plug 'tyru/open-browser.vim'
" for comment
Plug 'scrooloose/nerdcommenter'

" sneak: Jump to any location specified by two characters.
Plug 'justinmk/vim-sneak'

" Plug 'thinca/vim-quickrun'

Plug 'thinca/vim-localrc'

Plug 'twitvim/twitvim'

Plug 'maxmellon/vim-jsx-pretty'

Plug 'ap/vim-css-color'
Plug 'vim-scripts/CSSMinister'

" memorize cursor position
Plug 'farmergreg/vim-lastplace'

" diff
Plug 'AndrewRadev/linediff.vim'

" wakatime
Plug 'wakatime/vim-wakatime'

call plug#end()

colorscheme nord

" function! s:fuzzy(lhs, rhs) abort
"   return a:lhs =~ join(map(split(a:rhs, '\zs'), "printf('[\\x%02x].*', char2nr(v:val))"), '')
" endfunction
" 

" 各種設定の読み込み
let s:plugs = get(s:, 'plugs', get(g:, 'plugs', {}))
function! FindPlugin(name) abort
  return has_key(s:plugs, a:name) ? isdirectory(s:plugs[a:name].dir) : 0
endfunction
command! -nargs=1 UsePlugin if !FindPlugin(<args>) | finish | endif

runtime! _config/*.vim