From a537caddf0614aee07023eab0df78c8d0d28d428 Mon Sep 17 00:00:00 2001 From: neoteny Date: Sun, 3 Oct 2021 11:21:06 +0300 Subject: [PATCH] update: lvim, zsh --- config/lvim/config.lua | 35 ++++++++++++++++++++++++++--- config/lvim/ftplugin/go.lua | 5 +++-- config/lvim/ftplugin/javascript.lua | 4 ++-- config/lvim/lsp-settings/gopls.json | 4 ++-- config/lvim/lua/user/conjure.lua | 32 -------------------------- zshrc | 6 +---- 6 files changed, 40 insertions(+), 46 deletions(-) diff --git a/config/lvim/config.lua b/config/lvim/config.lua index cbc2beb..19385e8 100644 --- a/config/lvim/config.lua +++ b/config/lvim/config.lua @@ -47,11 +47,40 @@ end -- Pluginos lvim.plugins = { { "tpope/vim-surround", keys = { "c", "y", "d" }, event = "BufRead" }, - { "tzachar/cmp-tabnine", run = "./install.sh", event = "InsertEnter" }, { "folke/trouble.nvim", cmd = { "TroubleToggle" } }, - { "folke/todo-comments.nvim", event = "BufRead" }, { "editorconfig/editorconfig-vim" }, - { "theHamsta/nvim-dap-virtual-text", config = "vim.g.dap_virtual_text = true" }, + { + "theHamsta/nvim-dap-virtual-text", + config = function() + require("user.conjure").setup() + end, + }, + { + "folke/todo-comments.nvim", + event = "BufRead", + config = function() + require("todo-comments").setup({}) + end, + }, + { + "tzachar/cmp-tabnine", + run = "./install.sh", + event = "InsertEnter", + config = function() + require("cmp_tabnine.config"):setup({ + max_lines = 1000, + max_num_results = 10, + sort = true, + }) + end, + }, + { + "folke/lua-dev.nvim", + ft = "lua", + config = function() + require("user.lua-dev").setup() + end, + }, { "Smirnov-O/ts-unit.nvim", keys = { "vip", "cip", "yip", "dip" }, diff --git a/config/lvim/ftplugin/go.lua b/config/lvim/ftplugin/go.lua index b61fb5a..6c74444 100644 --- a/config/lvim/ftplugin/go.lua +++ b/config/lvim/ftplugin/go.lua @@ -1,6 +1,7 @@ lvim.lang.go.formatters = { - { exe = "gofmt" }, - { exe = "goimports" }, + { exe = "gofumpt" }, + -- { exe = "gofmt" }, + -- { exe = "goimports" }, } -- Debugger diff --git a/config/lvim/ftplugin/javascript.lua b/config/lvim/ftplugin/javascript.lua index 8652940..c6b3012 100644 --- a/config/lvim/ftplugin/javascript.lua +++ b/config/lvim/ftplugin/javascript.lua @@ -12,7 +12,7 @@ require("dap-install").config("jsnode", {}) -- Lsp lvim.lang.javascript.lsp.setup.handlers = { - ["textDocument/publishDiagnostics"] = function(_, _, p, client_id, _, config) + ["textDocument/publishDiagnostics"] = function(_, _, p, id, _, cfg) if p.diagnostics ~= nil then local i = 1 while i <= #p.diagnostics do @@ -23,6 +23,6 @@ lvim.lang.javascript.lsp.setup.handlers = { end end end - vim.lsp.diagnostic.on_publish_diagnostics(_, _, p, client_id, _, config) + vim.lsp.diagnostic.on_publish_diagnostics(_, _, p, id, _, cfg) end, } diff --git a/config/lvim/lsp-settings/gopls.json b/config/lvim/lsp-settings/gopls.json index 72d65a6..79e1ce0 100644 --- a/config/lvim/lsp-settings/gopls.json +++ b/config/lvim/lsp-settings/gopls.json @@ -1,6 +1,6 @@ { "go.logging.level": "error", - "go.lintOnSave": "file", + "go.lintOnSave": "package", "go.lintTool": "golint", - "go.formatTool": "gofmt" + "go.formatTool": "gofumpt" } diff --git a/config/lvim/lua/user/conjure.lua b/config/lvim/lua/user/conjure.lua index 41ed49f..4fa27c0 100644 --- a/config/lvim/lua/user/conjure.lua +++ b/config/lvim/lua/user/conjure.lua @@ -11,38 +11,6 @@ M.setup = function() -- Scheme vim.g["conjure#client#scheme#stdio#command"] = "chicken-csi -quiet -:c" vim.g["conjure#client#scheme#stdio#prompt_pattern"] = "\n-#;%d-> " - - lvim.builtin.cmp.sources = { - { name = "nvim_lsp", max_item_count = 7 }, - { name = "cmp_tabnine", max_item_count = 3 }, - { name = "buffer", max_item_count = 3 }, - { name = "path", max_item_count = 5 }, - { name = "luasnip", max_item_count = 3 }, - { name = "nvim_lua" }, - { name = "conjure" }, - } - - lvim.builtin.cmp.formatting = { - format = function(entry, vim_item) - local cmp_kind = require("user.lsp_kind").cmp_kind - vim_item.kind = cmp_kind(vim_item.kind) - vim_item.menu = ({ - buffer = "(Buffer)", - nvim_lsp = "(LSP)", - luasnip = "(Snip)", - spell = "(Spell)", - path = "(Path)", - conjure = "(Conjure)", - cmp_tabnine = "(Tabnine)", - })[entry.source.name] - vim_item.dup = ({ - buffer = 1, - path = 1, - nvim_lsp = 0, - })[entry.source.name] or 0 - return vim_item - end, - } end return M diff --git a/zshrc b/zshrc index ad99fe6..20a06f5 100644 --- a/zshrc +++ b/zshrc @@ -25,17 +25,13 @@ eval "$(zoxide init zsh)" dotnet() { $HOME/dotnet/dotnet "$@" } -asdf() { - . /opt/asdf-vm/asdf.sh - asdf $@ -} ## Aliases alias cls="clear" cp="cp -r" mkdir="mkdir -p" open="open_command" lg="lazygit" alias lv="lvim" vim="lvim" alias ...="cd ../.." .3="cd ../../.." alias gor="go run" gob="go build" gog="go get" goi="go install" got="go test" -alias n="npm" +alias n="npm" asdfi=". /opt/asdf-vm/asdf.sh" if [[ -f "/bin/exa" ]]; then alias ls="exa -l" ll="ls" la="ls -a"