all repos

init.lua @ 5733bbd27bd9428df777285224cba7ad21f65083

my nvim config
6 files changed, 31 insertions(+), 49 deletions(-)
refactor: remove `other.lua` for configs
Author: Smirnov Oleksandr ss2316544@gmail.com
Committed at: 2022-08-18 22:53:44 +0300
Parent: 32361ce
A lua/configs/autopairs.lua

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

+require("nvim-autopairs").setup { + check_ts = true, +}
D

@@ -1,40 +0,0 @@

-local M = {} - -function M.autopairs() - require("nvim-autopairs").setup { - check_ts = true, - } -end - -function M.treesitter() - require("nvim-treesitter.configs").setup { - ensure_installed = { "lua", "go", "gomod", "python", "yaml", "comment" }, - indent = { enable = true, disable = { "python", "go", "yaml", "nix" } }, - highlight = { enable = true, additional_vim_regex_highlighting = false }, - context_commentstring = { enable = true, enable_autocmd = false }, - autopairs = { enable = true }, - endwise = { enable = true }, - rainbow = { enable = true }, - } -end - -function M.project() - require("project_nvim").setup { - show_hidden = true, - patterns = { - ".git", - "Makefile", - "package.json", - "deno.json", - "go.mod", - "pyproject.toml", - "Cargo.toml", - }, - exclude_dirs = { - "~/.cargo", - "~/.golang", - }, - } -end - -return M
A lua/configs/project.lua

@@ -0,0 +1,16 @@

+require("project_nvim").setup { + show_hidden = true, + patterns = { + ".git", + "Makefile", + "package.json", + "deno.json", + "go.mod", + "pyproject.toml", + "Cargo.toml", + }, + exclude_dirs = { + "~/.cargo", + "~/.golang", + }, +}
A lua/configs/treesitter.lua

@@ -0,0 +1,9 @@

+require("nvim-treesitter.configs").setup { + ensure_installed = { "lua", "go", "gomod", "python", "yaml", "comment" }, + indent = { enable = true, disable = { "python", "go", "yaml", "nix" } }, + 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/utils.lua

@@ -25,11 +25,5 @@ ---@return string

setup = function(path) return string.format("require[[%s]].setup()", path) end, - - ---@param plug string - ---@return string - other = function(plug) - return string.format("require[[configs.other]].%s()", plug) - end, }, }
M lua/plugins.lua

@@ -19,7 +19,7 @@

use { "~/code/gopher.nvim", ft = "go" } use { "tpope/vim-surround", keys = { "c", "d", "y" } } use { "kyazdani42/nvim-web-devicons", module = "nvim-web-devicons" } - use { "ahmedkhalf/project.nvim", config = u.get.other "project" } + use { "ahmedkhalf/project.nvim", config = u.get.config "project" } use { "gpanders/editorconfig.nvim", event = "BufRead" } use { "ggandor/lightspeed.nvim", keys = { "s", "S", "f", "F" } }

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

use { -- auto pairs closer "windwp/nvim-autopairs", event = "InsertEnter", - config = u.get.other "autopairs", + config = u.get.config "autopairs", } use { -- status line

@@ -78,7 +78,7 @@

use { -- syntax "nvim-treesitter/nvim-treesitter", event = "BufRead", - config = u.get.other "treesitter", + config = u.get.config "treesitter", requires = { { "RRethy/nvim-treesitter-endwise", after = "nvim-treesitter" }, { "p00f/nvim-ts-rainbow", after = "nvim-treesitter" },