diff --git a/init.lua b/init.lua index 5837d86..36ccdcf 100644 --- a/init.lua +++ b/init.lua @@ -44,44 +44,6 @@ require("lazy").setup("plugins") require("mappings") require("lsp") --- Treesitter Consistent Syntax Highlighting and indent -require("nvim-treesitter.configs").setup({ - ensure_installed = { - "bash", - "c", - "dockerfile", - "gitcommit", - "go", - "gomod", - "lua", - "python", - "query", - "rust", - "toml", - "yaml", - "just", - }, - highlight = { - enable = true, - }, - playground = { - enable = true, - }, - -- Potentially remove, this is not really in my roation yet - incremental_selection = { - enable = true, - keymaps = { - init_selection = "", - node_incremental = "", - scope_incremental = "", - node_decremental = "", - }, - }, - sync_install = false, - auto_install = false, - ignore_install = {}, - modules = {}, -}) vim.filetype.add({ extension = { mdx = "mdx", service = "systemd" } }) vim.treesitter.language.register("markdown", "mdx") vim.treesitter.language.register("html", "superhtml") diff --git a/lazy-lock.json b/lazy-lock.json index 98579b1..5f32fab 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -15,7 +15,7 @@ "nvim-coverage": { "branch": "main", "commit": "a939e425e363319d952a6c35fb3f38b34041ded2" }, "nvim-lastplace": { "branch": "main", "commit": "0bb6103c506315044872e0f84b1f736c4172bb20" }, "nvim-lspconfig": { "branch": "master", "commit": "702f69fb167e9119f14adc4dfd4fcadf4d1b07a0" }, - "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, + "nvim-treesitter": { "branch": "main", "commit": "2b50ab5ccbcd9e5708deb351308edd738adbf84c" }, "nvim-treesitter-context": { "branch": "master", "commit": "9a8e39993e3b895601bf8227124a48ea8268149e" }, "oil.nvim": { "branch": "master", "commit": "0fcc83805ad11cf714a949c98c605ed717e0b83e" }, "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index fbd00b1..24c8e36 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -38,12 +38,6 @@ return { }, }, }, - -- Treesitter - { - "nvim-treesitter/nvim-treesitter", - build = ":TSUpdate", - }, - "nvim-treesitter/nvim-treesitter-context", -- UI { "EdenEast/nightfox.nvim", diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index b3a176f..dc7df9c 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -1,42 +1,90 @@ return { { "nvim-telescope/telescope.nvim", + branch = "0.1.x", cmd = "Telescope", dependencies = { "nvim-lua/plenary.nvim", "nvim-telescope/telescope-fzf-native.nvim", }, - branch = "0.1.x", - init = function() + config = function() require("telescope").setup({ pickers = { find_files = { - -- `hidden = true` will still show the inside of `.git/` as it's not `.gitignore`d. find_command = { "rg", "--files", "--hidden", "--glob", "!**/.git/*" }, }, }, }) + require("telescope").load_extension("fzf") - require("telescope").load_extension("harpoon") + pcall(function() + require("telescope").load_extension("harpoon") + end) end, - - -- lazy = true, keys = { - { "ff", require("telescope.builtin").find_files, desc = "Find File" }, - { "fg", require("telescope.builtin").live_grep, desc = "Live Grep" }, - { "fb", require("telescope.builtin").buffers, desc = "Buffer List" }, - { "fh", require("telescope.builtin").help_tags, desc = "Help Tags" }, - { "fc", require("telescope.builtin").colorscheme, desc = "Colorschme" }, - { "fq", require("telescope").extensions.harpoon.marks, desc = "Harpoon Marks" }, - { "fs", require("telescope.builtin").grep_string, desc = "Grep String" }, - { "s", require("telescope.builtin").spell_suggest, desc = "Spell suggest" }, + { + "ff", + function() + require("telescope.builtin").find_files() + end, + desc = "Find File", + }, + { + "fg", + function() + require("telescope.builtin").live_grep() + end, + desc = "Live Grep", + }, + { + "fb", + function() + require("telescope.builtin").buffers() + end, + desc = "Buffer List", + }, + { + "fh", + function() + require("telescope.builtin").help_tags() + end, + desc = "Help Tags", + }, + { + "fc", + function() + require("telescope.builtin").colorscheme() + end, + desc = "Colorscheme", + }, + { + "fq", + function() + local ok, telescope = pcall(require, "telescope") + if ok and telescope.extensions.harpoon then + telescope.extensions.harpoon.marks() + end + end, + desc = "Harpoon Marks", + }, + { + "fs", + function() + require("telescope.builtin").grep_string() + end, + desc = "Grep String", + }, + { + "s", + function() + require("telescope.builtin").spell_suggest() + end, + desc = "Spell Suggest", + }, }, }, { "nvim-telescope/telescope-fzf-native.nvim", - dependencies = { - { "nvim-telescope/telescope.nvim" }, - }, build = "make", }, } diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua new file mode 100644 index 0000000..c5a57e0 --- /dev/null +++ b/lua/plugins/treesitter.lua @@ -0,0 +1,50 @@ +return { + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + config = function() + require("nvim-treesitter.configs").setup({ + ensure_installed = { + "bash", + "c", + "dockerfile", + "gitcommit", + "go", + "gomod", + "lua", + "python", + "query", + "rust", + "toml", + "yaml", + "just", + }, + highlight = { + enable = true, + }, + playground = { + enable = true, + }, + -- Potentially remove, this is not really in my roation yet + incremental_selection = { + enable = true, + keymaps = { + init_selection = "", + node_incremental = "", + scope_incremental = "", + node_decremental = "", + }, + }, + sync_install = false, + auto_install = false, + ignore_install = {}, + modules = {}, + }) + end, + + { + "nvim-treesitter/nvim-treesitter-context", + event = "VeryLazy", + }, + + -- Treesitter Consistent Syntax Highlighting and indent +}