Skip to content

Instantly share code, notes, and snippets.

@tamlok tamlok/Session.vim
Created Nov 7, 2015

What would you like to do?
let SessionLoad = 1
if &cp | set nocp | endif
let s:cpo_save=&cpo
set cpo&vim
map! <S-Insert> *
nnoremap  h
nnoremap <NL> j
nnoremap  k
nnoremap  l
nmap  :cclose
vmap  "*d
map  \
nnoremap <silent> [l :lprevious
nnoremap <silent> [t :tprevious
nnoremap <silent> [q :cprevious
nnoremap <silent> [b :bprevious
vmap [% [%m'gv``
nnoremap \v V`]
nnoremap \ :nohlsearch
nmap \P "+P
nmap \p "+p
nmap \y "+y
vmap \y "+y
nnoremap \q :q
nnoremap \w :w
nmap \r :cs find c =expand("<cword>")

nmap \d :cs find g =expand("<cword>")

nnoremap <silent> ]l :lnext
nnoremap <silent> ]t :tnext
nnoremap <silent> ]q :cnext
nnoremap <silent> ]b :bnext
vmap ]% ]%m'gv``
vmap a% [%v]%
nmap gx <Plug>NetrwBrowseX
nnoremap <silent> <Plug>NetrwBrowseX :call netrw#NetrwBrowseX(expand("<cWORD>"),0)
nmap <F8> :set paste!
nmap <F7> :call DiffWithFileFromDisk()
map <silent> <C-F2> :if &guioptions =~# 'T' |set guioptions-=T |set guioptions-=m |else |set guioptions+=T |set guioptions+=m |endif
vmap <C-Del> "*d
vmap <S-Del> "*d
vmap <C-Insert> "*y
vmap <S-Insert> "-d"*P
nmap <S-Insert> "*P
inoremap {
cabbr noclo call RecoverCR()
cabbr luw LUWalk
cabbr lub LUBufs
cabbr luf LookupFile
cabbr csf cs find
cabbr gtr Gtags -r
cabbr gta Gtags
cabbr fms set foldmethod=syntax
cabbr noextab set tabstop=8 | set softtabstop=8 | set shiftwidth=8 | set noexpandtab
cabbr extab set tabstop=4 | set softtabstop=4 | set shiftwidth=4 | set expandtab
let &cpo=s:cpo_save
unlet s:cpo_save
set autochdir
set autoindent
set background=dark
set backspace=indent,eol,start
set cindent
set confirm
set encoding=utf-8
set fileencodings=UCS-BOM,UTF-8,Chinese
set foldlevelstart=10
set guicursor=a:blinkon0
set guifont=Consolas:h11
set guioptions=egt
set guitablabel=%{ShortTabLabel()}
set helplang=cn
set hidden
set history=200
set hlsearch
set imcmdline
set incsearch
set langmenu=zh_CN.UTF-8
set laststatus=2
set mouse=nvc
set path=.,,,D:\\/**
set report=0
set ruler
set scrolloff=3
set secure
set showmatch
set smartindent
set softtabstop=8
set statusline=%<[%n]\ %F\ %{\"[\".(&fenc==\"\"?&enc:&fenc).((exists(\"+bomb\")\ &&\ &bomb)?\",B\":\"\").\"]\ \"}\ %#StatuslineWarning#%{&ff!='unix'?'['.&ff.']':''}%*%h%#Modifier#%m%*%r\ \ %-14.(%l/%L,%c%V%)\ %P
set tags=./tags;/
set termencoding=utf-8
set title
set visualbell
set wildmenu
set wildmode=list:longest,full
set window=45
let s:so_save = &so | let s:siso_save = &siso | set so=0 siso=0
let v:this_session=expand("<sfile>:p")
silent only
cd D:\
if expand('%') == '' && !&modified && line('$') <= 1 && getline(1) == ''
let s:wipebuf = bufnr('%')
set shortmess=aoO
badd +0 D:\
edit D:\
set splitbelow splitright
set nosplitbelow
set nosplitright
wincmd t
set winheight=1 winwidth=1
setlocal keymap=
setlocal noarabic
setlocal autoindent
setlocal balloonexpr=
setlocal nobinary
setlocal bufhidden=
setlocal buflisted
setlocal buftype=
setlocal cindent
setlocal cinkeys=0{,0},0),:,0#,!^F,o,O,e
setlocal cinoptions=
setlocal cinwords=if,else,while,do,for,switch
set colorcolumn=81
setlocal colorcolumn=81
setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
setlocal commentstring=/*%s*/
setlocal complete=.,w,b,u,t,i
setlocal concealcursor=
setlocal conceallevel=0
setlocal completefunc=
setlocal nocopyindent
setlocal cryptmethod=
setlocal nocursorbind
setlocal nocursorcolumn
set cursorline
setlocal cursorline
setlocal define=
setlocal dictionary=
setlocal nodiff
setlocal equalprg=
setlocal errorformat=
setlocal noexpandtab
if &filetype != 'cpp'
setlocal filetype=cpp
set foldcolumn=2
setlocal foldcolumn=2
setlocal foldenable
setlocal foldexpr=0
setlocal foldignore=#
setlocal foldlevel=10
setlocal foldmarker={{{,}}}
set foldmethod=indent
setlocal foldmethod=indent
setlocal foldminlines=1
set foldnestmax=10
setlocal foldnestmax=10
setlocal foldtext=foldtext()
setlocal formatexpr=
setlocal formatoptions=cql
setlocal formatlistpat=^\\s*\\d\\+[\\]:.)}\\t\ ]\\s*
setlocal grepprg=
setlocal iminsert=2
setlocal imsearch=2
setlocal include=
setlocal includeexpr=
setlocal indentexpr=
setlocal indentkeys=0{,0},:,0#,!^F,o,O,e
setlocal noinfercase
setlocal iskeyword=@,48-57,_,128-167,224-235
setlocal keywordprg=
setlocal nolinebreak
setlocal nolisp
setlocal nolist
setlocal makeprg=
setlocal matchpairs=(:),{:},[:]
setlocal modeline
setlocal modifiable
setlocal nrformats=octal,hex
set number
setlocal number
setlocal numberwidth=4
setlocal omnifunc=ccomplete#Complete
setlocal path=
setlocal nopreserveindent
setlocal nopreviewwindow
setlocal quoteescape=\\
setlocal noreadonly
set relativenumber
setlocal relativenumber
setlocal norightleft
setlocal rightleftcmd=search
setlocal noscrollbind
setlocal shiftwidth=8
setlocal noshortname
setlocal smartindent
setlocal softtabstop=8
setlocal nospell
setlocal spellcapcheck=[.?!]\\_[\\])'\"\ \ ]\\+
setlocal spellfile=
setlocal spelllang=en
setlocal statusline=
setlocal suffixesadd=
setlocal swapfile
setlocal synmaxcol=3000
if &syntax != 'cpp'
setlocal syntax=cpp
setlocal tabstop=8
setlocal tags=
setlocal textwidth=0
setlocal thesaurus=
setlocal noundofile
setlocal nowinfixheight
setlocal nowinfixwidth
setlocal wrap
setlocal wrapmargin=0
let s:l = 1 - ((0 * winheight(0) + 22) / 44)
if s:l < 1 | let s:l = 1 | endif
exe s:l
normal! zt
normal! 0
tabnext 1
if exists('s:wipebuf')
silent exe 'bwipe ' . s:wipebuf
unlet! s:wipebuf
set winheight=1 winwidth=20 shortmess=filnxtToO
let s:sx = expand("<sfile>:p:r")."x.vim"
if file_readable(s:sx)
exe "source " . fnameescape(s:sx)
let &so = s:so_save | let &siso = s:siso_save
doautoall SessionLoadPost
unlet SessionLoad
" vim: set ft=vim :
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.