python环境
https://virtualenvwrapper.readthedocs.io/en/latest/install.html
java环境
## 安装jdk
https://docs.oracle.com/en/java/javase/11/install/installation-jdk-linux-platforms.html#GUID-ADC9C14A-5F51-4C32-802C-9639A947317F
go环境
## 安装go
https://go.dev/doc/install
按照zsh
https://github.com/ohmyzsh/ohmyzsh
https://github.com/zsh-users/zsh-autosuggestions/blob/master/INSTALL.md
配置vim
" set default encoding
set fenc=utf-8
set fencs=utf-8,usc-bom,euc-jp,gb18030,gbk,gb2312,cp936
" set color
colorscheme desert
" set gui font
set guifont=Bitstream\ Vera\ Sans\ Mono\ 10
" use vim to key in
set nocompatible
" set the rows of history
set history=100
" pop window to confirm if the change
set confirm
" set clipboard shared with window sys
set clipboard+=unnamed
" listen filetype
filetype on
" loading file plugin
filetype plugin on
" set indent for special file
filetype indent on
" save global var
set viminfo+=!
" not be spilt row when having keyword as follow
set iskeyword+=_,$,@,%,
" set programmer highlight
syntax on
" show highlight for keywords
syntax keyword gtkType gint gshort guint gushort gulong gdouble gfloat gchar guchar gboolean gpointer
highlight link gtkType Type
" highlight for char which over 100limited
highlight OverLength ctermbg=red ctermfg=white guibg=red guifg=white
match OverLength '\%101v.*'
" the color of the status line
highlight StatusLine guifg=SlateBlue guibg=Yellow
highlight StatusLineNC guifg=Gray guibg=White
" file settings
" set backup file
set nobackup
" not create swap file
setlocal noswapfile
set bufhidden=hide
set linespace=0
" auto completed opr in enhanced command
set wildmenu
" show the row and col at the position which mouse focused on
set ruler
set rulerformat=%20(%2*%<%f%=\ %m%r\ %3l\ %c\ %p%%%)
" the row high in cmd
set cmdheight=2
" use backspace keyboard to deal with those which ard indent, eol, start,etc.
set backspace=2
" allow backspace cross wide
set whichwrap+=<,>,h,l
" could use mouse at buffer in any where
set mouse=a
set selection=exclusive
set selectmode=mouse,key
" not show help whern started
set shortmess=atI
" tell us which row has been modified
set report=0
" set not bell sound by using vim keyboard
set noerrorbells
" show blank when splited window
set fillchars=vert:\ ,stl:\ ,stlnc:\
" show highlight for the matched word
set showmatch
" the time of the highlight which have been matched
set matchtime=5
" ignore case
set ignorecase
" not show the row which the search keyword in
set nohlsearch
" highlight for search keyword when finding keyword
set incsearch
" input :set list cmd to be seen what should be shown
set listchars=tab:\|\ ,trail:.,extends:>,precedes:<,eol:$
" keep 3 row between the buffer of the top and the bottom
set scrolloff=3
" not bell
set novisualbell
" the content of the status lines
set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [POS=%l,%v][%p%%]\ %{strftime(\"%d/%m/%y\ -\ %H:%M\")}
" show status line
set laststatus=2
" auto format
set formatoptions=tcrqn
" extend prev row indent,special for multi row comments
set autoindent
" if c program then auto indent
set smartindent
" use c indent
set cindent
" tab for 4 chars
set tabstop=4
" indent for 4 blank
set softtabstop=4
set shiftwidth=4
" not use tab to replace blank
set noexpandtab
" not change row
set nowrap
" sorted by name
let Tlist_Sort_Type = "name"
let Tlist_Use_Right_Window = 1
let Tlist_Compart_Format = 1
let Tlist_Exist_OnlyWindow = 1
let Tlist_File_Fold_Auto_Close = 0
let Tlist_Enable_Fold_Column = 0
" Autocommands
if has("autocmd")
autocmd FileType xml,html,c,cs,java,perl,shell,bash,cpp,python,vim,php,ruby set number
autocmd FileType xml,html vmap 'o'>o-->
autocmd FileType java,c,cpp,cs vmap ''>o*/
autocmd FileType html,text,php,vim,c,java,xml,bash,shell,perl,python setlocal textwidth=100
autocmd Filetype html,xml,xsl source $VIMRUNTIME/plugin/closetag.vim
\ if line("'\"") > 0 && line("'\"") <= line("{1}quot;) |
\ exe "normal g`\"" |
\ endif
endif " has("autocmd")
" use F5 to compile and run c program
" use F6 to compile and run c++ program
" if use in window then should be remove './'
" used for c
map :call CompileRunGcc()
func! CompileRunGcc()
exec "w"
exec "!gcc % -o %<"
exec "! ./%<"
endfunc
" used for c++
map :call CompileRunGpp()
func! CompileRunGpp()
exec "w"
exec "!g++ % -o %<"
exec "! ./%<"
endfunc
" show more clearly in .NFO file
set encoding=utf-8
function! SetFileEncodings(encodings)
let b:myfileencodingsbak=&fileencodings
let &fileencodings=a:encodings
endfunction
function! RestoreFileEncodings()
let &fileencodings=b:myfileencodingsbak
unlet b:myfileencodingsbak
endfunction
au BufReadPre *.nfo call SetFileEncodings('cp437')|set ambiwidth=single
au BufReadPost *.nfo call RestoreFileEncodings()
" show highlight for txt or vim file
au BufRead,BufNewFile * setfiletype txt
" use black keyboard to expand
set foldenable
"set foldmethod=manual
set foldmethod=syntax
set foldlevel=100
nnoremap @=((foldclosed(line('.')) < 0) ? 'zc' : 'zo')
" set minibufexpl plugin
" let g:miniBufExplMapWindowNavVim = 1
" let g:miniBufExplMapWindowNavArrows = 1
" let g:miniBufExplMapCTabSwitchBufs = 1
" let g:miniBufExplModSelTarget = 1
" set mapleader
let mapleader = ","
" use 'ss' to load .vimrc
map ss :source ~/.vimrc
" use 'ee' to open .vimrc file quickly
map ee :e ~/.vimrc
" use 'w' save file
map w :w
" use 'wq' to save and quit file quickly
map <silent> <leader>wq :wq<cr>
" auto source .vimrc and make it effect
autocmd! bufwritepost .vimrc source ~/.vimrc
自定义zsh配置
if [ -x /usr/bin/dircolors ]; then
eval "`dircolors -b`"
alias ls='ls --color=auto'
alias dir='dir --color=auto'
alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
export LESS=eFRX
export GREP_OPTIONS='--exclude-dir=.svn --exclude-dir=.git --color=auto -nrI'
export GOPATH=$HOME/go
export GO111MODULE=on
if [ -f /usr/local/bin/virtualenvwrapper.sh ]; then
export WORKON_HOME=/Users/keithl/.virtualenv
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
export VIRTUALENVWRAPPER_VIRTUALENV=/usr/local/bin/virtualenv
export VIRTUALENV_DISTRIBUTE=true
source /usr/local/bin/virtualenvwrapper.sh
fi
source ~/.bash_profile
export ZSH="/Users/keithl/.oh-my-zsh"
ZSH_THEME="robbyrussell"
plugins=(git colorize github jira vagrant virtualenv pip python brew macos zsh-syntax-highlighting zsh-autosuggestions zsh-completions)
source $ZSH/oh-my-zsh.sh
alias cls="clear"
alias tailf="tail -f"
alias ll="ls -al"
alias greadlink="readlink"
export LC_ALL="zh_CN.UTF-8"
PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p%{$fg[cyan]%}%d %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%}% %{$reset_color%}>'
export PATH="/usr/local/opt/qt/bin:$PATH"
alias ssh2work01="ssh ubuntu@work01"
alias ssh2work02="ssh ubuntu@work02"
alias ssh2master="ssh root@master"
alias gitlog="git log --graph --pretty=oneline --abbrev-commit"