Last active
June 24, 2020 16:56
-
-
Save toastal/163cdf3a6fb490b9a4ff07e81acf7991 to your computer and use it in GitHub Desktop.
Nvim conf
This file contains hidden or 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
" vim: noai ts=2 sw=2 | |
set shell=/bin/fish | |
let g:EditorConfig_exec_path = '/bin/editorconfig' | |
if has('mouse') | set mouse=a | endif | |
"set relativenumber | |
set number | |
set scrolloff=4 | |
set inccommand=split | |
set modeline | |
set modelines=4 | |
let mapleader=' ' | |
let is_vpn_connected = !empty(system('command -v nordvpn > /dev/null; and string match --entire "Status: Connected" (nordvpn status))')) | |
if is_vpn_connected | |
let g:plug_threads = 5 | |
let g:plug_retries = 1 | |
endif | |
call plug#begin('~/.config/nvim/plugged') | |
Plug 'andrwb/vim-lapis256' | |
Plug 'rakr/vim-one' | |
Plug 'arcticicestudio/nord-vim' | |
Plug 'itchyny/lightline.vim' | |
"Plug 'scrooloose/nerdtree' | |
Plug 'scrooloose/nerdcommenter' | |
"Plug 'godlygeek/tabular' | |
Plug 'tpope/vim-surround' | |
Plug 'w0rp/ale' | |
Plug 'maximbaz/lightline-ale' | |
Plug 'ryanoasis/vim-devicons' | |
Plug 'eugen0329/vim-esearch' | |
Plug 'autozimu/LanguageClient-neovim' | |
Plug 'editorconfig/editorconfig-vim' | |
Plug 'eapache/rainbow_parentheses.vim' | |
Plug 'airblade/vim-gitgutter' | |
Plug 'purescript-contrib/purescript-vim' | |
Plug 'FrigoEU/psc-ide-vim' | |
Plug 'neovimhaskell/haskell-vim' | |
Plug 'nbouscal/vim-stylish-haskell' | |
Plug 'ElmCast/elm-vim' | |
Plug 'vmchale/dhall-vim' | |
Plug 'hhsnopek/vim-sugarss', | |
" Plug 'digitaltoad/vim-pug' | |
Plug 'tpope/vim-rails' | |
Plug 'dag/vim-fish' | |
Plug 'Kuniwak/vint' | |
Plug 'kchmck/vim-coffee-script' | |
Plug 'vim-scripts/po.vim' | |
Plug 'junegunn/goyo.vim' | |
Plug 'junegunn/limelight.vim' | |
Plug 'reedes/vim-pencil' | |
Plug 'norcalli/nvim-colorizer.lua' | |
Plug 'Shougo/denite.nvim' | |
Plug 'rafi/vim-denite-mpc' | |
Plug 'raghur/vim-ghost', { 'do': ':GhostInstall' } | |
"Plug 'DanManN/vim-razer' | |
call plug#end() | |
" digraphs | |
digraph ~> 8605 " ↝ | |
digraph O+ 10753 " ⨁ | |
" colors | |
if $TERM ==? 'xterm-256color' || $TERM ==? 'xterm-termite' || $TERM ==? 'xterm-kitty' || $TERM ==? 'screen-256color' | |
let b:is_truecolor = $COLORTERM ==? 'truecolor' || $COLORTERM ==? '24bit' | |
if b:is_truecolor && has('termguicolors') | |
set termguicolors | |
else | |
set t_Co=256 | |
endif | |
set background=dark | |
colorscheme lapis256 | |
highlight Normal guifg=none ctermfg=none guibg=none ctermbg=none | |
" Rainbow Parens colors | |
let g:rbpt_colorpairs = [ | |
\ [210, '#ff8787'], | |
\ [075, '#5fafff'], | |
\ [214, '#ffaf00'], | |
\ [045, '#00d7ff'], | |
\ [086, '#5fffd7'], | |
\ [146, '#afafd7'], | |
\ [051, '#00ffff'], | |
\ [249, '#b2b2b2'], | |
\ [080, '#5fd7d7'], | |
\ ] | |
if b:is_truecolor | |
" Colorizer | |
lua require 'colorizer'.setup({ | |
\ '*'; | |
\ css = { rgb_fn = true; hsl_fn = true }; | |
\ less = { rgb_fn = true; hsl_fn = true }; | |
\ sass = { rgb_fn = true; hsl_fn = true }; | |
\ sugarss = { rgb_fn = true; hsl_fn = true }; | |
\ }, | |
\ { name = false } | |
\ ) | |
endif | |
endif | |
" lightline | |
let g:lightline#ale#indicator_checking = "\uf110" | |
let g:lightline#ale#indicator_warnings = "\uf071" | |
let g:lightline#ale#indicator_errors = "\uf05e" | |
let g:lightline#ale#indicator_ok = "\uf00c" | |
let g:lightline = | |
\ { 'colorscheme': 'OldHope' | |
\ , 'active': | |
\ { 'left': [ [ 'mode', 'paste' ], [ 'filename', 'gitbranch' ] ] | |
\ , 'right': [ [ 'lineinfo' ], [ 'percent' ], [ 'fileformat', 'fileencoding', 'filetype', 'linter_checking', 'linter_errors', 'linter_warnings', 'linter_ok' ] ] | |
\ } | |
\ , 'component_function': { 'filetype': 'MyFiletype', 'fileformat': 'MyFileformat' } | |
\ , 'component_expand': | |
\ { 'linter_checking': 'lightline#ale#checking' | |
\ , 'linter_warnings': 'lightline#ale#warnings' | |
\ , 'linter_errors': 'lightline#ale#errors' | |
\ , 'linter_ok': 'lightline#ale#ok' | |
\ } | |
\ , 'component_type': | |
\ { 'linter_checking': 'middle' | |
\ , 'linter_warnings': 'warnings' | |
\ , 'linter_errors': 'error' | |
\ , 'linter_ok': 'middle', | |
\ } | |
\ , 'separator': { 'left': '▒', 'right': '▒' } | |
\ } | |
"\ , 'right': [ [ 'linter_checking', 'linter_errors', 'linter_warnings', 'linter_ok' ] ] | |
"\ , 'separator': { 'left': '', 'right': '' } | |
" ALE | |
let b:ale_fixers = | |
\ { 'css': [ 'stylelint' ] | |
\ , 'javascript': [ 'eslint' ] | |
\ , 'purescript': [ 'purty' ] | |
\ , 'ruby': [ 'rubocop' ] | |
\ , 'sugarss': [ 'stylelint' ] | |
\ } | |
let g:ale_pattern_options = | |
\ { '\.min\.js$': { 'ale_linters': [], 'ale_fixers': [] } | |
\ , '\.min\.css$': { 'ale_linters': [], 'ale_fixers': [] } | |
\ } | |
let g:ale_lint_on_text_changed = 'never' | |
let g:ale_lint_on_save = 1 | |
let g:ale_fix_on_save = 1 | |
let g:ale_ruby_rubocop_executable = 'bundle' | |
let g:ale_ruby_sorbet_executable = 'bundle' | |
" Rainbow Parans | |
let g:bold_parentheses = 0 | |
augroup rainbowtime | |
au VimEnter * RainbowParenthesesToggle | |
au Syntax * RainbowParenthesesLoadRound | |
au Syntax * RainbowParenthesesLoadSquare | |
au Syntax * RainbowParenthesesLoadBraces | |
augroup END | |
" ESearch | |
let g:esearch = | |
\ { 'adapter': 'rg' | |
\ , 'backend': 'nvim' | |
\ , 'out': 'qflist' | |
\ , 'batch_size': 1000 | |
\ , 'use': [ 'visual', 'hlsearch', 'last' ] | |
\ } | |
" PureScript | |
let purescript_indent_case = 2 | |
let purescript_indent_do = 2 | |
let purescript_indent_if = 2 | |
let purescript_indent_in = 2 | |
let purescript_indent_let = 2 | |
let purescript_indent_where = 0 | |
" PSC IDE | |
let g:psc_ide_server_port = 4242 | |
" Elm | |
"let g:elm_format_autosave = 1 | |
" Haskell | |
let g:haskell_indent_disable = 1 | |
let g:haskell_indent_bare_where = 2 | |
let g:haskell_indent_before_where = 0 | |
let g:haskell_indent_case = 2 | |
let g:haskell_indent_do = 2 | |
let g:haskell_indent_guard = 2 | |
let g:haskell_indent_if = 2 | |
let g:haskell_indent_in = 2 | |
let g:haskell_indent_where = 2 | |
" Markdown | |
let g:markdown_fenced_languages = | |
\ [ 'bash=sh' | |
\ , 'css' | |
\ , 'elm' | |
\ , 'haskell' | |
\ , 'javascript' | |
\ , 'js=javascript' | |
\ , 'json=javascript' | |
\ , 'purescript' | |
\ , 'purs=purescript' | |
\ , 'sass' | |
\ , 'sh' | |
\ , 'sss=sass' | |
\ , 'xml' | |
\ ] | |
function! MyFiletype() | |
return winwidth(0) > 70 ? (strlen(&filetype) ? &filetype . ' ' . WebDevIconsGetFileTypeSymbol() : 'no ft') : '' | |
endfunction | |
function! MyFileformat() | |
return winwidth(0) > 70 ? (&fileformat . ' ' . WebDevIconsGetFileFormatSymbol()) : '' | |
endfunction | |
" Goyo | |
let g:goyo_width = 72 | |
let g:goyo_height = '92%' | |
augroup goyotime | |
autocmd! User GoyoEnter Limelight PencilSoft | |
autocmd! User GoyoLeave Limelight! | |
augroup END | |
" Limelight | |
let g:limelight_conceal_ctermfg = 'gray' | |
let g:limelight_conceal_ctermfg = 240 | |
" Pencil | |
let g:pencil#textwidth = g:goyo_width | |
augroup pencil | |
autocmd! | |
autocmd FileType text call pencil#init({'wrap': 'soft'}) | |
augroup END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment