From e16cbf7aed1fef223eec7e29c4c372ce941621b1 Mon Sep 17 00:00:00 2001 From: PiroHiroPiro Date: Thu, 13 Jul 2023 19:34:50 +0900 Subject: [PATCH] :bug: fix .vimrc --- install.sh | 27 ++++++++++++++++----------- vim/.vimrc | 46 ++++++++++++++++++++++++++++++++++++---------- 2 files changed, 52 insertions(+), 21 deletions(-) diff --git a/install.sh b/install.sh index 930e6f4..55e3d1c 100644 --- a/install.sh +++ b/install.sh @@ -226,29 +226,34 @@ echo "##### setup vim #####" install_if_not_exist vim echo "----- link vim setting files -----" -LINK_FILES=(.vimrc dein.toml dein_lazy.toml .config/dein) +LINK_FILES=(dein.toml dein_lazy.toml .config/dein) for file in ${LINK_FILES[@]}; do \ unlink ~/$file&>/dev/null ln -sf $DOTPATH/vim/$file ~/$file echo "Linked: ${file}"; \ done +# Permission deniedでinstallに失敗するので、予めsudoで作成 +MAKE_DIRS=(. .cache repos/github.com) +for dir in ${MAKE_DIRS[@]}; do \ + sudo mkdir -p ~/.config/dein/$dir + sudo chmod -R 777 ~/.config/dein/$dir; \ +done + echo "----- install dein.vim -----" if [ -d ~/.config/dein/repos/github.com/Shougo/dein.vim/ ]; then echo "dein.vim is already installed" else - if [ ! -f ~/.config/dein/installer.sh ]; then - echo "install dein installer.sh" - curl https://raw.githubusercontent.com/Shougo/dein-installer.vim/master/installer.sh > ~/.config/dein/installer.sh - fi - bash ~/.config/dein/installer.sh ~/.config/dein/ &>/dev/null + echo "install dein" + echo "" + sh -c "$(curl -fsSL https://raw.githubusercontent.com/Shougo/dein-installer.vim/master/installer.sh)" fi -# Permission deniedでinstallに失敗するので、予めsudoで作成 -MAKE_DIRS=(. .cache repos/github.com) -for dir in ${MAKE_DIRS[@]}; do \ - sudo mkdir -p ~/.config/dein/$dir - sudo chmod -R 777 ~/.config/dein/$dir; \ +LINK_FILES=(.vimrc) +for file in ${LINK_FILES[@]}; do \ + rm -f ~/$file&>/dev/null + ln -sf $DOTPATH/vim/$file ~/$file + echo "Linked: ${file}"; \ done echo "##### finish to setup vim #####" diff --git a/vim/.vimrc b/vim/.vimrc index e9b33cd..10d7441 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -1,4 +1,6 @@ """" dein """" +" Ward off unexpected things that your distro might have made, as +" well as sanely reset options when re-sourcing .vimrc if &compatible set nocompatible endif @@ -8,34 +10,57 @@ endif " ~/.config/deinで " sh installer.sh . " したと仮定 -let deinroot = "~/.config/dein/." -let $DEIN_PATH= deinroot . "/repos/github.com/Shougo/dein.vim" +let $DEIN_ROOT = "~/.config/dein/." +let $DEIN_PATH= $DEIN_ROOT . "/repos/github.com/Shougo/dein.vim" let tomlroot = "~/." -" Required: -set runtimepath+=$DEIN_PATH +" Set Dein base path (required) +let s:dein_base = '~/.cache/dein' + +" Set Dein source path (required) +let s:dein_src = $DEIN_PATH + +" Set Dein runtime path (required) +execute 'set runtimepath+=' . s:dein_src " Required: -if dein#load_state(deinroot) - call dein#begin(deinroot) +if dein#load_state($DEIN_ROOT) + " Call Dein initialization (required) + call dein#begin(s:dein_base) " Let dein manage dein " Required: - call dein#add($DEIN_PATH) - + call dein#add(s:dein_src) + " Your plugins go here: call dein#load_toml(tomlroot . "/dein.toml", {'lazy': 0}) call dein#load_toml(tomlroot . "/dein_lazy.toml", {'lazy': 1}) " not installed python... " call dein#add('Shougo/deoplete.nvim') + " Finish Dein initialization (required) call dein#end() + call dein#save_state() endif " Required: -filetype plugin indent on -syntax enable +" Attempt to determine the type of a file based on its name and possibly its +" contents. Use this to allow intelligent auto-indenting for each filetype, +" and for plugins that are filetype specific. +if has('filetype') + filetype indent plugin on +endif + +" Enable syntax highlighting +if has('syntax') + syntax on +endif + +" Uncomment if you want to install not-installed plugins on startup. +"if dein#check_install() +" call dein#install() +"endif " If you want to install not installed plugins on startup. if dein#check_install() @@ -145,6 +170,7 @@ set backspace=indent,eol,start " ファイル名補完 set wildmenu set wildmode=full +set rtp+=/home/linuxbrew/.linuxbrew/opt/fzf " マウス対応 "set mouse=a "set ttymouse=xterm2