" =============================================================================
let Tlist_Exit_OnlyWindow=1 "如果Taglist窗口是最後一個窗口則退出Vim
" << 判斷操作系統是 Windows 還是 Linux 和判斷是終端還是 Gvim >>
" =============================================================================
" -----------------------------------------------------------------------------
" < 判斷操作系統是否是 Windows 還是 Linux >
" -----------------------------------------------------------------------------
let g:iswindows = 0
let g:islinux = 0
if(has("win32") || has("win64") || has("win95") || has("win16"))
let g:iswindows = 1
else
let g:islinux = 1
endif
" -----------------------------------------------------------------------------
" < 判斷是終端還是 Gvim >
" -----------------------------------------------------------------------------
if has("gui_running")
let g:isGUI = 1
else
let g:isGUI = 0
endif
" -----------------------------------------------------------------------------
" < 個人偏好快捷鍵設置 >
" -----------------------------------------------------------------------------
"修改映射<ESC>鍵爲jk退出INSERT模式
inoremap jk <ESC>
"以新的頁籤打開當前光標處的文件,而非原本的覆蓋打開
nmap gf :tab vsp <cfile><CR>
"將一行文本從光標處進行換行
"nmap K a<CR><ESC>
"快捷新建shell解釋器頭
nmap bi ggdG<ESC>0i#!/bin/bash<ESC>
"全局代碼對齊,四個空格爲縮進單位
nmap fm <ESC>mzgg<S-v><S-g>=<ESC>'z
"快捷新建c語言常用頭文件
nmap ci ggdG<ESC>0i#include <stdio.h><CR>#include <string.h><CR>#include <stdlib.h><CR>#include <unistd.h> <CR>#include <signal.h><CR>#include <time.h><CR>#include <sys/types.h><CR>#include <sys/stat.h><CR>#include <fcntl.h><CR>#include <signal.h><CR>#include <sys/wait.h><CR>#include <sys/ipc.h><CR>#include <sys/socket.h><CR>#include <netinet/in.h><CR>#include <arpa/inet.h><CR><CR><CR><CR><CR>int main(void)<CR>{<CR><CR><CR><CR><CR><Space>return 0;}<CR><ESC>22gg
" -----------------------------------------------------------------------------