save
This commit is contained in:
@@ -1,44 +1,49 @@
|
||||
return {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
},
|
||||
|
||||
config = function()
|
||||
local data = assert(vim.fn.stdpath "data") --[[@as string]]
|
||||
|
||||
require("telescope").setup {
|
||||
extensions = {
|
||||
wrap_results = true,
|
||||
|
||||
fzf = {},
|
||||
history = {
|
||||
path = vim.fs.joinpath(data, "telescope_history.sqlite3"),
|
||||
limit = 100,
|
||||
},
|
||||
["ui-select"] = {
|
||||
require("telescope.themes").get_dropdown {},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
pcall(require("telescope").load_extension, "fzf")
|
||||
pcall(require("telescope").load_extension, "smart_history")
|
||||
pcall(require("telescope").load_extension, "ui-select")
|
||||
|
||||
local builtin = require "telescope.builtin"
|
||||
|
||||
vim.keymap.set("n", "<space>pf", builtin.find_files)
|
||||
vim.keymap.set("n", "<C-p>", builtin.git_files)
|
||||
vim.keymap.set("n", "<space>fh", builtin.help_tags)
|
||||
vim.keymap.set("n", "<space>fg", builtin.git_files)
|
||||
vim.keymap.set("n", "<space>/", builtin.current_buffer_fuzzy_find)
|
||||
|
||||
vim.keymap.set("n", "<leader>ps", function()
|
||||
builtin.grep_string { search = vim.fn.input "Grep > " }
|
||||
end)
|
||||
|
||||
vim.keymap.set("n", "<space>en", function()
|
||||
builtin.find_files { cwd = vim.fn.stdpath "config" }
|
||||
end)
|
||||
end,
|
||||
},
|
||||
|
||||
config = function()
|
||||
local data = assert(vim.fn.stdpath "data") --[[@as string]]
|
||||
|
||||
require("telescope").setup {
|
||||
extensions = {
|
||||
wrap_results = true,
|
||||
|
||||
fzf = {},
|
||||
history = {
|
||||
path = vim.fs.joinpath(data, "telescope_history.sqlite3"),
|
||||
limit = 100,
|
||||
},
|
||||
["ui-select"] = {
|
||||
require("telescope.themes").get_dropdown {},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
pcall(require("telescope").load_extension, "fzf")
|
||||
pcall(require("telescope").load_extension, "smart_history")
|
||||
pcall(require("telescope").load_extension, "ui-select")
|
||||
|
||||
local builtin = require "telescope.builtin"
|
||||
|
||||
vim.keymap.set("n", "<space>fd", builtin.find_files)
|
||||
vim.keymap.set("n", "<C-p>", builtin.git_files)
|
||||
vim.keymap.set("n", "<space>fh", builtin.help_tags)
|
||||
vim.keymap.set("n", "<space>fg", builtin.live_grep)
|
||||
vim.keymap.set("n", "<space>/", builtin.current_buffer_fuzzy_find)
|
||||
|
||||
vim.keymap.set("n", "<space>fw", builtin.grep_string)
|
||||
|
||||
vim.keymap.set("n", "<space>fn", function()
|
||||
builtin.find_files { cwd = vim.fn.stdpath "config" }
|
||||
end)
|
||||
end,
|
||||
}
|
||||
|
||||
66
nvim/.config/nvim/lua/vxclutch/lazy/treesitter.lua
Normal file
66
nvim/.config/nvim/lua/vxclutch/lazy/treesitter.lua
Normal file
@@ -0,0 +1,66 @@
|
||||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
config = function()
|
||||
require("nvim-treesitter.configs").setup {
|
||||
-- A list of parser names, or "all"
|
||||
ensure_installed = {
|
||||
"vimdoc",
|
||||
"c",
|
||||
"lua",
|
||||
"bash",
|
||||
"java",
|
||||
},
|
||||
|
||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||
sync_install = false,
|
||||
|
||||
-- Automatically install missing parsers when entering buffer
|
||||
-- Recommendation: set to false if you don"t have `tree-sitter` CLI installed locally
|
||||
auto_install = true,
|
||||
|
||||
indent = {
|
||||
enable = true,
|
||||
},
|
||||
|
||||
highlight = {
|
||||
-- `false` will disable the whole extension
|
||||
enable = true,
|
||||
disable = function(lang, buf)
|
||||
if lang == "html" then
|
||||
print "disabled"
|
||||
return true
|
||||
end
|
||||
|
||||
local max_filesize = 100 * 1024 -- 100 KB
|
||||
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
|
||||
if ok and stats and stats.size > max_filesize then
|
||||
vim.notify(
|
||||
"File larger than 100KB treesitter disabled for performance",
|
||||
vim.log.levels.WARN,
|
||||
{ title = "Treesitter" }
|
||||
)
|
||||
return true
|
||||
end
|
||||
end,
|
||||
|
||||
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
|
||||
-- Set this to `true` if you depend on "syntax" being enabled (like for indentation).
|
||||
-- Using this option may slow down your editor, and you may see some duplicate highlights.
|
||||
-- Instead of true it can also be a list of languages
|
||||
additional_vim_regex_highlighting = { "markdown" },
|
||||
},
|
||||
}
|
||||
|
||||
local treesitter_parser_config = require("nvim-treesitter.parsers").get_parser_configs()
|
||||
treesitter_parser_config.templ = {
|
||||
install_info = {
|
||||
url = "https://github.com/vrischmann/tree-sitter-templ.git",
|
||||
files = { "src/parser.c", "src/scanner.c" },
|
||||
branch = "master",
|
||||
},
|
||||
}
|
||||
|
||||
vim.treesitter.language.register("templ", "templ")
|
||||
end,
|
||||
}
|
||||
Reference in New Issue
Block a user