commit 00bc382d549a4c3c4c095c55b8cef43444c132a8
parent e2e026aac6a984d6fe1ca03e05ab268a786c5f13
Author: tongong <tongong@gmx.net>
Date: Wed, 25 May 2022 11:01:27 +0200
updated nvim config
Diffstat:
2 files changed, 36 insertions(+), 12 deletions(-)
diff --git a/config/nvim/init.vim b/config/nvim/init.vim
@@ -66,6 +66,7 @@ Plug 'ap/vim-css-color'
Plug 'guns/vim-clojure-static'
Plug 'tpope/vim-classpath'
Plug 'tpope/vim-fireplace'
+Plug 'https://git.sr.ht/~sircmpwn/hare.vim'
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
@@ -227,7 +228,7 @@ augroup main
" filetypes
autocmd BufRead,BufNewFile *.md setlocal filetype=markdown
- autocmd BufEnter *.remark setlocal syntax=markdown
+ autocmd BufRead,BufNewFile *.remark setlocal filetype=markdown
autocmd BufRead,BufNewFile *.elm setlocal tabstop=2 softtabstop=2 shiftwidth=2
" do not keep history for pass
autocmd BufEnter /dev/shm/* setlocal undofile&
diff --git a/config/nvim/lua/config.lua b/config/nvim/lua/config.lua
@@ -1,7 +1,13 @@
require("nvim-treesitter.configs").setup {
- ensure_installed = "maintained",
+ ensure_installed = "all",
+ -- treesitter indentation is broken
+ indent = {
+ enable = false
+ };
highlight = {
enable = true,
+ -- needed to fix indentation...
+ additional_vim_regex_highlighting = true,
},
}
@@ -15,15 +21,22 @@ cmp.setup({
end,
},
mapping = {
- ['<C-b>'] = cmp.mapping(cmp.mapping.scroll_docs(-4), { 'i', 'c' }),
- ['<C-f>'] = cmp.mapping(cmp.mapping.scroll_docs(4), { 'i', 'c' }),
- ['<C-Space>'] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }),
- ['<C-y>'] = cmp.config.disable, -- Specify `cmp.config.disable` if you want to remove the default `<C-y>` mapping.
- ['<C-e>'] = cmp.mapping({
- i = cmp.mapping.abort(),
- c = cmp.mapping.close(),
- }),
- ['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
+ ['<C-j>'] = function(fallback)
+ if cmp.visible() then
+ cmp.select_next_item()
+ else
+ fallback()
+ end
+ end,
+ ['<C-k>'] = function(fallback)
+ if cmp.visible() then
+ cmp.select_prev_item()
+ else
+ fallback()
+ end
+ end,
+ ['<Tab>'] = cmp.mapping.confirm({ select = true }),
+ ['<CR>'] = cmp.mapping.confirm({ select = true }),
},
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
@@ -35,6 +48,16 @@ cmp.setup({
-- Setup lspconfig.
local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())
-require('lspconfig')["ccls"].setup { capabilities = capabilities }
+require('lspconfig')["ccls"].setup {
+ capabilities = capabilities;
+ init_options = {
+ cache = {
+ directory = "/tmp/ccls-cache";
+ };
+ clang = {
+ extraArgs = {"--gcc-toolchain=/usr"};
+ };
+ };
+}
require('lspconfig')["texlab"].setup { capabilities = capabilities }
require('lspconfig')["tsserver"].setup { capabilities = capabilities }