all repos

init.lua @ e8875d6b4513b7067717906472d3a5cb205f00a2

my nvim config
20 files changed, 68 insertions(+), 115 deletions(-)
clean config
Author: Smirnov Oleksandr ss2316544@gmail.com
Committed at: 2022-12-21 16:18:05 +0200
Parent: 6c962fd
M ftplugin/lua.lua

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

-local map = require("core.utils").map - vim.opt_local.tabstop = 2 vim.opt_local.shiftwidth = 2 vim.opt_local.softtabstop = 2 - -map("n", "<leader>;t", "<Plug>PlenaryTestFile")
D

@@ -1,3 +0,0 @@

-vim.opt_local.tabstop = 4 -vim.opt_local.shiftwidth = 4 -vim.opt_local.softtabstop = 4
M lua/configs/cmp.lua

@@ -101,7 +101,6 @@ end

end, }, sources = { - { name = "conjure", max_item_count = 4 }, { name = "nvim_lsp", max_item_count = 8 }, { name = "buffer", max_item_count = 4 }, { name = "luasnip", max_item_count = 3 },
M lua/configs/dap/init.lua

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

-local dap = require "dap" - require("nvim-dap-virtual-text").setup {} require "configs.dap.ui" - --- NOTE: go setuping in ftplugin/go.lua -require "configs.dap.langs.python"(dap) vim.fn.sign_define("DapBreakpoint", { text = "",
D

@@ -1,17 +0,0 @@

-return function(dap) - dap.adapters.python = { - type = "executable", - command = "python", - args = { "-m", "debugpy.adapter" }, - } - - dap.configurations.python = { - { - type = "python", - request = "launch", - name = "Launch file", - program = "${file}", - pythonPath = "python", - }, - } -end
M lua/configs/illuminate.lua

@@ -3,8 +3,7 @@ providers = { "lsp", "treesitter" },

filetypes_denylist = { "NvimTree", "packer", - "neogitstatus", - "Trouble", + "NeogitStatus", "TelescopePrompt", }, }
M lua/configs/lsp/diagnostic.lua

@@ -1,45 +1,47 @@

-return function() - local border = { - { "", "FloatBorder" }, - { "", "FloatBorder" }, - { "", "FloatBorder" }, - { "", "FloatBorder" }, - { "", "FloatBorder" }, - { "", "FloatBorder" }, - { "", "FloatBorder" }, - { "", "FloatBorder" }, - } +local M = {} - local diagnostic = { - virtual_text = true, - update_in_insert = false, - underline = true, - severity_sort = false, - signs = { - active = { - { name = "DiagnosticSignError", text = "" }, - { name = "DiagnosticSignWarn", text = "" }, - { name = "DiagnosticSignHint", text = "" }, - { name = "DiagnosticSignInfo", text = "" }, - }, - }, - float = { - focusable = true, - style = "minimal", - border = border, - source = "always", - header = "", - prefix = "", +M.border = { + { "", "FloatBorder" }, + { "", "FloatBorder" }, + { "", "FloatBorder" }, + { "", "FloatBorder" }, + { "", "FloatBorder" }, + { "", "FloatBorder" }, + { "", "FloatBorder" }, + { "", "FloatBorder" }, +} + +M.diagnostic = { + virtual_text = true, + update_in_insert = false, + underline = true, + severity_sort = false, + signs = { + active = { + { name = "DiagnosticSignError", text = "" }, + { name = "DiagnosticSignWarn", text = "" }, + { name = "DiagnosticSignHint", text = "" }, + { name = "DiagnosticSignInfo", text = "" }, }, - } + }, + float = { + focusable = true, + style = "minimal", + border = M.border, + source = "always", + header = "", + prefix = "", + }, +} +function M.setup() vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { - border = border, + border = M.border, }) - vim.diagnostic.config(diagnostic) - for _, sign in ipairs(diagnostic.signs.active) do + vim.diagnostic.config(M.diagnostic) + for _, sign in ipairs(M.diagnostic.signs.active) do vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text,

@@ -47,3 +49,5 @@ numhl = "",

}) end end + +return M
M lua/configs/lsp/init.lua

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

-require "configs.lsp.diagnostic"() +require("configs.lsp.diagnostic").setup() require "configs.lsp.inlayhints" require "configs.lsp.null-ls" require("mason-lspconfig").setup {
M lua/configs/lsp/inlayhints.lua

@@ -1,32 +1,22 @@

local hints = require "lsp-inlayhints" -local group = vim.api.nvim_create_augroup("LspAttach_inlayhints", {}) vim.api.nvim_create_autocmd("LspAttach", { - group = group, callback = function(args) - if not (args.data and args.data.client_id) then + if not args.data and not args.data.client_id then return end - local client = vim.lsp.get_client_by_id(args.data.client_id) - hints.on_attach(client, args.buf) + hints.on_attach( + vim.lsp.get_client_by_id(args.data.client_id), + args.buf, + true + ) end, }) hints.setup { inlay_hints = { highlight = "Comment", - parameter_hints = { - show = false, - prefix = "<- ", - separator = ", ", - }, - type_hints = { - show = true, - prefix = "", - separator = ", ", - remove_colon_end = false, - remove_colon_start = false, - }, + parameter_hints = { show = false }, }, }
M lua/configs/lsp/null-ls.lua

@@ -9,9 +9,7 @@ sources = {

formatting.stylua, diagnostic.selene, formatting.black.with { extra_args = { "--fast" } }, - formatting.djhtml, diagnostic.flake8, - formatting.isort, diagnostic.golangci_lint, formatting.gofumpt, formatting.goimports,
M lua/configs/lsp/servers.lua

@@ -3,8 +3,7 @@

return { denols = { root_dir = lspconfig.util.root_pattern("deno.json", "deno.jsonc") }, tsserver = { root_dir = lspconfig.util.root_pattern "package.json" }, - -- stylua: ignore - emmet_ls = { filetypes = { "css", "html", "htmldjango", "less", "scss", "javascriptreact", "typescriptreact" } }, + emmet_ls = {}, dockerls = {}, gopls = { settings = {

@@ -23,8 +22,8 @@ rangeVariableTypes = true,

}, codelenses = { generate = false, - gc_details = true, - test = true, + gc_details = false, + test = false, tidy = true, }, },
M lua/configs/neotest.lua

@@ -5,7 +5,6 @@

neotest.setup { adapters = { require "neotest-go" { experimental = { test_table = true } }, - require "neotest-jest", require "neotest-plenary", }, icons = {
M lua/configs/nvimtree.lua

@@ -4,7 +4,14 @@ renderer = { group_empty = true },

git = { enable = true }, filters = { dotfiles = true, - custom = { "^\\.git$", "node_modules", "__pycache__", "vendor", "target" }, + custom = { + "^\\.git$", + "^\\.bin$", + "node_modules", + "__pycache__", + "vendor", + "target", + }, }, view = { side = "right",

@@ -13,6 +20,7 @@ list = {

{ key = { "l", "<CR>", "o" }, action = "edit" }, { key = "h", action = "close_node" }, { key = "v", action = "vsplit" }, + { key = "s", action = "split" }, }, }, },
M lua/configs/project.lua

@@ -3,8 +3,10 @@ show_hidden = true,

patterns = { "^\\.git$", "Makefile", + "Justfile", "package.json", "go.mod", + "go.work", "pyproject.toml", "Cargo.toml", "deps.edn",
M lua/configs/telescope.lua

@@ -7,11 +7,11 @@ prompt_prefix = " ",

selection_caret = " ", file_ignore_patterns = { "^\\.git$", + "^\\.bin$", "node_modules", "__pycache__", "target", "vendor", - ".bin", }, mappings = { i = {
M lua/configs/treesitter.lua

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

require("nvim-treesitter.configs").setup { - ensure_installed = { - "lua", - "go", - "gomod", - "gowork", - "python", - "clojure", - "yaml", - "make", - "comment", - }, + ensure_installed = { "lua", "go", "gomod", "gowork", "make", "comment" }, indent = { enable = true, disable = { "python" } }, highlight = { enable = true, additional_vim_regex_highlighting = false }, - context_commentstring = { enable = true, enable_autocmd = false }, autopairs = { enable = true }, endwise = { enable = true }, rainbow = { enable = true },
M lua/core/options.lua

@@ -4,13 +4,15 @@ -- leader

vim.g.mapleader = " " vim.g.maplocalleader = "," --- indent +-- indenting vim.o.smartindent = true vim.o.expandtab = true vim.o.cursorline = true vim.o.shiftwidth = 4 +vim.o.softtabstop = 4 vim.o.tabstop = 4 +-- other cool stuff vim.o.ignorecase = true vim.o.smartcase = true vim.o.number = true
M lua/plugins.lua

@@ -20,7 +20,7 @@ use { "~/code/gopher.nvim", ft = "go", module = "gopher" }

use { "tpope/vim-surround", keys = { "c", "d", "y" } } use { "kyazdani42/nvim-web-devicons", module = "nvim-web-devicons" } use { "ahmedkhalf/project.nvim", config = u.get.config "project" } - use { "gpanders/editorconfig.nvim", event = "BufRead" } + -- use { "gpanders/editorconfig.nvim", event = "BufRead" } use { -- commenting helper "numToStr/Comment.nvim",

@@ -90,7 +90,6 @@ module = "neotest",

requires = { { "nvim-neotest/neotest-go", module = "neotest-go" }, { "nvim-neotest/neotest-plenary", module = "neotest-plenary" }, - { "haydenmeade/neotest-jest", module = "neotest-jest" }, }, }
M luasnippets/all.lua

@@ -10,7 +10,6 @@ return s("", {

c(1, { t(with_cmt "TODO: "), t(with_cmt "FIXME: "), - t(with_cmt "HACK: "), t(with_cmt "BUG: "), }), })
D

@@ -1,5 +0,0 @@

----@diagnostic disable: undefined-global --- selene: allow(undefined_variable) -return { - s("req", fmt('local {} = require "{}"', { i(1, "name"), i(2, "module") })), -}