CoC:诊断窗口接管屏幕

如何解决CoC:诊断窗口接管屏幕

我正在使用 CoC 设置 neovim。

它似乎运行良好,但有一个大问题:我的诊断窗口非常大

enter image description here

我不确定这是为什么。我希望这只是几行。理想情况下,它应该不会直接出现在代码上方,但我不确定如何配置。

这是我的 Neovim 配置:

call plug#begin('~/.config/nvim/autoload')
  Plug 'easymotion/vim-easymotion' " Get to where you want to go fast
  Plug 'nanotech/jellybeans.vim'   " Pretty theme

  Plug 'scrooloose/nerdtree'

  Plug 'junegunn/fzf',{ 'do': { -> fzf#install() } }
  Plug 'junegunn/fzf.vim' " Fuzzy search

  Plug 'jiangmiao/auto-pairs',{ 'tag': 'v2.0.0' } " auto-pairs of parens
  Plug 'Olical/conjure',{'tag': 'v4.15.0'} " Interactive Clojure Eval
  Plug 'guns/vim-sexp' " paredi for vim
  Plug 'tpope/vim-sexp-mappings-for-regular-people'
  Plug 'clojure-vim/clojure.vim'

  Plug 'neoclide/coc.nvim',{'branch': 'release'} " Language servers for vim!
  Plug 'w0rp/ale' " linter -- TODO: maybe lsp obviates the need for this?
call plug#end()

" vim:foldmethod=marker:foldlevel=0

" Stopa's vimrc -- my magic sauce for getting things done!
" -----------------------------------------------------------------------------

" Vim settings {{{1
" Important {{{2
set nocompatible                        " Enable Vim features
syntax on                               " Turn on syntax highlighting
let mapleader = ","                     " Set <leader> character
let maplocalleader = ","                " Set <localleader> character
colorscheme jellybeans                  " Favorite so far
set encoding=utf-8                      " Use utf-8 when reading files
set fileencoding=utf-8                  " Files are written using utf-8
set lazyredraw                          " Don't redraw on macros -- boosts performance
set ttyfast                             " Faster redraws and smoother vim
set modelines=1                         " Read the modeline at the top

" Ignore these files in Vim's file explorer {{{2
set wildignore+="/tmp/*,*.so,*.swp,*.zip

" Make clipboard the default register {{{2
set clipboard=unnamed


" Highlight column 81 {{{2
set colorcolumn=81
highlight ColorColumn ctermbg=234

" General {{{2
set autoread                            " Reload files when outside changes made
set backspace=indent,eol,start          " Allow backspace in insert mode
set foldnestmax=2                       " Sets max fold level.
set gcr=a:blinkon0                      " Disable cursor blink
set hidden                              " Buffers can exist in background
set history=1000                        " keep 100 lines of command line history
set laststatus=2                        " lightline needs this to display status when opening first buffer
set noshowmode                          " using Lightline to show status bar instead
set noswapfile                          " Disable swap files. I don't use them
set number                              " Line numbers!
set ruler                               " show the cursor position all the time
set scrolloff=8                         " Start scrolling 8 lines away from bottom
set shortmess+=I                        " Remove Vim startup message for empty file
set showcmd                             " Show incomplete commands at bottom
set showmode                            " Show current mode down the bottom
set splitbelow                          " Default horizontal split below
set splitright                          " Default vertical split right
set visualbell                          " Disable sounds

" Wrap {{{2
set wrap
set linebreak                           " Wrap lines at convienent points
set textwidth=0
set wrapmargin=0

" Searching {{{2
set hlsearch                            " highlight searching
set incsearch                           " do incremental searching
set ignorecase                          " searches are case insensitive
set smartcase                           " unless you search with a capital letter

" Tabs and Spaces {{{2
set expandtab
set tabstop=4
set softtabstop=4
set shiftwidth=4

" Auto adjust window sizes when they become current {{{2
set winwidth=84
set winheight=5
set winminheight=5
set winheight=999
" }}} End section

" Key mappings {{{1
" Highlight initials in notes {{{2
:match Todo /JA:/

" Easy Navigating {{{2
:inoremap jk <Esc>
:nnoremap j gj
:nnoremap k gk

" Easy window cycling {{{2
:nnoremap <C-h> <C-w>h
:nnoremap <C-j> <C-w>j
:nnoremap <C-k> <C-w>k
:nnoremap <C-l> <C-w>l

" Easy save/quit {{{2
:noremap <leader>w :w<CR>
:nnoremap <leader>q :q!<CR>
:nnoremap <leader>zz :qa!<CR>


" Reload vimrc file {{{2
:nnoremap <silent><leader>sv :so $MYVIMRC<CR>

" Edit useful files {{{2
:nnoremap <silent><leader>ev :e $MYVIMRC<CR>
:nnoremap <silent><leader>et :e $MYTMUXCONF<CR>
:nnoremap <silent><leader>ez :e $MYZSH<CR>
:nnoremap <silent><leader>ep :e $MYPROFILE<CR>
:nnoremap <silent><leader>ed :e $MYTODOS<CR>

" Clear search {{{2
:nnoremap <silent><leader>/ :nohlsearch<CR>

" Easy command Mode {{{2
:nnoremap ; :

" Easy begin/end line navigation {{{2
:nnoremap H 0w
:nnoremap L $

" Easy clipboard copy {{{2
:vnoremap <silent><leader>c :w !pbcopy<CR><CR>

" Easy clipboard paste {{{2
:nnoremap <silent><leader>v :r !pbpaste<CR><CR>

" Easy grep under cursor {{{2
:nmap <silent><leader>r viw"ry:Ag! <C-R>r<CR><CR>

" Easy code folding {{{2
:nnoremap <Space> za

" Focus fold {{{2
:nnoremap <leader>f zMzA

" Toggle lint errors/warnings
:nnoremap <leader>A :ALEToggle<CR><CR>

" Quick newline {{{2
:nnoremap <CR> o<Esc>

" Toggle NERDTree {{{2
:nnoremap <leader>nt :NERDTree<CR>
"
" Toggle show formatting {{{2
:nnoremap <leader>l :set list!<CR>

" Window manipulation {{{2
:nnoremap <leader>\ :vsp<CR>
:nnoremap <leader>m :vertical resize 80<CR>

" Fugitive shortcuts {{{2
:nnoremap <leader>gb :Gblame<CR>


" Tab switching {{{2
:nnoremap <leader>1 1gt
:nnoremap <leader>2 2gt
:nnoremap <leader>3 3gt
:nnoremap <leader>4 4gt
:nnoremap <leader>5 5gt
:nnoremap <leader>6 6gt
:nnoremap <leader>7 7gt
:nnoremap <leader>8 8gt
:nnoremap <leader>9 9gt
:nnoremap <leader>0 :tablast<CR>
:nnoremap <leader>x :tabclose<CR>
:nnoremap <leader>t :0tabnew<CR>

" Easy fzf {{{2
nmap ; :Buffers<CR>
nmap <leader>p :Files<CR>

" Toggle paste mode {{{2
:nnoremap <leader>P :set invpaste!<CR>

" Ctags navigation {{{2
:nnoremap <leader>g <C-]>
:nnoremap <leader>b <C-t>

" Easy Ack/Ag {{{2
:nnoremap <leader>a :Ag

" Easy commenting {{{2
:nnoremap // :TComment<CR>
:vnoremap // :TComment<CR>

" Prevent overwriting default register (system clipboard) when inconvenient {{{2
:vnoremap x "_x
:vnoremap c "_c
:vnoremap p "_dP

" Don't use arrow keys in normal mode :) {{{2
:nnoremap <Left>  <NOP>
:nnoremap <Right> <NOP>
:nnoremap <Up>    <NOP>
:nnoremap <Down>  <NOP>

" In insert or command mode,move normally by using Ctrl {{{2
inoremap <C-h> <Left>
inoremap <C-j> <Down>
inoremap <C-k> <Up>
inoremap <C-l> <Right>
cnoremap <C-h> <Left>
cnoremap <C-j> <Down>
cnoremap <C-k> <Up>
cnoremap <C-l> <Right>

" Enables filetype detection and loads indent files {{{2
" Note: It's important this called after vim/bundle is added to vim's
" runtime path so that ftdetect will be loaded
" Thanks:  http://stackoverflow.com/a/19314347
filetype plugin indent on

" Set path for fzf
set rtp+=/usr/local/opt/fzf

" Use Omni-Completion
set omnifunc=syntaxcomplete#Complete

" Plugins {{{1
" Ag {{{2
if executable('ag')
  " Use ag over grep
  set grepprg=ag\ --nogroup\ --nocolor

  " use ag over ack
  let g:ackprg = 'ag --vimgrep'
endif

" Lightline {{{2
" General settings
let g:lightline = {
    \ 'colorscheme': 'jellybeans',\ 'mode_map': { 'c': 'NORMAL' },\ 'active': {
    \   'left': [ [ 'mode','paste' ],[ 'fugitive','filename' ] ]
    \ },\ 'component_function': {
    \   'fugitive': 'MyFugitive'
    \ },\ 'separator': { 'left': "",'right': '' },\ 'subseparator': { 'left': '|','right': '|' }
    \ }

" NERDTree {{{2
" Files and directories I don't want to see
" Note the use of vim-style regex
let NERDTreeIgnore = [
            \ '\.\(pyc\|swp\|db\|coverage\|DS_Store\)$',\ '\.\(git\|hg\|svn\|egg-info\)$[[dir]]',\ '\(coverage\|pytests\)\.xml$',\ ]

" I do want to see dotfiles (like .gitignore)
let NERDTreeShowHidden=1

" Pretty NERDTree
let NERDTreeMinimalUI = 1
let NERDTreeDirArrows = 1

" vim-javascript {{{2
" Enable syntax highlighting for flow
let g:javascript_plugin_flow = 1

" ale {{{2
" Configure error and warning formatting
let g:ale_sign_error = '✘'
let g:ale_sign_warning = '⚠'
highlight ALEErrorSign ctermbg=NONE ctermfg=red
highlight ALEWarningSign ctermbg=NONE ctermfg=yellow

let g:ale_lint_on_enter = 0 " Don't lint files on open
let g:ale_sign_column_always = 1 " Keep column open by default

" Linters
let g:ale_linters = {
\   'javascript': ['eslint'],\}
let g:ale_linters_explicit = 1

" Fixers
let g:ale_fixers = {
  \ 'javascript': ['eslint']
  \ }


" vim-jsx-pretty {{{2
" Colorful style
let g:vim_jsx_pretty_colorful_config = 1

" vim-prettier {{{2
" Run prettier async
let g:prettier#exec_cmd_async = 1

" Custom functions {{{1
" Strip whitespace and save cursor position {{{2
function! <SID>StripTrailingWhitespaces()
    " Preparation: save last search,and cursor position.
    let _s=@/
    let l = line(".")
    let c = col(".")
    " Do the business:
    %s/\s\+$//e
    " Clean up: restore previous search history,and cursor position
    let @/=_s
    call cursor(l,c)
endfunction

" Displays current git branch in powerline {{{2
function! MyFugitive()
  if &ft !~? 'vimfiler\|gundo' && exists("*fugitive#head")
    let _ = fugitive#head()
    return strlen(_) ? "\u00A7 "._ : ''
  endif
  return ''
endfunction
" }}}

" Autocommands {{{1
augroup configgroup
    " Clear previous autocmds
    autocmd!

    " White Space Settings for different file types {{{2
    autocmd FileType python setlocal ts=4 sts=4 sw=4 et
    autocmd FileType javascript,jsx,tsx setlocal ts=2 sts=2 sw=2 et
    autocmd FileType css setlocal ts=2 sts=2 sw=2 et
    autocmd FileType ruby setlocal ts=2 sts=2 sw=2 et
    autocmd FileType html,htmljinja setlocal ts=2 sts=2 sw=2 et

    " Clean up trailing white spaces {{{2
    autocmd BufWritePre * :call <SID>StripTrailingWhitespaces()

    " Python folding {{{2
    au FileType python setlocal foldmethod=indent
    au FileType python setlocal foldlevel=0

    " Javascript folding {{{2
    au FileType javascript,tsx setlocal foldmethod=syntax
    au FileType javascript,tsx setlocal foldlevel=1

    " Rainbow-ify parens/brackets for selected file types {{{2
    au FileType javascriptreact,jsx call rainbow#load()

    " Enable vim-jinja highlighting for .jinja files {{{2
    autocmd BufNewFile,BufRead *.jinja set filetype=htmljinja

    " Trigger autoread whenever I switch buffer or when focusing vim again {{{2
    " Thanks: http://stackoverflow.com/questions/2490227/how-does-vims-autoread-work/20418591#20418591
    au FocusGained,BufEnter * :silent! !

    " Save whenever switching between windows and buffers {{{2
    au FocusLost,BufLeave,WinLeave * :silent! w

    " Close the Omni-Completion tip window when a selection is made {{{2
    " These lines close it on movement in insert mode or when leaving insert mode
    " Thanks:
    " http://stackoverflow.com/questions/3105307/how-do-you-automatically-remove-the-preview-window-after-autocompletion-in-vim
    autocmd CursorMovedI * if pumvisible() == 0|pclose|endif
    autocmd InsertLeave * if pumvisible() == 0|pclose|endif
" }}} End section

augroup END

" COC {{{1
" Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable
" delays and poor user experience.
set updatetime=300

" Use tab for trigger completion with characters ahead and navigate.
" NOTE: Use command ':verbose imap <tab>' to make sure tab is not mapped by
" other plugin before putting this into your config.
inoremap <silent><expr> <TAB>
      \ pumvisible() ? "\<C-n>" :
      \ <SID>check_back_space() ? "\<TAB>" :
      \ coc#refresh()
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"

function! s:check_back_space() abort
  let col = col('.') - 1
  return !col || getline('.')[col - 1]  =~# '\s'
endfunction

" Use <c-space> to trigger completion.
if has('nvim')
  inoremap <silent><expr> <c-space> coc#refresh()
else
  inoremap <silent><expr> <c-@> coc#refresh()
endif

" Make <CR> auto-select the first completion item and notify coc.nvim to
" format on enter,<cr> could be remapped by other vim plugin
inoremap <silent><expr> <cr> pumvisible() ? coc#_select_confirm()
                              \: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"

" Remap keys for gotos
nmap <silent> gd <Plug>(coc-definition)
nmap <leader>u <Plug>(coc-references)
nmap <leader>rn <Plug>(coc-rename)
command! -nargs=0 Format :call CocAction('format')

" Diagnostics
inoremap <silent><expr> <c-space> coc#refresh()
nmap <silent> [l <Plug>(coc-diagnostic-prev)
nmap <silent> ]l <Plug>(coc-diagnostic-next)
nmap <silent> [k :CocPrev<cr>
nmap <silent> ]k :CocNext<cr>

" Highlight symbol under cursor on CursorHold
autocmd CursorHold * silent call CocActionAsync('highlight')
vmap <leader>f <Plug>(coc-format-selected)
nmap <leader>f <Plug>(coc-format-selected)

" Fix autofix problem of current line
nmap <leader>aq  <Plug>(coc-fix-current)

" Show documentation
nnoremap <silent> K :call <SID>show_documentation()<CR>
function! s:show_documentation()
  if &filetype == 'vim'
    execute 'h '.expand('<cword>')
  else
    call CocAction('doHover')
  endif
endfunction

autocmd BufReadCmd,FileReadCmd,SourceCmd jar:file://* call s:LoadClojureContent(expand("<amatch>"))
 function! s:LoadClojureContent(uri)
  setfiletype clojure
  let content = CocRequest('clojure-lsp','clojure/dependencyContents',{'uri': a:uri})
  call setline(1,split(content,"\n"))
  setl nomodified
  setl readonly
endfunction

" }}} End Section

" Source private vimrc {{{1
if filereadable(expand("~/.vim/vimrc.private.after"))
  source ~/.vim/vimrc.private.after
endif

帮助将不胜感激。主基:

  1. 为什么诊断窗口是全屏的?
  2. 有什么办法可以将它配置得更小,或者显示在其他地方? (可能在主窗格下方)

解决方法

问题是

" Auto adjust window sizes when they become current {{{2
set winwidth=84
set winheight=5
set winminheight=5
set winheight=999
" }}} End section

删除这个就成功了

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


依赖报错 idea导入项目后依赖报错,解决方案:https://blog.csdn.net/weixin_42420249/article/details/81191861 依赖版本报错:更换其他版本 无法下载依赖可参考:https://blog.csdn.net/weixin_42628809/a
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下 2021-12-03 13:33:33.927 ERROR 7228 [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPL
错误1:gradle项目控制台输出为乱码 # 解决方案:https://blog.csdn.net/weixin_43501566/article/details/112482302 # 在gradle-wrapper.properties 添加以下内容 org.gradle.jvmargs=-Df
错误还原:在查询的过程中,传入的workType为0时,该条件不起作用 &lt;select id=&quot;xxx&quot;&gt; SELECT di.id, di.name, di.work_type, di.updated... &lt;where&gt; &lt;if test=&qu
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct redisServer’没有名为‘server_cpulist’的成员 redisSetCpuAffinity(server.server_cpulist); ^ server.c: 在函数‘hasActiveC
解决方案1 1、改项目中.idea/workspace.xml配置文件,增加dynamic.classpath参数 2、搜索PropertiesComponent,添加如下 &lt;property name=&quot;dynamic.classpath&quot; value=&quot;tru
删除根组件app.vue中的默认代码后报错:Module Error (from ./node_modules/eslint-loader/index.js): 解决方案:关闭ESlint代码检测,在项目根目录创建vue.config.js,在文件中添加 module.exports = { lin
查看spark默认的python版本 [root@master day27]# pyspark /home/software/spark-2.3.4-bin-hadoop2.7/conf/spark-env.sh: line 2: /usr/local/hadoop/bin/hadoop: No s
使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams[&#39;font.sans-serif&#39;] = [&#39;SimHei&#39;] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -&gt; systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping(&quot;/hires&quot;) public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate&lt;String
使用vite构建项目报错 C:\Users\ychen\work&gt;npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-