Skip to content

Instantly share code, notes, and snippets.

@nikneroz
Last active July 8, 2018 18:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nikneroz/6565914f6ed48c569e1be79e6cfa0dcd to your computer and use it in GitHub Desktop.
Save nikneroz/6565914f6ed48c569e1be79e6cfa0dcd to your computer and use it in GitHub Desktop.
Neovim & Windows WLS
if &compatible
set nocompatible
endif
" Required:
set runtimepath+=~/.config/nvim/dein/repos/github.com/Shougo/dein.vim
set runtimepath+=~/.config/nvim/dein/.cache/vim-airline/
set clipboard=unnamed
" Required:
if dein#load_state('/home/denis/.config/nvim/dein')
call dein#begin('/home/denis/.config/nvim/dein')
" Required:
call dein#add('/home/denis/.config/nvim/dein/repos/github.com/Shougo/dein.vim')
" Run plugins asynchronously
call dein#add('neomake/neomake')
call dein#add('benjie/neomake-local-eslint.vim')
" Syntax checker
" call dein#add('scrooloose/syntastic')
" 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')
call dein#add('scrooloose/nerdtree')
" call dein#add('vimlab/split-term.vim')
call dein#add('terryma/vim-multiple-cursors')
call dein#add('airblade/vim-gitgutter.git')
call dein#add('kana/vim-fakeclip')
" Autocomplete
call dein#add('Shougo/deoplete.nvim')
call dein#add('Shougo/neosnippet.vim')
call dein#add('Shougo/neosnippet-snippets')
" Utils for development
call dein#add('tpope/vim-surround')
call dein#add('scrooloose/nerdcommenter')
call dein#add('mileszs/ack.vim')
" 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')
" Themes
call dein#add('fatih/molokai')
call dein#add('notpratheek/vim-luna')
call dein#add('flazz/vim-colorschemes')
call dein#add('xolox/vim-misc')
call dein#add('xolox/vim-colorscheme-switcher')
call dein#add('altercation/vim-colors-solarized')
" 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
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 guifont=Inconsolata\ for\ Powerline:h16
set fillchars+=stl:\ ,stlnc:\
set laststatus=2
set lazyredraw
set lz
set colorcolumn=120
set hid
set re=1
set nofoldenable
au BufNewFile,BufRead *.json.jbuilder set ft=ruby
au BufNewFile,BufRead *.slim set filetype=slim
" Favorite themes: iceberg hybrid solarized bvemu busybee monokai Molokai wombat256mod Tomorrow-Night up lilypink 256-grayvim 256-jungle babymate256 blacklight 1989
colorscheme up
"+ AIRLINE
" 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
" Config for nonexistent powerline fonts
" if !exists('g:airline_symbols')
" let g:airline_symbols = {}
" endif
" unicode symbols
" let g:airline_symbols.crypt = '#'
" let g:airline_symbols.readonly = 'READONLY'
" let g:airline_symbols.linenr = 'LINE'
" let g:airline_symbols.maxlinenr = ' MAX'
" let g:airline_symbols.branch = '∫'
" let g:airline_symbols.paste = 'ρ'
" let g:airline_symbols.whitespace = 'Ξ'
" Disable color switcher default mappings
let g:colorscheme_switcher_define_mappings=0
" Enable autocomplete
let g:deoplete#enable_at_startup = 1
" + Syntax
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
" let g:syntastic_always_populate_loc_list = 1
" let g:syntastic_loc_list_height = 5
" let g:syntastic_auto_loc_list = 0
" let g:syntastic_check_on_open = 1
" let g:syntastic_check_on_wq = 1
" let g:syntastic_javascript_checkers = ['eslint']
" let g:syntastic_javascript_eslint_exec = './node_modules/.bin/eslint'
" let g:syntastic_enable_elixir_checker = 0
" let g:syntastic_elixir_elixir_exe = 'elixirc'
" let g:syntastic_error_symbol = '●'
" let g:syntastic_style_error_symbol = '☻'
" let g:syntastic_warning_symbol = '☕'
" let g:syntastic_style_warning_symbol = '☺'
" highlight link SyntasticErrorSign SignColumn
" highlight link SyntasticWarningSign SignColumn
" highlight link SyntasticStyleErrorSign SignColumn
" highlight link SyntasticStyleWarningSign SignColumn
" When writing a buffer.
call neomake#configure#automake('w')
" When writing a buffer, and on normal mode changes (after 750ms).
call neomake#configure#automake('nw', 750)
" When reading a buffer (after 1s), and when writing.
call neomake#configure#automake('rw', 1000)
let g:neomake_javascript_enabled_makers = ['eslint']
let g:neomake_tempfile_base_directory = '/home/denis/.config/nvim/tmp/neomake'
let g:neomake_elixir_enabled_makers = ['elixir']
" let g:neomake_elixir_elixir_maker = {
" \ 'exe': 'elixirc',
" \ 'args': [
" \ '--ignore-module-conflict', '--warnings-as-errors',
" \ '--app', 'mix', '--app', 'ex_unit',
" \ '-o', '$TMPDIR', '%:p'
" \ ],
" \ 'errorformat':
" \ '%E** %s %f:%l: %m,' .
" \ '%W%f:%l'
" \ }
autocmd! BufWritePost * Neomake
let g:jsx_ext_required = 0
" - Syntax
let g:NERDSpaceDelims = 1
" let g:NERDCommentEmptyLines = 1
let g:NERDCustomDelimiters = { 'javascript.jsx': { 'left': '//', 'leftAlt': '{/*', 'rightAlt': '*/}' } }
" yank
let g:unite_source_history_yank_enable = 1
" Поиск по файлам
if executable('ag')
let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""'
let g:ctrlp_use_caching = 0
let g:ackprg = 'ag --vimgrep'
endif
"+ Multiple cursors
" let g:multi_cursor_quit_key = '<C-[>'
" let g:multi_cursor_exit_from_insert_mode = 0
"- Multiple cursors
"
":nmap - Display normal mode maps
":imap - Display insert mode maps
":vmap - Display visual and select mode maps
":smap - Display select mode maps
":xmap - Display visual mode maps
":cmap - Display command-line mode maps
":omap - Display operator pending mode maps
nnoremap K :Ack! "\b<C-R><C-W>\b"<CR>:cw<CR> " Search by word under cursor
nnoremap <C-y> :reg<cr> " Show yank history
let mapleader = "\<Space>"
nmap <Leader>, <c-w><
nmap <Leader>. <c-w>>
nmap <Leader>= <c-w>+
nmap <Leader>- <c-w>-
"+ ColorTheme Switch
nnoremap <Leader>p :NextColorScheme<cr>
nnoremap <Leader>o :PrevColorScheme<cr>
"- ColorTheme Switch
" + Buffers switch
nnoremap <Leader>[ :bprevious<cr>
nnoremap <Leader>] :bnext<cr>
" - Buffers switch
" + Open NerdTree
nmap <c-i> :NERDTreeToggle<cr>
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
" - Open NerdTree
autocmd BufWritePre * %s/\s\+$//e
"+ Expand neosnippet inside of Deoplete autocomplete
nmap <c-j> <c-w>j
nmap <c-k> <c-w>k
nmap <c-h> <c-w>h
nmap <c-l> <c-w>l
"+ Expand neosnippet inside of Deoplete autocomplete
"+ 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
hi ColorColumn term=reverse cterm=reverse ctermbg=gray
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment