vim syntastic omnisharp-vim giving false errors - vim

So I am using the omnisharp-vim plugin along with syntastic to show my errors in my web project. When I load a cs file up it is reporting all these errors. When I open the same project up in VS 2015 I do not see the same errors
MyProject.Web\Controllers\DashboardController.cs|11 col 52 error| 'MyProjectAuthorizeAttribute' is not a known identifier
MyProject.Web\Controllers\DashboardController.cs|11 col 54 error| Error: ?
MyProject.Web\Controllers\DashboardController.cs|12 col 51 error| 'BaseController' is not a known identifier
MyProject.Web\Controllers\DashboardController.cs|14 col 27 error| 'ILogger' is not a known identifier
MyProject.Web\Controllers\DashboardController.cs|15 col 44 error| 'ILoggerFactory' is not a known identifier
Maybe I am missing some configuration in my .vimrc file?
" General -----------------------
set nocompatible " Makes vim better
scriptencoding utf-8 " Setting everything to UTF-8
set encoding=utf-8
set history=256
set timeoutlen=250
set clipboard+=unnamed
let g:autotagTagsFile = ".git/tags"
set tags=./.git/tags,tags,./.git/coffeetags,coffeetags;$HOME
set nobackup
set nowritebackup
set noswapfile
set hlsearch
set ignorecase
set smartcase
set incsearch
" turn off search highlight
nnoremap <leader><space> :nohlsearch<CR>
let mapleader = ','
let maplocalleader = ' '
let g:netrw_banner = 0
" Formatting --------------------
set nowrap
set tabstop=4
set softtabstop=4
set shiftwidth=4
set backspace=indent
set backspace+=eol
set backspace+=start
set autoindent
set cindent
set indentkeys-=0#
set cinkeys-=0#
set cinoptions=:s,ps,ts,cs
set cinwords=if,else,while,do
set cinwords+=for,switch,case
set linespace=4
set listchars=tab:>.,trail:.,extends:\#,nbsp:.
set list
" Plugins ------------------------
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'OmniSharp/omnisharp-vim'
Plugin 'tpope/vim-dispatch'
Plugin 'scrooloose/syntastic'
Plugin 'Shougo/unite.vim'
Plugin 'xero/sourcerer.vim'
Plugin 'bling/vim-airline'
Plugin 'airblade/vim-gitgutter'
Plugin 'ap/vim-css-color'
Plugin 'groenewege/vim-less'
Plugin 'hail2u/vim-css3-syntax'
Plugin 'kien/ctrlp.vim'
Plugin 'jasoncodes/ctrlp-modified.vim'
Plugin 'kaneshin/ctrlp-git-log'
Plugin 'jiangmiao/auto-pairs'
Plugin 'lokaltog/vim-easymotion'
Plugin 'majutsushi/tagbar'
Plugin 'mattn/ctrlp-git'
Plugin 'tacahiroy/ctrlp-funky'
Plugin 'mattn/emmet-vim'
Plugin 'mtscout6/rainbow_parentheses.vim'
Plugin 'mtscout6/vim-ctags-autotag'
Plugin 'mtscout6/vim-tagbar-css'
Plugin 'scrooloose/nerdtree'
Plugin 'terryma/vim-multiple-cursors'
Plugin 'tpope/vim-fugitive'
Plugin 'tpope/vim-git'
Plugin 'tpope/vim-markdown'
Plugin 'tpope/vim-surround'
call vundle#end()
filetype plugin indent on
" Rainbow
map <leader>rt :RainbowParenthesesToggle<CR>
map <leader>r( :RainbowParenthesesLoadRound<CR>
map <leader>r[ :RainbowParenthesesLoadSquare<CR>
map <leader>r{ :RainbowParenthesesLoadBraces<CR>
map <leader>r< :RainbowParenthesesLoadChevrons<CR>
" File Type Settings --------------------
" Markdown editing
autocmd Filetype markdown setlocal wrap
autocmd Filetype markdown setlocal linebreak
autocmd Filetype markdown setlocal nolist
autocmd Filetype markdown setlocal columns=80
autocmd Filetype markdown setlocal tw=80
autocmd Filetype markdown setlocal wm=4
" GVIM Options -----------------------
set guioptions-=m
set guioptions-=T
set guioptions-=r
set guioptions-=L
" Visual ------------------------
syntax on
set showmatch
if has('gui_running')
set guifont=InputMono:h14
colorscheme sourcerer
if has('mac')
set noantialias
endif
endif
set novisualbell
set noerrorbells
set vb t_vb=
set laststatus=2
" Airline Settings
let g:airline_powerline_fonts = 1
let g:airline#extensions#tabline#enabled = 1
" Default
let g:airline#extensions#tmuxline#enabled = 0
" Presentation
"let g:airline#extensions#tmuxline#enabled = 1
" Ctrl-P settings
let g:ctrlp_working_path_mode = 'r'
let g:ctrlp_extensions = ['tag', 'buffertag', 'line', 'funky']
", 'git-log', 'git_branch', 'git_files', 'modified']
let g:ctrlp_custom_ignore = 'node_modules\|DS_Store\|git|bower_components'
map <leader>t :CtrlP<CR>
map <leader>gs :CtrlPGitFiles<CR>
map <leader>gb :CtrlPGitBranch<CR>
map <leader>gl :CtrlPGitLog<CR>
map <leader>gm :CtrlPModified<CR>
" ctrlp-modified
map <Leader>m :CtrlPModified<CR>
map <Leader>M :CtrlPBranch<CR>
" Tagbar settings
map <F8> :TagbarToggle<CR>
" Emmet settings
imap <C-e> <C-y>,
" Multiple Cursor Settings
let g:multi_cursor_use_default_mapping=0
let g:multi_cursor_start_key='<leader>m'
let g:multi_cursor_next_key='<C-n>'
let g:multi_cursor_prev_key='<C-p>'
let g:multi_cursor_skip_key='<C-x>'
let g:multi_cursor_quit_key='<Esc>'
" Git Gutter Settings
highlight clear SignColumn
map ]h <Plug>GitGutterNextHunk
map [h <Plug>GitGutterPrevHunk
map <leader>hv <Plug>GitGutterPreviewHunk
map <Leader>hs <Plug>GitGutterStageHunk
map <Leader>hr <Plug>GitGutterRevertHunk
" NERD Tree Settings
map <TAB> :NERDTreeToggle<CR>
map <leader>ff :NERDTreeFind<CR>
let NERDTreeShowHidden=1
let NERDTreeIgnore=[]
" Syntastic Settings
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
"let g:syntastic_<filetype>_checkers = ['omnisharp']
let g:syntastic_cs_checkers = ['syntax', 'semantic', 'issues']
" Omnisharp settings
let g:OmniSharp_server_type = 'roslyn'
let g:OmniSharp_selector_ui = 'unite'
let g:OmniSharp_selector_ui = 'ctrlp'
let g:OmniSharp_timeout = 1
set noshowmatch
set completeopt=longest,menuone,preview
set splitbelow
augroup omnisharp_commands
autocmd!
"Set autocomplete function to OmniSharp (if not using YouCompleteMe completion plugin)
autocmd FileType cs setlocal omnifunc=OmniSharp#Complete
" Synchronous build (blocks Vim)
"autocmd FileType cs nnoremap <F5> :wa!<cr>:OmniSharpBuild<cr>
" Builds can also run asynchronously with vim-dispatch installed
autocmd FileType cs nnoremap <leader>b :wa!<cr>:OmniSharpBuildAsync<cr>
" automatic syntax check on events (TextChanged requires Vim 7.4)
autocmd BufEnter,TextChanged,InsertLeave *.cs SyntasticCheck
" Automatically add new cs files to the nearest project on save
autocmd BufWritePost *.cs call OmniSharp#AddToProject()
"show type information automatically when the cursor stops moving
autocmd CursorHold *.cs call OmniSharp#TypeLookupWithoutDocumentation()
"The following commands are contextual, based on the current cursor position.
autocmd FileType cs nnoremap gd :OmniSharpGotoDefinition<cr>
autocmd FileType cs nnoremap <leader>fi :OmniSharpFindImplementations<cr>
autocmd FileType cs nnoremap <leader>ft :OmniSharpFindType<cr>
autocmd FileType cs nnoremap <leader>fs :OmniSharpFindSymbol<cr>
autocmd FileType cs nnoremap <leader>fu :OmniSharpFindUsages<cr>
"finds members in the current buffer
autocmd FileType cs nnoremap <leader>fm :OmniSharpFindMembers<cr>
" cursor can be anywhere on the line containing an issue
autocmd FileType cs nnoremap <leader>x :OmniSharpFixIssue<cr>
autocmd FileType cs nnoremap <leader>fx :OmniSharpFixUsings<cr>
autocmd FileType cs nnoremap <leader>tt :OmniSharpTypeLookup<cr>
autocmd FileType cs nnoremap <leader>dc :OmniSharpDocumentation<cr>
"navigate up by method/property/field
autocmd FileType cs nnoremap <C-K> :OmniSharpNavigateUp<cr>
"navigate down by method/property/field
autocmd FileType cs nnoremap <C-J> :OmniSharpNavigateDown<cr>
augroup END
nnoremap <leader><space> :OmniSharpGetCodeActions<cr>
vnoremap <leader><space> :call OmniSharp#GetCodeActions('visual')<cr>
" rename with dialog
nnoremap <leader>nm :OmniSharpRename<cr>
nnoremap <F2> :OmniSharpRename<cr>
" rename without dialog - with cursor on the symbol to rename... ':Rename newname'
command! -nargs=1 Rename :call OmniSharp#RenameTo("<args>")
" Force OmniSharp to reload the solution. Useful when switching branches etc.
nnoremap <leader>rl :OmniSharpReloadSolution<cr>
nnoremap <leader>cf :OmniSharpCodeFormat<cr>
" Load the current .cs file to the nearest project
nnoremap <leader>tp :OmniSharpAddToProject<cr>
" (Experimental - uses vim-dispatch or vimproc plugin) - Start the omnisharp server for the current solution
nnoremap <leader>ss :OmniSharpStartServer<cr>
nnoremap <leader>sp :OmniSharpStopServer<cr>
" Add syntax highlighting for types and interfaces
nnoremap <leader>th :OmniSharpHighlightTypes<cr>
"Don't ask to save when changing buffers (i.e. when jumping to a type definition)
set hidden

probably VS dont use the same checkers as syntastic ,
run the comand :SyntasticInfo
and it will return what checker it is using them you can find why is those errors comming up and how to make you program pass the syntax checker
obs i dont know visual studio but most of your error are is not a known identifier
maybe is because it is defined in other file and VS checks it but not syntastic checker

Related

vim-fireplace cpp don't evaluate every time

I'm having trouble with vim-fireplace using the cpp command.
I'm only using cpp to evaluate the println but at some random point vim enters insert mode and overwrites whatever I type. ESC don't work, only ctrl-c.
This problem is only on my Ubuntu machine, on Mac it works fine.
Here is my vimrc.
filetyp plugin indent on
"set noswapfile
" set filetype detection
filetype on
" VIM-PLUGGED settings ---------------------- {{{
" Specify a directory for plugins
" - For Neovim: ~/.local/share/nvim/plugged
" - Avoid using standard Vim directory names like 'plugin'
call plug#begin('~/.vim/plugged')
" Make sure you use single quotes
" On-demand loading
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
Plug 'tpope/vim-fireplace', { 'for': 'clojure' }
Plug 'vim-scripts/paredit.vim', { 'for': 'clojure' }
" Any valid git URL is allowed
" Plug 'https://github.com/vim-airline/vim-airline.git'
" Initialize plugin system
call plug#end()
" :PlugInstall
" }}}
" GUI set number
set numberwidth=1
set number
" highlight search
set hlsearch incsearch
let mapleader = ","
let maplocalleader = ","
set tabstop=2 " The width of a TAB is set to 4.
set shiftwidth=2
set softtabstop=2
set expandtab
" MAPPINGS
let mapleader = ","
let maplocalleader = ","
inoremap jk <esc>
nnoremap <c-j> 5<c-e>
nnoremap <c-k> 5<c-y>
nnoremap ff :execute "noh"<cr>
" edit vimrc
:nnoremap <leader>ev :vsplit $MYVIMRC<cr>
:nnoremap <leader>sv :source $MYVIMRC<cr>
:nnoremap <leader>ec :split $VIMSETUP/cheetsheet<cr>
:nnoremap <leader>en :split $VIMSETUP/notes<cr>
" Clojure file settings ---------------------- {{{
augroup filetype_clojure
autocmd!
" autocmd FileType clojure nnoremap J gJ
autocmd FileType clojure nmap <leader>e cpp
autocmd FileType clojure nnoremap <leader>r :Require<cr>
augroup END
" }}}
" Vimscript file settings ---------------------- {{{
augroup filetype_vim
autocmd!
autocmd FileType vim setlocal foldmethod=marker
augroup END
" }}}
nnoremap <c-b> :NERDTreeToggle<cr>

Buffers not working in vim

My buffers are not working for some reason. When I click <leader>b it says
Not an editor command: Buffers
This is my .vimrc file:
set nocompatible " required
filetype off " required
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" required
Plugin 'VundleVim/Vundle.vim'
" General
Plugin 'scrooloose/nerdtree'
Plugin 'kien/ctrlp.vim'
Plugin 'scrooloose/syntastic'
Plugin 'tpope/vim-commentary'
" User Interface
Plugin 'altercation/vim-colors-solarized'
Plugin 'JarrodCTaylor/vim-256-color-schemes'
Plugin 'JarrodCTaylor/vim-reflection'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'bling/vim-airline'
" Programming
Plugin 'mattn/emmet-vim'
Plugin 'tpope/vim-surround'
Plugin 'leafgarland/typescript-vim'
" Languages
Plugin 'pangloss/vim-javascript'
Plugin 'davidhalter/jedi-vim'
" all plugins must be above this line!!
call vundle#end() " required
filetype plugin indent on " required
" non-plugin stuff after this line!!
" Map leader to ,
let mapleader=','
set t_Co=256
syntax on
set nobackup " Don't constantly write backup files
set noswapfile " Ain't nobody got time for swap files
set noerrorbells " Don't beep
set nowrap " Do not wrap lines
set shiftwidth=4 " Number of spaces to use for each step of indent
set showcmd " Display incomplete commands in the bottom line of the screen
set tabstop=4 " Number of spaces that a <Tab> counts for
set undolevels=1000 " Never can be too careful when it comes to undoing
set hidden " Don't unload the buffer when we switch between them. Saves undo history
set visualbell " Visual bell instead of beeping
set wildmenu " Command-line completion in an enhanced mode
set shell=bash " Required to let zsh know how to run things on the command line
set ttimeoutlen=50 " Fix delay when escaping from insert with Esc
set noshowmode " Hide the default mode text (e.g. -- INSERT -- below the statusline)
set showbreak=↪\
set synmaxcol=256
set scrolloff=3
set clipboard=unnamed
au BufNewFile,BufRead *.json set ft=javascript
" Status line / visual configuration
syntax enable
set t_Co=256
set t_ut=
hi clear
hi String ctermfg=81 ctermbg=NONE cterm=NONE guifg=#5fd7ff guibg=NONE gui=NONE
hi CursorLine cterm=NONE ctermbg=darkred ctermfg=white
set laststatus=2 " Make the second to last line of vim our status line
let g:airline_theme='understated' " Use the custom theme I wrote
let g:airline_left_sep='' " No separator as they seem to look funky
let g:airline_right_sep='' " No separator as they seem to look funky
let g:airline#extensions#branch#enabled = 0 " Do not show the git branch in the status line
let g:airline#extensions#syntastic#enabled = 1 " Do show syntastic warnings in the status line
let g:airline#extensions#tabline#show_buffers = 0 " Do not list buffers in the status line
let g:airline_section_x = '' " Do not list the filetype or virtualenv in the status line
let g:airline_section_y = '[R%04l,C%04v] [LEN=%L]' " Replace file encoding and file format info with file position
let g:airline_section_z = '' " Do not show the default file position info
let g:airline#extensions#virtualenv#enabled = 0
autocmd BufReadPost quickfix nnoremap <buffer> <CR> :.cc<CR>
autocmd BufReadPost quickfix nnoremap <buffer> o :.cc<CR>
nnoremap <Leader>W :%s/\s\+$//<CR>:let #/=''<CR>
let g:syntastic_check_on_open=1 " check for errors when file is loaded
let g:syntastic_loc_list_height=5 " the height of the error list defaults to 10
let g:syntastic_python_checkers = ['flake8'] " sets flake8 as the default for checking python files
let g:syntastic_javascript_checkers = ['jshint'] " sets jshint as our javascript linter
let g:syntastic_filetype_map = { 'handlebars.html': 'handlebars' }
let g:syntastic_mode_map={ 'mode': 'active',
\ 'active_filetypes': [],
\ 'passive_filetypes': ['html', 'handlebars'] }
set tags=./.ctags,.ctags;
let g:NERDTreeMapJumpNextSibling = ''
let g:NERDTreeMapJumpPrevSibling = ''
let g:gundo_preview_bottom = 1
let g:markdown_fold_style = 'nested'
let g:markdown_fenced_languages = ['python', 'sh', 'vim', 'javascript', 'html', 'css', 'c', 'sql']
let g:indent_guides_start_level = 2
let g:indent_guides_guide_size = 1
let g:indent_guides_exclude_filetypes = ['help', 'nerdtree']
let g:indent_guides_auto_colors = 0
autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd ctermbg=238
autocmd VimEnter,Colorscheme * :hi IndentGuidesEven ctermbg=249
function! s:DeleteBuffer()
let line = getline('.')
let bufid = line =~ '\[\d\+\*No Name\]$' ? str2nr(matchstr(line, '\d\+'))
\ : fnamemodify(line[2:], ':p')
exec "bd" bufid
exec "norm \<F5>"
endfunction
" NERDTree configuration
let g:NERDTreeChDirMode=2
let g:NERDTreeIgnore=['\.rbc$', '\~$', '\.pyc$', '\.db$', '\.sqlite$', '__pycache__']
let g:NERDTreeSortOrder=['^__\.py$', '\/$', '*', '\.swp$', '\.bak$', '\~$']
let g:NERDTreeShowBookmarks=1
let g:nerdtree_tabs_focus_on_files=1
let g:NERDTreeMapOpenInTabSilent = '<RightMouse>'
let g:NERDTreeWinSize = 50
set wildignore+=*/tmp/*,*.so,*.swp,*.zip,*.pyc,*.db,*.sqlite
nnoremap <silent> <F2> :NERDTreeFind<CR>
nmap <F3> :NERDTreeToggle<CR>
" buffer configuration
nnoremap <silent> <leader>b :Buffers<CR>
" close buffer
nnoremap <leader>c :bd<CR>
Can someone tell me if I missed something? I will also accept tips on upgrading my vimrc file so feel free to give any tips :) But I mainly want to fix this problem. So please tell me what I should remove or add to get this working again. It was working before. This really appeared suddenly.
Maybe a typo, see :h buffers
Please change following line (lowercase the B in :Buffers)
nnoremap <silent> <leader>b :Buffers<CR>
to
nnoremap <silent> <leader>b :buffers<CR>

Vim cursor moves forward 7 characters when I use my remapped <Esc>

I took a stab at writing my own .vimrc for the first time. I've gotten used to using "kj" as a replacement for Escape so I added a remapping. Here is a copy of my .vimrc:
set nocompatible
filetype off
" Plugins
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'sjl/badwolf'
Plugin 'scrooloose/nerdtree'
Plugin 'scrooloose/syntastic'
Plugin 'scrooloose/nerdcommenter'
Plugin 'tpope/vim-fugitive'
Plugin 'kien/ctrlp.vim'
Plugin 'majutsushi/tagbar'
Plugin 'bling/vim-airline'
Plugin 'bronson/vim-trailing-whitespace'
call vundle#end()
filetype plugin indent on
" Ctrl P
let g:ctrlp_atch_window = 'bottom,order:ttb'
let g:ctrlp_switch_buffer = 0
let g:ctrlp_working_path_mode = 0
" Syntastic
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_js_checkers = ['jshint']
" Fugitive
set statusline+=%{fugitive#statusline()}
" Vim Airline
set laststatus=2
" Colors
syntax enable
colorscheme badwolf
let g:badwolf_darkgutter=1
" Misc
set ttyfast
set backspace=indent,eol,start
" Spaces & Tabs
set tabstop=2
set expandtab
set softtabstop=2
set shiftwidth=2
set autoindent
" UI Layout
set number
set showcmd
set cursorline
set wildmenu
set showmatch
match Error /\%81v.\+/
" Searching
set ignorecase
set incsearch
set hlsearch
" Folding
" set foldmethod=indent
" set foldnestmax=10
" set foldenable
" nnoremap <space> za
" set foldlevelstart=10
" Shortcut Remmaping
inoremap kj <Esc>
vnoremap kj <Esc>
" Movement
" nnoremap <buffer> <silent> j gj
" nnoremap <buffer> <silent> k gk
map <C-h> :wincmd h<CR>
map <C-j> :wincmd j<CR>
map <C-k> :wincmd k<CR>
map <C-l> :wincmd l<CR>
" Leader Shortcuts
let mapleader=","
let g:mapleader=","
nnoremap <leader>w :NERDTree<CR>
nnoremap <leader>l :call ToggleNumber()<CR>
nnoremap <leader><space> <silent> :nohlsearch<CR>
nnoremap <leader>t :TagbarToggle<CR>
" Custom Functions
function! ToggleNumber()
if(&relativenumber == 1)
set norelativenumber
set number
else
set relativenumber
endif
endfunc
" Return to last edit position when opening files (You want this!)
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif
" Remember info about open buffers on close
set viminfo^=%
When I include the "kj" remappings upon pressing "kj" while in insert mode, I enter normal mode and then my cursor moves forwards 7 characters. Without the remapping the letters are simply be typed into the buffer.
I have tried disabling all of my plugins, but the problem still persists. This is driving me mad, any ideas what could be causing this to happen?
There are trailing spaces right after inoremap kj <Esc>, which is interpreted as a part of the mapping. Try removing these spaces.

vim: dbext output unreadable

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:
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>
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

macvim can not fold code "E490: No fold found"

I can not fold my code in macvim
my environment and settings is at the gist link https://gist.github.com/poc7667/7035979
is there any idead ?
hi Comment ctermfg=6
"function SetCafeOptions()
"CoffeeCompile
":set nonu
":res -24
":res +24
"endfunction
set encoding=utf-8
set fileencoding=utf-8
colorscheme elflord
set smartindent
set tabstop=4
set expandtab
set shiftwidth=4
"make it autoreload
set autoread
"auto move it last time the position you viewed
"make vim save and load the folding of the document each time it loads"
""also places the cursor in the last place that it was left."
"try to set show ansi color
if &term=="ansi"
set t_Co=0
endif
"set expandtab
filetype on
if has("cscope")
set csprg=/usr/bin/cscope
set csto=0
set cst
set nocsverb
" add any database in current directory
if filereadable("cscope.out")
cs add cscope.out
" else add database pointed to by environment
elseif $CSCOPE_DB != ""
cs add $CSCOPE_DB
endif
set csverb
set cscopetag
set cscopequickfix=s-,g-,c-,d-,t-,e-,f-,i-
endif
"let Tlist can close windows at one time
let Tlist_Show_One_File=1
let Tlist_Exit_OnlyWindow=1
" Key map
" Presee F4 and you can open the NERDTree
nnoremap <silent> <F4> :NERDTree<CR>
"nnoremap <silent> <F3> :!/usr/bin/env python %<CR>
" Show function List with Tlist
nnoremap <F12> :TlistToggle<CR>
" Map ctrl+q to ctrlw+ctrlw
"
"nnoremap <silent> <C-q> :<C-w><C-w>
"switch in splitted window
map <c-d> <c-w>l
map <c-a> <c-w>h
"set highlight
set hlsearch
"set autocomplet
"autocmd BufNewFile,BufRead *.html.erb set filetype=html.eruby
autocmd BufNewFile,BufRead *.html.erb set filetype=erb.html.eruby
filetype plugin on
"auto import python template
autocmd bufnewfile *.py 0r ~/common_lib/python/tmpl.py
map gn :bn<cr>
map gp :bp<cr>
map ff :CtrlP<cr>
map gt :buffers<cr>
"set NerdTreeSize
let g:NERDTreeWinSize=12
"auto close the nerdtress window whe you open new file
let g:ctrlp_dont_split = 'nerdtree'
set nocompatible " explictly get out of vi-compatible mode
set background=dark " we plan to use a dark background
syntax on " syntax highlighting on
set number " turn on line numbers
set wildignore+=*/test/*,*/tmp/*,*.so,*.swp,*.zip " MacOSX/Linux
set ruler "always show current position along the bottom
set incsearch " do highlight as you type you search phrase
set ignorecase " case insensitive by default
set smartcase " if there are caps, go case-sensitive
"Rope vim
let $PYTHONPATH .= ":~/install/ropehg/rope:~/install/ropehg/ropemode:~/install/ropehg/ropevim"
source ~/install/ropehg/ropevim/ropevim.vim
let g:pymode_rope_goto_def_newwin = "new"
let ropevim_vim_completion=1
"Use Ctrl + ] . to autocomple
inoremap <C-]> <C-R>=RopeCodeAssistInsertMode()<CR>
map <leader>j :RopeGotoDefinition<CR>
map <leader>r :RopeRename<CR>
" Load the whole plugin
let g:pymode = 1
" Load run code plugin
let g:pymode_run = 1
"add ctrlp.vim setting
""
let g:ctrlp_custom_ignore = 'tmp$\|\.git$\|\.hg$\|\.svn$\|.rvm$'
let g:ctrlp_working_path_mode = 'ra'
let g:ctrlp_match_window_bottom=1
let g:ctrlp_max_height=15
let g:ctrlp_match_window_reversed=0
let g:ctrlp_mruf_max=500
let g:ctrlp_follow_symlinks=1
"Vundle
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'gmarik/vundle'
Bundle 'tpope/vim-surround'
Bundle 'Raimondi/delimitMate'
"coffee script"
Bundle 'kchmck/vim-coffee-script'
Bundle 'ack.vim'
Bundle 'matchit.zip'
"Markdown"
"Bundle 'plasticboy/vim-markdown'
""Vim-scripts repo
Bundle 'The-NERD-Commenter'
Bundle 'pep8'
""Bundle 'AutoClose'
filetype plugin indent on
nmap <leader>a <Esc>:Ack ""
"folding code
nnoremap <space> za
vnoremap <space> zf
" pep8
let g:pep8_map='<leader>8'
"coffee script"
call pathogen#infect()
"make vim save and load the folding of the document each time it loads"
""also places the cursor in the last place that it was left."
au BufWinLeave *.* mkview
au BufWinEnter *.* silent loadview
let Tlist_Use_Right_Window = 1
"autocmd BufEnter * if &filetype == "" | setlocal ft=python | endif
"markdown https://github.com/plasticboy/vim-markdown/wiki"
"let g:vim_markdown_folding_disabled=1
"auto exec ruby and coffee script with F5 , remeber to save file before launching
autocmd FileType python map <leader>p :!python %<cr>
autocmd FileType ruby,rb map <leader>5 :w!<cr>:!ruby %<cr>
autocmd FileType * map <leader>e :qa!<cr>
"autocmd FileType coffee nmap <F5> :CoffeeCompile<cr>
"autocmd FileType coffee map <F5> :call SetCafeOptions()<cr>
so ~/.vim/snippets/support_functions.vim
Your .vimrc doesn't actually enable folding anywhere. Folding is not enabled by default. You need to tell Vim what method to use to fold your code.
What method you use might depend on what type of code you are editing. SOME syntax highlighting files define syntax-based folding. Other syntax files do not. If your code is of a type that supports syntax-based folding, then you can :setlocal foldmethod=syntax after loading the file. You can do this in an autocmd in your .vimrc if you like, for example autocmd FileType c setlocal foldmethod=syntax or you can do it manually.
Other automatic fold methods include "marker", "expr", and "indent". By default the fold method is "manual" and you must first create folds with zf in order to use folding commands.
See http://vim.wikia.com/wiki/Folding for a more detailed discussion.
Removing these lines solve the folding problem for me:
au BufWinLeave *.* mkview
au BufWinEnter *.* silent loadview

Resources