2018-09-21 15:43:53 +03:00
|
|
|
set nocompatible
|
|
|
|
filetype off
|
|
|
|
set background=light
|
|
|
|
|
|
|
|
let g:python_host_prog = '/usr/bin/python2'
|
|
|
|
let g:python3_host_prog = '/usr/bin/python3'
|
|
|
|
let g:ruby_host_prog = 'rvm system do neovim-ruby-host'
|
|
|
|
let g:node_host_prog = '/usr/lib/node_modules/neovim/bin/cli.js'
|
|
|
|
set clipboard+=unnamedplus
|
|
|
|
|
2018-09-21 16:34:28 +03:00
|
|
|
function! BuildYCM(info)
|
|
|
|
" info is a dictionary with 3 fields
|
|
|
|
" - name: name of the plugin
|
|
|
|
" - status: 'installed', 'updated', or 'unchanged'
|
|
|
|
" - force: set on PlugInstall! or PlugUpdate!
|
|
|
|
if a:info.status == 'installed' || a:info.force
|
|
|
|
!./install.py
|
|
|
|
endif
|
|
|
|
endfunction
|
|
|
|
|
2018-09-21 15:56:17 +03:00
|
|
|
" Specify a directory for plugins
|
|
|
|
" - For Neovim: ~/.local/share/nvim/plugged
|
|
|
|
" - Avoid using standard Vim directory names like 'plugin'
|
|
|
|
call plug#begin('~/.vim/plugged')
|
2018-09-21 15:43:53 +03:00
|
|
|
|
2018-09-21 15:56:17 +03:00
|
|
|
Plug 'junegunn/vim-plug'
|
2018-09-21 15:43:53 +03:00
|
|
|
|
2018-09-21 15:56:17 +03:00
|
|
|
Plug 'tpope/vim-sensible'
|
2018-09-21 16:34:28 +03:00
|
|
|
Plug 'Valloric/YouCompleteMe', { 'do': function('BuildYCM') }
|
2018-09-21 15:56:17 +03:00
|
|
|
Plug 'docunext/closetag.vim'
|
|
|
|
Plug 'editorconfig/editorconfig-vim'
|
|
|
|
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
|
|
|
|
Plug 'majutsushi/tagbar'
|
|
|
|
Plug 'tpope/vim-commentary'
|
|
|
|
Plug 'airblade/vim-gitgutter'
|
2018-09-21 16:33:05 +03:00
|
|
|
Plug 'antoyo/vim-licenses', { 'for': ['php', 'js', 'coffee'] }
|
2018-09-21 15:43:53 +03:00
|
|
|
|
2018-09-21 15:56:17 +03:00
|
|
|
Plug 'Shougo/neosnippet'
|
|
|
|
Plug 'Shougo/neosnippet-snippets'
|
2018-09-21 15:43:53 +03:00
|
|
|
|
2018-09-21 15:56:17 +03:00
|
|
|
Plug 'qpkorr/vim-bufkill'
|
|
|
|
Plug 'pseewald/vim-anyfold'
|
|
|
|
|
|
|
|
Plug 'kchmck/vim-coffee-script', { 'for': 'coffee' }
|
|
|
|
Plug 'StanAngeloff/php.vim', { 'for': 'php' }
|
2018-09-21 15:43:53 +03:00
|
|
|
" GPG support
|
|
|
|
" Plugin 'mhinz/vim-signify'
|
|
|
|
" Plugin 'godlygeek/tabular'
|
2018-09-21 15:56:17 +03:00
|
|
|
Plug 'plasticboy/vim-markdown'
|
|
|
|
Plug 'junegunn/goyo.vim', { 'for': 'markdown' }
|
2018-09-21 15:43:53 +03:00
|
|
|
" Plugin 'joonty/vdebug'
|
|
|
|
" Fountain support
|
2018-09-21 15:56:17 +03:00
|
|
|
Plug 'kblin/vim-fountain', { 'for': 'fountain' }
|
|
|
|
Plug 'leafgarland/typescript-vim', { 'for': ['ts', 'typescript' ]}
|
|
|
|
Plug 'jason0x43/vim-js-indent', { 'for': ['js', 'javascript']}
|
2018-09-21 15:43:53 +03:00
|
|
|
" Plugin 'Quramy/tsuquyomi'
|
2018-09-21 15:56:17 +03:00
|
|
|
Plug 'evidens/vim-twig', { 'for': 'twig' }
|
|
|
|
Plug 'jwalton512/vim-blade', { 'for': ['blade', 'blade.php']}
|
|
|
|
Plug 'elzr/vim-json', { 'for': 'json' }
|
|
|
|
Plug 'mustache/vim-mustache-handlebars', { 'for': ['mustache', 'handlebars'] }
|
2018-09-21 15:43:53 +03:00
|
|
|
|
2018-09-21 15:56:17 +03:00
|
|
|
Plug 'maksimr/vim-jsbeautify', { 'for': 'js' }
|
2018-09-21 15:43:53 +03:00
|
|
|
|
2018-09-21 15:56:17 +03:00
|
|
|
call plug#end()
|
2018-09-21 15:43:53 +03:00
|
|
|
filetype plugin indent on
|
|
|
|
|
|
|
|
syntax enable
|
|
|
|
" let g:solarized_termcolors=256
|
|
|
|
" colorscheme solarized
|
|
|
|
" set lines=40 " 40 lines of text instead of 24,
|
|
|
|
if !has('win32') && !has('win64') && !has('nvim')
|
|
|
|
set term=$TERM " Make arrow and other keys work
|
|
|
|
endif
|
|
|
|
set mouse=a
|
|
|
|
|
|
|
|
set showtabline=1
|
|
|
|
set smartindent
|
|
|
|
set nu
|
|
|
|
set tabstop=2
|
|
|
|
set shiftwidth=2
|
|
|
|
set expandtab
|
|
|
|
set stal=2
|
|
|
|
set lbr
|
|
|
|
set wrap
|
|
|
|
set fencs=utf-8,default,cp1251,cp866
|
|
|
|
set backspace=indent,eol,start " backspace for dummys
|
|
|
|
set linespace=0 " No extra spaces between rows
|
|
|
|
set foldenable " auto fold code
|
|
|
|
set hidden " any buffer can be hidden (keeping its changes) without first writing the buffer to a file
|
|
|
|
set synmaxcol=500
|
|
|
|
|
|
|
|
set cursorline
|
|
|
|
set colorcolumn=110
|
|
|
|
"set dir=.,/var/tmp,/tmp
|
|
|
|
set noswapfile
|
|
|
|
au BufRead,BufNewFile *.tpl set filetype=smarty
|
|
|
|
au BufRead,BufNewFile *.cson set filetype=coffee
|
|
|
|
autocmd FileType html,htmldjango,jinjahtml,eruby,mako let b:closetag_html_style=1
|
|
|
|
autocmd FileType html,xhtml,xml,htmldjango,jinjahtml,eruby,mako source ~/.vim/bundle/closetag.vim/plugin/closetag.vim
|
|
|
|
|
|
|
|
if !has('nvim')
|
|
|
|
set ttymouse=xterm2
|
|
|
|
endif
|
|
|
|
|
|
|
|
" autocmd vimenter * NERDTree
|
|
|
|
map <C-b> :NERDTreeToggle<CR>
|
|
|
|
let NERDTreeIgnore=['\\.pyc', '\\\~$', '\\.swo$', '\\.swp$', '\\.git', '\\.hg', '\\.svn', '\\.bzr']
|
|
|
|
let NERDTreeQuitOnOpen=1
|
|
|
|
|
|
|
|
map <C-j> <C-W>j<C-W>_
|
|
|
|
map <C-k> <C-W>k<C-W>_
|
|
|
|
map <C-h> <C-W>h<C-W>_
|
|
|
|
map <C-l> <C-W>l<C-W>_
|
|
|
|
map ; :
|
|
|
|
:command Wq wq
|
|
|
|
:command WQ wq
|
|
|
|
:command W w
|
|
|
|
:command Q q
|
|
|
|
|
|
|
|
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
|
|
|
|
|
|
|
|
" autocmd StdinReadPre * let s:std_in=1
|
|
|
|
" autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
|
|
|
|
|
|
|
|
nmap \; :TagbarToggle<CR>
|
|
|
|
|
|
|
|
if filereadable(expand("\~/.vimrc.local"))
|
|
|
|
source \~/.vimrc.local
|
|
|
|
endif
|
|
|
|
|
|
|
|
nnoremap <leader>l :TagbarToggle<CR>
|
|
|
|
" let g:vim_markdown_folding_disabled = 1
|
|
|
|
let g:vim_markdown_folding_level = 4
|
|
|
|
let g:vim_markdown_conceal = 0
|
|
|
|
|
|
|
|
" TypeScript autocompletion
|
|
|
|
if !exists("g:ycm_semantic_triggers")
|
|
|
|
let g:ycm_semantic_triggers = {}
|
|
|
|
endif
|
|
|
|
let g:ycm_semantic_triggers['typescript'] = ['.']
|
|
|
|
|
|
|
|
let anyfold_activate=1
|
|
|
|
set foldlevel=4
|
|
|
|
autocmd User anyfoldLoaded normal zv
|
|
|
|
set laststatus=1
|
|
|
|
let g:ale_lint_on_save = 1
|
|
|
|
let g:ale_lint_on_text_changed = 0
|
|
|
|
|
|
|
|
" Let's save undo info!
|
|
|
|
if !isdirectory($HOME."/.vim")
|
|
|
|
call mkdir($HOME."/.vim", "", 0770)
|
|
|
|
endif
|
|
|
|
if !isdirectory($HOME."/.vim/undo-dir")
|
|
|
|
call mkdir($HOME."/.vim/undo-dir", "", 0700)
|
|
|
|
endif
|
|
|
|
|
|
|
|
" persistent undo
|
|
|
|
set undodir=~/.vim/undo-dir
|
|
|
|
set undofile
|
|
|
|
set undolevels=1000 " How many undos
|
|
|
|
set undoreload=10000 " number of lines to save for undo
|
|
|
|
|
|
|
|
" copy with mouse selection
|
|
|
|
vnoremap <LeftRelease> "*ygv
|
|
|
|
|
|
|
|
" neosnippet
|
|
|
|
imap <c-q> <Plug>(neosnippet_expand_or_jump)
|
|
|
|
smap <c-q> <Plug>(neosnippet_expand_or_jump)
|
|
|
|
xmap <c-q> <Plug>(neosnippet_expand_target)
|
|
|
|
|
|
|
|
" Enable snipMate compatibility feature.
|
|
|
|
" let g:neosnippet#enable_snipmate_compatibility = 1
|
|
|
|
" Tell Neosnippet about the other snippets
|
|
|
|
" let g:neosnippet#snippets_directory='~/.vim/bundle/vim-snippets/snippets'
|
|
|
|
|
|
|
|
" For conceal markers.
|
|
|
|
if has('conceal')
|
|
|
|
set conceallevel=2 concealcursor=niv
|
|
|
|
let g:tex_conceal = ""
|
|
|
|
endif
|
|
|
|
|
|
|
|
map <c-f> :call JsBeautify()<cr>
|
|
|
|
|
|
|
|
" Stick with the UTF-8 encoding.
|
|
|
|
if has('multi_byte')
|
|
|
|
" Encoding used for the terminal.
|
|
|
|
if empty(&termencoding)
|
|
|
|
let &termencoding = &encoding
|
|
|
|
endif
|
|
|
|
|
|
|
|
" Encoding used in buffers, registers, strings in expressions, "viminfo"
|
|
|
|
" file, etc.
|
|
|
|
set encoding=utf-8
|
|
|
|
|
|
|
|
" Encoding used for writing files.
|
|
|
|
setglobal fileencoding=utf-8
|
|
|
|
endif
|
|
|
|
|
|
|
|
" Use both Unix and DOS file formats, but favor the Unix one for new files.
|
|
|
|
set fileformats=unix,dos
|
2018-09-21 16:33:05 +03:00
|
|
|
|
|
|
|
let g:licenses_copyright_holders_name = 'Alexander Yakovlev <keloero@oreolek.ru>'
|
|
|
|
" let g:licenses_authors_name = 'Alexander Yakovlev <keloero@oreolek.ru>'
|
|
|
|
let g:licenses_default_commands = ['gpl', 'affero', 'isc']
|