vim:dbext输出不可读

时间:2014-02-06 18:23:37

标签: vim dbext

我正在运行:Windows 7,gvim 7.4

把它放在我的vimrc中:

"------------dbext--------------
" Microsoft SQL Server
let g:dbext_default_profile_microsoft_production = 'type=SQLSRV:integratedlogin=1:dsnname=SQLOLEDB.1:srvname=SVR:extra=-t'

使用和不使用“extra = -t”尝试使用相同的结果: enter image description here

这是我的整个vimrc:

set nocompatible
set number
set list
set noerrorbells visualbell t_vb=

"gui
set guifont=Consolas:h14
colorscheme blue

"tab and indent settings
set shiftwidth=2
set tabstop=2
set noexpandtab

"split windows
nnoremap <C-k> :exe "vertical resize +10"<CR>
nnoremap <C-j> :exe "vertical resize -10"<CR>

"NERDTree
set autochdir "set working dir to active buffer
let NERDTreeChDirMode=2 "set dir for NERDTree
nnoremap <leader>n :NERDTreeToggle .<CR>

"autocompletion
set omnifunc=syntaxcomplete#Complete
" SuperTab
let g:SuperTabDefaultCompletionType = "<C-X><C-O>"
let g:SuperTabClosePreviewOnPopupClose = 1

"<Ctrl-l> redraws the screen, remove highlighting
set hlsearch

autocmd GUIEnter * set visualbell t_vb=

"directories
set backupdir=C:\G_Drive\code\vim\vimdir
set directory=C:\G_Drive\code\vim\vimdir


source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin

"pathogen
filetype off "run pathogen before plugin config
execute pathogen#infect()
"call pathogen#runtime_append_all_bundles()
call pathogen#incubate()
call pathogen#helptags()
syntax on
filetype plugin indent on
filetype plugin on

"syntastic
let g:syntastic_check_on_open=1
let g:syntastic_enable_signs=1
" On by default, turn it off for html
"let g:syntastic_mode_map = { 'mode': 'active',
"   \ 'active_filetypes': [], }
"   \ 'passive_filetypes': ['html'] }
"let g:syntastic_jshint_exec='$HOME/AppData/Roaming/npm/jshint.cmd'
"let g:syntastic_jshint_exec='C:/Users/Drupal Intermediate/AppData/Roaming/npm/jshint.cmd'
let g:syntastic_javascript_checkers = ['jshint']
let g:syntastic_html_checkers = ['w3']
let g:syntastic_php_checkers = ['php', 'phpcs', 'phpmd']

"------------dbext--------------
" Microsoft SQL Server
let g:dbext_default_profile_microsoft_production = 'type=SQLSRV:integratedlogin=1:dsnname=SQLOLEDB.1:srvname=SVR:extra=-t'

set shell=powershell
set shellcmdflag=-command

"info bar
set laststatus=2
set statusline= 
set statusline+=file:\ %F%m%h%r\ %y\ \| 
set statusline+=buff:\ %n\| 
set statusline+=%=
set statusline+=\|row:\ %l\|col:\ %c%V 
set statusline+=\|\ %p%% 

"maps
nnoremap  p  :put<cr>
nnoremap <S-Space> :bn<cr>:syntax sync fromstart<cr>
nnoremap <silent> <C-l> :nohl<CR><C-l>
"nnoremap - mzI/* <esc>A */<esc>`z
nnoremap <C-Tab> :set tabstop=2<bar>set noexpandtab<bar>%retab!<cr>

1 个答案:

答案 0 :(得分:2)

领先的ÿþ个字符会将其丢弃;这是一个字节顺序标记(十六进制0xFFFE),用于16位Unicode编码。 Vim没有正确检测到这一点。阅读:help 'fileencodings'以了解如何解决这个问题,或者只是(重新)通过

读取缓冲区
:edit! ++enc=ucs-2le