Install vim 8.0 (and gvim) with choco install vim
.
Don't install gvim with its installer, it can't handle path corretly in cmder.
Install junegunn/vim-plug for gvim on Windows: copy plug.vim into folder c:\Program Files (x86)\Vim\vim80\autoload.
Add the following lines into .vimrc (open it with :e $MYVIMRC
in vim):
call plug#begin('~/.vim/plugged')
Plug 'posva/vim-vue', { 'for': 'vue' }
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
call plug#end()
Install plugins with :PlugInstall
.
Note 1:
Find .vimrc file location with :echo expand('~')
or :echo $HOME
.
Note 2: The gvim installer doesn't contains vim, so you have to use cmder's vim in git-for-windows folder, which will result in 2 vim environments.
Note 3: The font of vim in console is set up in the cmder. vim itself has no indenpendent font to set up.
Note 4: my .vimrc and .gvimrc files:
.vimrc:
set nocompatible
set clipboard=unnamed
set autowrite
set splitbelow
set splitright
nnoremap <F2> :set wrap!<CR>
let mapleader=","
let maplocalleader = ","
set nobackup
set noswapfile
" code folding
set foldmethod=indent
set foldnestmax=2
nnoremap <space> za
set laststatus=2
" JavaScript code folding
"set foldmethod=syntax
"set foldlevelstart=4
"let javaScript_fold=1
" vim-go
autocmd FileType go nmap <leader>b <Plug>(go-build)
autocmd FileType go nmap <leader>r <Plug>(go-run)
autocmd FileType go nmap <leader>t <Plug>(go-test)
let g:go_auto_type_info = 0
" nerdtree
nnoremap <C-i> :NERDTreeToggle<CR>
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
syntax on
" Font color for line longer than 80 characters
highlight OverLength ctermfg=cyan guibg=#592929
match OverLength /\%81v.\+/
set incsearch
set et
set sw=2
set ts=2
set nu
set nowrap
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
nnoremap ; :
nnoremap : ;
vnoremap ; :
vnoremap : ;
" undo & undotree configs
set undodir=$HOME/.vim/undo/ "make sure this folder exists
set undofile
set undolevels=1000
set undoreload=10000
cabbrev ss set spell!<CR>
cabbrev mt MBEToggle<CR>
cabbrev mru MBEToggleMRU<CR>
cabbrev vb vert sb
cabbrev tt TagbarToggle<CR>
cabbrev nt NERDTreeToggle<CR>
call plug#begin('~/.vim/plugged')
Plug 'posva/vim-vue', { 'for': 'vue' }
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
Plug 'fatih/vim-go', { 'do': ':GoInstallBinaries' }
Plug 'fholgado/minibufexpl.vim'
Plug 'geoffharcourt/vim-matchit'
Plug 'vim-airline/vim-airline'
Plug 'scrooloose/nerdcommenter'
Plug 'scrooloose/nerdtree'
Plug 'kien/ctrlp.vim'
call plug#end()
filetype plugin indent on
.gvimrc:
set encoding=utf-8
set guioptions-=T
set guioptions-=m
set noswapfile
set nobackup
set guifont=Consolas:h12
colo koehler
nnoremap ; :
nnoremap : ;
vnoremap ; :
vnoremap : ;
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>