Created
September 10, 2020 10:05
-
-
Save Kagemaru/8b453faee2f574a41c2302a394f2ecd2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
call plug#begin() | |
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } | |
Plug 'SirVer/ultisnips' | |
Plug 'arcticicestudio/nord-vim' | |
Plug 'autozimu/LanguageClient-neovim', { 'branch': 'next', 'do': 'bash install.sh' } | |
Plug 'dense-analysis/ale' | |
Plug 'godlygeek/tabular' | |
Plug 'honza/vim-snippets' | |
Plug 'jiangmiao/auto-pairs' | |
Plug 'jpo/vim-railscasts-theme' | |
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } | |
Plug 'junegunn/fzf.vim' | |
Plug 'roxma/nvim-completion-manager' | |
Plug 'ryanoasis/vim-devicons' | |
Plug 'scrooloose/nerdtree' | |
Plug 'slim-template/vim-slim' | |
Plug 'tpope/vim-bundler' | |
Plug 'tpope/vim-commentary' | |
Plug 'tpope/vim-dispatch' | |
Plug 'tpope/vim-endwise' | |
Plug 'tpope/vim-projectionist' | |
Plug 'tpope/vim-rails' | |
Plug 'vim-ruby/vim-ruby' | |
call plug#end() | |
set number | |
if (has("termguicolors")) | |
set termguicolors | |
endif | |
syntax enable | |
"colorscheme nord | |
colorscheme railscasts | |
" Config NERDTree | |
let g:NERDTreeShowHidden = 1 | |
let g:NERDTreeMinimalUI = 1 | |
let g:NERDTreeIgnore = [] | |
let g:NERDTreeStatusline = '' | |
" Automaticaly close nvim if NERDTree is only thing left open | |
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif | |
" Toggle | |
nnoremap <silent> <C-b> :NERDTreeToggle<CR> | |
" Config Terminal | |
" open new split panes to right and below | |
set splitright | |
set splitbelow | |
" turn terminal to normal mode with escape | |
tnoremap <Esc> <C-\><C-n> | |
" start terminal in insert mode | |
au BufEnter * if &buftype == 'terminal' | :startinsert | endif | |
" open terminal on ctrl+n | |
function! OpenTerminal() | |
split term://bash | |
resize 10 | |
endfunction | |
nnoremap <c-n> :call OpenTerminal()<CR><Paste> | |
" Config Control+P | |
nnoremap <C-p> :FZF<CR> | |
let g:fzf_action = { | |
\ 'ctrl-t': 'tab split', | |
\ 'ctrl-s': 'split', | |
\ 'ctrl-v': 'vsplit' | |
\} | |
let $FZF_DEFAULT_COMMAND = 'ag -g ""' | |
" Ale config | |
let g:ale_fixers = { | |
\ 'ruby': ['rubocop'], | |
\} | |
let g:ale_fix_on_save = 1 | |
function! LinterStatus() abort | |
let l:counts = ale#statusline#Count(bufnr('')) | |
let l:all_errors = l:counts.error + l:counts.style_error | |
let l:all_non_errors = l:counts.total - l:all_errors | |
return l:counts.total == 0 ? '✨ all good ✨' : printf( | |
\ '😞 %dW %dE', | |
\ all_non_errors, | |
\ all_errors | |
\) | |
endfunction | |
set statusline= | |
set statusline+=%m | |
set statusline+=\ %f | |
set statusline+=%= | |
set statusline+=\ %{LinterStatus()} | |
" Config deoplete | |
let g:deoplete#enable_at_startup = 1 | |
inoremap <silent><expr> <TAB> | |
\ pumvisible() ? "\<C-n>" : | |
\ <SID>check_back_space() ? "\<TAB>" : | |
\ deoplete#mappings#manual_complete() | |
function! s:check_back_space() abort "{{{ | |
let col = col('.') - 1 | |
return !col || getline('.')[col - 1] =~ '\s' | |
endfunction"}}} | |
" Config LanuageClient | |
" Required for operations modifying multiple buffers like rename. | |
set hidden | |
let g:LanguageClient_serverCommands = { | |
\ 'rust': ['~/.cargo/bin/rustup', 'run', 'stable', 'rls'], | |
\ 'javascript': ['/usr/local/bin/javascript-typescript-stdio'], | |
\ 'javascript.jsx': ['tcp://127.0.0.1:2089'], | |
\ 'python': ['/usr/local/bin/pyls'], | |
\ 'ruby': ['./solargraph', 'stdio'], | |
\ } | |
" note that if you are using Plug mapping you should not use `noremap` mappings. | |
noremap <F5> <Plug>(lcn-menu) | |
" Or map each action separately | |
noremap <silent>K <Plug>(lcn-hover) | |
noremap <silent> gd <Plug>(lcn-definition) | |
noremap <silent> <F2> <Plug>(lcn-rename) | |
" Config Ultisnips | |
" Trigger configuration. Do not use <tab> if you use https://github.com/Valloric/YouCompleteMe. | |
let g:UltiSnipsExpandTrigger="<tab>" | |
let g:UltiSnipsJumpForwardTrigger="<c-b>" | |
let g:UltiSnipsJumpBackwardTrigger="<c-z>" | |
" If you want :UltiSnipsEdit to split your window. | |
let g:UltiSnipsEditSplit="vertical" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment