Question

I'm running: Windows 7, gvim 7.4

Put this in my vimrc:

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

Tried it with and without the "extra=-t" with the same result: enter image description here

Here is my entire 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>
Was it helpful?

Solution

The leading ÿþ characters give it away; that's a byte order mark (hexadecimal 0xFFFE), used for 16-bit Unicode encodings. Vim didn't properly detect that. Read :help 'fileencodings' to learn how to fix that, or just (re-)read the buffer via

:edit! ++enc=ucs-2le
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top