diff --git a/README.md b/README.md index 7363703..910e65e 100644 --- a/README.md +++ b/README.md @@ -105,6 +105,7 @@ As usual, to have your system use `vimpager` in place of `less`, you'll need to | F10 and Backslash+{ | ALL | Toggle the **tagbar** source code tag sidebar | | F11 and Backslash+\] | ALL | Toggle the **gundo** undo history sidebar | | F12 and Backslash+\[ | ALL | Toggle **vimfiler** file manager sidebar | +| Backslash+Backslash | N | Toggle the location list for **ale** issues | #### Toggles #### @@ -197,7 +198,7 @@ For a complete list of mappings specific to **darkcloud-vimconfig**, check the l * [vim-signify](https://github.com/mhinz/vim-signify): When a version controlled file is changed, this displays a column showing where and how, and allows for navigation to and between differences. * [vim-surround](https://github.com/tpope/vim-surround): Provides functionality to exchange surrounding delimiters and xml-style tags with another, or simply remove them. * [vim-repeat](https://github.com/tpope/vim-repeat): A library used by vim-surround to allow its delimiter-switching functions to be repeated with the `.` command. -* [vim-togglelist](https://github.com/milkypostman/vim-togglelist): Supplies toggle functions for the *location* and *error* lists, which are used by a number of plugins and normally require separate open and close commands. +* [vim-togglelist](https://github.com/milkypostman/vim-togglelist): A simple plugin for vim that allows you to bind a key to toggle the Location List and the Quickfix List. * [vim-trailing-whitespace](https://github.com/bronson/vim-trailing-whitespace): Highlights and allows for the easy removal of trailing whitespace in documents. * [vim-unimpaired](https://github.com/tpope/vim-unimpaired): Pairs of handy bracket mappings. diff --git a/vim/config/keyboard.vim b/vim/config/keyboard.vim index aefcebb..55dac2a 100644 --- a/vim/config/keyboard.vim +++ b/vim/config/keyboard.vim @@ -490,6 +490,9 @@ nmap k ':execute "setlocal iskeyword+=".getline(".")[col(".")-1]:echo "The character ".getline(".")[col(".")-1]." has been added to iskeyword"' nmap K ':execute "setlocal iskeyword-=".getline(".")[col(".")-1]:echo "The character ".getline(".")[col(".")-1]." has been removed from iskeyword"' + "toggle the location list + nnoremap ':call ToggleLocationList()' + "toggle the command reference box nnoremap ~ ':TCommand' @@ -590,15 +593,25 @@ set pastetoggle= "toggle syntax checking - nnoremap ':ALEToggle' - xnoremap ':ALETogglegv' - inoremap ':ALEToggle' - nnoremap ':ALEToggle' - xnoremap ':ALETogglegv' - inoremap ':ALEToggle' - nnoremap ':ALEToggle' - xnoremap ':ALETogglegv' - inoremap ':ALEToggle' + function! ToggleAle() + ALEToggle + + if g:ale_enabled + set scl=yes + else + set scl=auto + endif + endfunction + + nnoremap ':call ToggleAle()' + xnoremap ':call ToggleAle()gv' + inoremap ':call ToggleAle()' + nnoremap ':call ToggleAle()' + xnoremap ':call ToggleAle()gv' + inoremap ':call ToggleAle()' + nnoremap ':call ToggleAle()' + xnoremap ':call ToggleAle()gv' + inoremap ':call ToggleAle()' "toggle goyo nnoremap ` ':Goyo' diff --git a/vim/config/plugins/ale.vim b/vim/config/plugins/ale.vim index 286b963..5696911 100644 --- a/vim/config/plugins/ale.vim +++ b/vim/config/plugins/ale.vim @@ -3,30 +3,35 @@ if !exists("g:autostartchecker") || &diff let g:autostartchecker = 0 endif +"start ale if autostartchecker is true let g:ale_enabled = g:autostartchecker -" open list of warnings and errors when they exist -let g:ale_open_list = 1 +"always show the sign column when ale is running +if g:autostartchecker + set scl=yes +else + set scl=auto +endif -" size of the list -let g:ale_list_window_size = 5 +"don't open the error list when detected (hitting leader twice will do this) +let g:ale_open_list = 0 -" don't fix on save +"don't fix on save let g:ale_fix_on_save = 0 -" configure when to lint +"configure when to lint let g:ale_lint_on_text_changed = 'normal' let g:ale_lint_on_enter = 1 let g:ale_lint_on_filetype_changed = 1 let g:ale_lint_on_save = 1 let g:ale_lint_on_insert_leave = 1 -" list of ale fixers +"list of ale fixers let g:ale_fixers = { \ 'javascript': [ 'eslint' ] \ } -" don't run ale on minified files +"don't run ale on minified files let g:ale_pattern_options = { \ '\.min\.[^\.]*$': { 'ale_linters': [], 'ale_fixers': [] }, \ }