Vim entering normal mode when option + 8 or 9 - vim

While in insert mode, my vim is entering normal mode when I press the key: option + 8 or 9, this corresponds to a [ or ], respectively on my mac. To write code this is really annoying, as I need brackets a lot. How can I remove this? Thank you.
I attach below my .vimrc file.
I have changed the esc key in inoremap to "jk" and the map leader key to ";".
Update: My terminal is alacritty, and there I don't have this problem. Only in vim.
" Disable compatibility with vi which can cause unexpected issues.
set nocompatible
" Enable type file detection. Vim will be able to try to detect the type of file in use.
filetype on
" Enable plugins and load plugin for the detected file type.
filetype plugin on
" Load an indent file for the detected file type.
filetype indent on
" While searching though a file incrementally highlight matching characters as you type.
set incsearch
" Enable auto completion menu after pressing TAB.
set wildmenu
" Make wildmenu behave like similar to Bash completion.
set wildmode=list:longest
" There are certain files that we would never want to edit with Vim.
" Wildmenu will ignore files with these extensions.
set wildignore=*.docx,*.jpg,*.png,*.gif,*.pdf,*.pyc,*.exe,*.flv,*.img,*.xlsx
:set relativenumber
:set number
:set autoindent
:set tabstop=4
:set shiftwidth=4
:set smarttab
:set softtabstop=4
:set mouse=a
:colorscheme iceberg
set termguicolors
set t_Co=256
set background=dark
set term=xterm-256color
set foldmethod=indent
set foldnestmax=10
set nofoldenable
set foldlevel=2
syntax on
syntax enable
" Highlight cursor line underneath the cursor horizontally.
set cursorline
set backspace=indent,eol,start
" Highlight cursor line underneath the cursor vertically.
set cursorcolumn
set list
set showbreak=↪\
set listchars=tab:→\ ,eol:↲,nbsp:␣,trail:•,extends:⟩,precedes:⟨
call plug#begin('~/.config/nvim/plugged')
Plug 'https://github.com/tpope/vim-commentary' " For Commenting gcc & gc
Plug 'https://github.com/tc50cal/vim-terminal' " Vim Terminal
Plug 'https://github.com/ryanoasis/vim-devicons' " Developer Icons
Plug 'https://github.com/neoclide/coc.nvim' " Auto Completion
Plug 'https://github.com/preservim/nerdtree' " NerdTree
"Plug 'ap/vim-css-color'
Plug 'ryanoasis/vim-devicons'
Plug 'vim-airline/vim-airline'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
Plug 'airblade/vim-gitgutter'
Plug 'ctrlpvim/ctrlp.vim' " fuzzy find files
Plug 'scrooloose/nerdcommenter'
Plug 'christoomey/vim-tmux-navigator'
Plug 'morhetz/gruvbox'
Plug 'HerringtonDarkholme/yats.vim' " TS Syntax
Plug 'https://github.com/terryma/vim-multiple-cursors' " CTRL + N for multiple cursors
Plug 'vimwiki/vimwiki'
set encoding=UTF-8
call plug#end()
let g:vimwiki_list = [{'path': '~/vimwiki/',
\ 'syntax': 'markdown', 'ext': '.md'}]
nnoremap <C-n> :NERDTree<CR>
inoremap jk <ESC>
" Set the backslash as the leader key."
let mapleader = ','
nmap <C-n> :NERDTreeToggle<CR>
vmap ++ <plug>NERDCommenterToggle
let g:NERDTreeGitStatusWithFlags = 1
tnoremap jk <C-\><c-n>
nmap <F8> :TagbarToggle<CR>
let &t_SI.="\e[5 q" "SI = INSERT mode
let &t_SR.="\e[4 q" "SR = REPLACE mode
" Have nerdtree ignore certain files and directories.
let NERDTreeIgnore=['\.git$', '\.jpg$', '\.mp4$', '\.ogg$', '\.iso$', '\.pdf$', '\.pyc$', '\.odt$', '\.png$', '\.gif$', '\.db$']

The problem was in my alacritty terminal. Fixed it by changing the alacritty.yml config to:
alt_send_esc: false

Related

Characters remain in the window when using COC or Jedi plugin in Vim

I've been using Vim for about 6 month and finally reached the level where I can't live without it.
I'm really grateful for those who wrote great tutorials or blog posts, and kindly answered easy questions which helped be alot.
Since I started using the autocompletion Plugin, Jedi, characters from the autocompletion window still remain in main window after the autocompletion window is disappeared. I thought this problem was only limited to the Jedi Plugin, but after I changed it into COC Plugin, I still experience the same problem.
I've searched quite a lot and couldn't find any thread about this problem and now I'm starting to think this problem is only occuring to me.
Solution to the problem is the best, but I'll be still grateful for any suggestions, link to a other thread.
I attached my .vimrc below.
Vim 8.2
Windows 10
" vim runtime config file
" Written by Knowblesse 2020
" Adapted from miguelgrinberg/.vimrc
"""""""""""""""""""""""""""""""""""
" Basics "
"""""""""""""""""""""""""""""""""""
" Sane text files
set fileformat=unix " uses line ending LF (not DOS-style CR LF)
set encoding=utf-8
set fileencoding=utf-8
" View
set number
set colorcolumn=100
set nowrap
set hlsearch
set relativenumber
set scrolloff=8
set scrolloff=8
set splitright
set clipboard=unnamedplus
" Tab
set tabstop=4
set shiftwidth=4
set softtabstop=4
set expandtab
" Font
if has('unix')
echo "Unix Mode"
set guifont=Bitstream\ Vera\ Sans\ Mono\ 12
else
echo "Window Mode"
set guifont=Bitstream\ Vera\ Sans\ Mono:h12
endif
"""""""""""""""""""""""""""""""""""
" Key Bindings "
"""""""""""""""""""""""""""""""""""
imap jk <Esc>
nmap <Tab> >>
nmap <S-tab> <<
vmap < <gv
vmap > >gv
map <leader>t :call NERDTreeToggle()<CR>
"remove highlighted
nmap <leader>] : nohlsearch<CR>
"delete buffer w/o closing the current window
nmap <leader>q :bp\|bd #<CR>
"faster editting
if has('unix')
nmap <leader>vv :e ~/VCF/vimrc/vimrc.vim <CR>
else
nmap <leader>vv :e C:\VCF\vimrc\vimrc.vim <CR>
endif
"""""""""""""""""""""""""""""""""""
" Color Scheme "
"""""""""""""""""""""""""""""""""""
syntax on
colorscheme monokai
filetype on
filetype plugin indent on
"""""""""""""""""""""""""""""""""""
" Plugin "
"""""""""""""""""""""""""""""""""""
"monokai theme is manually installed
"ctag is manually installed
call plug#begin()
Plug 'yegappan/taglist'
Plug 'tpope/vim-sensible'
Plug 'mg979/vim-visual-multi'
"buffer lists instead of tab
Plug 'ap/vim-buftabline'
"NERD
Plug 'preservim/nerdtree'
"Git
Plug 'airblade/vim-gitgutter'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'tpope/vim-fugitive'
"Coding
Plug 'davidhalter/jedi-vim'
Plug 'ervandew/supertab'
"Plug 'dense-analysis/ale'
Plug 'itchyny/lightline.vim'
"Color theme
Plug 'joshdick/onedark.vim'
"Table generataion
Plug 'dhruvasagar/vim-table-mode'
"Vertical line generation
Plug 'Yggdroot/indentLine'
" For Testing .....................
"Auto Commplete
Plug 'neoclide/coc.nvim', {'branch': 'release'}
"Arduino
Plug 'stevearc/vim-arduino'
call plug#end()
Red arrows shows remaining characters

Vim opens with a 'c' pressed

When I open vim, I have to press the esc key before working w/ what is in the file because it assumes a 'c' was pressed.
It hasn't always been like this but I am unsure how to troubleshoot it.
When I run vim -u NONE or vim --noplugin, it doesn't assume 'c' has been pressed, but when I comment out the last two plugins that I installed (typescript-vim and ag.vim), it does assume 'c' was pressed.
Can anyone see any other setting that might be the culprit?
set t_Co=16
set nocompatible
filetype off
set rtp+=~/.vim/bundle/vundle.vim
call vundle#begin()
Bundle 'gmarik/vundle.vim'
" vim-snipmate dependencies
Plugin 'MarcWeber/vim-addon-mw-utils'
Plugin 'vim-scripts/tlib'
Plugin 'ToadJamb/vim_test_runner'
Plugin 'garbas/vim-snipmate'
Plugin 'tpope/vim-surround'
Plugin 'tpope/vim-rake'
Plugin 'tpope/vim-endwise'
Plugin 'kien/ctrlp.vim'
Plugin 'vim-scripts/DeleteTrailingWhitespace'
Plugin 'altercation/vim-colors-solarized'
Plugin 'ervandew/supertab'
Plugin 'kchmck/vim-coffee-script'
Plugin 'slim-template/vim-slim'
Plugin 'tpope/vim-rails'
Plugin 'tpope/vim-markdown'
Plugin 'vim-scripts/Align'
Plugin 'ToadJamb/vim_alternate_file'
Plugin 'ToadJamb/vim_tab_number'
Plugin 'Keithbsmiley/swift.vim'
Plugin 'vim-multiple-cursors'
Plugin 'leafgarland/typescript-vim'
Plugin 'rking/ag.vim'
call vundle#end()
filetype plugin indent on
" Plugin settings
let g:instant_markdown_autostart = 0
autocmd BufNewFile,BufRead Capfile setf ruby
autocmd BufNewFile,BufRead Gemfile setf ruby
" System-level settings
set noswapfile " Turn off the use of swap files - seems to use them anyway
"set dir='' " Really turn off the use of swap files
" Behavior
set expandtab " Expand tabs to spaces
set tabstop=2 " Set tabs to two spaces (No conversion - just display)
set shiftwidth=2 " Use 2 spaces when shifting with '>' or '<'
set ignorecase " Ignore case in patterns.
set smartcase " Case-sensitive matching for patterns with an uppercase letter
set backspace=2 " Make backspace/delete work in insert mode.
set showcmd " Show current command
" Presentation - always visible
syntax on " Syntax highlighting
set number " Show line numbers in margin
set cursorline " Highlight the line the cursor is on
set fillchars=stl:-,vert:\| " Set the characters used to fill borders
let &stl='%t %([%R%M]%) %L %l,%c ' " Status line format
" Presentation - conditional
set nowrap " Do not wrap text
set hlsearch " Highligh search text
set laststatus=2 " Always show the status bar
set listchars=trail::,tab:-> " How trailing spaces & tabs should be represented (tabstop matters for tab)
set list " Required in order for listchars to work
set colorcolumn=80 " Right margin at 80 characters
" Performance - Primarily for Ruby - Any file around 200 lines has a problem.
" Solution found here:
" http://stackoverflow.com/questions/16902317/vim-slow-with-ruby-syntax-highlighting
"set ttyfast " When playing with these 3 options, this one seemed to have no effect.
"set re=1 " Use the old regex engine (default is 0).
set lazyredraw " Don't redraw the screen for every little thing.
" Features
set foldmethod=indent " Enable folding based on language syntax
set nofoldenable " Open files with all folds expanded
" Toggle folding using the space bar.
nnoremap <silent> <Space> #=(foldlevel('.')?'za':"\<Space>")<CR>
vnoremap <Space> zf
:let mapleader = ","
" Toggle buffers using leader
map <leader><leader> :b#<cr>
" Enter clears highlighting
nnoremap <cr> :nohlsearch<cr>
" Open alternate files
command AF :execute OpenAlternateFile()
map <silent> <leader>s :call OpenAlternateFile() <CR>
" Run tests
map <silent> <leader>t :call TriggerTest()<CR>
map <silent> <leader>r :call TriggerPreviousTest()<CR>
" Binding for Ag
map <leader>/ :Ag<space>
" Quickfix bindings
map <ENTER> :cn<CR>
" *** No Color Scheme ***
"hi! String ctermfg=00
"hi! LineNr ctermfg=04
"hi! CursorLine ctermfg=none ctermbg=07 cterm=none
" *** Miscellaneous ***
"let g:solarized_termcolors=16 " Local
"let g:solarized_termcolors=256 " Remote
"set background=light
color solarized

Vim cursor wrapping with .vimrc

I can't seem to get cursor wrapping to work in vim 7.3. I've tried suggestions found elsewhere, including the following, which have no effect:
:set whichwrap+=<,>
:set whichwrap+=>,l
:set whichwrap+=<,h
Any suggestions? I've included my .vimrc in case there is a conflict...
syntax on
":set whichwrap+=<,h
set whichwrap+=<,>,[,]
colorscheme koehler
noremap <tab> i
inoremap <Down> <C-o>gj
inoremap <Up> <C-o>gk
nnoremap ; :
nnoremap : ;
set more " use more prompt
set autoread " watch for file changes
set number " line numbers
set noautowrite " don't automagically write on :next
set lazyredraw " don't redraw when don't have to
set showmode
set showcmd
set nocompatible " vim, not vi
set autoindent smartindent " auto/smart indent
set smarttab " tab and backspace are smart
set tabstop=4 " 6 spaces
set shiftwidth=2
set scrolloff=5 " keep at least 5 lines above/below
set sidescrolloff=5 " keep at least 5 lines left/right
set history=200
set backspace=indent,eol,start
set linebreak
set cmdheight=2 " command line two lines high
set undolevels=1000 " 1000 undos
set updatecount=100 " switch every 100 chars
set complete=.,w,b,u,U,t,i,d " do lots of scanning on tab completion
set noerrorbells " No error bells please
set visualbell t_vb= " and don't make faces
filetype on " Enable filetype detection
filetype indent on " Enable filetype-specific indenting
filetype plugin on " Enable filetype-specific plugins
set wildmode=longest:full
set wildmenu " menu has tab completion
set laststatus=2
set incsearch " incremental search
set ignorecase " search ignoring case
set hlsearch " highlight the search
set showmatch " show matching bracket
set diffopt=filler,iwhite " ignore all whitespace and sync
if v:version >= 700
" Enable spell check for text files
autocmd BufNewFile,BufRead *.txt setlocal spell spelllang=en
endif
" mappings
" toggle list mode
nmap <LocalLeader>tl :set list!<cr>
" toggle paste mode
nmap <LocalLeader>pp :set paste!<cr>
The following line in your .vimrc is a conflict. Commenting out that line will probably fix the issue.
set nocompatible " vim, not vi
And for automatic wrap, I suggest you use this one and use more of h and l than the left & right arrow keys:
set whichwrap+=<,>,h,l,[,]
The issue is putting set nocompatible in the middle of your vimrc (I made the same mistake).
Actually nocompatible is set when a vimrc is detected, but set nocompatible has a side effect of resetting all options to default.
From :help nocompatible:
This is a special kind of option, because when it's set or reset, other options are also changed as a side effect.
NOTE: Setting or resetting this option can have a lot of unexpected
effects: Mappings are interpreted in another way, undo behaves
differently, etc. If you set this option in your vimrc file, you
should probably put it at the very start.

Vim Question: Sparkup doesn't work for files opened from a running Vim session

If I were to open a file with Vim from the command prompt (eg: vim ~/.vimrc), the Sparkup text generation seems to work perfectly fine. For example if I insert:
html:xs
and then push control + e, sparkup generates a nice HTML strict boilerplate. However if I then split to another file from the running Vim session, Sparkup stops working in the newly opened file. It's totally possible that other plugins lose their functionality as well. Here is my .vimrc file:
set nocompatible " use vim defaults
set number " show line numbers
set tags=tags;$HOME/.vim/tags/ "recursively searches directory for 'tags' file
set expandtab " tabs are converted to spac
set tabstop=4 " numbers of spaces of tab character
set shiftwidth=4 " numbers of spaces to (auto)indent
set showcmd " display incomplete commands
set incsearch " do incremental searching
set ruler " show the cursor position all the time
set numberwidth=4 " line numbering takes up 5 spaces
set ignorecase " ignore case when searching
set nowrap " stop lines from wrapping
set incsearch " show search matches as you type
call pathogen#helptags()
call pathogen#runtime_append_all_bundles()
filetype on " enables filetype detection
filetype plugin on " enables filetype specific plugins
filetype plugin indent on " Loads pyflake-vim's ftplugin files automatically when a Python buffer is opened
syntax on " syntax highlighing
colorscheme default
nmap <silent> <c-y> :NERDTreeToggle<CR>
nmap <silent> <c-o> :OpenBookmark
" TagList Plugin Configuration
let Tlist_Ctags_Cmd='/usr/bin/ctags' " point taglist to ctags
let Tlist_GainFocus_On_ToggleOpen = 1 " Focus on the taglist when its toggled
let Tlist_Close_On_Select = 1 " Close when something's selected
let Tlist_Use_Right_Window = 1 " Project uses the left window
let Tlist_File_Fold_Auto_Close = 1 " Close folds for inactive files
" Omnicompletion functions
set ofu=syntaxcomplete#complete
autocmd FileType python set omnifunc=pythoncomplete#Complete
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
au FileType py set expandtab
map <F2> :previous<CR> " map F2 to open previous buffer
map <F3> :next<CR> " map F3 to open next buffer
map <F5> :TlistToggle<CR> " map F5 to toggle the Tag Listing
map <silent><C-Left> <C-T> " taglist - map Ctrl-LeftArrow to jump to the method/property under your cursor
map <silent><C-Right> <C-]> " taglist - map Ctrl-RhitArrow to jump back to your source code
" Easy window navigation
map <C-h> <C-w>h
map <C-j> <C-w>j
map <C-k> <C-w>k
map <C-l> <C-w>l
" When vimrc is edited, reload it
autocmd! bufwritepost vimrc source ~/.vim_runtime/vimrc
highlight SpellBad term=reverse ctermbg=Gray ctermfg=Red
And here are some other plugins I have inside ~/.vim/bundles:
IndexedSearch nerdtree snipmate.vim vim-css-color vim-git vim-rails vim-ruby-debugger vim-supertab vim-tcomment
gist pyflakes-vim textile.vim vim-cucumber vim-haml vim-repeat vim-shoulda vim-surround vim-vividchalk
jquery pysmell vim-align vim-fugitive vim-markdown vim-ruby vim-sparkup vim-taglist
Can it be that this plugin is bound to a given FileType and that when you change window the FileType is not the same?
If it doesn't work, try adding your plugin to ftplugins.

Syntax highlighting in terminal vim but not gVIM

I am currently using VIM in the terminal and have perfect syntax highlighting happening. But then when I try to use gvim no matter what type of file or how many times I type: ":syntax on" I don't get any syntax highlighting. Any ideas anyone?
Thank you.
Here is my .vimrc for those who are interested:
" Turn on pathogen for all plug-ins installed after 9/13/2010
call pathogen#helptags()
call pathogen#runtime_append_all_bundles()
" My color theme for vim
colors sorcerer
" Disable line wrapping for now
set nowrap
" Enable the mouse even when vi is used in the terminal
set mouse=a
" Since I use linux, I want this
let g:clipbrdDefaultReg = '+'
" This shows what you are typing as a command. I love this!
set showcmd
" Automatically cd into the directory that the file is in
autocmd BufEnter * execute "chdir ".escape(expand("%:p:h"), ' ')
"Fix Vim's regex...
nnoremap / /\v
vnoremap / /\v
" Gimme some breathing room at the bottom please...
set scrolloff=5
" makes vim usable with screen
set restorescreen
" Disable the arrow keys... helps the learning
map <up> <nop>
map <down> <nop>
map <left> <nop>
map <right> <nop>
imap <up> <nop>
imap <down> <nop>
imap <left> <nop>
imap <right> <nop>
"Kill error bells
set noerrorbells
set visualbell
set t_vb=
" Turn on spell check
" set spell
" Thesaurus!!
set thesaurus+=/usr/share/myspell/dicts/mthesaur.txt
" Some NERDTree love
let NERDTreeBookmarksFile=expand("$HOME/.vim/NERDTreeBookmarks")
let NERDTreeShowBookmarks=1
let NERDTreeQuitOnOpen=1
let NERDTreeHighlightCursorline=1
let NERDTreeShowFiles=1
let NERDTreeShowHidden=1
" Make swapping windows easier...
map <C-h> <C-w>h
map <C-j> <C-w>j
map <C-k> <C-w>k
map <C-l> <C-w>l
" Allow for buffers to be hidden so that they need not be closed to go to
" another file
set hidden
" Turn on incremental search
set incsearch
set smartcase
" Long history is long
set history=1000
set undolevels=1000
" No need for a vi backup file
set nobackup
" Colors!!
set t_Co=256
" Compatibility
set nocompatible
set formatprg=par
" Syntastic!!
let g:syntastic_enable_signs=1
let g:syntastic_auto_loclist=1
let g:syntastic_quiet_warnings=0
" For soft wrapping text
command! -nargs=* Wrap set wrap linebreak nolist
set showbreak=…
" Sandro spacing preferences here
set number
set expandtab
set autoindent
set smartindent
set softtabstop=4
set shiftwidth=4
set shiftround
" Sandro key mapping here
map <F2> :NERDTreeToggle<CR>
"allow backspacing over everything in insert mode
set backspace=indent,eol,start
set showmode "show current mode down the bottom
"Setting the status line...
set statusline=%f "tail of the filename
"display a warning if the file format isn't Unix
set statusline+=%#warningmsg#
set statusline+=%{&ff!='unix'?'['.&ff.']':''}
set statusline+=%*
"display a warning if file encoding isn't UTf-8
set statusline+=%#warningmsg#
set statusline+=%{(&fenc!='utf-8'&&&fenc!='')?'['.&fenc.']':''}
set statusline+=%*
set statusline+=%h "help file flag
set statusline+=%y "filetype
set statusline+=%r "read only flag
set statusline+=%m "modified flag
"Syntastic!!
" set statusline+=%#warningmsg#
" set statusline+=%{SyntasticStatuslineFlag()}
" set statusline+=%*
" Auto completion options
set wildmode=list:longest "Change tab completion to be like Bash's
set wildignore=*.o,*.obj,*~,*.swp,*.pyc "Files to ignore on auto complete
"display tabs and trailing spaces
set list
" Use the same symbols as TextMate for tabstops and EOLs
set listchars=tab:▸\•,extends:»,precedes:«,trail:•
let g:pydiction_location='~/.vim/after/ftplugin/pydiction/complete-dict'
set sm
set ai
let java_highlight_all=1
let java_highlight_functions="style"
let java_allow_cpp_keywords=1
set tags=~/.tags
set complete=.,w,b,u,t,i
command W w !sudo tee % > /dev/null
" IMPORTANT: win32 users will need to have 'shell slash' set so that latex
" can be called correctly.
"set shell slash
" IMPORTANT: grep will sometimes skip displaying the file name if you
" search in a singe file. This will confuse Latex-Suite. Set your grep
" program to always generate a file-name.
"set grepprg=grep\ -nH\ $*
" OPTIONAL: Starting with Vim 7, the filetype of empty .tex files defaults to
" 'plaintex' instead of 'tex', which results in vim-latex not being loaded.
" The following changes the default filetype back to 'tex':
" let g:tex_flavor='latex'
filetype on " enables filetype detection
filetype plugin on " enables filetype specific plug-ins
syntax on
filetype indent on " OPTIONAL: This enables automatic indentation as you type.
" VIM 7.3 features here...
if v:version >= 703
set relativenumber
set undofile
endif
Use :let g:colors_name to see the name of the colourscheme that has been loaded, the value should be 'sorcerer', if it's not then something has gone seriously wrong
Type :hi Operator, you 'xxx' part should be coloured and you should see guifg=<color> in the output.
Put a new line at the top of your .vimrc containing just the word "finish", this will stop vim processing your .vimrc. Using :colors default and :syntax on should be enough to get syntax highlighting turned on. If this works then just move the finish line down through your .vimrc until you find the section that is breaking syntax highlighting.
On windows, gVim uses a file called _vimrc, so check for that as well.
When you type :version in gvim do you see +syntax listed in your features list?
Try comparing that to your regular Vim version. Maybe your gvim build didn't include the syntax highlighting feature.
The issue was fixed once I finally figured out how to get gvim 7.3. Then the syntax highlighting magically came.
Building on Thien's response, I also had the same experience (set syntax=on fails, the menu options succeed but only until Vim is restarted).
The menu option apparently triggers :syn=on, and adding that to _vimrc does enable syntax highlighting persistently where set syntax=on did not. I'll leave it to someone with more experience to explain the difference between those two.
set syntax=xxx was not working for me in gvim 7.3 on Windows XP although it did for vim in cygwin. To get syntax highlighting I had to go to Menu > Syntax > Show filetypes in menu > select syntax. I guess the menu command and the vim commands don't do the same thing with gvim on Windows.

Resources