Update neovim settings
diff --git a/modules/neovim/coc/default.nix b/modules/neovim/coc/default.nix
index e174559..d119954 100644
--- a/modules/neovim/coc/default.nix
+++ b/modules/neovim/coc/default.nix
@@ -18,6 +18,8 @@
};
"suggest.noselect" = false;
"cSpell.checkOnlyEnabledfileTypes" = false;
+ "diagnostic.virtualText" = true;
+ "diagnostic.virtualTextCurrentLineOnly" = false;
"cSpell.dictionaryDefinitions" = [
{
name = "imperative";
@@ -63,9 +65,8 @@
coc-git # TODO: Check if coc-git is still needed
# Snippet completion
- ultisnips
vim-snippets
- coc-ultisnips
+ coc-snippets
# General utils
coc-pairs
diff --git a/modules/neovim/coc/keybinds.vim b/modules/neovim/coc/keybinds.vim
index d92073b..0116a91 100644
--- a/modules/neovim/coc/keybinds.vim
+++ b/modules/neovim/coc/keybinds.vim
@@ -12,13 +12,24 @@
let g:UltiSnipsJumpForwardTrigger="<NUL>"
let g:UltiSnipsJumpBackwardTrigger="<NUL>"
inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm() : "\<CR>"
-inoremap <silent><expr> <Tab> coc#pum#visible() ? coc#pum#next(0) : UltiSnips#CanJumpForwards() ? "<C-R>=UltiSnips#JumpForwards()<cr>" : "\<Tab>"
-inoremap <silent><expr> <S-Tab> coc#pum#visible() ? coc#pum#prev(0) : UltiSnips#CanJumpBackwards() ? "<C-R>=UltiSnips#JumpBackwards()<cr>" : "\<S-Tab>"
-xnoremap <silent> <Tab> :call UltiSnips#SaveLastVisualSelection()<cr>gvs
+inoremap <silent><expr> <Tab> coc#pum#visible() ? coc#pum#next(0) :
+ \ coc#expandableOrJumpable() ? "\<C-r>=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\<CR>" :
+ \ CheckBackSpace() ? "\<TAB>" :
+ \ coc#refresh()
+
+function! CheckBackSpace() abort
+ let col = col('.') - 1
+ return !col || getline('.')[col - 1] =~# '\s'
+endfunction
+
+let g:coc_snippet_next = '<tab>'
+inoremap <silent><expr> <S-Tab> coc#pum#visible() ? coc#pum#prev(0) : "\<S-Tab>"
+xnoremap <silent> <Tab> <Plug>(coc-snippets-select)
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()
diff --git a/modules/neovim/coc/snippets/markdown.snippets b/modules/neovim/coc/snippets/markdown.snippets
index 4754625..c5c7f21 100644
--- a/modules/neovim/coc/snippets/markdown.snippets
+++ b/modules/neovim/coc/snippets/markdown.snippets
@@ -43,7 +43,7 @@
\int ${0} \text{ d}x
endsnippet
-snippet idx "Integrate definitely with respect to x" i
+snippet iddx "Integrate definitely with respect to x" i
\int{${0}}{${1}}${2} \text{ d}x
endsnippet
@@ -76,3 +76,7 @@
${VISUAL}
<!-- spell-checker:enable -->
endsnippet
+
+snippet normaldistribution "A normal distribution" w
+X\sim N(${0:mean}, ${1:variance})
+endsnippet
diff --git a/modules/neovim/coc/trouble.lua b/modules/neovim/coc/trouble.lua
new file mode 100644
index 0000000..ede4963
--- /dev/null
+++ b/modules/neovim/coc/trouble.lua
@@ -0,0 +1,3 @@
+require("trouble").setup {
+ use_diagnostic_signs = true,
+}
diff --git a/modules/neovim/hardtime/hardtime.vim b/modules/neovim/hardtime/hardtime.vim
index 910244a..1f0df2c 100644
--- a/modules/neovim/hardtime/hardtime.vim
+++ b/modules/neovim/hardtime/hardtime.vim
@@ -2,3 +2,5 @@
let g:list_of_disabled_keys = ["<UP>", "<DOWN>", "<LEFT>", "<RIGHT>"]
let g:hardtime_showmsg = 1
let g:hardtime_allow_different_key = 1
+
+
diff --git a/modules/neovim/markdown/default.nix b/modules/neovim/markdown/default.nix
index 9829208..39dbf4d 100644
--- a/modules/neovim/markdown/default.nix
+++ b/modules/neovim/markdown/default.nix
@@ -5,6 +5,7 @@
ncm2-markdown-subscope
markdown-preview-nvim
vim-table-mode
+ vim-pandoc
];
extraConfig = builtins.readFile ./markdown.vim;
};
diff --git a/modules/neovim/markdown/markdown.vim b/modules/neovim/markdown/markdown.vim
index 0ff94c1..9092207 100644
--- a/modules/neovim/markdown/markdown.vim
+++ b/modules/neovim/markdown/markdown.vim
@@ -3,3 +3,8 @@
let g:vim_markdown_new_list_item_indent = 2
let g:vim_markdown_autowrite = 1
+let g:pandoc#filetypes#pandoc_markdown = 0
+let g:pandoc#filetypes#handled = ["pandoc", "rst", "textile", "markdown"]
+let g:pandoc#formatting#textwidth = 80
+let g:pandoc#formatting#mode = "h"
+let g:pandoc#spell#enabled = 0
diff --git a/modules/neovim/wiki/wiki.vim b/modules/neovim/wiki/wiki.vim
index a4f8f39..13f6a33 100644
--- a/modules/neovim/wiki/wiki.vim
+++ b/modules/neovim/wiki/wiki.vim
@@ -1,6 +1,7 @@
let g:wiki_root = '~/Documents/wiki'
let g:wiki_filetypes = ['md']
let g:wiki_link_extension = '.md'
+let g:wiki_index_name = 'README'
let g:wiki_map_create_page = 'WikiCreateTransform'
@@ -9,6 +10,8 @@
" If the file is new, then append the current date
return filereadable(l:name)
\ ? a:name
+ \ : a:name =~ ".*\.private$"
+ \ ? substitute(substitute(a:name, " ", "_", "g"), "\.private$", "", "") . "_" . strftime("%Y%m%d") . ".private"
\ : substitute(a:name, " ", "_", "g") . '_' . strftime('%Y%m%d')
endfunction