all repos

dotfiles @ 846f374

my dotfiles
10 files changed, 54 insertions(+), 57 deletions(-)
update lvim
Author: neoteny ss2316544@gmail.com
Committed at: 2021-10-08 09:42:28 +0300
Parent: da1068f
M config/lvim/config.lua

@@ -1,4 +1,4 @@

-lvim.format_on_save = false +lvim.format_on_save = true lvim.lint_on_save = true lvim.colorscheme = "onedarker"

@@ -12,28 +12,18 @@ lvim.builtin.gitsigns.opts.current_line_blame = true

lvim.builtin.gitsigns.opts.current_line_blame_opts = { delay = 200 } -- TreeSitter -lvim.builtin.treesitter.ensure_installed = { - "javascript", - "typescript", - "jsdoc", - "yaml", - "toml", - "lua", - "go", -} +lvim.builtin.treesitter.ensure_installed = { "javascript", "typescript", "jsdoc", "yaml", "toml", "lua", "go", "gomod" } lvim.builtin.treesitter.indent.disable = { "python" } -- Telescope lvim.builtin.telescope.defaults.layout_config.prompt_position = "top" -lvim.builtin.telescope.defaults.file_ignore_patterns = { - ".git", - "node_modules", - "env", - ".bin", -} +lvim.builtin.telescope.defaults.file_ignore_patterns = { ".git", "node_modules", "target", "env", ".bin" } -- NvimTree lvim.builtin.nvimtree.ignore = { ".git", "node_modules", ".bin", "env" } + +-- LSP +-- lvim.lsp.override = {"gopls"} -- Others require "user.plugins"
M config/lvim/ftplugin/go.lua

@@ -1,7 +1,7 @@

lvim.lang.go.formatters = { - { exe = "gofumpt" }, - -- { exe = "gofmt" }, - -- { exe = "goimports" }, + { exe = "gofumpt" }, + -- { exe = "gofmt" }, + { exe = "goimports" }, } -- Debugger
M config/lvim/ftplugin/javascript.lua

@@ -1,10 +1,10 @@

lvim.lang.javascript.formatters = { - -- { exe = "eslint_d" }, - { exe = "prettierd" }, + -- { exe = "eslint_d" }, + { exe = "prettierd" }, } lvim.lang.javascript.linters = { - { exe = "eslint_d" }, + { exe = "eslint_d" }, } -- Debugger

@@ -12,17 +12,17 @@ require("dap-install").config("jsnode", {})

-- Lsp lvim.lang.javascript.lsp.setup.handlers = { - ["textDocument/publishDiagnostics"] = function(_, _, p, id, _, cfg) - if p.diagnostics ~= nil then - local i = 1 - while i <= #p.diagnostics do - if p.diagnostics[i].code == 80001 then - table.remove(p.diagnostics, i) - else - i = i + 1 - end - end - end - vim.lsp.diagnostic.on_publish_diagnostics(_, _, p, id, _, cfg) - end, + ["textDocument/publishDiagnostics"] = function(_, _, p, id, _, cfg) + if p.diagnostics ~= nil then + local i = 1 + while i <= #p.diagnostics do + if p.diagnostics[i].code == 80001 then + table.remove(p.diagnostics, i) + else + i = i + 1 + end + end + end + vim.lsp.diagnostic.on_publish_diagnostics(_, _, p, id, _, cfg) + end, }
M config/lvim/ftplugin/lua.lua

@@ -1,8 +1,8 @@

lvim.lang.lua.formatters = { - { exe = "stylua" }, + { exe = "stylua" }, } lvim.lang.lua.linters = { - -- { exe = "luacheck" }, - -- { exe = "selene" }, + -- { exe = "luacheck" }, + { exe = "selene" }, }
M config/lvim/ftplugin/python.lua

@@ -1,8 +1,8 @@

lvim.lang.python.formatters = { - { exe = "black" }, - { exe = "isort" }, + { exe = "black" }, + { exe = "isort" }, } lvim.lang.python.linters = { - { exe = "flake8" }, + { exe = "flake8" }, }
M config/lvim/ftplugin/typescript.lua

@@ -1,8 +1,8 @@

lvim.lang.typescript.formatters = { - -- { exe = "eslint_d" }, - { exe = "prettierd" }, + -- { exe = "eslint_d" }, + { exe = "prettierd" }, } lvim.lang.typescript.linters = { - { exe = "eslint_d" }, + { exe = "eslint_d" }, }
M config/lvim/lua/plug/tabnine.lua

@@ -1,12 +1,12 @@

local M = {} function M.setup() - local ok, tabnine = pcall(require, "cmp_tabnine.config") + local ok, tabnine_cfg = pcall(require, "cmp_tabnine.config") if not ok then return end - tabnine:setup { + tabnine_cfg:setup { max_lines = 1000, max_num_results = 10, sort = true,
A config/lvim/lua/plug/ultest.lua

@@ -0,0 +1,8 @@

+local M = {} + +function M.setup() + -- GOlang + vim.g["test#go#gotest#optiongs"] = "-v --short" +end + +return M
M config/lvim/lua/user/keymaps.lua

@@ -1,9 +1,10 @@

lvim.keys.normal_mode["<C-w>"] = "<cmd>BufferClose<cr>" lvim.keys.normal_mode["<C-s>"] = "<cmd>w<cr>" +lvim.keys.term_mode["jk"] = "<C-\\><C-n>" lvim.keys.visual_mode["jk"] = "<esc>" -- Which key -lvim.builtin.which_key.mappings.l.a = { "<cmd>Telescope lsp_code_actions<cr>", "Code Actions" } +-- lvim.builtin.which_key.mappings.l.a = { "<cmd>Telescope lsp_code_actions<cr>", "Code Actions" } lvim.builtin.which_key.mappings.l.d = { "<cmd>TroubleToggle<cr>", "Diagnostics" } lvim.builtin.which_key.mappings.l.R = { "<cmd>TroubleToggle lsp_references<cr>", "References" } lvim.builtin.which_key.mappings.s.P = { "<cmd>Telescope projects<cr>", "Projects" }

@@ -19,6 +20,7 @@ k = { "<Plug>(ultest-prev-fail)", "Prev fail" },

} -- Beffers +lvim.keys.normal_mode["<A-0>"] = "<cmd>BufferLast<cr>" local fmt = string.format for i = 1, 9 do lvim.keys.normal_mode[fmt("<A-%d>", i)] = fmt("<cmd>BufferGoto %d<cr>", i)
M config/lvim/lua/user/plugins.lua

@@ -11,7 +11,7 @@ {

"folke/todo-comments.nvim", event = "BufRead", config = function() - require "plug.todo-comment" + require("plug.todo-comment").setup() end, }, {

@@ -19,7 +19,7 @@ "tzachar/cmp-tabnine",

run = "./install.sh", event = "InsertEnter", config = function() - require "plug.tabnine" + require("plug.tabnine").setup() end, }, {

@@ -33,7 +33,7 @@ {

"Smirnov-O/ts-unit.nvim", keys = { "vip", "cip", "yip", "dip" }, config = function() - require "plug.ts-unit" + require("plug.ts-unit").setup() end, }, {

@@ -41,13 +41,10 @@ "rcarriga/vim-ultest",

requires = { { "vim-test/vim-test", after = "vim-ultest" }, }, + cmd = { "Ultest", "UltestStop", "UltestClear", "UltestNearest", "UltestOutput" }, run = ":UpdateRemotePlugins", - cmd = { - "Ultest", - "UltestStop", - "UltestClear", - "UltestNearest", - "UltestOutput", - }, + config = function() + require("plug.ultest").setup() + end, }, }