From 61dc1712af9a7425007567199cf35d8a1503b993 Mon Sep 17 00:00:00 2001 From: paul-loedige Date: Wed, 22 Feb 2023 17:54:22 +0100 Subject: [PATCH] merged laptop into master --- neovim/.config/nvim/coc.vim | 54 ++++++++++--------- neovim/.config/nvim/ftplugin/tex.vim | 2 - neovim/.config/nvim/init.vim | 17 +++++- qtile/.config/qtile/Groups.py | 13 ++++- qtile/.config/qtile/Screens.py | 2 +- qtile/.config/qtile/Widgets.py | 1 - qtile/.config/qtile/autostart.sh | 3 +- .../custom/plugins/zsh-syntax-highlighting | 2 +- 8 files changed, 60 insertions(+), 34 deletions(-) diff --git a/neovim/.config/nvim/coc.vim b/neovim/.config/nvim/coc.vim index 74525bf..9bd540b 100644 --- a/neovim/.config/nvim/coc.vim +++ b/neovim/.config/nvim/coc.vim @@ -1,30 +1,36 @@ -" TextEdit might fail if hidden is not set. -set hidden +" May need for vim (not neovim) since coc.nvim calculate byte offset by count +" utf-8 byte sequence. +set encoding=utf-8 " Some servers have issues with backup files, see #649. set nobackup set nowritebackup -" Give more space for displaying messages. -set cmdheight=2 - " Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable " delays and poor user experience. set updatetime=300 -" Don't pass messages to |ins-completion-menu|. -set shortmess+=c +" Always show the signcolumn, otherwise it would shift the text each time +" diagnostics appear/become resolved. +set signcolumn=yes " Use tab for trigger completion with characters ahead and navigate. +" NOTE: There's always complete item selected by default, you may want to enable +" no select by `"suggest.noselect": true` in your configuration file. " NOTE: Use command ':verbose imap ' to make sure tab is not mapped by " other plugin before putting this into your config. inoremap - \ pumvisible() ? "\" : - \ check_back_space() ? "\" : + \ coc#pum#visible() ? coc#pum#next(1) : + \ CheckBackspace() ? "\" : \ coc#refresh() -inoremap pumvisible() ? "\" : "\" +inoremap coc#pum#visible() ? coc#pum#prev(1) : "\" -function! s:check_back_space() abort +" Make to accept selected completion item or notify coc.nvim to format +" u breaks current undo, please make your own choice. +inoremap coc#pum#visible() ? coc#pum#confirm() + \: "\u\\=coc#on_enter()\" + +function! CheckBackspace() abort let col = col('.') - 1 return !col || getline('.')[col - 1] =~# '\s' endfunction @@ -36,11 +42,6 @@ else inoremap coc#refresh() endif -" Make auto-select the first completion item and notify coc.nvim to -" format on enter, could be remapped by other vim plugin -inoremap pumvisible() ? coc#_select_confirm() - \: "\u\\=coc#on_enter()\" - " Use `[g` and `]g` to navigate diagnostics " Use `:CocDiagnostics` to get all diagnostics of current buffer in location list. nmap [g (coc-diagnostic-prev) @@ -53,15 +54,13 @@ nmap gi (coc-implementation) nmap gr (coc-references) " Use K to show documentation in preview window. -nnoremap K :call show_documentation() +nnoremap K :call ShowDocumentation() -function! s:show_documentation() - if (index(['vim','help'], &filetype) >= 0) - execute 'h '.expand('') - elseif (coc#rpc#ready()) +function! ShowDocumentation() + if CocAction('hasProvider', 'hover') call CocActionAsync('doHover') else - execute '!' . &keywordprg . " " . expand('') + call feedkeys('K', 'in') endif endfunction @@ -93,6 +92,9 @@ nmap ac (coc-codeaction) " Apply AutoFix to problem on the current line. nmap qf (coc-fix-current) +" Run the Code Lens action on the current line. +nmap cl (coc-codelens-action) + " Map function and class text objects " NOTE: Requires 'textDocument.documentSymbol' support from the language server. xmap if (coc-funcobj-i) @@ -107,7 +109,7 @@ omap ac (coc-classobj-a) " Remap and for scroll float windows/popups. if has('nvim-0.4.0') || has('patch-8.2.0750') nnoremap coc#float#has_scroll() ? coc#float#scroll(1) : "\" - nnoremap coc#float#has_scroll() ? coc#float#scroll(0) : "\" + nnoremap coc#float#has_scroll() ? coc#float#scroll(0) : "\" inoremap coc#float#has_scroll() ? "\=coc#float#scroll(1)\" : "\" inoremap coc#float#has_scroll() ? "\=coc#float#scroll(0)\" : "\" vnoremap coc#float#has_scroll() ? coc#float#scroll(1) : "\" @@ -120,13 +122,13 @@ nmap (coc-range-select) xmap (coc-range-select) " Add `:Format` command to format current buffer. -command! -nargs=0 Format :call CocAction('format') +command! -nargs=0 Format :call CocActionAsync('format') " Add `:Fold` command to fold current buffer. command! -nargs=? Fold :call CocAction('fold', ) " Add `:OR` command for organize imports of the current buffer. -command! -nargs=0 OR :call CocAction('runCommand', 'editor.action.organizeImport') +command! -nargs=0 OR :call CocActionAsync('runCommand', 'editor.action.organizeImport') " Add (Neo)Vim's native statusline support. " NOTE: Please see `:h coc-status` for integrations with external plugins that @@ -149,4 +151,4 @@ nnoremap j :CocNext " Do default action for previous item. nnoremap k :CocPrev " Resume latest coc list. -nnoremap p :CocListResume +nnoremap p :CocListResume diff --git a/neovim/.config/nvim/ftplugin/tex.vim b/neovim/.config/nvim/ftplugin/tex.vim index 8ca12dd..1b4f901 100644 --- a/neovim/.config/nvim/ftplugin/tex.vim +++ b/neovim/.config/nvim/ftplugin/tex.vim @@ -1,5 +1,3 @@ -" set german as default -setlocal spelllang=de " folding setlocal foldmethod=expr setlocal foldexpr=vimtex#fold#level(v:lnum) diff --git a/neovim/.config/nvim/init.vim b/neovim/.config/nvim/init.vim index 0344240..c2ee86c 100644 --- a/neovim/.config/nvim/init.vim +++ b/neovim/.config/nvim/init.vim @@ -54,6 +54,7 @@ let mapleader=" " " set mapleader to space let maplocalleader=" " " set localleader to space set timeoutlen=1000 " set timeout length set spell " activate spell-checking +setlocal spelllang=de,en_us " enable German and English spell checking set nocompatible " disable compatibility to old-time vi let g:indentLine_setConceal = 0 " disable the conceal 'feature' of indentLine plugin set showmatch " show matching brackets. @@ -193,7 +194,21 @@ highlight CursorLineNr ctermfg=7 lua <