Skip to content

Commit

Permalink
🐛 fix .vimrc
Browse files Browse the repository at this point in the history
  • Loading branch information
PiroHiroPiro committed Jul 13, 2023
1 parent 1c8a66f commit e16cbf7
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 21 deletions.
27 changes: 16 additions & 11 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 #####"
Expand Down
46 changes: 36 additions & 10 deletions vim/.vimrc
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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()
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e16cbf7

Please sign in to comment.