Конфигурация


Конфигурация vim хранится в файлах: ~/.vimrc и ~/.gvimrc
Узнать какой именно файл используется можно прямо в vim командами:

:echo $VIM
:echo $MYVIMRC

У каждого свой конфиг Vim. У меня достаточно простой:

" VIM CONFIGURATION
"------------------
" -- vim-plug manager
call plug#begin('~/.vim/plug')
Plug 'preservim/nerdtree'
Plug 'dterei/VimCobaltColourScheme'
Plug 'tomasr/molokai'
Plug 'vim-scripts/xoria256.vim'
Plug 'nanotech/jellybeans.vim'
Plug 'vim-scripts/desert256.vim'
Plug 'marcweber/vim-addon-mw-utils'
Plug 'tomtom/tlib_vim'
Plug 'garbas/vim-snipmate'
Plug 'yegappan/taglist'
Plug 'preservim/tagbar'
Plug 'kien/ctrlp.vim'
Plug 'jlanzarotta/bufexplorer'
Plug 'preservim/nerdtree'
Plug 'vimwiki/vimwiki'
Plug 'vim-scripts/DrawIt'
Plug 'orel1/vim-txt2tags'
Plug 'yegappan/grep'
Plug 'davidoc/taskpaper.vim'
Plug 'hallison/vim-markdown'
Plug 'vim-pandoc/vim-pandoc'
call plug#end()



" --BELLS--
set noerrorbells
set visualbell

" --BACKUP--
set backup
set backupdir=/tmp
set noswapfile

" --UNDO--
set undofile
set undodir=~/.vim/undo

" --WORKDIR--
set dir=~/.vim

" --RUS-ENG--
" Ctrl+^ = rus-eng
set keymap=russian-jcukenwin
set iminsert=0
set imsearch=0
highlight lCursor guifg=NONE guibg=Cyan

" --FOLDING--
set foldenable
set foldmethod=manual
set foldcolumn=3
set foldlevel=10
"let perl_folding=1
"let php_folding=1

" --SYNTAX--
syntax on

" --PLUGINS--
filetype indent on
filetype plugin on

" --INDENT--
set autoindent
set smartindent
set tabstop=4
set softtabstop=4
set shiftwidth=4
set expandtab

" --TAB-EXCEPTION--
autocmd filetype crontab,fstab,make,*.snippet 
  set noexpandtab tabstop=8 shiftwidth=8

" --LINE-NO--
set number

" --CURSOR--
set cursorline

" --CASE--
set ignorecase

" --SEARCH--
set hlsearch

" --MODE--
set showcmd
set showmode

" --RULER--
set ruler

" --BRACKETS--
set showmatch

" --TERM--
" /usr/share/termcap/*
set term=rxvt
"set term=rxvt-256color
"set term=rxvt-unicode-256color

" --WINHEIGHT--
"set winheight=999

" --STOREBUF--
set hidden

" --SPECCHARS--
set list listchars=tab:··

" --ENCODING--
set encoding=utf-8

" --COLORS--
set t_Co=256
color xoria256
"color molokai
"color desert256
"color jellybeans
"color oceandeep

" --GUI--
set guifont=Terminus 8
set statusline=> %f%m%r%h%w [%{&ff}] [A%03.3b] [H%02.2B] %=[%04l,%04v] [%p%%] [%L]
set laststatus=2
highlight statusline ctermbg=6 ctermfg=8 guibg=grey guifg=black


" --REMAP-Fx--
nmap    <ESC>[11^    <C-F1>
nmap    <ESC>[12^    <C-F2>
nmap    <ESC>[13^    <C-F3>
nmap    <ESC>[14^    <C-F4>
nmap    <ESC>[15^    <C-F5>
nmap    <ESC>[17^    <C-F6>
nmap    <ESC>[18^    <C-F7>
nmap    <ESC>[19^    <C-F8>
nmap    <ESC>[20^    <C-F9>
nmap    <ESC>[21^    <C-F10>
nmap    <ESC>[23^    <C-F11>
nmap    <ESC>[24^    <C-F12>

nmap    <ESC>[5^    <C-PageUp>
nmap    <ESC>[6^    <C-PageDown>
nmap    <ESC>[7^    <C-Home>
nmap    <ESC>[8^    <C-End>
nmap    <ESC>[7$    <S-Home>

" --REMAP--
map <C-h> <Esc>:bp<CR>
map <C-l> <Esc>:bn<CR>
map <C-k> <Esc>:bdelete<CR>
map <C-j> <Esc>:browse tabnew<CR>
map <C-PageUp> <Esc>:tabprevious<CR>
map <C-PageDown> <Esc>:tabnext<CR>

" --NAV-CHANGE--
nnoremap <F9> <Esc>[c
nnoremap <F10> <Esc>]c

" --NAV-ERROR--
nmap <F11> <Esc>:cp<CR>
nmap <F12> <Esc>:cn<CR>

" --NAV-DIFF--
nnoremap <C-Home> <Esc>:diffput
nnoremap <C-End> <Esc>:diffget
nnoremap <S-Home> <Esc>:diffupdate

" --PLUGS--
nmap <C-F2> <Esc>:NERDTreeToggle<CR>
nmap <C-F3> <Esc>:TlistToggle<CR>
nmap <C-F4> <Esc>:CtrlPBuffer<CR>
nmap <C-F5> <Esc>:CtrlPTag<CR>
nmap <C-F6> <Esc>:BufExplorer<CR>


" --LEADER---
nmap <leader>nn :NERDTreeToggle<cr>
nmap <leader>tt :TlistToggle<cr>
nmap <leader>rr :NERDTreeFind<cr>


" tab-autocomplete
function! CleverTab()
   if strpart( getline('.'), 0, col('.')-1 ) =~ '^s*$'
      return "<Tab>"
   else
      return "<C-N>"
   endif
endfunction
inoremap <Tab> <C-R>=CleverTab()<CR>

"function InsertTabWrapper()
"     let col = col('.') - 1
"     if !col || getline('.')[col - 1] !~ 'k'
"         return "<tab>"
"     else
"         return "<c-p>"
"     endif
"endfunction
"imap <tab> <c-r>=InsertTabWrapper()<cr>

" --COMPLETE--
set complete=""
" source1 - current buffer
set complete+=.
" source2 - dictionary
set complete+=k
" source3 - other buffers
set complete+=b
" source4 - tags
set complete+=t

" --DICT--
set dictionary+=~/.vim/dict/PHP.dict


" ================
" --PLUGINS-OPTS--
" ================

" --TAGLIST--
let Tlist_Show_One_File = 1
let Tlist_Show_Menu = 1

" --NERDTREE--
let NERDTreeHijackNetrw = 0
let NERDTreeShowBookmarks = 1
let NERDTreeQuitOnOpen = 1
"autocmd VimEnter * NERDTree
"autocmd VimEnter * wincmd p
"autocmd VimEnter * lcd %:p:h

" --SESSION--
let g:session_autosave = 'no'
let g:session_autoload = 'no'
let g:session_directory = '.'

" --WIKI--
let wiki_1 = {}
let wiki_1.path = '~/.vim/wiki1/'
let wiki_1.path_html = '~/.vim/wiki1-html/'

let wiki_2 = {}
let wiki_2.path = '~/.vim/wiki2/'
let wiki_2.path_html = '~/.vim/wiki2-html/'
let wiki_2.nested_syntaxes = {'python': 'python', 'c++': 'cpp'}

let wiki_ts = {}
let wiki_ts.name = 'tab2spr'
let wiki_ts.path = '/home/tab2txt/wiki/'
let wiki_ts.path_html = '/home/tab2txt/html/'
let wiki_ts.template_path = '/home/tab2txt/wiki/'
let wiki_ts.template_default = 'default'
let wiki_ts.template_ext = '.tpl'
let wiki_ts.css_name = 'main.css'

let g:vimwiki_list = [wiki_1, wiki_2]

" --SNIPMATE--
let g:snips_author = 'SunDoctor'

" --MENU--
set wildmenu
set wildcharm=<Tab>
menu Exec.quit-vim   :wqa!
menu Exec.bash-256c  :!export TERM=rxvt-unicode-256color && /bin/bash<CR>
menu Exec.bash       :!/bin/bash<CR>
menu Exec.mc         :!mc<CR>
map <C-m>            :emenu Exec.<Tab>

" --PATCH--
"starts vim in replace mode?
nnoremap <silent><esc> :noh<return><esc>

" --USE--
" NERDTree
" TagList
" CtrlP
" SnipMate
" VDebug
" VimWiki
" DrawIt
" BufExplorer
" txt2tags

" EOF

Для переключения Vim в en_US.UTF-8 внутри Windows можно добавить:

set enc=utf-8
set fileencoding=utf-8
set langmenu=en_US.UTF-8
let $LANG='en_US.UTF-8'
language messages en

и запускать gvim с помощью ключа:

gvim --cmd "lang English_United States"