From cfa2de4792dc6d161fb07f457ec6d6c44efc8ca3 Mon Sep 17 00:00:00 2001 From: Tyrel Souza Date: Mon, 2 Jan 2023 15:37:07 -0500 Subject: [PATCH] treesitter almost fixed --- Makefile | 0 home/config/nvim/lua/plugins.lua | 37 +++++++++++++++-------------- home/config/nvim/lua/settings.lua | 2 +- home/config/nvim/lua/utils/init.lua | 16 +++++++++++++ 4 files changed, 36 insertions(+), 19 deletions(-) create mode 100644 Makefile create mode 100644 home/config/nvim/lua/utils/init.lua diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e69de29 diff --git a/home/config/nvim/lua/plugins.lua b/home/config/nvim/lua/plugins.lua index 6e77d92..5fe6abe 100644 --- a/home/config/nvim/lua/plugins.lua +++ b/home/config/nvim/lua/plugins.lua @@ -6,24 +6,25 @@ return function(use) -- Prevents reinstall of treesitter plugins every boot vim.opt.runtimepath:append(parser_install_dir) - -- Treesitter is managed by the package config, we just manage configs/deps here - -- use({ "nvim-treesitter/nvim-treesitter-refactor" }) - -- use({ "RRethy/nvim-treesitter-textsubjects" }) - -- require("nvim-treesitter.configs").setup({ - -- highlight = { enable = true, disable = { "lua" } }, - -- indent = { enable = true }, - -- refactor = { highlight_definitions = { enable = true } }, - -- incremental_selection = { enable = true }, - -- matchup = { enable = true }, - -- textsubjects = { - -- enable = true, - -- prev_selection = ",", - -- keymaps = { - -- ["."] = "textsubjects-smart", - -- }, - -- }, - -- parser_install_dir = parser_install_dir, - -- }) + -- Treesitter is managed by the package config, we just manage configs/deps here + use({ "nvim-treesitter/nvim-treesitter-refactor" }) + use({ "RRethy/nvim-treesitter-textsubjects" }) + + require("nvim-treesitter.configs").setup({ + -- highlight = { enable = true, disable = { "lua" } }, + -- indent = { enable = true }, + -- refactor = { highlight_definitions = { enable = true } }, + -- incremental_selection = { enable = true }, + -- matchup = { enable = true }, + -- textsubjects = { + -- enable = true, + -- prev_selection = ",", + -- keymaps = { + -- ["."] = "textsubjects-smart", + -- }, + -- }, + parser_install_dir = parser_install_dir, + }) use({'atelierbram/vim-colors_atelier-schemes'}) use({'robertmeta/nofrils'}) diff --git a/home/config/nvim/lua/settings.lua b/home/config/nvim/lua/settings.lua index 8783e7d..b3f8993 100644 --- a/home/config/nvim/lua/settings.lua +++ b/home/config/nvim/lua/settings.lua @@ -40,7 +40,7 @@ vim.opt.undofile = true vim.opt.number = true vim.opt.relativenumber = true -vim.g.colors = "Atelier_SulphurpoolDark" +vim.cmd 'colorscheme Atelier_SulphurpoolDark' vim.g.floaterm_keymap_toggle = '' vim.g.floaterm_width = 0.9 vim.g.floaterm_height = 0.9 diff --git a/home/config/nvim/lua/utils/init.lua b/home/config/nvim/lua/utils/init.lua new file mode 100644 index 0000000..bd53235 --- /dev/null +++ b/home/config/nvim/lua/utils/init.lua @@ -0,0 +1,16 @@ +local utils = { } + +local scopes = {o = vim.o, b = vim.bo, w = vim.wo} + +function utils.opt(scope, key, value) + scopes[scope][key] = value + if scope ~= 'o' then scopes['o'][key] = value end +end + +function utils.map(mode, lhs, rhs, opts) + local options = {noremap = true} + if opts then options = vim.tbl_extend('force', options, opts) end + vim.api.nvim_set_keymap(mode, lhs, rhs, options) +end + +return utils