More neovim settings updates
diff --git a/modules/neovim/coc/default.nix b/modules/neovim/coc/default.nix
index d119954..cfdfda9 100644
--- a/modules/neovim/coc/default.nix
+++ b/modules/neovim/coc/default.nix
@@ -12,11 +12,23 @@
coc = {
enable = true;
settings = {
+ diagnostic.floatConfig = {
+ border = true;
+ rounded = true;
+ };
+ signature.floatConfig = {
+ border = true;
+ rounded = true;
+ };
+ hover.floatConfig = {
+ border = true;
+ rounded = true;
+ };
suggest.floatConfig = {
border = true;
rounded = true;
};
- "suggest.noselect" = false;
+ "suggest.noselect" = true;
"cSpell.checkOnlyEnabledfileTypes" = false;
"diagnostic.virtualText" = true;
"diagnostic.virtualTextCurrentLineOnly" = false;
@@ -35,6 +47,7 @@
code_blocks = false;
tables = false;
};
+ MD024.siblings_only = true;
};
languageserver = {
nix = {
@@ -42,6 +55,10 @@
filetypes = ["nix"];
};
};
+ "snippets.extends" = {
+ markdown = ["tex"];
+ };
+ "snippets.autoTrigger" = false;
};
};
plugins = with pkgs.vimPlugins; [
@@ -55,6 +72,7 @@
coc-go
coc-markdownlint
coc-texlab
+ coc-pyright
# Spellchecker
nixpkgs-minion.legacyPackages.${system}.vimPlugins.coc-spell-checker
@@ -68,7 +86,7 @@
vim-snippets
coc-snippets
- # General utils
+ # General utilities
coc-pairs
];
extraConfig = lib.pipe [./keybinds.vim ./theme.vim] [
@@ -82,22 +100,31 @@
rust-analyzer
texlab
omnisharp-roslyn
+ nodePackages.pyright
+ (python3.withPackages (pyPkgs:
+ with pyPkgs; [
+ pycodestyle
+ black
+ rope
+ ]))
];
};
- home.file = lib.pipe ./snippets [
- builtins.readDir
- builtins.attrNames
- (map
- (f: {
- name = ".config/nvim/UltiSnips/${f}";
- value = {
- source = ./snippets + "/${f}";
- target = ".config/nvim/UltiSnips/${f}";
- };
- }))
- builtins.listToAttrs
- lib.traceValSeq
- ] // {
- ".config/coc/placeholder".text = "";
- };
+ home.file =
+ lib.pipe ./snippets [
+ builtins.readDir
+ builtins.attrNames
+ (map
+ (f: {
+ name = ".config/nvim/UltiSnips/${f}";
+ value = {
+ source = ./snippets + "/${f}";
+ target = ".config/nvim/UltiSnips/${f}";
+ };
+ }))
+ builtins.listToAttrs
+ lib.traceValSeq
+ ]
+ // {
+ ".config/coc/placeholder".text = "";
+ };
}
diff --git a/modules/neovim/coc/keybinds.vim b/modules/neovim/coc/keybinds.vim
index 0116a91..ae7e174 100644
--- a/modules/neovim/coc/keybinds.vim
+++ b/modules/neovim/coc/keybinds.vim
@@ -1,5 +1,5 @@
-nmap <silent> ]c :call CocAction('diagnosticNext')<cr>
-nmap <silent> [c :call CocAction('diagnosticPrevious')<cr>
+nmap <silent> ]c :silent! call CocAction('diagnosticNext')<cr>
+nmap <silent> [c :silent! call CocAction('diagnosticPrevious')<cr>
nmap <silent> <Leader>fs <Plug>(coc-codeaction-selected)
nmap <silent> <Leader>fb <Plug>(coc-codeaction)
nmap <silent> <Leader>ff <Plug>(coc-codeaction-cursor)
@@ -29,7 +29,6 @@
snoremap <nowait><silent> <Tab> <Esc>:call UltiSnips#JumpForwards()<cr>
snoremap <nowait><silent> <S-Tab> <Esc>:call UltiSnips#JumpForwards()<cr>
-inoremap <silent><silent> <C-s> <Esc>l:Snippets<cr>
function! s:show_documentation()
@@ -41,3 +40,8 @@
endfunction
nnoremap <silent> K :call <SID>show_documentation()<CR>
+
+command Snippets CocFzfList snippets
+
+autocmd FileType tex let b:coc_pairs = [["$", "$"]]
+autocmd FileType markdown let b:coc_pairs = [["$", "$"]]
diff --git a/modules/neovim/coc/snippets/markdown.snippets b/modules/neovim/coc/snippets/markdown.snippets
index c5c7f21..041cddc 100644
--- a/modules/neovim/coc/snippets/markdown.snippets
+++ b/modules/neovim/coc/snippets/markdown.snippets
@@ -24,27 +24,23 @@
# Online reference: https://github.com/SirVer/ultisnips/blob/master/doc/UltiSnips.txt
snippet latex "A latex block" w
-$${0}$
+$${VISUAL}${1}$${0}
endsnippet
snippet dydx "The derivative" i
-\frac{dy}{dx}
+\frac{d${1:y}}{d${2:x}}${0}
endsnippet
-snippet dydt "The derivative of `y` WRT `t`" i
-\frac{dy}{dx}
+snippet derivative "The derivative" i
+\frac{d${1:y}}{d${2:x}}${0}
endsnippet
-snippet dydx "The derivative of `x` WRT `t`" i
-\frac{dy}{dx}
+snippet inti "Integrate indefinitely" i
+\int ${1} \text{ d}${2:x}${0}
endsnippet
-snippet iidx "Integrate indefinitely with respect to x" i
-\int ${0} \text{ d}x
-endsnippet
-
-snippet iddx "Integrate definitely with respect to x" i
-\int{${0}}{${1}}${2} \text{ d}x
+snippet intd "Integrate definitely" i
+\int{${1}}{${2}}${3} \text{ d}${4:x}${0}
endsnippet
snippet ihat "The I vector" i
@@ -55,12 +51,12 @@
\hat{\bm{j}}
endsnippet
-snippet vec "A vector" i
-\bm{${0}}
+snippet vecbold "A vector" i
+\bm{${1}}${0}
endsnippet
-snippet col "A column vector" i
-\begin{bmatrix}${0}\end{bmatrix}
+snippet veccol2 "A 2-tall column vector" i
+\begin{pmatrix} ${1} \\\\ ${2} \end{pmatrix}${0}
endsnippet
snippet nl "A latex newline (e.g. for column vectors)" i
@@ -68,7 +64,7 @@
endsnippet
snippet d2ydx2 "The second derivative" i
-\frac{d^2y}{dx^2}
+\frac{d^2${1:y}}{d${2:x}^2}${0}
endsnippet
snippet nospell "Disable spellcheck on the visually-selected region"
@@ -77,6 +73,10 @@
<!-- spell-checker:enable -->
endsnippet
-snippet normaldistribution "A normal distribution" w
-X\sim N(${0:mean}, ${1:variance})
+snippet normaldistribution "A normal distribution" i
+X\sim N(${1:mean}, ${2:variance})${0}
+endsnippet
+
+snippet 2x2matrix "A 2 by 2 matrix" i
+\begin{bmatrix} ${1} & ${2} \\\\ ${3} & ${4} \end{bmatrix}${0}
endsnippet
diff --git a/modules/neovim/coc/theme.vim b/modules/neovim/coc/theme.vim
index dae527c..a5f52f5 100644
--- a/modules/neovim/coc/theme.vim
+++ b/modules/neovim/coc/theme.vim
@@ -11,3 +11,8 @@
call g:Highlight("CocPumMenu", g:transparent, g:black)
call g:Highlight("CocFloating", g:transparent, g:black)
call g:Highlight("CocSearch", g:red, g:transparent)
+
+call g:Highlight("DiagnosticVirtualTextInfo", g:darkblue, g:transparent)
+call g:Highlight("DiagnosticVirtualTextHint", g:darkblue, g:transparent)
+call g:Highlight("DiagnosticVirtualTextWarn", g:darkyellow, g:transparent)
+call g:Highlight("DiagnosticVirtualTextError", g:darkred, g:transparent)
diff --git a/modules/neovim/coc/trouble.lua b/modules/neovim/coc/trouble.lua
deleted file mode 100644
index ede4963..0000000
--- a/modules/neovim/coc/trouble.lua
+++ /dev/null
@@ -1,3 +0,0 @@
-require("trouble").setup {
- use_diagnostic_signs = true,
-}