vim

tablenew

tablenew [++ opt 选项][++ cmd]文件 tabc 关闭当前的tab tabo 关闭所有的其他的tab tabs 查看所有打开的tab tabp 前一个 tabn 后一个 标准模式下:gt,gT可以直接在tab之间切换

ctrl+z 进入后台

fg 打开后台执行的命令

screen -S 新建一个screen

screen -r 重新打开

screen -list

ctrl+a ctrl+c 新建一个screen tab

ctrl+a shift+a 更改screen tab的名字

ctrl+a ctrl+n 跳转到下一个screen 会话

ctrl+a ctrl+p 返回到上一个screen 会话

exit 退出一个screen会话

同一个文件比较 sp vs

vim配置


" Syntax Highlighting on, depends on syntax/(type).vim
syntax on

" Mouse avaiable
set mouse=a

" Show line number
set nu

set nocompatible
set ruler
set smarttab
set tabstop=4
set shiftwidth=4
set expandtab
set nobackup
set noswapfile
set autochdir
set backupcopy=yes
"set nowrapscan
set incsearch
set hlsearch
set noerrorbells
set novisualbell
"set showmatch
"set matchtime=2
set magic
set hidden
set guioptions-=T
set guioptions-=m
set smartindent
set backspace=indent,eol,start

set cmdheight=1
set laststatus=2
set statusline=\ %<%F[%1*%M%*%n%R%H]%=\ %y\ %0(%{&fileformat}\ %{&encoding}\ %c:%l/%L%)\
set tags=tags;/
set foldenable
"set foldmethod=syntax
set foldcolumn=0
setlocal foldlevel=1
"set foldclose=all
"nnoremap <space> @=((foldclosed(line('.')) < 0) ? 'zc' : 'zo')<CR>

filetype plugin indent off

"return OS type, eg: windows, or linux, mac, et.st..
function! MySys()
    if has("win16") || has("win32") || has("win64") || has("win95")
        return "windows"
    elseif has("unix")
        return "linux"
    endif
endfunction

if MySys() == "windows"
    let $VIMFILES = $VIM.'/vimfiles'
elseif MySys() == "linux"
    let $VIMFILES = $HOME.'/.vim'
endif

let helptags=$VIMFILES.'/doc'

" GUI
set guifont=Monospace\ 12

if has("win32")
   set guifont=Inconsolata:h12:cANSI
endif

if has("multi_byte")
    set encoding=utf-8
    set termencoding=utf-8
    set formatoptions+=mM
    set fencs=utf-8,gbk

    if v:lang =~? '^\(zh\)\|\(ja\)\|\(ko\)'
        set ambiwidth=double
    endif

    if has("win32")
        source $VIMRUNTIME/delmenu.vim
        source $VIMRUNTIME/menu.vim
        language messages zh_CN.utf-8
    endif
else
    echoerr "Sorry, this version of (g)vim was not compiled with +multi_byte"
endif

" Buffers
" nnoremap <C-RETURN> :bnext<CR>
" nnoremap <C-S-RETURN> :bprevious<CR>

" Tab
nnoremap <C-TAB> :tabnext<CR>
nnoremap <C-S-TAB> :tabprev<CR>

map tn :tabnext<cr>
map tp :tabprevious<cr>
map td :tabnew .<cr>
map te :tabedit
map tc :tabclose<cr>

nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l

" Python
autocmd FileType python set tabstop=4 shiftwidth=4 expandtab
autocmd FileType python map <F12> :!python %<CR>

" Ctrl+c
vmap <C-c> "+y

"-----------------------------------------------------------------
" plugin - taglist.vim  ??????,??ctags??
" F4 ????taglist??
"-----------------------------------------------------------------
if MySys() == "windows"
    let Tlist_Ctags_Cmd = '"'.$VIMRUNTIME.'/ctags.exe"'
elseif MySys() == "linux"
    let Tlist_Ctags_Cmd = '/usr/bin/ctags'
endif

nnoremap <silent><F4> :TlistToggle<CR>
let Tlist_Show_One_File = 1
let Tlist_Exit_OnlyWindow = 1
let Tlist_Use_Right_Window = 1
let Tlist_File_Fold_Auto_Close=1
let Tlist_Auto_Open = 0
let Tlist_Auto_Update = 1
let Tlist_Hightlight_Tag_On_BufEnter = 1
let Tlist_Enable_Fold_Column = 0
let Tlist_Process_File_Always = 1
let Tlist_Display_Prototype = 0
let Tlist_Compact_Format = 1

" F3 NERDTree
map <F3> :NERDTreeToggle<CR>
imap <F3> <ESC>:NERDTreeToggle<CR>

map <F12> :nohlsearch<CR>
imap <F12> <ESC>:nohlsearch<CR>

map <F11> #

nnoremap <C-q> :q<CR>
nnoremap <C-s> :w<CR>
nnoremap <F7> <C-t>
nnoremap <F8> <C-o>

let NERDSpaceDelims=1
let NERDCompactSexyComs=1

"-----------------------------------------------------------------
" plugin - NeoComplCache.vim    ??????
"-----------------------------------------------------------------
let g:AutoComplPop_NotEnableAtStartup = 1
let g:NeoComplCache_EnableAtStartup = 1
let g:NeoComplCache_SmartCase = 1
let g:NeoComplCache_TagsAutoUpdate = 1
let g:NeoComplCache_EnableInfo = 1
let g:NeoComplCache_EnableCamelCaseCompletion = 1
let g:NeoComplCache_MinSyntaxLength = 3
let g:NeoComplCache_EnableSkipCompletion = 1
let g:NeoComplCache_SkipInputTime = '0.5'
let g:NeoComplCache_SnippetsDir = $VIMFILES.'/snippets'
" <TAB> completion
inoremap <expr><TAB> pumvisible() ? "\<TAB>" : "\<C-n>"
" snippets expand key
imap <silent> <C-e> <Plug>(neocomplcache_snippets_expand)
smap <silent> <C-e> <Plug>(neocomplcache_snippets_expand)

" Source a global configuration file if available
if filereadable("/etc/vim/vimrc.local")
  source /etc/vim/vimrc.local
endif

let g:winManagerWindowLayout='FileExplorer|TagList'
nmap wm :WMToggle<cr>

nnoremap <F2> :cs f f
set completeopt=longest,menu


nnoremap <silent> <F5> :Rgrep<CR>
set completeopt=longest,menu

nnoremap <silent> <F6> :split<CR>
set completeopt=longest,menu

nnoremap <silent> <F7> :close<CR>
set completeopt=longest,menu


let g:SuperTabRetainCompletionType=2
let g:SuperTabDefaultCompletionType="<C-X><C-O>"

set csprg=/usr/bin/cscope
nnoremap <silent> <F9> :nohls<CR>
set completeopt=longest,menu

" Ignore case-sensitive
set ic

" For autoload/pathogen.vim
call pathogen#infect()
call pathogen#helptags()

" For colors/vividchalk.vim
colo vividchalk

highlight ExtraWhitespace ctermbg=red guibg=darkgreen
autocmd ColorScheme * highlight ExtraWhitespace ctermbg=red guibg=red
match ExtraWhitespace /\s\+$\| \+\ze\t/

转载于:https://my.oschina.net/lvhuizhenblog/blog/1809505

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值