# neovim install windows での nvim install の手順です。 # scoop ## インストール scoop を install します。 Windows Power Shell で以下のコマンドを実行します。 ``` > Set-ExecutionPolicy RemoteSigned -scope CurrentUser >invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh') ``` # git-bash ## インストール git-bash を install します。 git-bash は git を install すると、一緒に install されます。 ``` # -g を付ける場合は管理者権限で実行してください。 > scoop install git -g ``` ## 初期設定 git-bash を windows terminal に登録します。 - windows terminal を開きく。タブ欄のプルダウンメニューを開く。 - [設定] > [+ 新しいプロファイルを追加します] > [+ 新しい殻のプロファイル] - 名前 : GitBash - [コマンドライン] > [参照] : GitBash.exe の Path を選択 - 例 : C:\ProgramData\scoop\apps\git\current\bin\bash.exe - 開始ディレクトリ : 好きな場所を選んでください。 - 例 : C:\Users\admin # neovim ## インストール neovim を install します。 ``` $ scoop install neovim -g ``` ## 初期設定 ### nvim フォルダーの設定 nvim の設定をまとめたフォルダを C:\Users\admin\.config\nvim とします。 ``` $ echo -e "export XDG_CONFIG_HOME=~/.config" >> ~/.bashrc $ source ~/.bashrc $ mkdir ~/.config/nvim $ cd ~/.config/nvim ``` ### 設定ファイルの作成 以下の設定ファイルを作成します。 - init.vim - option.vim - keymap.vim #### init.vim ``` $ cat << '_EOF_' >> init.vim " read option setting file runtime! option.vim runtime! keymap.vim _EOF_ ``` #### option.vim ``` $ cat << '_EOF_' >> option.vim set number set mouse=a set termguicolors set ambiwidth=double set hidden set list set visualbell set expandtab set smartindent set shiftwidth=4 set softtabstop=4 set autochdir set fileencoding=utf-8 set fileencodings=utf-8,cp932 set clipboard+=unnamed,unnamedplus set wildmode=longest,full set noswapfile set title set laststatus=2 set wildmode=list:longest set infercase set wildmenu set backspace=indent,eol,start set textwidth=0 set encoding=utf-8 set helplang=ja set shortmess+=I command! -nargs=0 IG call IncludeGuard() function! IncludeGuard() let res_head = '#pragma once'."\n\n" silent! execute '1s/^/\=res_head' endfunction syntax enable command! -nargs=0 FullIG call FullIncludeGuard() function! FullIncludeGuard() let name = fnamemodify(expand('%'),':t') let name = toupper(name) let included = substitute(name,'\.','_','g').'_' let res_head = '#ifndef '.included."\n#define ".included."\n\n" let res_foot = "\n".'#endif /*'.included.'*/'"\n" silent! execute '1s/^/\=res_head' silent! execute '$s/$/\=res_foot' endfunction _EOF_ ``` #### keymap.vim ``` $ cat << '_EOF_' >> keymap.vim nnoremap <A-v> <C-v> nnoremap j gj nnoremap k gk vnoremap j gj vnoremap k gk inoremap <silent> jj <Esc> inoremap <A-h> <Left> inoremap <A-j> <Down> inoremap <A-k> <Up> inoremap <A-l> <Right> inoremap <A-d> <BS> inoremap <A-m> <CR> inoremap { {}<Left> inoremap ( ()<Left> inoremap [ []<Left> inoremap ' ''<Left> inoremap " ""<Left> inoremap <A-[> <C-d> inoremap <A-]> <C-t> inoremap <Esc> <Esc> inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>" inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<S-TAB>" nnoremap <C-t> <C-w>ji nnoremap <silent> <Leader>v :vs<CR> nnoremap <silent> <Leader>s :sp<CR> nnoremap <A-tab> :tabnext<cr> nnoremap <A-w> <C-w> tnoremap <Esc> <C-\><C-n>:quit<CR> tnoremap <silent> jj <C-\><C-n>:quit<CR> tnoremap <A-h> <Left> tnoremap <A-j> <Down> tnoremap <A-k> <Up> tnoremap <A-l> <Right> tnoremap <A-d> <BS> tnoremap <A-m> <CR> command! -nargs=* T split | wincmd j | resize 10 | terminal <args> autocmd TermOpen * startinsert _EOF_ ``` # プラグイン ## dein.vim パッケージマネージャーです。 ### インストール 一時的なフォルダを作成し、そこで git clone を行います。 ``` $ mkdir tmp_dir $ cd tmp_dir $ git clone git@github.com:Shougo/dein-installer.vim.git ``` clone したフォルダからインストーラーだけをコピーして、ディレクトリを削除します。 ``` $ cp dein-installer.vim/installer.sh installer.sh $ rm -rf dein-installer.vim/ ``` インストーラーを起動して、表示に従い操作します。 ``` $ bash installer.sh [ DEIN.VIM LOCATION ] 1 cache path (~/.cache/dein) 2 local path (~/.local/share/dein) Select dein.vim location to clone with git (eg. 1 or 2) 1 [ CONFIG LOCATION ] 1 vim path (~/.vimrc) 2 neovim path (~/.config/nvim/init.vim) Select your editor config location (eg. 1 or 2) 2 Cloning Dein.vim into '/c/Users/admin/.cache/dein/repos/github.com/Shougo/dein.vim'... remote: Enumerating objects: 66, done. remote: Counting objects: 100% (66/66), done. remote: Compressing objects: 100% (55/55), done. remote: Total 66 (delta 2), reused 33 (delta 0), pack-reused 0 Unpacking objects: 100% (66/66), 82.49 KiB | 387.00 KiB/s, done. From https://github.com/Shougo/dein.vim * branch master -> FETCH_HEAD * [new branch] master -> origin/master Looking for an existing 'init.vim' config... Found init.vim. Creating backup in '/c/Users/admin/.config/nvim/init.vim.pre-dein-vim'... Using the Dein.vim config example and adding it to '/c/Users/admin/.config/nvim/init.vim'... _______________________________________________________________ ####### ######## ### ### ### ### ### ### ########### ##! ### ##! ##! ##!#!### ##! ### ##! ##! ##! ##! #!# !#! #!!!:! !!# #!##!!#! #!# !#! !!# #!! !#! #!# !!: !!! !!: !!: !!: !!! !:..:! !!: !!: !!: :::::: :::::::: ::: ::: :: :: :: ::: ::: ::: by Shougo • MIT License • v3.0 _______________________________________________________________ All done. Look at your init.vim file to set plugins, themes, and more. ● Documentation: /c/Users/admin/.cache/dein/repos/github.com/Shougo/dein.vim/doc/dein.txt ● Chat with the community: https://gitter.im/Shougo/dein.vim ● Report issues: https://github.com/Shougo/dein.vim/issues ``` 一時的に作成したディレクトリを削除します。 ``` $ cd .. $ rm -rf tmp_dir ``` ### 初期設定 `init.vim` が dein.vim によって書き換えられたので、リネームし、元の `init.vim` から読み込むようにします。 ``` $ mv init.vim deinsetting.vim $ mv init.vim.pre-dein-vim init.vim $ echo 'runtime! deinsetting.vim' >> init.vim ``` `deinsetting.vim` 内の Path を 修正します。 ``` $ perl -pi -e 's|^(let s:dein_base) =.*|$1 = '\''~\\.cache\\dein'\''|' deinsetting.vim $ perl -pi -e 's|^(let s:dein_src) =.*|$1 = '\''~\\.cache\\dein\\repos\\github.com\\Shougo\\dein.vim'\''|' deinsetting.vim ``` .toml 形式でプラグインをインストールするため、 `dein.toml` を作成し、`deinsetting.vim` で読み込むように設定します。 ``` $ touch dein.toml ``` deinsetting.vim を以下のように編集 ``` ...前略 call dein#begin(s:dein_base) call dein#add(s:dein_src) " Your plugins go here: let s:toml = '~/.config/nvim/dein.toml' call dein#load_toml(s:toml, {'lazy':0}) " Finish Dein initialization (required) call dein#end() ...中略 " Uncomment if you want to install not-installed plugins on startup. if dein#check_install() call dein#install() endif ``` ## neon カラースキームです。好きなものを設定してください。 ### インストール ``` $ cat << '_EOF_' >> dein.toml [[plugins]] repo='rafamadriz/neon' _EOF_ ``` ### 設定 colorscheme の設定は `deinsetting.vim` 内の `call dein#end()` より後に記述しなければならないので、`deinsetting.vim` 内で書きます。 ``` $ echo 'colorscheme neon'>> deinsetting.vim ``` ## vim-airline ステータスバーを表示してくれるプラグインです。 ### インストール ``` $ cat << '_EOF_' >> dein.toml [[plugins]] repo='vim-airline/vim-airline' hook_add = ''' let g:airline#extensions#tabline#enabled = 1 let g:airline#extensions#default#layout = [ \ [ 'a', 'b', 'c' ], \ ['z'] \ ] let g:airline_section_c = '%t %M' let g:airline_section_z = get(g:, 'airline_linecolumn_prefix', '').'%3l:%-2v' let g:airline#extensions#hunks#non_zero_only = 1 let g:airline#extensions#tabline#fnamemod = ':t' let g:airline#extensions#tabline#show_buffers = 1 let g:airline#extensions#tabline#show_splits = 0 let g:airline#extensions#tabline#show_tabs = 1 let g:airline#extensions#tabline#show_tab_nr = 0 let g:airline#extensions#tabline#show_tab_type = 1 let g:airline#extensions#tabline#show_close_button = 0 ''' [[plugins]] repo='vim-airline/vim-airline-themes' _EOF_ ``` ## Fern.vim ファイルツリーを表示してくれるプラグインです。 ### インストール ``` $ cat << '_EOF_' >> dein.toml [[plugins]] repo = 'lambdalisue/fern.vim' hook_add = ''' nnoremap <A-n> : Fern . -reveal=% -drawer -toggle -width=40<CR> nnoremap <A-q> gt ''' _EOF_ ``` ### 設定 フォントの設定のため、関連プラグインをインストールします。 ``` $ cat << '_EOF_' >> dein.toml [[plugins]] repo = 'lambdalisue/nerdfont.vim' [[plugins]] repo = 'lambdalisue/fern-renderer-nerdfont.vim' hook_add = ''' let g:fern#renderer = 'nerdfont' let g:fern#renderer#nerdfont#indent_markers = 1 ''' _EOF_ ``` - [hack-nerd-fonts](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/Hack/Regular/HackNerdFont-Regular.ttf) からフォントをダウンロードする。 - ダウンロードしたファイルをクリックして [インストール] を押す。 - [コントーロールパネル] > [デスクトップのカスタマイズ] > [フォント] - インストールしたフォントファイルをここにドラッグアンドドロップする。 ## glyph-palette.vim アイコンに色をつけます。 ``` cat << '_EOF_' >> dein.toml [[plugins]] repo = 'lambdalisue/glyph-palette.vim' hook_add = ''' augroup my-glyph-palette autocmd! * autocmd FileType fern call glyph_palette#apply() autocmd FileType nerdtree,startify call glyph_palette#apply() augroup END ''' _EOF_ ``` ## coc.nvim ### インストール 依存関係にある nodejs を インストールします。 ``` $ scoop install nodejs -g ``` coc.nvim をインストールします。 ``` cat << '_EOF_' >> dein.toml [[plugins]] repo = 'neoclide/coc.nvim' merged = 0 rev = 'release' hook_add = ''' source ~/.config/nvim/coc.vim ''' _EOF_ ``` ### 設定 coc.vim を作成して、設定を記述します。 ``` $ cat << '_EOF_' >> coc.vim let g:coc_global_extensions = [ \'coc-clangd', \'coc-pyright' \] highlight CocErrorSign ctermfg=15 ctermbg=196 highlight CocWarningSign ctermfg=0 ctermbg=172 noremap <silent> <Leader>info :<C-u>call CocAction('doHover')<cr> nnoremap <silent> <Leader>df :call CocAction('jumpDefinition')<CR> nnoremap <space>fmt :call CocAction('format')<CR> nnoremap <space>fx :call CocAction('doQuickfix')<CR> 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>" function! CheckBackspace() abort let col = col('.') - 1 return !col || getline('.')[col - 1] =~# '\s' endfunction function! ShowDocumentation() if CocAction('hasProvider', 'hover') call CocActionAsync('doHover') else call feedkeys('K', 'in') endif endfunction _EOF_ ``` coc.nvim の具体的な設定を記述します。 ``` cat << '_EOF_' >> coc-setting.json { "suggest.noselect": true, "clangd.path": "~\\.config\\coc\\extensions\\coc-clangd-data\\install\\16.0.2\\clangd_16.0.2\\bin\\clangd.exe", "suggest.keepCompleteopt": true, "clangd.arguments": ["--log", "verbose"], "clangd.trace.server": "verbose", "coc.preferences.formatOnSave": true } _EOF_ ``` ## Alpha-nvim ダッシュボードのプラグインです。 ## インストール 遅延読み込みをするために、`dein_lazy.toml` を作成します。 ``` cat << '_EOF_' >> dein_lazy.toml [[plugins]] repo = 'goolord/alpha-nvim' lua_post_source = ''' local alpha = require("alpha") local dashboard = require("alpha.themes.dashboard") -- Footer local function footer() local version = vim.version() local print_version = "v" .. version.major .. '.' .. version.minor .. '.' .. version.patch local datetime = os.date('%Y/%m/%d %H:%M:%S') return print_version .. ' - ' .. datetime end local logo = [[ ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ]] -- Set header dashboard.section.header.val = { [[⠰⡜⢆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣴⠞⠁]], [[⠀⢳⡈⢧⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡀⡀⠀⠀⠀⠀⠀⠀⣴⠆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡤⢖⠽⠊⠁⠀⠀]], [[⠀⠀⢳⠈⢧⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⠤⠖⢋⡩⣝⠯⢻⣭⠓⠦⣄⣠⣮⠏⠀⠀⠀⠀⠀⠀⠀⢀⣠⠴⢊⡡⠖⠁⠀⠀⠀⠀⠀]], [[⠀⠀⠀⢧⠀⢳⡀⠀⠀⠀⠀⠀⠀⢀⣴⣊⣁⠠⡺⠝⠋⠁⠀⠀⢷⢧⠀⡴⡱⠓⠦⣄⠀⠀⠀⣀⠤⠚⠉⡠⠔⠉⠀⠀⠀⠀⠀⠀⠀⠀]], [[⠀⠀⠀⠈⡆⠀⢳⡀⠀⠀⠀⠠⠄⠉⠀⠨⠫⢹⣅⠀⠀⠀⠀⠀⠸⣟⠜⡴⠁⠀⠀⢈⣹⠖⠋⠀⣀⠔⠋⠀⠀⠀⠀⢀⡀⠀⠀⠀⠀⠀]], [[⠀⠀⠀⠀⠸⡄⠀⠱⡀⠀⢸⠟⣟⠿⢍⢆⠀⠈⠻⡀⠀⠀⣀⠤⠲⠋⡼⠿⣿⠶⠚⠉⠀⢀⡔⠊⠀⠀⠀⠀⢀⡤⣺⠕⠁⠀⠀⠀⠀⠀]], [[⠀⠀⠀⠀⠀⢹⡀⠀⠹⡄⠈⡆⠸⡄⠈⢧⣄⠀⠀⢱⡠⠊⢡⣞⣁⡼⠖⠉⠀⠀⢀⣀⠊⠙⠳⣄⠀⢀⡤⢒⠵⠊⠀⠀⠀⠀⠀⠀⠀⠀]], [[⠀⠀⠀⠀⠀⠀⢳⠀⠀⠹⡄⢹⣀⡳⠤⣬⣿⣴⣠⠊⢀⣠⠔⠊⠁⠀⠀⢀⡠⠒⠁⠈⢳⡦⣀⡨⢛⢥⣮⣁⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀]], [[⠀⠀⠀⠀⠀⠀⠀⡇⢠⡀⢙⣞⣛⣛⣒⠶⣚⣾⠵⠚⣉⣤⠀⠀⠀⣠⠔⠉⠀⠀⠀⢀⡠⢟⡩⡖⢹⡆⠀⠈⣿⡀⠀⠀⠀⠀⠀⠀⠀⠀]], [[⠀⠀⠀⠀⠀⠀⠀⢧⢸⢧⡜⠉⠉⠙⡎⠉⣜⠤⣒⠭⠓⠁⠀⢠⠏⠀⠀⠀⠀⢀⡰⣁⠀⠉⢻⡅⢸⡇⠀⠀⣿⣇⠀⠀⠀⠀⠀⠀⠀⠀]], [[⠀⠀⠀⠀⠀⠀⠀⢸⣆⣿⠃⠀⠀⢀⡇⢨⠓⠉⠀⠀⢀⡠⠔⠃⠀⠀⠀⠀⠀⠘⠓⠉⠀⠀⠀⢷⢐⣀⠀⢀⣧⣿⡄⠀⠀⠀⠀⠀⠀⠀]], [[⠀⠀⠀⠀⠀⠀⢰⠃⢸⡇⠀⠀⠀⢸⢃⡸⡇⣀⠴⠚⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⢽⣌⡉⠹⣞⠁⢧⠀⠀⠀⠀⠀⠀⠀]], [[⠀⠀⠀⠀⠀⠀⢿⢲⣞⣃⠀⣀⣴⠾⠀⠉⠛⣾⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⠀⠀⠀⠀⡴⠁⠀⠈⢉⠷⡟⠀⠈⣧⠀⠀⠀⠀⠀⠀]], [[⠀⠀⠀⠀⠀⠀⢸⠓⣎⣙⠉⡍⠀⠀⢀⡠⠖⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣤⠟⠀⠀⢀⣊⣀⣠⡤⠤⢋⡜⢿⡀⡀⢸⠀⠀⠀⠀⠀⠀]], [[⠀⠀⠀⠀⠀⠀⡸⡁⣩⣩⣷⣝⡠⠖⠉⠀⠀⢠⠀⣀⣀⣀⣠⡤⠴⠒⠋⠈⠀⣠⣄⠀⠒⢛⠧⠤⠶⢶⠈⠀⠘⢧⠘⣼⠀⠀⠀⠀⠀⠀]], [[⠀⠀⠀⠀⠀⢰⢻⡇⣠⡞⠘⣿⡀⠀⠀⠀⠀⢁⠜⠛⠛⠀⠀⣀⣀⣄⠀⠀⠉⠀⢹⠀⠀⠚⠶⣤⣶⣶⢀⡀⠀⠘⡇⡟⠀⠀⠀⠀⠀⠀]], [[⠀⠀⠀⠀⠀⠘⣎⠯⣭⠇⢀⡟⢲⣄⣀⢴⡎⠁⠀⠐⠚⠉⠉⠀⠠⢞⡷⡦⠶⢿⣇⠀⠀⣘⡉⠛⢉⣻⣷⡍⠀⢰⣷⠃⠀⠀⠀⠀⠀⠀]], [[⠀⠀⠀⠀⠀⠀⠈⠳⣼⡛⢻⣇⠀⣯⣮⣭⣖⠙⢲⣶⠶⠶⠒⣦⡠⠜⡰⠁⢀⣾⠃⠀⢸⠹⣇⣤⠛⠁⣼⡇⢠⢿⡏⠀⠀⠀⠀⠀⠀⠀]], [[⠀⠀⠀⠀⠀⠀⠀⠀⢹⣇⠀⣿⡄⢉⡿⠈⠉⠙⠺⠷⢶⣖⡾⠿⣶⣿⠷⣲⣾⠃⠀⠀⢇⠀⠙⠲⢤⣶⠟⠀⢸⣾⠁⠀⠀⠀⠀⠀⠀⠀]], [[⠀⠀⠀⠀⠀⠀⠀⠀⠀⠻⣀⣼⣷⠸⢿⠿⣶⠀⠀⠀⠀⠀⠀⠀⣹⢹⠀⠀⣿⠀⠀⠀⠈⡝⣻⠯⠿⠲⠀⠀⡿⠇⠀⠀⠀⠀⠀⠀⠀⠀]], [[⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣯⡿⣿⡇⣾⣤⣄⡀⠀⠀⠀⠀⠀⢠⡿⠈⡆⠀⠿⠀⠀⠀⠀⢀⣻⣶⣶⠿⠓⡎⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀]], [[⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⣿⣿⡇⠀⠣⠉⠛⠀⠀⠀⠀⠀⣼⠇⣰⡁⢸⡇⣀⠇⠀⠀⢀⠑⠚⠀⠀⢠⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀]], [[⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣇⣿⡧⠲⢻⠛⡶⡄⠀⠀⠀⣰⠟⣰⡃⡇⠘⡟⠁⠀⢀⠔⠁⠀⠀⠀⡰⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀]], [[⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡾⡀⢀⣤⡾⠂⠐⠁⠹⣄⣠⣂⠵⠚⢹⣧⣇⣀⣇⡀⠂⠁⠀⠀⠀⢀⠞⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀]], [[⠀⠀⠀⠀⠀⠀⠀⠀⠀⡸⠀⣽⡍⠾⣿⡏⢳⡄⢠⢻⠉⠀⠀⠀⢸⣿⠀⢠⢫⡀⠀⠀⠀⠀⡰⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀]], [[⠀⠀⠀⠀⠀⠀⠀⠀⢠⠃⢀⡿⣷⣾⣿⣽⡖⠿⠃⡞⠀⠀⠀⠀⠸⣿⢠⠏⠀⢳⠀⠀⢀⠜⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀]], [[⠀⠀⠀⠀⠀⠀⠀⠀⡜⠀⣼⡾⠟⠁⢸⡘⡇⠀⢀⠇⠀⠀⠀⠀⠀⣿⠎⠀⠀⠈⡆⡠⠋⠀⠀⠀ ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ]], [[⠀⠀⠀⠀⠀⠀⠀⢰⠁⢀⡇⠀⠀⠀⠈⢧⠹⢤⣎⣀⣀⣀⡤⠤⢖⡟⠀⠀⠀⢀⠟⠁⠀⠀⠀⠀ ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ]], [[⠀⠀⠀⠀⠀⠀⠀⡞⠀⡼⠀⢀⡀⠀⠀⠈⠳⢾⣀⣀⣀⣤⠤⠖⡞⠀⠀⠀⡰⠁⠀⠀⠀⠀⠀⠀ ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ]], [[⠀⠀⠀⠀⠀⠀⢰⠁⢰⠃⢶⣻⠯⢤⣀⡀⠀⠀⠀⠀⠀⠀⠀⡜⠀⠀⢠⠎⠀⠀⠀⠀⠀⠀⠀⠀ ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ]], [[⠀⠀⠀⠀⠀⠀⣎⡠⠞⠉⠓⠲⢤⣄⣀⠉⠙⠒⢢⡴⢭⡆⡼⠀⠀⡴⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀ ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ]], [[⠀⠀⠀⠀⡠⠞⠉⠀⠀⠀⠀⠀⠀⠀⠉⠙⠒⡦⢬⣙⠊⡽⠁⡠⠊⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ]], } -- dashboard.section.header.val = { -- "", -- "", -- "", -- "", -- "", -- "", -- "", -- "", -- " ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ", -- " ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ", -- " ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ", -- " ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ", -- " ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ", -- " ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ", -- " ", -- -- -- -- -- } -- Set menu dashboard.section.buttons.val = { dashboard.button( "e", " > New file" , ":ene <BAR> startinsert <CR>"), -- dashboard.button( "f", " > Find file", ":cd $HOME/Workspace | Telescope find_files<CR>"), -- dashboard.button( "r", " > Recent" , ":Telescope oldfiles<CR>"), dashboard.button( "n", " > Open Current Directory" , ": Fern . -reveal=% -drawer -toggle -width=30<CR>"), dashboard.button( "s", " > Settings" , ": Fern ~/.config/nvim -reveal=% -drawer -toggle -width=30<CR>"), dashboard.button( "q", " > Quit NVIM", ":qa<CR>"), } -- Set footer -- NOTE: This is currently a feature in my fork of alpha-nvim (opened PR #21, will update snippet if added to main) -- To see test this yourself, add the function as a dependecy in packer and uncomment the footer lines -- ```init.lua -- return require('packer').startup(function() -- use 'wbthomason/packer.nvim' -- use { -- 'goolord/alpha-nvim', branch = 'feature/startify-fortune', -- requires = {'BlakeJC94/alpha-nvim-fortune'}, -- config = function() require("config.alpha") end -- } -- end) -- ``` -- local fortune = require("alpha.fortune") -- dashboard.section.footer.val = fortune() -- Send config to alpha alpha.setup(dashboard.opts) -- Disable folding on alpha buffer vim.cmd([[ autocmd FileType alpha setlocal nofoldenable ]])''' _EOF_ ``` deinsetting.vim に遅延読み込みの設定を記述します。 ``` ...前略 call dein#begin(s:dein_base) call dein#add(s:dein_src) " Your plugins go here: let s:toml = '~/.config/nvim/dein.toml' call dein#load_toml(s:toml, {'lazy':0}) let s:lazy_toml = '~/.config/nvim/dein_lazy.toml' call dein#load_toml(s:lazy_toml, {'lazy':1}) " Finish Dein initialization (required) call dein#end() ...後略 ```