Skip to content

Instantly share code, notes, and snippets.

@khirotaka
Last active April 14, 2024 01:19
Show Gist options
  • Save khirotaka/73a47741dd5e1e8cd2920e7d8b73a09c to your computer and use it in GitHub Desktop.
Save khirotaka/73a47741dd5e1e8cd2920e7d8b73a09c to your computer and use it in GitHub Desktop.
set number
" シンタックスハイライトの設定
syntax on
filetype on
filetype indent on
filetype plugin indent on
augroup vimrc
autocmd!
autocmd FileType c,cpp,java setl cindent
autocmd FileType c,cpp,java setl softtabstop=4 shiftround
autocmd FileType yaml,yml setl shiftwidth=2 tabstop=2 softtabstop=2 expandtab
autocmd FileType go setl shiftwidth=4 tabstop=4 softtabstop=4 noexpandtab
set cinkeys-=0#
augroup END
" タブ の大きさをスペース 4つ分に設定
set expandtab
set tabstop=4
set shiftwidth=4
set smartcase
set hlsearch
set wildmenu
set wildmode=full
call plug#begin('~/.vim/plugged')
Plug 'nathanaelkane/vim-indent-guides'
Plug 'rizzatti/dash.vim'
Plug 'rust-lang/rust.vim'
Plug 'lambdalisue/fern.vim'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'mattn/vim-goimports'
Plug 'arzg/vim-colors-xcode'
if has('nvim') || has('patch-8.0.902')
Plug 'mhinz/vim-signify'
else
Plug 'mhinz/vim-signify', { 'tag': 'legacy' }
endif
call plug#end()
colorscheme habamax
" airlineの設定
let g:airline_theme='jellybeans'
let g:airline#extensions#branch#enabled=1
" cocの設定
inoremap <silent><expr> <TAB>
\ coc#pum#visible() ? coc#pum#next(1) :
\ CheckBackspace() ? "\<Tab>" :
\ coc#refresh()
inoremap <expr><S-TAB> coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>"
inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm()
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
" fernの設定
" control + n で表示
" control + h で親フォルダへ
nnoremap <C-n> :Fern . -reveal=% -drawer -toggle -width=30<CR>
" カーソルラインの設定
highlight LineNr ctermfg=239
highlight CursorLine cterm=NONE
set cursorline
hi clear CursorLine
hi Comment ctermfg=DarkGrey
" clipboard
set clipboard+=unnamed
function! CheckBackspace() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
command Term terminal ++curwin ++noclose
command Hterm bo terminal ++noclose
command Vterm vert terminal ++noclose
tnoremap <Esc><Esc> <c-\><c-n>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment