forked from get-me-power/vim-study
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
115 lines (97 loc) · 2.91 KB
/
vimrc
File metadata and controls
115 lines (97 loc) · 2.91 KB
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
scriptencoding utf-8
if has('vim_starting') " Changing encoding in Vim at runtime is undefined behavior.
set fileencodings=utf-8,sjis,cp932,euc-jp
set fileformats=unix,mac,dos
endif
" setting vim-plug
call plug#begin('~/.vim/plugged')
" statusline
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
" git
Plug 'lambdalisue/gina.vim'
Plug 'tpope/vim-fugitive'
" シンタックスハイライト
Plug 'sheerun/vim-polyglot'
" インクリメンタルサーチ
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
" テキストオブジェクト
Plug 'easymotion/vim-easymotion'
" インターフェース改善
Plug 'itchyny/vim-cursorword'
" url見やすくする
Plug 'tyru/open-browser.vim'
" ファイラ
Plug 'cocopon/vaffle.vim'
" カラースキーム
Plug 'morhetz/gruvbox'
" Lsp関連のプラグイン
Plug 'prabirshrestha/vim-lsp'
Plug 'mattn/vim-lsp-settings'
Plug 'prabirshrestha/asyncomplete.vim'
Plug 'prabirshrestha/asyncomplete-lsp.vim'
call plug#end()
" setting vim
if !has('nvim')
set backspace=indent,eol,start
endif
"syntax enable
filetype plugin indent on
set number
set autoindent
set smartindent
" インクリメンタルサーチ
set incsearch
set nobackup
set noswapfile
if has('mouse')
set mouse=a
endif
if &t_Co != 256
set t_Co=256
endif
" ファイルタイプごとにインデントを設定
augroup MyFileTypeIndentOverRide
autocmd!
autocmd FileType py setlocal tabstop=4 softtabstop=4 shiftwidth=4
autocmd FileType rb setlocal tabstop=2 softtabstop=2 shiftwidth=2
autocmd FileType html setlocal tabstop=2 softtabstop=2 shiftwidth=2
autocmd FileType vim setlocal tabstop=2 softtabstop=2 shiftwidth=2
autocmd FileType eruby setlocal tabstop=2 softtabstop=2 shiftwidth=2
augroup END
" vimのキーバインド設定
nnoremap <ESC><ESC> :nohlsearch<CR>
if has('terminal')
tnoremap <silent><C-u> <C-\><C-N>
endif
"スペースをトリガーにする
let mapleader = "\<Space>"
noremap <Leader>t :terminal<CR>
nnoremap <Leader>v :vsplit<CR>
nnoremap <Leader>s :split<CR>
nnoremap <Leader>f :Files<CR>
nnoremap <Leader>g :GFiles<CR>
" インデントを一括で行う
function s:Indent()
let save_cursor = getcurpos()
execute "normal " . "gg=G"
call setpos('.', save_cursor)
endfunction
" インデントコマンドを定義
command -nargs=0 Indent call s:Indent()
" setting vim-airline
set ttimeoutlen=10
let g:airline_extensions = ['branch', 'fzf', 'tabline']
" setting vim-lsp
nnoremap <expr> <silent> <C-]> execute(':LspDefinition') =~ "not supported" ? "\<C-]>" : ":echo<cr>"
" setting open-blowser.vim
nmap gx <Plug>(openbrowser-smart-search)
vmap gx <Plug>(openbrowser-smart-search)
" setting fzf
let g:fzf_layout = { 'window': '10new' }
" setting vaffle
function! RenderMyFavoriteIcon(item) abort
return WebDevIconsGetFileTypeSymbol(a:item.basename, a:item.is_dir)
endfunction
let g:vaffle_render_custom_icon = 'RenderMyFavoriteIcon'