首页 打造适合自己的System
文章
取消

打造适合自己的System

下面是自己的一些步骤仅供参考:
打造适合自己的系统
1 增加快捷键
1.1 增加Ctrl+R快捷命令行命令
1.1 建立sort目录,将常用操作快捷方式加入到其中(记得将名字改成简单易记的英文
名字),并将sort目录添加到系统环境path中。

2 软件设置

  • 2.1 下载将firefox。* 2.2 firefox AddonList
    • 2.2.1 Ietab
    • 2.2.2 vimperator * 2.2.3 firebug 2.2.4 google toolbar(只用书签功能)
  • 2.2.5 Adblock Plus
    • 2.2.6 Autofile Forms
    • 2.2.7 User Agent Switcher 2.2.8 Web Developer

2.2 下载VIM,下载自己的VIM配置文件

  
“  author: feelinglucky[[email protected]](mailto:[email protected])  
“  modify:  Simon<[email protected]
“ website: [http://csbde.cn](http://csbde.cn) “ date: 2008-10-07</[email protected]

“ 在处理未保存或只读文件的时候,弹出确认
set confirm
set linebreak
set textwidth=80
set nocompatible
set backspace=2
set history=400
set ruler
set number
set hlsearch
“逐字符高亮搜索词语
set incsearch
set expandtab
set noerrorbells
set novisualbell
“高亮的时间
set matchtime=5
“close visual bell
set t_vb=
set foldmethod=marker
set tabstop=4
set shiftwidth=4
set nobackup
set nowritebackup
“set noswapfile
set smarttab
set smartindent
set autoindent
set cindent
set wrap
set autoread
set cmdheight=1
set showtabline=2
“和其他程序共用剪贴(Windows)
set clipboard+=unnamed
set tabpagemax=20
set laststatus=2
“状态栏
“set statusline=%F%m%r%h [%{&ff}] [%Y] %w %=[POS] %l,%c %=%P
set statusline= %F%m%r%h %w [PWD] %r%{CurrectDir()}%h %=[%{(&fenc==””)?&enc:&fenc}] [POS] %l,%c %= %P
“set statusline=%F%m%r%h%w [FORMAT=%{&ff}] [TYPE=%Y] [POS=%l,%v][%p%%] %{strftime(“%d/%m/%y - %H:%M”)}[PWD] %r%{CurrectDir()}%h
function! CurrectDir()
return substitute(getcwd(), “”, “”, “g”)
endfunction
let g:calendar_diary=$VIM

“ 配置多语言环境
if has(“multi_byte”)
set encoding=utf-8
set termencoding=utf-8
set formatoptions+=mM
set fencs=utf-8,gbk

1
2
3
4
5
6
7
8
9
10
11
if v:lang =~? '^(zh)|(ja)|(ko)'
    set ambiwidth=double
endif

if has("win32")
    source $VIMRUNTIME/delmenu.vim
    source $VIMRUNTIME/menu.vim
    source $VIMRUNTIME/mswin.vim
    behave mswin
    language messages zh_CN.utf-8
endif

else
echoerr “Sorry, this version of (g)vim was not compiled with +multi_byte”
endif

if has(‘gui_running’)
if has(“win32”)
source $VIMRUNTIME/mswin.vim
endif

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
" Always show file types in menu
let do_syntax_sel_menu=1

unmap  |  "  for Redo is kept in insert mode
iunmap |  "  for Select-All is kept in normal mode
" Key mapping to switch windows quickly ( is already mapped)
nnoremap  W
inoremap  W

" 针对 Windows 的配置
if has("win32")
    set guifont=新宋体:h10:cGB2312
   " set guifontwide=YaHei Consolas Hybrid:h10
    "au GUIEnter * simalt ~x " 最大化窗口
     set lines=30
    set columns=85
elseif has("unix")
    set guifont=
    set guifontwide=
elseif has("mac") || has("macunix")
    set guifont=
    set guifontwide=
endif

colorscheme desert
set guioptions=
set guioptions+=r
set cursorline

else
“ English messages only
“language messages en

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
" set the default theme in no-GUI
colorscheme default

" Do not increase the windows width in taglist
let Tlist_Inc_Winwidth=0

" Set text-mode menu
if has('wildmenu')
    set wildmenu
    set cpoptions-=<
    set wildcharm=
    nmap       :emenu 
    imap  :emenu 
endif

" Change encoding according to the current console code page
if &termencoding != '' && &termencoding != &encoding
    let &encoding=&termencoding
    let &fileencodings='ucs-bom,utf-8,' . &encoding
endif

endif
if has(“autocmd”)
filetype plugin indent on
“ autocmd FileType xml,html,c,cs,java,perl,shell,bash,cpp,python,vim,php,ruby set number

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
augroup vimrcEx
    au!
    autocmd FileType text setlocal textwidth=80
    autocmd BufReadPost *
                 if line("'"") > 0 && line("'"") <= line("$") |
                   exe "normal g`"" |
                 endif
augroup END
function! AutoClose()
    :inoremap ( ()i
    :inoremap " ""i
    :inoremap ' ''i
    :inoremap { {}i
    :inoremap [ []i
    :inoremap ) =ClosePair(')')
    :inoremap } =ClosePair('}')
    :inoremap ] =ClosePair(']')
endf

function! ClosePair(char)
    if getline('.')[col('.') - 1] == a:char
        return ""
    else
        return a:char
    endif
endf

"auto close for PHP and Javascript script
au FileType php,c,cpp,h,python,javascript exe AutoClose()

endif
“Other Setting
“语法高亮
syntax on
“ key stock

“绑定自动补全的快捷键; imap ;

“ca日记h
map ca :Calendar “设定开关Taglist插件的快捷键为F4,可以在VIM的左侧栏列出函数列表等 map :Tlist

“设置程序的编译运行和调试的快捷键F5,F6,Ctrl-F5
map :call CompileRun() map :call Debug() map :call Run()

“设置代码格式化快捷键F3
map :s/^//// map :s/^//// “设置tab操作的快捷键,绑定:tabnew到t,绑定:tabn, :tabp到n, “p map t :tabnew map n :tabn map p :tabp

“使用e打开当前文件同目录中的文件 if has(“unix”) map ,e :e =expand(“%:p:h”) . “/“ else map ,e :e =expand(“%:p:h”) . “” endif

“定义CompileRun函数,用来调用进行编译和运行
func CompileRun()
exec “w”
“C程序
if &filetype == ‘c’
if has(“win32”)
exec “!del %<.exe”
else
exec “!rm %<.exe”
endif
exec “!gcc % -o %<.exe”
if has(“win32”)
exec “!%<.exe”
else
exec “!./%<.exe”
endif
else
if &filetype == ‘cpp’
if has(“win32”)
exec “!del %<.exe”
else
exec “!rm %<.exe”
endif
exec “!g++ % -o %<.exe”
if has(“win32”)
exec “!%<.exe”
else
exec “!./%<.exe”
endif
endif
endif
endfunc
“结束定义CompileRun

“定义Run函数,用来调用进行编译和运行
func Run()
exec “w”
“C程序

if has(“win32”)
exec “!%<.exe”
else
exec “!./%<.exe”
endif
endfunc
“结束定义Run

“定义Debug函数,用来调试程序
func Debug()
exec “w”
if has(“win32”)
exec “!del %<.exe”
else
exec “!rm %<.exe”
endif
exec “!g++ % -g -o %<.exe”
exec “!gdb %<.exe”
endfunc
“结束定义Debug

2.3 下载TC,以及TC设置文件

本文由作者按照 CC BY-NC-SA 4.0 进行授权
热门标签

Trayconizer 将你的程序最小化到托盘区

linux系统locale的设定

Comments powered by Disqus.

热门标签