From e4fe71cac9688e5663f0479234f0afc8b4933840 Mon Sep 17 00:00:00 2001 From: "Christoph J. Scherr" Date: Thu, 6 Jul 2023 09:50:44 +0200 Subject: [PATCH 01/12] disable defaults for nvim-tree wsl --- home/.config/nvim/nvim-tree.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home/.config/nvim/nvim-tree.vim b/home/.config/nvim/nvim-tree.vim index 6083ee6..d49fb59 100644 --- a/home/.config/nvim/nvim-tree.vim +++ b/home/.config/nvim/nvim-tree.vim @@ -21,7 +21,7 @@ local function my_on_attach(bufnr) -- however, through magic, the default keys are loaded anyways ONLY IN WSL -- I have made a separate branch (wsl) for any such things -- just use a proper Linux, if possible - api.config.mappings.default_on_attach(bufnr) + --api.config.mappings.default_on_attach(bufnr) -- custom mappings -- cd From 3687632da7e961a1219710cde77845e6333ed0a6 Mon Sep 17 00:00:00 2001 From: "Christoph J. Scherr" Date: Thu, 6 Jul 2023 10:00:36 +0200 Subject: [PATCH 02/12] fancy fzf spell correction vim --- home/.config/nvim/common.vim | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/home/.config/nvim/common.vim b/home/.config/nvim/common.vim index 9e10e1b..158f6e5 100644 --- a/home/.config/nvim/common.vim +++ b/home/.config/nvim/common.vim @@ -117,8 +117,15 @@ nnoremap ZN [S " mark correct with zg, mark bad with zw, undo with zug/zuw -" correct with zc, default is z= but that sucks for qwertz keyboards -nnoremap z z= +" fancy fzf correct with zc, default is z= but that sucks for qwertz keyboards +function! FzfSpellSink(word) + exe 'normal! "_ciw'.a:word +endfunction +function! FzfSpell() + let suggestions = spellsuggest(expand("")) + return fzf#run({'source': suggestions, 'sink': function("FzfSpellSink"), 'down': 10 }) +endfunction +nnoremap z :call FzfSpell() " don't make things written as `something` a typo syntax region cBackTickNoSpell start=+`+ end=+`+ From 67867720c2c38a93c08667c5558ba94058b155d7 Mon Sep 17 00:00:00 2001 From: "Christoph J. Scherr" Date: Thu, 6 Jul 2023 15:45:45 +0200 Subject: [PATCH 03/12] disable ALE display --- home/.config/nvim/coc-settings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home/.config/nvim/coc-settings.json b/home/.config/nvim/coc-settings.json index 0faf7cd..3e2101c 100644 --- a/home/.config/nvim/coc-settings.json +++ b/home/.config/nvim/coc-settings.json @@ -1,5 +1,5 @@ { "rust-analyzer.server.path": "~/.cargo/bin/rust-analyzer", "suggest.acceptSuggestionOnCommitCharacter": true, - "diagnostic.displayByAle": true + "diagnostic.displayByAle": false } From ed72cc4c3d576efc9dcfd2a92cee8aeba1e7456a Mon Sep 17 00:00:00 2001 From: "Christoph J. Scherr" Date: Mon, 10 Jul 2023 11:14:06 +0200 Subject: [PATCH 04/12] slime finds terminal better now --- home/.config/nvim/main.vim | 5 ----- 1 file changed, 5 deletions(-) diff --git a/home/.config/nvim/main.vim b/home/.config/nvim/main.vim index a9eef6a..654dd12 100644 --- a/home/.config/nvim/main.vim +++ b/home/.config/nvim/main.vim @@ -190,9 +190,4 @@ dimensions = { vim.keymap.set('n', '', 'lua require("FTerm").toggle()') vim.keymap.set('t', '', 'lua require("FTerm").toggle()') --- slime --- get id of a terminal, FloatTerm is usually 7, but I should rice this more -vim.g.slime_get_jobid = function() - return 7 -end EOF From ca4e5dcc35d12ac98567cf4f739b341940163212 Mon Sep 17 00:00:00 2001 From: "Christoph J. Scherr" Date: Mon, 10 Jul 2023 13:18:08 +0200 Subject: [PATCH 05/12] slime hotkeys --- home/.config/nvim/main.vim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/home/.config/nvim/main.vim b/home/.config/nvim/main.vim index 654dd12..2963471 100644 --- a/home/.config/nvim/main.vim +++ b/home/.config/nvim/main.vim @@ -122,6 +122,8 @@ runtime coc.vim " slime (sends stuff to other programs, like ipython) let g:slime_target = "neovim" +nmap a ggvG:SlimeSend +nmap cs :SlimeConfig "------------------------------------------------------ lua << EOF From c626503e8db798716f816a88c4cb7d08f55b186e Mon Sep 17 00:00:00 2001 From: "Christoph J. Scherr" Date: Mon, 10 Jul 2023 14:48:28 +0200 Subject: [PATCH 06/12] disable mouse mostly --- home/.config/nvim/common.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home/.config/nvim/common.vim b/home/.config/nvim/common.vim index 6c5dac9..c9c76a6 100644 --- a/home/.config/nvim/common.vim +++ b/home/.config/nvim/common.vim @@ -14,7 +14,7 @@ set autoindent " indent a new line the same amount as the line just set number " add line numbers set wildmode=longest,list " get bash-like tab completions set cc=100 " set an 100 column border for good coding style -set mouse=a " enable mouse click +set mouse=hr " enable mouse for help file editing and hitting prompts set cursorline " highlight current cursor line set ttyfast " Speed up scrolling in Vim set fdm=indent " folding method syntax From 3fee00aba52726189f9b2c697201fb6a8e1fe15a Mon Sep 17 00:00:00 2001 From: "Christoph J. Scherr" Date: Mon, 10 Jul 2023 14:48:48 +0200 Subject: [PATCH 07/12] format hotkey coc --- home/.config/nvim/coc.vim | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/home/.config/nvim/coc.vim b/home/.config/nvim/coc.vim index cda38f8..944144e 100644 --- a/home/.config/nvim/coc.vim +++ b/home/.config/nvim/coc.vim @@ -78,9 +78,13 @@ autocmd CursorHold * silent call CocActionAsync('highlight') " Symbol renaming nmap rn (coc-rename) +" Formatting all code +vmap F (coc-format-selected) +nmap F (coc-format-selected) + " Formatting selected code -xmap f (coc-format-selected) -nmap f (coc-format-selected) +xmap f :call CocActionAsync('format') +nmap f :call CocActionAsync('format') augroup mygroup autocmd! From f0f20f32b63cfef2da19b4e737a66cb37cdb86f5 Mon Sep 17 00:00:00 2001 From: "Christoph J. Scherr" Date: Tue, 11 Jul 2023 13:32:47 +0200 Subject: [PATCH 08/12] reenable mouse --- home/.config/nvim/common.vim | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/home/.config/nvim/common.vim b/home/.config/nvim/common.vim index c9c76a6..d54a0c2 100644 --- a/home/.config/nvim/common.vim +++ b/home/.config/nvim/common.vim @@ -1,7 +1,6 @@ " GENERAL CONFIGS ---------------------------------------------------------------------------------- syntax on " syntax highlighting set nocompatible " disable compatibility to old-time vi -set mouse=v " middle-click paste with set number set nocompatible set hlsearch " highlight search @@ -14,7 +13,7 @@ set autoindent " indent a new line the same amount as the line just set number " add line numbers set wildmode=longest,list " get bash-like tab completions set cc=100 " set an 100 column border for good coding style -set mouse=hr " enable mouse for help file editing and hitting prompts +set mouse=a " enable mouse for help file editing and hitting prompts set cursorline " highlight current cursor line set ttyfast " Speed up scrolling in Vim set fdm=indent " folding method syntax From 137c09f227f38956d0393e3146318c793abfb9e0 Mon Sep 17 00:00:00 2001 From: "Christoph J. Scherr" Date: Tue, 11 Jul 2023 13:32:47 +0200 Subject: [PATCH 09/12] reenable mouse --- home/.config/nvim/common.vim | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/home/.config/nvim/common.vim b/home/.config/nvim/common.vim index c9c76a6..d54a0c2 100644 --- a/home/.config/nvim/common.vim +++ b/home/.config/nvim/common.vim @@ -1,7 +1,6 @@ " GENERAL CONFIGS ---------------------------------------------------------------------------------- syntax on " syntax highlighting set nocompatible " disable compatibility to old-time vi -set mouse=v " middle-click paste with set number set nocompatible set hlsearch " highlight search @@ -14,7 +13,7 @@ set autoindent " indent a new line the same amount as the line just set number " add line numbers set wildmode=longest,list " get bash-like tab completions set cc=100 " set an 100 column border for good coding style -set mouse=hr " enable mouse for help file editing and hitting prompts +set mouse=a " enable mouse for help file editing and hitting prompts set cursorline " highlight current cursor line set ttyfast " Speed up scrolling in Vim set fdm=indent " folding method syntax From 5c23c39ac371f6f5231f5cb2dc92270995e7d5ea Mon Sep 17 00:00:00 2001 From: "Christoph J. Scherr" Date: Tue, 11 Jul 2023 13:44:47 +0200 Subject: [PATCH 10/12] fix coc commands --- home/.config/nvim/coc.vim | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/home/.config/nvim/coc.vim b/home/.config/nvim/coc.vim index 944144e..a54e606 100644 --- a/home/.config/nvim/coc.vim +++ b/home/.config/nvim/coc.vim @@ -156,18 +156,20 @@ command! -nargs=0 OR :call CocActionAsync('runCommand', 'editor.action.org " Mappings for CoCList " Show all diagnostics -nnoremap CA :CocList diagnostics +nnoremap ca :CocList diagnostics " Manage extensions -nnoremap CE :CocList extensions +nnoremap ce :CocList extensions " Show commands -nnoremap CC :CocList commands +nnoremap cc :CocList commands " Find symbol of current document -nnoremap CO :CocList outline +nnoremap co :CocList outline " Search workspace symbols -nnoremap CS :CocList -I symbols +nnoremap cs :CocList -I symbols " Do default action for next item -nnoremap CJ :CocNext +nnoremap cj :CocNext " Do default action for previous item -nnoremap CK :CocPrev +nnoremap ck :CocPrev " Resume latest coc list -nnoremap CP :CocListResume +nnoremap cp :CocListResume +" reload rust language server +nnoremap crr :CocCommand rust-analyzer.reload From 661238aed01e3cf1d9e9717ce3cdfd6a049f1244 Mon Sep 17 00:00:00 2001 From: "Christoph J. Scherr" Date: Tue, 11 Jul 2023 15:24:16 +0200 Subject: [PATCH 11/12] add coc-markdownlint --- home/.config/nvim/coc.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home/.config/nvim/coc.vim b/home/.config/nvim/coc.vim index a54e606..9678931 100644 --- a/home/.config/nvim/coc.vim +++ b/home/.config/nvim/coc.vim @@ -1,4 +1,4 @@ -let g:coc_global_extensions = ['coc-json', 'coc-git', 'coc-clangd', 'coc-cmake', 'coc-css', 'coc-floaterm', 'coc-fzf-preview', 'coc-html', 'coc-json', 'coc-lists', 'coc-lua', 'coc-pyright', 'coc-rust-analyzer', 'coc-sh', 'coc-sql', ] +let g:coc_global_extensions = ['coc-json', 'coc-git', 'coc-clangd', 'coc-cmake', 'coc-css', 'coc-floaterm', 'coc-fzf-preview', 'coc-html', 'coc-json', 'coc-lists', 'coc-lua', 'coc-pyright', 'coc-rust-analyzer', 'coc-sh', 'coc-sql', 'coc-markdownlint'] " navigate between errors quickly nmap (coc-diagnostic-prev) From 7a9649c523c27faf679c77123687b6f88d480704 Mon Sep 17 00:00:00 2001 From: "Christoph J. Scherr" Date: Tue, 11 Jul 2023 15:24:16 +0200 Subject: [PATCH 12/12] add coc-markdownlint --- home/.config/nvim/coc.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home/.config/nvim/coc.vim b/home/.config/nvim/coc.vim index 944144e..d685182 100644 --- a/home/.config/nvim/coc.vim +++ b/home/.config/nvim/coc.vim @@ -1,4 +1,4 @@ -let g:coc_global_extensions = ['coc-json', 'coc-git', 'coc-clangd', 'coc-cmake', 'coc-css', 'coc-floaterm', 'coc-fzf-preview', 'coc-html', 'coc-json', 'coc-lists', 'coc-lua', 'coc-pyright', 'coc-rust-analyzer', 'coc-sh', 'coc-sql', ] +let g:coc_global_extensions = ['coc-json', 'coc-git', 'coc-clangd', 'coc-cmake', 'coc-css', 'coc-floaterm', 'coc-fzf-preview', 'coc-html', 'coc-json', 'coc-lists', 'coc-lua', 'coc-pyright', 'coc-rust-analyzer', 'coc-sh', 'coc-sql', 'coc-markdownlint'] " navigate between errors quickly nmap (coc-diagnostic-prev)