" =============================================================================
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
let g:isgui = 0
" < 个人偏好快捷键设置 >
"修改映射<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