Skip to content

Instantly share code, notes, and snippets.

@devlights
Forked from kazmura11/.vimrc
Last active November 26, 2022 04:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devlights/2ff36954159d866ecdd4928cd329092b to your computer and use it in GitHub Desktop.
Save devlights/2ff36954159d866ecdd4928cd329092b to your computer and use it in GitHub Desktop.
"---------------------------------------------------------------------------
" 検索の挙動に関する設定:
"
" 検索時に大文字小文字を無視 (noignorecase:無視しない)
set ignorecase
" 大文字小文字の両方が含まれている場合は大文字小文字を区別
set smartcase
" インクリメンタルサーチ
set incsearch
" 検索ハイライト
set hlsearch
"---------------------------------------------------------------------------
" 編集に関する設定:
"
" タブの画面上での幅
set tabstop=4
" 連続した空白に対してタブキーやバックスペースキーでカーソルが動く幅
set softtabstop=4
" 自動インデントでずれる幅
set shiftwidth=4
" タブをスペースに展開する/ しない (expandtab:展開する)
set expandtab
" 自動的にインデントする (noautoindent:インデントしない)
set autoindent
" バックスペースでインデントや改行を削除できるようにする
set backspace=indent,eol,start
" 検索時にファイルの最後まで行ったら最初に戻る (nowrapscan:戻らない)
set wrapscan
" 括弧入力時に対応する括弧を表示 (noshowmatch:表示しない)
set showmatch
" コマンドライン補完するときに強化されたものを使う(参照 :help wildmenu)
set wildmenu
" テキスト挿入中の自動折り返しを日本語に対応させる
set formatoptions+=mM
"---------------------------------------------------------------------------
" GUI固有ではない画面表示の設定:
"
" タイトルを表示する
set title
" 行番号を表示 (nonumber:非表示)
set number
" ルーラーを表示 (noruler:非表示)
set ruler
" タブや改行を表示 (list:表示)
set nolist
" どの文字でタブや改行を表示するかを設定
"set listchars=tab:>-,extends:<,trail:-,eol:<
" 長い行を折り返して表示 (nowrap:折り返さない)
set wrap
" 常にステータス行を表示 (詳細は:he laststatus)
set laststatus=2
" コマンドラインの高さ (Windows用gvim使用時はgvimrcを編集すること)
set cmdheight=2
" コマンドをステータス行に表示
set showcmd
" モードを表示する
set showmode
" タイトルを表示
set title
" 画面のカラースキーマ
colorscheme desert
"---------------------------------------------------------------------------
" ファイル操作に関する設定:
"
" バックアップファイルを作成しない (次行の先頭の " を削除すれば有効になる)
set nobackup
" スワップファイルを作成しない (次行の先頭の " を削除すれば有効になる)
set noswapfile
" シンタックスハイライト
syntax on
"---------------------------------------------------------------------------
" netrw:
" - https://vim-jp.org/vimdoc-ja/pi_netrw.html#netrw-cd
"
let g:netrw_keepdir=0
"---------------------------------------------------------------------------
" vim-plug:
" - vim-go
"
" 参考: https://qiita.com/zipper/items/9a63856580872c5e02a4
if has("mac") || has("unix")
" 参考: https://github.com/junegunn/vim-plug/wiki/tips#automatic-installation
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
call plug#begin('~/.vim/plugged')
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
Plug 'ctrlpvim/ctrlp.vim'
Plug 'vim-jp/vimdoc-ja'
call plug#end()
" 参考: https://github.com/fatih/vim-go/issues/207
let g:go_fmt_command = "goimports"
endif
"---------------------------------------------------------------------------
" color scheme:
"
" [dracula theme](https://draculatheme.com/vim)
"
" $ mkdir -p ~/.vim/pack/theme/start
" $ cd ~/.vim/pack/theme/start
" $ git clone https://github.com/dracula/vim.git dracula
"
packadd! dracula
colorscheme dracula
@devlights
Copy link
Author

.vimrcのシンプル設定より拝借。感謝 m(_ _)m

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment