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 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 " Specify a directory for plugins " - For Neovim: ~/.local/share/nvim/plugged " - Avoid using standard Vim directory names like 'plugin' call plug#begin('~/.vim/plugged') Plug 'junegunn/vim-plug' Plug 'tpope/vim-sensible' Plug 'Valloric/YouCompleteMe', { 'do': function('BuildYCM') } Plug 'editorconfig/editorconfig-vim' Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } Plug 'majutsushi/tagbar' Plug 'tpope/vim-commentary' Plug 'airblade/vim-gitgutter' Plug 'vim-airline/vim-airline' Plug 'vim-airline/vim-airline-themes' Plug 'Shougo/neosnippet' Plug 'Shougo/neosnippet-snippets' Plug 'qpkorr/vim-bufkill' Plug 'pseewald/vim-anyfold' Plug 'kchmck/vim-coffee-script', { 'for': 'coffee' } Plug 'StanAngeloff/php.vim', { 'for': 'php' } Plug 'antoyo/vim-licenses' Plug 'docunext/closetag.vim', { 'for': ['php', 'html', 'md'] } " GPG support " Plugin 'mhinz/vim-signify' " Plugin 'godlygeek/tabular' Plug 'plasticboy/vim-markdown', { 'for': ['markdown', 'md'] } Plug 'junegunn/goyo.vim' " Plugin 'joonty/vdebug' " Fountain support Plug 'kblin/vim-fountain', { 'for': 'fountain' } Plug 'leafgarland/typescript-vim', { 'for': ['ts', 'typescript' ]} Plug 'jason0x43/vim-js-indent', { 'for': ['js', 'javascript']} " Plugin 'Quramy/tsuquyomi' 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'] } Plug 'maksimr/vim-jsbeautify', { 'for': ['js', 'javascript'] } let g:ale_completion_enabled = 1 Plug 'w0rp/ale' call plug#end() 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 au BufRead,BufNewFile *.heml set filetype=html autocmd FileType html,htmldjango,jinjahtml,eruby,mako let b:closetag_html_style=1 if !has('nvim') set ttymouse=xterm2 endif " autocmd vimenter * NERDTree map :NERDTreeToggle let NERDTreeIgnore=['\\.pyc', '\\\~$', '\\.swo$', '\\.swp$', '\\.git', '\\.hg', '\\.svn', '\\.bzr'] let NERDTreeQuitOnOpen=1 map j_ map k_ map h_ map l_ 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 if filereadable(expand("\~/.vimrc.local")) source \~/.vimrc.local endif nnoremap l :TagbarToggle " 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 " if you don't want linters to run on opening a file let g:ale_lint_on_enter = 0 let g:ale_linters = { \ 'javascript': ['eslint'], \ 'php': ['php'] \} let g:ale_fixers = { \ '*': ['remove_trailing_lines', 'trim_whitespace'], \ 'javascript': ['eslint'], \ 'php': ['phpcbf'], \} " 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 "*ygv " neosnippet imap (neosnippet_expand_or_jump) smap (neosnippet_expand_or_jump) xmap (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 :call JsBeautify() " 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 let g:licenses_copyright_holders_name = 'Alexander Yakovlev ' " let g:licenses_authors_name = 'Alexander Yakovlev ' let g:licenses_default_commands = ['gpl', 'affero', 'isc'] let g:airline_theme='luna' let g:airline_extensions = ['tagbar','hunks','ale'] let g:airline_highlighting_cache = 1 let g:airline#extensions#ale#enabled = 1