" ファイルの種類毎に設定ファイルを記述できるようにする filetype plugin indent off "-------------------------------" " Global "-------------------------------" " `.vim` is used when human rights are being violated let g:human_rights = 0 let g:is_mac = has("mac") let g:is_linux = has("linux") let g:is_windows = has("win32") let g:is_wsl = has("wsl") let g:is_unix = has("unix") " TODO: path_sep " -- NOTE: " -- Windows: "\" " -- Linux: "/" " ---@type string " local path_sep_char = string.sub(package.config, 1, 1) " -- NOTE: self.path_sep = self.is_windows and "\\" or "/" " ---@type string " self.path_sep = self.is_windows and string.rep(path_sep_char, 2) or path_sep_char "-------------------------------" " Settings "-------------------------------" let g:use_copilot = 0 "-------------------------------" " Options "-------------------------------" "# True Colorでのシンタックスハイライト set termguicolors let &t_8f = "\[38;2;%lu;%lu;%lum" let &t_8b = "\[48;2;%lu;%lu;%lum" " マウス操作を有効にする set mouse=a " シンタックスハイライトを有効にする syntax enable " 使用可能性のある改行コードを指定 set fileformats=unix,dos,mac " ファイル読み込むときのエンコード " 左から順に試す set fileencodings=utf-8,cp932,ucs-bombs,euc-jp " 全角文字の表示に2文字分使うようにする set ambiwidth=double " スワップファイルを作成しないようにする set noswapfile " :q したときにバッファを消さず隠して保持しておくようにする " Linuxの場合のみ設定 " TODO: Improve if g:is_unix set hidden endif " 行番号を表示する set number " 空白文字を可視化する set list set listchars=tab:>-,trail:*,nbsp:+,space:⋅ " 良い感じにインデントしてくれるようにする set smartindent " ビープ音を画面フラッシュで代替 set visualbell " TABキーを押したときにtab文字ではなくスペースを入力するようにする set expandtab " TABキーを押したときのインデントのスペース個数を指定する set tabstop=4 " 自動インデントのスペース個数を指定する set shiftwidth=4 " 検索関係の設定 " 大文字小文字の区別をなくす set ignorecase " 検索単語に大文字が含まれていた場合特別な意味があると解釈させる set smartcase " 一番下の単語まで行ったら一番上に戻るようにさせる set wrapscan " ある行の行頭から前の行の行末に移動したり, 逆に行末から次の行の行頭に移動できるようにする " BackSpaceキー, SPACEキーで有効になる " <(←キー),>(→キー)はNORMALモード及びVISUALモードで各キーにこの機能を割り当て " [(←キー),](→キー)はINSERTモード(置換含む)でこの機能を有効にする set whichwrap=b,s,<,>,[,] " NeoVimの無名レジスタ(yでヤンクしたときにコピーする先)とOSのクリップボードを結びつける set clipboard+=unnamedplus "-------------------------------" " Plugins "-------------------------------" " Automatic installation on startup let s:jetpackfile = expand(':p:h') .. '/pack/jetpack/opt/vim-jetpack/plugin/jetpack.vim' let s:jetpackurl = "https://raw.githubusercontent.com/tani/vim-jetpack/master/plugin/jetpack.vim" if !filereadable(s:jetpackfile) call system(printf('curl -fsSLo %s --create-dirs %s', s:jetpackfile, s:jetpackurl)) endif packadd vim-jetpack call jetpack#begin() Jetpack 'tani/vim-jetpack', {'opt': 1} " colorscheme Jetpack 'sainnhe/sonokai' " utilities Jetpack 'vim-jp/vimdoc-ja' call jetpack#end() " Automatic plugin installation on startup for name in jetpack#names() if !jetpack#tap(name) call jetpack#sync() break endif endfor "------------------------------- " keymaps "------------------------------- " ファイル上の1行が画面上では複数行にわたっているとき " NORMALモード時の j/kで見た目通りに移動できるようにする nnoremap j gj nnoremap k gk " win32yankの設定 "nnoremap y :.w !win32yank.exe -i "vnoremap y :w !win32yank.exe -i "nnoremap p :r !win32yank.exe -o "vnoremap p :r !win32yank.exe -o " Ctrl+Wを押した後にnを押すことで新規タブを開けるようにする nnoremap n :enew " ESCキー連打でハイライト解除 nmap :nohlsearch "------------------------------- " vim-jp/vimdoc-ja "------------------------------- set helplang=ja,en " sainnhe/sonokai let g:sonokai_style = 'andromeda' colorscheme sonokai " 末尾なのでこれを入れる filetype plugin indent on