From 36b58f11398dadff5cf2b6efb14460e6f9c30ecc Mon Sep 17 00:00:00 2001 From: shaoying Date: Tue, 18 Sep 2018 14:17:08 +0800 Subject: [PATCH] tce add .vimrc --- etc/dotsfile/.vimrc | 103 ++++++++++++++++++++++++++++++++++ src/contexts/web/web.go | 6 ++ usr/library/wiki.js | 34 +++++------ usr/template/common/wiki.html | 13 ++++- 4 files changed, 137 insertions(+), 19 deletions(-) create mode 100644 etc/dotsfile/.vimrc diff --git a/etc/dotsfile/.vimrc b/etc/dotsfile/.vimrc new file mode 100644 index 00000000..db6da2eb --- /dev/null +++ b/etc/dotsfile/.vimrc @@ -0,0 +1,103 @@ +"加载插件"{{{ +call plug#begin() +Plug 'vim-scripts/tComment' +Plug 'airblade/vim-gitgutter' +Plug 'vim-airline/vim-airline' +Plug 'vim-airline/vim-airline-themes' +Plug 'ntpeters/vim-better-whitespace' + +Plug 'vim-scripts/taglist.vim' +let g:Tlist_Enable_Fold_Column=0 +nnoremap :TlistToggle + +Plug 'scrooloose/nerdtree' +let g:NERDTreeWinPos="right" +nnoremap :NERDTreeToggle + +Plug 'kien/ctrlp.vim' +let g:ctrlp_cmd='CtrlPBuffer' + +Plug 'rking/ag.vim' +nnoremap :Ag =expand("") + +Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } +nnoremap :FZF -q =expand("") + +Plug 'fatih/vim-go' +Plug 'chr4/nginx.vim' +Plug 'othree/html5.vim' +Plug 'godlygeek/tabular' +Plug 'plasticboy/vim-markdown' +Plug 'vim-scripts/python.vim' + +Plug 'vim-syntastic/syntastic' +Plug 'Valloric/YouCompleteMe' +let g:ycm_confirm_extra_conf=0 +nnoremap gd :YcmCompleter GoToDeclaration + +Plug 'benmills/vimux' +let mapleader=";" +nnoremap vp :VimuxPromptCommand +nnoremap vl :VimuxRunLastCommand +nnoremap vx :VimuxInterruptRunner +nnoremap vz :VimuxZoomRunner + +Plug 'vim-scripts/matrix.vim--Yang' +call plug#end() +"}}} +" 基本配置"{{{ +set number +set relativenumber +set cursorline +set cursorcolumn +set ruler +set showcmd +set showmode +set cc=80 +set nowrap +set scrolloff=3 + +set tabstop=4 +set shiftwidth=4 +set cindent +set expandtab + +set showmatch +set matchtime=2 +set foldenable +set foldmethod=marker + +set hlsearch +set incsearch +set nowrapscan +set smartcase + +set hidden +set autowrite +set encoding=utf-8 +set mouse=a + +colorscheme elflord +set t_Co=256 +"}}} +"映射快捷键"{{{ +nnoremap h +nnoremap j +nnoremap k +nnoremap l +nnoremap : + +nnoremap j gj +nnoremap k gk + +nnoremap df :FZF +inoremap jk +cnoremap jk +"}}} +" 编程配置{{{ +set keywordprg=man\ -a + +autocmd BufNewFile,BufReadPost *.shy set filetype=shy +autocmd BufNewFile,BufReadPost *.shy set commentstring=#%s +autocmd BufNewFile,BufReadPost *.conf set filetype=nginx +"}}} diff --git a/src/contexts/web/web.go b/src/contexts/web/web.go index 34db865d..691aaced 100644 --- a/src/contexts/web/web.go +++ b/src/contexts/web/web.go @@ -457,6 +457,12 @@ var Index = &ctx.Context{Name: "web", Help: "应用中心", "template": "detail", "title": "json", "option": map[string]interface{}{"ninput": 1}, }, + map[string]interface{}{ + "from": "root", "to": []interface{}{}, + "module": "cli", "detail": []interface{}{"system", "tmux", "show-buffer"}, + "template": "detail", "title": "buffer", + "option": map[string]interface{}{"ninput": 1}, + }, map[string]interface{}{ "from": "root", "to": []interface{}{}, "module": "cli", "command": "system", diff --git a/usr/library/wiki.js b/usr/library/wiki.js index f34335e6..601a9e8d 100644 --- a/usr/library/wiki.js +++ b/usr/library/wiki.js @@ -26,22 +26,24 @@ function keyup(event) { } document.onkeyup = keyup; -function toggle() { - window.list_hide = !window.list_hide; - var list = document.getElementsByClassName("list")[0]; - var content = document.getElementsByClassName("content")[0]; - if (list_hide) { - list.style.visibility = "hidden"; - list.style.width="0px"; - list.style.height="0px"; - list.style["min-width"]="0px"; - content.style.width="100%"; - } else { - list.style.visibility = "visible"; - list.style.width="15%"; - list.style.height="100%"; - list.style["min-width"]="180px"; - content.style.width="85%"; +function toggle(side) { + if (side == "left") { + window.left_list_hide = !window.left_list_hide; + var list = document.getElementsByClassName("list")[0]; + var content = document.getElementsByClassName("content")[0]; + if (left_list_hide) { + list.style.visibility = "hidden"; + list.style.width="0px"; + list.style.height="0px"; + list.style["min-width"]="0px"; + content.style.width="100%"; + } else { + list.style.visibility = "visible"; + list.style.width="15%"; + list.style.height="100%"; + list.style["min-width"]="180px"; + content.style.width="85%"; + } } } diff --git a/usr/template/common/wiki.html b/usr/template/common/wiki.html index b5ba995e..d4ce8b82 100644 --- a/usr/template/common/wiki.html +++ b/usr/template/common/wiki.html @@ -107,9 +107,15 @@ p { height:100%; float:left; } +.toggle1 { + background-color:green; + width:2%; + height:100%; + float:right; +} .texts { - width:96%; - max-width:800px; + max-width:800px; + width:94%; float:left; margin-left:2%; } @@ -167,7 +173,8 @@ p { }
-
+
+
{{if option . "modify_time"|meta}}
上次修订时间: {{option . "modify_time"|meta}} 修订次数: {{option . "modify_count"|meta}}
{{end}}