Update nvim ALE config

This commit is contained in:
Andrejus
2020-09-28 14:30:37 +01:00
parent 71dd4e58dc
commit 4f757401f1
6 changed files with 92 additions and 48 deletions

View File

@@ -1 +1,2 @@
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion

View File

@@ -21,9 +21,12 @@ set hidden
set smartindent set smartindent
set expandtab " et = expandtab (spaces instead of tabs)
set tabstop=4 " ts = tabstop (the number of spaces that a tab equates to)
set shiftwidth=4 " sw = shiftwidth (the number of spaces to use when indenting
" -- or de-indenting -- a line)
" sts = softtabstop (the number of spaces to use when expanding tabs)
set et sts=4 sw=4 ts=4
set foldenable set foldenable
set foldmethod=indent set foldmethod=indent

View File

@@ -8,4 +8,3 @@ endif
source $XDG_CONFIG_HOME/nvim/base.vim source $XDG_CONFIG_HOME/nvim/base.vim
source $XDG_CONFIG_HOME/nvim/plugins.vim source $XDG_CONFIG_HOME/nvim/plugins.vim
source $XDG_CONFIG_HOME/nvim/mappings.vim source $XDG_CONFIG_HOME/nvim/mappings.vim

View File

@@ -22,60 +22,70 @@ Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
Plug 'vim-airline/vim-airline' Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes' Plug 'vim-airline/vim-airline-themes'
" === Languages === " " minimap
" lint Plug 'severin-lemaignan/vim-minimap'
Plug 'dense-analysis/ale'
" Intellisense Engine " indent guides
Plug 'neoclide/coc.nvim', {'do': 'yarn install --frozen-lockfile'} Plug 'nathanaelkane/vim-indent-guides'
" fzf
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
" elm
Plug 'elmcast/elm-vim'
" Python
Plug 'numirias/semshi', {'do': ':UpdateRemotePlugins'}
" DOcumentation GEneraton " DOcumentation GEneraton
Plug 'kkoomen/vim-doge' Plug 'kkoomen/vim-doge'
" Trailing whitespace highlighting & automatic fixing
Plug 'ntpeters/vim-better-whitespace'
" auto-close plugins " auto-close plugins
Plug 'rstacruz/vim-closer' Plug 'rstacruz/vim-closer'
Plug 'tpope/vim-endwise' Plug 'tpope/vim-endwise'
" Improved motion in Vim " Improved motion in Vim
Plug 'easymotion/vim-easymotion' Plug 'easymotion/vim-easymotion'
Plug 'tpope/vim-surround' Plug 'tpope/vim-surround'
" Snippet support " Snippet support
Plug 'Shougo/neosnippet' Plug 'Shougo/neosnippet'
Plug 'Shougo/neosnippet-snippets' Plug 'Shougo/neosnippet-snippets'
" Print function signatures in echo area " Print function signatures in echo area
Plug 'Shougo/echodoc.vim' Plug 'Shougo/echodoc.vim'
" Enable git changes to be shown in sign column " Enable git changes to be shown in sign column
Plug 'mhinz/vim-signify' Plug 'mhinz/vim-signify'
Plug 'tpope/vim-fugitive' Plug 'tpope/vim-fugitive'
" Comment out lines
Plug 'tpope/vim-commentary'
" fzf
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
" === Languages === "
" Intellisense Engine
Plug 'neoclide/coc.nvim', {'do': 'yarn install --frozen-lockfile'}
Plug 'liuchengxu/vista.vim'
" lint
Plug 'dense-analysis/ale'
" Trailing whitespace highlighting & automatic fixing
Plug 'ntpeters/vim-better-whitespace'
" Languages
Plug 'sheerun/vim-polyglot'
" elm
Plug 'elmcast/elm-vim'
" js
Plug 'othree/yajs.vim'
" Python
Plug 'numirias/semshi', {'do': ':UpdateRemotePlugins'}
Plug 'Vimjas/vim-python-pep8-indent'
" Initialize plugin system " Initialize plugin system
call plug#end() call plug#end()
" ============================================================================ " " ============================================================================ "
" === PLUGIN SETUP === " " === PLUGIN SETUP === "
" ============================================================================ " " ============================================================================ "
@@ -97,17 +107,30 @@ let g:NERDTreeIgnore = ['\.git$[[dir]]']
let g:elm_setup_keybindings = 0 let g:elm_setup_keybindings = 0
let g:ale_fix_on_save = 1
let g:ale_lint_on_text_changed = 'always' let g:ale_lint_on_text_changed = 'always'
let g:ale_lint_delay = 1000 let g:ale_lint_delay = 1000
let g:ale_sign_error = '\ ' let g:ale_sign_error = '>>'
let g:ale_sign_warning = '\ ' let g:ale_sign_warning = '--'
let g:ale_linters = {
\ 'python': ['flake8', 'pylint'],
\ 'typescript': ['prettier', 'tslint'],
\ 'javascript': ['prettier', 'eslint'],
\ 'scss': ['prettier'],
\ 'html': ['prettier'],
\}
let g:ale_fixers = { let g:ale_fixers = {
\ '*': ['remove_trailing_lines', 'trim_whitespace'], \ '*': ['remove_trailing_lines', 'trim_whitespace'],
\ 'cpp': ['clang'],
\ 'python': ['yapf'],
\ 'typescript': ['prettier', 'tslint'],
\ 'javascript': ['prettier', 'eslint'],
\ 'scss': ['prettier'],
\ 'html': ['prettier'],
\} \}
let g:ale_linters = { let g:ale_fix_on_save = 1
\ 'python': ['flake8']
\}
let g:airline_theme='badwolf' let g:airline_theme='badwolf'
@@ -241,3 +264,7 @@ endfunction
if exists('g:loaded_webdevicons') if exists('g:loaded_webdevicons')
call webdevicons#refresh() call webdevicons#refresh()
endif endif
let g:indent_guides_enable_on_vim_startup = 1
let g:indent_guides_start_level = 2
let g:indent_guides_guide_size = 1

View File

@@ -14,7 +14,6 @@ export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring && pip3 install --us
npm install -g neovim elm-format npm install -g neovim elm-format
sudo gem install neovim sudo gem install neovim
echo "Running PlugInstall"; echo "Running PlugInstall";
nvim --headless +PlugInstall +PlugUpgrade +PlugUpdate +qall nvim --headless +PlugInstall +PlugUpgrade +PlugUpdate +qall
nvim --version nvim --version

View File

@@ -8,15 +8,16 @@ from subprocess import run, CalledProcessError
import pytest import pytest
# ---------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Helper functions # Helper functions
# ---------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
def in_path(binary: str) -> bool: def in_path(binary: str) -> bool:
""" """
Helper function to check whether `binary` is in PATH. Helper function to check whether `binary` is in PATH.
""" """
return find_executable(binary) is not None return find_executable(binary) is not None
def in_shell_path(shell: str, binary: str) -> bool: def in_shell_path(shell: str, binary: str) -> bool:
""" """
Helper function to check whether `binary` is in interactive shell's PATH. Helper function to check whether `binary` is in interactive shell's PATH.
@@ -29,11 +30,13 @@ def in_shell_path(shell: str, binary: str) -> bool:
return False return False
# ---------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Test fixtures # Test fixtures
# ---------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
shells: List[str] = [ shells: List[str] = [
'sh', 'bash', 'fish', 'sh',
'bash',
'fish',
] ]
binaries: List[str] = [ binaries: List[str] = [
@@ -42,16 +45,27 @@ binaries: List[str] = [
*shells, *shells,
# tools # tools
"git", "nvim", "git",
"firebase", "aws", "terraform", "nvim",
"docker", "docker-compose", "firebase",
"aws",
"terraform",
"docker",
"docker-compose",
"screenfetch", "screenfetch",
# language: python # language: python
"pyenv", "python3", "pip3", "poetry", "pyenv",
"python3",
"pip3",
"poetry",
# langauge: js # langauge: js
"nvm", "node", "npm", "yarn", "elm", "nvm",
"node",
"npm",
"yarn",
"elm",
] ]
@@ -63,6 +77,7 @@ def test_shells(shell: str):
""" Assert all shells we expect are in PATH. """ """ Assert all shells we expect are in PATH. """
assert in_path(shell) assert in_path(shell)
@pytest.mark.parametrize("binary", binaries) @pytest.mark.parametrize("binary", binaries)
@pytest.mark.parametrize("shell", shells) @pytest.mark.parametrize("shell", shells)
def test_binaries(shell: str, binary: str): def test_binaries(shell: str, binary: str):