feat(nvim): add nvim-treesitter-context
This commit is contained in:
parent
cf0a317b23
commit
976045d1ca
|
@ -1,5 +1,5 @@
|
||||||
local status_ok, configs = pcall(require, "nvim-treesitter.configs")
|
local has_configs, configs = pcall(require, "nvim-treesitter.configs")
|
||||||
if not status_ok then
|
if not has_configs then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -53,7 +53,14 @@ configs.setup {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
local nmap = require "opdavies.keymap".nmap
|
local nmap = require("opdavies.keymap").nmap
|
||||||
|
|
||||||
nmap({ "<leader>th", "<cmd>TSHighlightCapturesUnderCursor<CR>" })
|
nmap { "<leader>th", "<cmd>TSHighlightCapturesUnderCursor<CR>" }
|
||||||
nmap({ "<leader>tp", "<cmd>TSPlaygroundToggle<CR>" })
|
nmap { "<leader>tp", "<cmd>TSPlaygroundToggle<CR>" }
|
||||||
|
|
||||||
|
local has_context, context = pcall(require, "treesitter-context")
|
||||||
|
if not has_context then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
context.setup { enable = true }
|
||||||
|
|
|
@ -69,6 +69,7 @@ return packer.startup(function()
|
||||||
|
|
||||||
-- Treesitter
|
-- Treesitter
|
||||||
use "nvim-treesitter/playground"
|
use "nvim-treesitter/playground"
|
||||||
|
use 'nvim-treesitter/nvim-treesitter-context'
|
||||||
use {
|
use {
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
run = ":TSUpdate",
|
run = ":TSUpdate",
|
||||||
|
|
Loading…
Reference in a new issue