Skip to content

Instantly share code, notes, and snippets.

@nikneroz

nikneroz/init.vim

Last active May 5, 2019
Embed
What would you like to do?
Neovim config
if &compatible
set nocompatible " Be iMproved
endif
" Required:
set runtimepath+=~/.cache/dein/repos/github.com/Shougo/dein.vim
set clipboard=unnamed
set modifiable
" Required:
if dein#load_state('/Users/rozenkin/.cache/dein')
call dein#begin('/Users/rozenkin/.cache/dein')
" Required:
call dein#add('/Users/rozenkin/.cache/dein/repos/github.com/Shougo/dein.vim')
" Syntax checker
call dein#add('w0rp/ale')
" Vim eco-system:
call dein#add('ctrlpvim/ctrlp.vim')
call dein#add('vim-airline/vim-airline')
call dein#add('vim-airline/vim-airline-themes')
" Utils for development
call dein#add('mileszs/ack.vim')
call dein#add('eugen0329/vim-esearch')
call dein#add('terryma/vim-multiple-cursors')
call dein#add('airblade/vim-gitgutter')
call dein#add('tpope/vim-surround')
call dein#add('scrooloose/nerdcommenter')
call dein#add('scrooloose/nerdtree')
call dein#add('tpope/vim-fugitive')
" Syntax plugins
call dein#add('joukevandermaas/vim-ember-hbs')
call dein#add('elzr/vim-json')
call dein#add('slim-template/vim-slim')
call dein#add('kchmck/vim-coffee-script')
call dein#add('plasticboy/vim-markdown')
call dein#add('elixir-lang/vim-elixir')
call dein#add('pangloss/vim-javascript')
call dein#add('mxw/vim-jsx')
call dein#add('tomlion/vim-solidity')
call dein#add('posva/vim-vue')
call dein#add('digitaltoad/vim-pug')
" Autocomplete
call dein#add('Shougo/deoplete.nvim')
call dein#add('Shougo/neosnippet.vim')
call dein#add('Shougo/neosnippet-snippets')
" Themes
call dein#add('flazz/vim-colorschemes')
call dein#add('xolox/vim-misc')
call dein#add('xolox/vim-colorscheme-switcher')
" Required:
call dein#end()
call dein#save_state()
endif
" Required:
filetype plugin indent on
syntax enable
set undofile
set undodir=~/.config/nvim/undodir
" If you want to install not installed plugins on startup.
if dein#check_install()
call dein#install()
endif
" Favorite themes: iceberg hybrid solarized bvemu busybee monokai Molokai wombat256mod Tomorrow-Night up lilypink 256-grayvim 256-jungle babymate256 blacklight 1989
colorscheme up
set encoding=utf-8
set termencoding=utf-8
set backupcopy=yes
set hlsearch
set backspace+=start,eol,indent
set number
set smartindent
set tabstop=2
set shiftwidth=2
set expandtab
set termguicolors
set fillchars+=stl:\ ,stlnc:\
set laststatus=2
set lazyredraw
set lz
set colorcolumn=120
set hid
set re=1
set nofoldenable
set shell=/usr/local/bin/fish
autocmd FileType vue syntax sync fromstart
let mapleader = "\<Space>"
let g:deoplete#enable_at_startup = 1
let g:airline_powerline_fonts = 1
let g:NERDSpaceDelims = 1
let g:NERDCustomDelimiters = { 'javascript.jsx': { 'left': '//', 'leftAlt': '{/*', 'rightAlt': '*/}' } }
let g:NERDTreeChDirMode = 2
let g:ctrlp_working_path_mode = 'rw'
let g:ale_linters = {
\ 'javascript': ['eslint'],
\ 'elixir': ['mix_format']
\ } "Lint js with eslint
" let g:ale_fixers = {'javascript': ['prettier', 'eslint']} "Fix eslint errors
" let g:ale_javascript_prettier_options = '--print-width 100' "Set max width to 100 chars for prettier
let g:ale_sign_error = '🚩'
let g:ale_sign_warning = ''
let g:ale_lint_on_enter = 1
let g:ale_lint_on_save = 1
" Avaliable themes: 'wombat' 'solarized' 'molokai' 'tomorrow' 'base16'
let g:airline_theme='wombat'
let g:airline_powerline_fonts = 1
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#branch#enabled = 1
let g:airline#extensions#branch#empty_message = 'No branch!'
let g:airline#extensions#branch#use_vcscommand = 0
let g:airline#extensions#branch#displayed_head_limit = 10
let g:airline#extensions#ale#enabled = 1
" + Search by filename
if executable('ag')
let g:esearch = {
\ 'adapter': 'ag',
\ 'backend': 'nvim',
\ 'out': 'qflist',
\ 'batch_size': 1000,
\ 'use': ['visual', 'hlsearch', 'last'],
\ 'default_mappings': 1,
\}
let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""'
let g:ctrlp_use_caching = 0
endif
" - Search by filename
" + Fast buffer switchers
nmap <c-j> <c-w>j
nmap <c-k> <c-w>k
nmap <c-h> <c-w>h
nmap <c-l> <c-w>l
" - Fast buffer switchers
" + Buffers switch
nnoremap <Leader>[ :bprevious<cr>
nnoremap <Leader>] :bnext<cr>
" - Buffers switch
" + Terminal: exit from insert mode and switch tab
tnoremap <Leader>[ <C-\><C-n>:bprevious<cr>
tnoremap <Leader>] <C-\><C-n>:bnext<cr>
" - Terminal: exit from insert mode and switch tab
" + Open NerdTree
nmap <c-i> :NERDTreeToggle<cr>
" - Open NerdTree
" + ColorTheme Switch
nnoremap <Leader>p :NextColorScheme<cr>
nnoremap <Leader>o :PrevColorScheme<cr>
" - ColorTheme Switch
" + Expand neosnippet inside of Deoplete autocomplete
imap <C-k> <Plug>(neosnippet_expand_or_jump)
smap <C-k> <Plug>(neosnippet_expand_or_jump)
xmap <C-k> <Plug>(neosnippet_expand_target)
" - Expand neosnippet inside of Deoplete autocomplete
" + Search by word within visual selection
vnoremap // y/<C-R>"<CR>
" - Search by word within visual selection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment