diff options
author | Luca Matei Pintilie <luca@lucamatei.com> | 2023-08-06 19:23:34 +0000 |
---|---|---|
committer | Luca Matei Pintilie <luca@lucamatei.com> | 2023-08-06 19:23:34 +0000 |
commit | b7db85b9c33da9f18485c18775628951152137f6 (patch) | |
tree | 3bf375abc190c14a0dcc4b126b93e849b252283a /.config/nvim/lua/plugins.lua | |
parent | 43fd5c1630142d25dc560f7be36695fb33cc8c30 (diff) | |
download | dotfiles-b7db85b9c33da9f18485c18775628951152137f6.tar dotfiles-b7db85b9c33da9f18485c18775628951152137f6.tar.gz dotfiles-b7db85b9c33da9f18485c18775628951152137f6.tar.bz2 dotfiles-b7db85b9c33da9f18485c18775628951152137f6.tar.lz dotfiles-b7db85b9c33da9f18485c18775628951152137f6.tar.xz dotfiles-b7db85b9c33da9f18485c18775628951152137f6.tar.zst dotfiles-b7db85b9c33da9f18485c18775628951152137f6.zip |
Update neovim a bit, with razor plugin
Diffstat (limited to '.config/nvim/lua/plugins.lua')
-rw-r--r-- | .config/nvim/lua/plugins.lua | 64 |
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() |