aboutsummaryrefslogtreecommitdiff
path: root/.config/nvim/lua/plugins.lua
diff options
context:
space:
mode:
Diffstat (limited to '.config/nvim/lua/plugins.lua')
-rw-r--r--.config/nvim/lua/plugins.lua64
1 files changed, 64 insertions, 0 deletions
diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua
index 711116a..85f0e6a 100644
--- a/.config/nvim/lua/plugins.lua
+++ b/.config/nvim/lua/plugins.lua
@@ -32,6 +32,7 @@ local PKGS = {
{ url = "https://github.com/nvim-treesitter/nvim-treesitter-context" };
{ url = "https://github.com/norcalli/nvim-colorizer.lua.git" };
{ url = "https://github.com/mracos/mermaid.vim.git" };
+ { url = "https://github.com/jlcrochet/vim-razor.git" };
-- Themes
{ url = "https://github.com/dracula/vim.git" };
@@ -101,6 +102,24 @@ local function init_plugins()
local gitsigns = require("gitsigns")
local marks = require("marks")
local neotest = require("neotest")
+ local telescope = require("telescope")
+ local telescopeConfig = require("telescope.config")
+ local previewers = require("telescope.previewers")
+
+ local _bad = { ".*%.cshtml" }
+ local bad_files = function(filepath)
+ for _, v in ipairs(_bad) do if filepath:match(v) then return false end end
+
+ return true
+ end
+
+ local new_maker = function(filepath, bufnr, opts)
+ opts = opts or {}
+ if opts.use_ft_detect == nil then opts.use_ft_detect = true end
+ opts.use_ft_detect = opts.use_ft_detect == false and false or
+ bad_files(filepath)
+ previewers.buffer_previewer_maker(filepath, bufnr, opts)
+ end
paq(PKGS)
@@ -312,6 +331,51 @@ local function init_plugins()
})
neotest.setup({ adapters = { require("neotest-dotnet") } })
+
+ -- Clone the default Telescope configuration
+ local vimgrep_arguments = { unpack(telescopeConfig.values.vimgrep_arguments) }
+
+ -- I want to search in hidden/dot files.
+ table.insert(vimgrep_arguments, "--hidden")
+ -- I don't want to search in the `.git` directory.
+ table.insert(vimgrep_arguments, "--glob")
+ table.insert(vimgrep_arguments, "!**/.git/*")
+
+ telescope.setup({
+ defaults = {
+ -- `hidden = true` is not supported in text grep commands.
+ vimgrep_arguments = vimgrep_arguments;
+ buffer_previewer_maker = new_maker;
+ };
+ 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/*";
+ "--trim";
+ };
+ };
+ live_grep = {
+ -- `hidden = true` will still show the inside of `.git/` as it's not `.gitignore`d.
+ find_command = {
+ "rg";
+ "--files";
+ "--hidden";
+ "--glob";
+ "!**/.git/*";
+ "--trim";
+ };
+ path_display = { "smart" };
+ only_sort_text = true;
+ word_match = "-w";
+ search = "";
+ };
+ };
+ })
end
local function clone_paq()