mirror of
https://github.com/olexsmir/dotfiles.git
synced 2026-01-15 08:41:34 +02:00
update lvim
This commit is contained in:
parent
da1068fdc2
commit
846f37457c
10 changed files with 54 additions and 57 deletions
|
|
@ -1,4 +1,4 @@
|
|||
lvim.format_on_save = false
|
||||
lvim.format_on_save = true
|
||||
lvim.lint_on_save = true
|
||||
lvim.colorscheme = "onedarker"
|
||||
|
||||
|
|
@ -12,29 +12,19 @@ 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"
|
||||
require "user.keymaps"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
lvim.lang.go.formatters = {
|
||||
{ exe = "gofumpt" },
|
||||
-- { exe = "gofmt" },
|
||||
-- { exe = "goimports" },
|
||||
{ exe = "gofumpt" },
|
||||
-- { exe = "gofmt" },
|
||||
{ exe = "goimports" },
|
||||
}
|
||||
|
||||
-- Debugger
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
lvim.lang.lua.formatters = {
|
||||
{ exe = "stylua" },
|
||||
{ exe = "stylua" },
|
||||
}
|
||||
|
||||
lvim.lang.lua.linters = {
|
||||
-- { exe = "luacheck" },
|
||||
-- { exe = "selene" },
|
||||
-- { exe = "luacheck" },
|
||||
{ exe = "selene" },
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
lvim.lang.python.formatters = {
|
||||
{ exe = "black" },
|
||||
{ exe = "isort" },
|
||||
{ exe = "black" },
|
||||
{ exe = "isort" },
|
||||
}
|
||||
|
||||
lvim.lang.python.linters = {
|
||||
{ exe = "flake8" },
|
||||
{ exe = "flake8" },
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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" },
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
8
config/lvim/lua/plug/ultest.lua
Normal file
8
config/lvim/lua/plug/ultest.lua
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
local M = {}
|
||||
|
||||
function M.setup()
|
||||
-- GOlang
|
||||
vim.g["test#go#gotest#optiongs"] = "-v --short"
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
@ -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 @@ lvim.builtin.which_key.mappings["t"] = {
|
|||
}
|
||||
|
||||
-- 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)
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ lvim.plugins = {
|
|||
"folke/todo-comments.nvim",
|
||||
event = "BufRead",
|
||||
config = function()
|
||||
require "plug.todo-comment"
|
||||
require("plug.todo-comment").setup()
|
||||
end,
|
||||
},
|
||||
{
|
||||
|
|
@ -19,7 +19,7 @@ lvim.plugins = {
|
|||
run = "./install.sh",
|
||||
event = "InsertEnter",
|
||||
config = function()
|
||||
require "plug.tabnine"
|
||||
require("plug.tabnine").setup()
|
||||
end,
|
||||
},
|
||||
{
|
||||
|
|
@ -33,7 +33,7 @@ lvim.plugins = {
|
|||
"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 @@ lvim.plugins = {
|
|||
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,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue