Open the ale error list by hitting leader twice instead of on error, and always show the gutter when ale is enabled to avoid having the window jump around as errors appear and disappear

This commit is contained in:
Kevin MacMartin 2018-03-13 22:50:50 -04:00
parent 676378ca45
commit 8861aa289f
3 changed files with 37 additions and 18 deletions

View file

@ -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 | | F10 and Backslash+{ | ALL | Toggle the **tagbar** source code tag sidebar |
| F11 and Backslash+\] | ALL | Toggle the **gundo** undo history sidebar | | F11 and Backslash+\] | ALL | Toggle the **gundo** undo history sidebar |
| F12 and Backslash+\[ | ALL | Toggle **vimfiler** file manager sidebar | | F12 and Backslash+\[ | ALL | Toggle **vimfiler** file manager sidebar |
| Backslash+Backslash | N | Toggle the location list for **ale** issues |
#### Toggles #### #### 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-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-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-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-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. * [vim-unimpaired](https://github.com/tpope/vim-unimpaired): Pairs of handy bracket mappings.

View file

@ -490,6 +490,9 @@
nmap <expr><silent> <Leader>k ':execute "setlocal iskeyword+=".getline(".")[col(".")-1]<CR>:echo "The character ".getline(".")[col(".")-1]." has been added to iskeyword"<CR>' nmap <expr><silent> <Leader>k ':execute "setlocal iskeyword+=".getline(".")[col(".")-1]<CR>:echo "The character ".getline(".")[col(".")-1]." has been added to iskeyword"<CR>'
nmap <expr><silent> <Leader>K ':execute "setlocal iskeyword-=".getline(".")[col(".")-1]<CR>:echo "The character ".getline(".")[col(".")-1]." has been removed from iskeyword"<CR>' nmap <expr><silent> <Leader>K ':execute "setlocal iskeyword-=".getline(".")[col(".")-1]<CR>:echo "The character ".getline(".")[col(".")-1]." has been removed from iskeyword"<CR>'
"toggle the location list
nnoremap <silent><expr> <Leader><Leader> ':call ToggleLocationList()<CR>'
"toggle the command reference box "toggle the command reference box
nnoremap <silent><expr> ~ ':TCommand<CR>' nnoremap <silent><expr> ~ ':TCommand<CR>'
@ -590,15 +593,25 @@
set pastetoggle=<F3> set pastetoggle=<F3>
"toggle syntax checking "toggle syntax checking
nnoremap <silent><expr> <F4> ':ALEToggle<CR>' function! ToggleAle()
xnoremap <silent><expr> <F4> '<Esc>:ALEToggle<CR>gv' ALEToggle
inoremap <silent><expr> <F4> '<C-O>:ALEToggle<CR>'
nnoremap <silent><expr> <C-F4> ':ALEToggle<CR>' if g:ale_enabled
xnoremap <silent><expr> <C-F4> '<Esc>:ALEToggle<CR>gv' set scl=yes
inoremap <silent><expr> <C-F4> '<C-O>:ALEToggle<CR>' else
nnoremap <silent><expr> <A-F4> ':ALEToggle<CR>' set scl=auto
xnoremap <silent><expr> <A-F4> '<Esc>:ALEToggle<CR>gv' endif
inoremap <silent><expr> <A-F4> '<C-O>:ALEToggle<CR>' endfunction
nnoremap <silent><expr> <F4> ':call ToggleAle()<CR>'
xnoremap <silent><expr> <F4> '<Esc>:call ToggleAle()<CR>gv'
inoremap <silent><expr> <F4> '<C-O>:call ToggleAle()<CR>'
nnoremap <silent><expr> <C-F4> ':call ToggleAle()<CR>'
xnoremap <silent><expr> <C-F4> '<Esc>:call ToggleAle()<CR>gv'
inoremap <silent><expr> <C-F4> '<C-O>:call ToggleAle()<CR>'
nnoremap <silent><expr> <A-F4> ':call ToggleAle()<CR>'
xnoremap <silent><expr> <A-F4> '<Esc>:call ToggleAle()<CR>gv'
inoremap <silent><expr> <A-F4> '<C-O>:call ToggleAle()<CR>'
"toggle goyo "toggle goyo
nnoremap <silent><expr> <Leader>` ':Goyo<CR>' nnoremap <silent><expr> <Leader>` ':Goyo<CR>'

View file

@ -3,13 +3,18 @@ if !exists("g:autostartchecker") || &diff
let g:autostartchecker = 0 let g:autostartchecker = 0
endif endif
"start ale if autostartchecker is true
let g:ale_enabled = g:autostartchecker let g:ale_enabled = g:autostartchecker
" open list of warnings and errors when they exist "always show the sign column when ale is running
let g:ale_open_list = 1 if g:autostartchecker
set scl=yes
else
set scl=auto
endif
" size of the list "don't open the error list when detected (hitting leader twice will do this)
let g:ale_list_window_size = 5 let g:ale_open_list = 0
"don't fix on save "don't fix on save
let g:ale_fix_on_save = 0 let g:ale_fix_on_save = 0