summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchristianchiarulli <[email protected]>2021-07-05 21:03:46 -0400
committerchristianchiarulli <[email protected]>2021-07-05 21:03:46 -0400
commit326f1e7060a06a543fbe7971550650d7606776a4 (patch)
tree7d6b9c0b9bcb05ada3dac210ee6b7f754dd66efc
parent2e4314331b442dc4686546d9721b0db4769158e0 (diff)
more treesitter
-rw-r--r--lua/default-config.lua4
-rw-r--r--lua/lv-treesitter/init.lua13
-rw-r--r--lua/plugins.lua37
3 files changed, 46 insertions, 8 deletions
diff --git a/lua/default-config.lua b/lua/default-config.lua
index bd996acd..97f0c58a 100644
--- a/lua/default-config.lua
+++ b/lua/default-config.lua
@@ -70,6 +70,8 @@ O = {
ts_playground = { active = false },
ts_context_commentstring = { active = false },
ts_hintobjects = { active = false },
+ ts_autotag = { active = false },
+ ts_rainbow = { active = false },
ts_textobjects = { active = false },
ts_textsubjects = { active = false },
telescope_fzy = { active = false },
@@ -263,4 +265,4 @@ O = {
},
footer = { "chrisatmachine.com" },
},
-} \ No newline at end of file
+}
diff --git a/lua/lv-treesitter/init.lua b/lua/lv-treesitter/init.lua
index 0cd3bf6f..27877f03 100644
--- a/lua/lv-treesitter/init.lua
+++ b/lua/lv-treesitter/init.lua
@@ -1,3 +1,4 @@
+-- TODO refacor this whole file and treesitter in general
-- if not package.loaded['nvim-treesitter'] then return end
--
-- Custom parsers
@@ -99,7 +100,7 @@ require("nvim-treesitter.configs").setup {
-- indent = {enable = true, disable = {"python", "html", "javascript"}},
-- TODO seems to be broken
indent = { enable = { "javascriptreact" } },
- -- autotag = { enable = O.plugin.ts_autotag.active },
+ autotag = { enable = O.plugin.ts_autotag.active },
textobjects = {
swap = {
enable = O.plugin.ts_textobjects,
@@ -133,9 +134,9 @@ require("nvim-treesitter.configs").setup {
show_help = "?",
},
},
- -- rainbow = {
- -- enable = O.plugin.ts_rainbow.active,
- -- extended_mode = true, -- Highlight also non-parentheses delimiters, boolean or table: lang -> boolean
- -- max_file_lines = 1000, -- Do not enable for files with more than 1000 lines, int
- -- },
+ rainbow = {
+ enable = O.plugin.ts_rainbow.active,
+ extended_mode = true, -- Highlight also non-parentheses delimiters, boolean or table: lang -> boolean
+ max_file_lines = 1000, -- Do not enable for files with more than 1000 lines, int
+ },
}
diff --git a/lua/plugins.lua b/lua/plugins.lua
index 86c2c628..643d133d 100644
--- a/lua/plugins.lua
+++ b/lua/plugins.lua
@@ -315,6 +315,7 @@ return require("packer").startup(function(use)
end,
disable = not O.plugin.lsp_rooter.active,
}
+
-- Markdown preview
use {
"iamcco/markdown-preview.nvim",
@@ -322,18 +323,21 @@ return require("packer").startup(function(use)
ft = "markdown",
disable = not O.plugin.markdown_preview.active,
}
+
-- Interactive scratchpad
use {
"metakirby5/codi.vim",
cmd = "Codi",
disable = not O.plugin.codi.active,
}
+
-- Use fzy for telescope
use {
"nvim-telescope/telescope-fzy-native.nvim",
event = "BufRead",
disable = not O.plugin.telescope_fzy.active,
}
+
-- Use project for telescope
use {
"nvim-telescope/telescope-project.nvim",
@@ -347,24 +351,28 @@ return require("packer").startup(function(use)
event = "BufRead",
disable = not O.plugin.sanegx.active,
}
+
-- Sane gx for netrw_gx bug
use {
"folke/todo-comments.nvim",
event = "BufRead",
disable = not O.plugin.todo_comments.active,
}
+
-- LSP Colors
use {
"folke/lsp-colors.nvim",
event = "BufRead",
disable = not O.plugin.lsp_colors.active,
}
+
-- Git Blame
use {
"f-person/git-blame.nvim",
event = "BufRead",
disable = not O.plugin.git_blame.active,
}
+
use {
"ruifm/gitlinker.nvim",
event = "BufRead",
@@ -386,24 +394,28 @@ return require("packer").startup(function(use)
disable = not O.plugin.gitlinker.active,
requires = "nvim-lua/plenary.nvim",
}
+
-- Lazygit
use {
"kdheepak/lazygit.nvim",
cmd = "LazyGit",
disable = not O.plugin.lazygit.active,
}
+
-- Octo
use {
"pwntester/octo.nvim",
event = "BufRead",
disable = not O.plugin.octo.active,
}
+
-- Diffview
use {
"sindrets/diffview.nvim",
event = "BufRead",
disable = not O.plugin.diffview.active,
}
+
-- Easily Create Gists
use {
"mattn/vim-gist",
@@ -411,12 +423,14 @@ return require("packer").startup(function(use)
disable = not O.plugin.gist.active,
requires = "mattn/webapi-vim",
}
+
-- Lush Create Color Schemes
use {
"rktjmp/lush.nvim",
-- cmd = {"LushRunQuickstart", "LushRunTutorial", "Lushify"},
disable = not O.plugin.lush.active,
}
+
-- HTML preview
use {
"turbio/bracey.vim",
@@ -432,7 +446,13 @@ return require("packer").startup(function(use)
}
-- LANGUAGE SPECIFIC GOES HERE
- use { "lervag/vimtex", ft = "tex", config = function() require("lv-vimtex") end }
+ use {
+ "lervag/vimtex",
+ ft = "tex",
+ config = function()
+ require "lv-vimtex"
+ end,
+ }
-- Rust tools
-- TODO: use lazy loading maybe?
@@ -479,16 +499,31 @@ return require("packer").startup(function(use)
disable = not O.plugin.tabnine.active,
}
+ -- Pretty parentheses
+ use {
+ "p00f/nvim-ts-rainbow",
+ disable = not O.plugin.ts_rainbow.active,
+ }
+
+ -- Autotags <div>|</div>
+ use {
+ "windwp/nvim-ts-autotag",
+ event = "InsertEnter",
+ disable = not O.plugin.ts_autotag.active,
+ }
+
-- Custom semantic text objects
use {
"nvim-treesitter/nvim-treesitter-textobjects",
disable = not O.plugin.ts_textobjects.active,
}
+
-- Smart text objects
use {
"RRethy/nvim-treesitter-textsubjects",
disable = not O.plugin.ts_textsubjects.active,
}
+
-- Text objects using hint labels
use {
"mfussenegger/nvim-ts-hint-textobject",