neovim

Personal neovim configuration files
git clone git://gtms.dev/neovim
Log | Files | Refs

commit 7ca9112a5bd2fbd75d831660e3f9527a268302de
parent ff05c17e635cbdf7d6567f5551011953f16f4314
Author: Tomas Nemec <owl@gtms.dev>
Date:   Tue, 13 Feb 2024 09:24:46 +0100

update

Diffstat:
Mafter/plugin/cmp.lua | 8+++++---
Mafter/plugin/qmk.lua | 6+++---
Mlua/tms/lsp/dart.lua | 9++++++++-
3 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/after/plugin/cmp.lua b/after/plugin/cmp.lua @@ -117,7 +117,9 @@ cmp.setup({ { name = 'nvim_lsp', -- entry_filter = function(entry, ctx) - -- vim.print({ entry.id, entry.score, entry.exact, entry.completion_item }) + -- local file = io.open('/home/tms/cmp_log', 'a') + -- file:write(vim.fn.json_encode { entry.id, entry.score, entry.exact, entry.completion_item }) + -- file:close() -- return true -- end, }, @@ -134,10 +136,10 @@ cmp.setup({ priority_weight = 2, comparators = { -- cmp.config.compare.offset, - -- cmp.config.compare.exact, + cmp.config.compare.exact, -- compare.scopes, + cmp.config.compare.score, cmp.config.compare.sort_text, - -- cmp.config.compare.score, -- cmp.config.compare.recently_used, -- cmp.config.compare.locality, -- cmp.config.compare.kind, diff --git a/after/plugin/qmk.lua b/after/plugin/qmk.lua @@ -249,7 +249,7 @@ vim.api.nvim_create_autocmd({ 'BufRead', 'BufNewFile' }, { sources = { { name = 'qmk_keys' }, { name = 'nvim_lsp' }, - { name = 'luasnip' }, + { name = 'snippets' }, { name = 'buffer', keyword_length = 5 }, }, } @@ -282,8 +282,8 @@ if pcall(require, 'qmk') then name = 'LAYOUT_ergodox_pretty', layout = { 'x x x x x x x _ _ x x x x x x x', - 'x x x x x x _ _ _ _ x x x x x x', 'x x x x x x x _ _ x x x x x x x', + 'x x x x x x _ _ _ _ x x x x x x', 'x x x x x x x _ _ x x x x x x x', 'x x x x x _ _ _ _ _ _ x x x x x', '_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _', @@ -294,5 +294,5 @@ if pcall(require, 'qmk') then comment_preview = { keymap_overrides = { XXXXXXX = 'XX', KC_NO = 'XX' } }, } - require('qmk').setup(planck) + require('qmk').setup(ergo) end diff --git a/lua/tms/lsp/dart.lua b/lua/tms/lsp/dart.lua @@ -4,6 +4,13 @@ local capabilities = { workspace = { workspaceEdit = { documentChanges = true }, fileOperations = { willRename = true } }, } +local function root_dir(path) + path = path or vim.fs.dirname(vim.api.nvim_buf_get_name(0)) + local matches = vim.fs.find('pubspec.yaml', + { path = path, upward = true, limit = math.huge, stop = vim.uv.os_homedir() }) + return vim.fs.dirname(matches[#matches]) +end + function M.start() vim.lsp.start { name = 'dartls', @@ -14,7 +21,7 @@ function M.start() '--port=10000', '--instrumentation-log-file=/tmp/dart-plugin-log', }, - root_dir = vim.fs.dirname(vim.fs.find({ 'pubspec.yaml', '.git' }, { upward = true })[1]), + root_dir = root_dir(), capabilities = vim.tbl_deep_extend('force', require'tms.lsp'.capabilities(), capabilities), init_options = { closingLabels = true, outline = true, flutterOutline = true }, settings = { dart = { completeFunctionCalls = true, showTodos = true, lineLength = 120 } },