1
0
Fork 0
dotfiles/.vimrc

224 lines
6.2 KiB
VimL

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
call plugpac#begin()
Pack 'junegunn/vim-plug'
Pack 'crusoexia/vim-monokai'
Pack 'tpope/vim-sensible'
Pack 'neoclide/coc.nvim', {'tag': '*', 'do': { -> coc#util#install()}}
Pack 'editorconfig/editorconfig-vim'
Pack 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
Pack 'majutsushi/tagbar'
Pack 'tpope/vim-commentary'
Pack 'airblade/vim-gitgutter'
Pack 'vim-airline/vim-airline'
Pack 'vim-airline/vim-airline-themes'
Pack 'honza/vim-snippets'
Pack 'isRuslan/vim-es6'
Pack 'algotech/ultisnips-php'
Pack 'qpkorr/vim-bufkill'
Pack 'pseewald/vim-anyfold'
Pack 'kchmck/vim-coffee-script', { 'for': 'coffee' }
Pack 'StanAngeloff/php.vim', { 'for': 'php' }
Pack '2072/PHP-Indenting-for-VIm', { 'for': 'php' }
Pack 'antoyo/vim-licenses'
Pack 'docunext/closetag.vim', { 'for': ['php', 'html', 'md'] }
" GPG support
" Plugin 'mhinz/vim-signify'
" Plugin 'godlygeek/tabular'
Pack 'plasticboy/vim-markdown', { 'for': ['markdown', 'md'] }
Pack 'junegunn/goyo.vim'
" Plugin 'joonty/vdebug'
" Fountain support
Pack 'kblin/vim-fountain', { 'for': 'fountain' }
Pack 'leafgarland/typescript-vim', { 'for': ['ts', 'typescript' ]}
Pack 'jason0x43/vim-js-indent', { 'for': ['js', 'javascript']}
" Plugin 'Quramy/tsuquyomi'
Pack 'evidens/vim-twig', { 'for': 'twig' }
Pack 'jwalton512/vim-blade', { 'for': ['blade', 'blade.php']}
Pack 'elzr/vim-json', { 'for': 'json' }
Pack 'mustache/vim-mustache-handlebars', { 'for': ['mustache', 'handlebars'] }
Pack 'maksimr/vim-jsbeautify', { 'for': ['js', 'javascript'] }
Pack 'roxma/LanguageServer-php-neovim', {'do': 'composer install && composer run-script parse-stubs'}
Pack 'otommod/twee-sugarcube.vim', {'for': ['twee']}
let g:ale_completion_enabled = 1
Pack 'w0rp/ale'
call plugpac#end()
filetype plugin indent on
syntax enable
colorscheme monokai
set termguicolors
let g:monokai_term_italic = 1
" 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
au BufRead,BufNewFile *.twee set filetype=twee
au BufRead,BufNewFile *.tw set filetype=twee
au BufRead,BufNewFile *.tw2 set filetype=twee
autocmd FileType html,htmldjango,jinjahtml,eruby,mako let b:closetag_html_style=1
if !has('nvim')
set ttymouse=xterm2
endif
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'] = ['.']
autocmd Filetype * AnyFoldActivate
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'],
\ 'scss': ['sasslint'],
\}
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 <LeftRelease> "*ygv
" 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
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']
let g:airline_theme='luna'
let g:airline_extensions = ['tagbar','ale']
let g:airline_highlighting_cache = 1
let g:airline#extensions#ale#enabled = 1
map <C-b> :NERDTreeToggle<CR>
let NERDTreeIgnore=['\\.pyc', '\\\~$', '\\.swo$', '\\.swp$', '\\.git', '\\.hg', '\\.svn', '\\.bzr']
let NERDTreeQuitOnOpen=1
" disable default plugins
let g:loaded_2html_plugin = 1
let g:loaded_rrhelper = 1
let g:loaded_remote_plugins = 1
let g:loaded_netrwPlugin = 1
let g:loaded_spellfile_plugin = 1
let g:loaded_shada_plugin = 1