From ce7327a6c9958de02363ad79bdaffb08106cc0f9 Mon Sep 17 00:00:00 2001 From: taynpg Date: Mon, 29 Apr 2024 22:11:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0vim=E5=AE=89=E8=A3=85shell?= =?UTF-8?q?=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vim/install.sh | 20 ++++++++++++++++++++ vim/vimrc | 4 +++- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100755 vim/install.sh diff --git a/vim/install.sh b/vim/install.sh new file mode 100755 index 0000000..0f44eb5 --- /dev/null +++ b/vim/install.sh @@ -0,0 +1,20 @@ + +# 设置源文件和目标文件夹路径 +source_vimrc="$(dirname "$(realpath "$0")")/vimrc" +source_colors="$(dirname "$(realpath "$0")")/colors" +target_vimfiles="$HOME/.vim" +target_colors="$HOME/.vim/colors" + +# 创建目标文件夹(如果不存在) +mkdir -p "$target_vimfiles" + +# 复制 vimrc 文件到目标文件夹 +cp -f "$source_vimrc" "$target_vimfiles" + +# 复制 colors 文件夹到目标文件夹 +if [ -d "$source_colors" ]; then + cp -rf "$source_colors" "$target_colors" +fi + +echo "操作完成" + diff --git a/vim/vimrc b/vim/vimrc index 5c554d5..5ab260e 100755 --- a/vim/vimrc +++ b/vim/vimrc @@ -5,6 +5,7 @@ filetype on set vb t_vb= colorscheme gruvbox " set background=light +set background=dark set incsearch set backspace=2 set shiftwidth=4 @@ -40,6 +41,7 @@ endif :nnoremap 4k :nnoremap 9k :nnoremap 9j +:nnoremap q :q :vnoremap < >gv @@ -74,4 +76,4 @@ endif " %= “对齐方向改变的分界点 " %- ”对齐方向改变为右对齐 -set statusline=[%Y]\%{\"[\".(&fenc==\"\"?&enc:&fenc).((exists(\"+bomb\")\ &&\ &bomb)?\"+\":\"\").\"]\"}\[%{&ff}]\[%03.3b]\[%02.2B]\[%04l,%04v][%p%%]\[%L]\ %=%{strftime(\"%d/%m/%y\ -\ %H:%M\")}\%=%F%m%r%h%w +set statusline=[%Y]\%{\"[\".(&fenc==\"\"?&enc:&fenc).((exists(\"+bomb\")\ &&\ &bomb)?\"+\":\"\").\"]\"}\[%{&ff}]\[%03.3b]\[%02.2B]\[%04l,%04v][%p%%]\[%L]\ %=【%{strftime(\"%d/%m/%y\ -\ %H:%M\")}\】%=%F%m%r%h%w