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
Related
When I press 0 in Normal mode, the cursor goes to the second column and not the first one.
This is not the normal behavior stated in vim's :help 0.
I have tried disabling the remaps to move between wrapped lines from my config (below) and the behavior is the same.
Is there any way to change this? Maybe a package it's interfering with the regular behavior but I cannot see which one.
Here is my .vimrc config file
set backspace=indent,eol,start " backspace over everything in insert mode
set nocompatible " be improved, required
filetype off " required
" vim-plug manager
" Plugins will be downloaded under the specified directory.
call plug#begin('~/.vim/plugged')
Plug 'lervag/vimtex'
let g:tex_flavor='latex'
let g:vimtex_view_method='zathura'
let g:vimtex_quickfix_mode=0
set conceallevel=1
let g:tex_conceal='abdmg'
Plug 'sirver/ultisnips'
let g:UltiSnipsExpandTrigger = '<tab>'
let g:UltiSnipsJumpForwardTrigger = '<tab>'
let g:UltiSnipsJumpBackwardTrigger = '<s-tab>'
Plug 'itchyny/lightline.vim'
Plug 'sainnhe/gruvbox-material'
Plug 'scrooloose/nerdcommenter'
" List ends here. Plugins become visible to Vim after this call.
call plug#end()
syntax enable
"colorscheme monokai
set number
set ts=4
set expandtab
set autoindent
set wildmenu
set showmatch
set showmatch
set incsearch
set nohlsearch
set linebreak
set ttimeoutlen=0
set laststatus=2
set noshowmode
" Lets you edit another file without saving the current
set hidden
" GUI enhancements
" Set nice colors for 256 terminal
if !has('gui_running')
set t_Co=256
endif
" Set the airline colorscheme
let g:lightline = {'colorscheme' : 'gruvbox_material'}
" Set colorscheme
set termguicolors
set background=dark
let g:gruvbox_material_background = 'medium'
colorscheme gruvbox-material
" REMAPS
" Inserting a real Tab when pressing Shift + Tab
:inoremap <S-Tab> <C-V>Tab>
" Move between wrapped lines
noremap <silent> k gk
noremap <silent> j gj
noremap <silent> 0 g0
noremap <silent> $ g$
This question already has answers here:
How can I disable scratch preview window?
(2 answers)
Closed 5 years ago.
How do I get rid of the preview tab at the top that is popping up when I select an autocomplete suggestion?
here is my .vimrc mostly copied from someone else(julienschmidt) as I'm new to vim but I see nothing about tags.
" -----------------
" General
" -----------------
set nocp "enable Vi incompatible features
filetype plugin on "per-filetype settings
set shiftwidth=2
set tabstop=2
" -----------------
" Plugins
" -----------------
execute pathogen#infect()
" ----------------
" Encoding
" ----------------
set encoding=utf-8 "utf-8 encoding
set termencoding=utf-8 "utf-8 terminal
scriptencoding utf-8
set ff=unix "unix line endings
" -----------------
" Theme
" -----------------
set t_Co=256
syntax on "syntax highlighting
set nu "show line numbers
set ru "show ruler at cursor pos
set cursorline "highlight current line
set hlsearch "highlight search results
set showmatch "matching parentheses
set gcr=n:blinkon0 "turn off blinking cursor in normal mode
" highlight the word under cursor (CursorMoved is inperformant)
highlight WordUnderCursor cterm=underline "ctermfg=7
autocmd CursorHold * exe printf('match WordUnderCursor /\V\<%s\>/', escape(expand('<cword>'), '/\'))
"statusbar
set laststatus=2
" ----------------
" Behavior
" ----------------
set ai "autoindent
set backspace=indent,eol,start "allow backspacing over everything in insert mode
set shiftround "round > < to shiftwidth
set ignorecase smartcase "ignore case, except if contains uppercase
set noerrorbells visualbell t_vb= "don't ring the bell
set incsearch "incremental search
set mouse=a "enable mouse
set mousehide "Hide the mouse cursor while typing
set virtualedit=onemore "Allow for cursor beyond last character
set sc "show incomplete commmands
set tw=72 "textwidth 72 characters
autocmd GUIEnter * set visualbell t_vb=
if has('clipboard')
if has('unnamedplus') "use + register for copy-paste when available
set clipboard=unnamed,unnamedplus
else "otherwise try to use * register
set clipboard=unnamed
endif
endif
"go
let g:go_highlight_functions = 1
let g:go_highlight_methods = 1
let g:go_highlight_structs = 1
let g:go_highlight_interfaces = 1
let g:go_highlight_operators = 1
let g:go_highlight_build_constraints = 1
let g:go_fmt_command = "goimports"
au FileType go nmap <Leader>s <Plug>(go-implements)
au FileType go nmap <Leader>i <Plug>(go-info)
au FileType go nmap <Leader>e <Plug>(go-rename)
au FileType go nmap <leader>r <Plug>(go-run)
au FileType go nmap <leader>b <Plug>(go-build)
au FileType go nmap <leader>t <Plug>(go-test)
au FileType go nmap <Leader>gd <Plug>(go-doc)
au FileType go nmap <Leader>gv <Plug>(go-doc-vertical)
au FileType go nmap <leader>co <Plug>(go-coverage)
"Markdown
autocmd BufNewFile,BufReadPost *.md set filetype=markdown
let g:markdown_fenced_languages = ['html', 'python', 'bash=sh']
"always start in first line in git commit messages
au FileType gitcommit au! BufEnter COMMIT_EDITMSG call setpos('.', [0, 1, 1, 0])
"refresh vimrc after saving
autocmd BufWritePost ~/.vimrc source %
autocmd BufWritePost ~/.vim/vimrc source %
The add-ons in my bundle are auto-pairs, nerdtree, vim-airline, vim-fugitive, vim-go, YouCompleteMe. I'm guessing airline or YCM are the issue? Anyway if there's a something I can put in my .vimrc to disable this I would greatly appreciate it.
I actually found the answer myself using trusty google: https://github.com/Valloric/YouCompleteMe/issues/2015. It's a "feature" of YouCompleteMe and can be turned off by placing set completeopt-=preview in the .vimrc. I'll leave this for google searches.
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
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.
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