godot and telescope ripgrep

This commit is contained in:
Christian Nieves
2025-03-16 16:38:34 -05:00
parent f595b1fcfa
commit 76686a0e87
9 changed files with 240 additions and 217 deletions

View File

@ -13,35 +13,37 @@ decorations = "None"
[colors]
draw_bold_text_with_bright_colors = true
# Default colors
[colors.primary]
background = '#1e2024'
foreground = '#a1a3a8'
# Normal colors
[colors.normal]
black = '#27272a'
blue = '#5e7fdd'
cyan = '#97c3fa'
green = '#90b99f'
magenta = '#e29eca'
red = '#d45d9e'
white = '#c9c7cd'
yellow = '#f0ea2d'
# Bright colors
[colors.bright]
black = "#949494"
blue = "#74b2ff"
cyan = "#85dc85"
green = "#36c692"
magenta = "#ae81ff"
red = "#ff5189"
white = "#e4e4e4"
yellow = "#c6c684"
black = '#353539'
blue = '#a7b3dd'
cyan = '#6de6fc'
green = '#a8fc8d'
magenta = '#eb4cce'
red = '#ca72de'
white = '#c9c7cd'
yellow = '#f7f48d'
[colors.cursor]
cursor = "#8e8e8e"
text = "#080808"
[colors.normal]
black = "#323437"
blue = "#80a0ff"
cyan = "#79dac8"
green = "#8cc85f"
magenta = "#cf87e8"
red = "#ff5454"
white = "#c6c6c6"
yellow = "#e3c78a"
[colors.primary]
background = "#080808"
bright_foreground = "#eeeeee"
foreground = "#bdbdbd"
[colors.selection]
background = "#b2ceee"
text = "#080808"

View File

@ -25,14 +25,6 @@ end
require("lazy").setup({
-- this entry tells lazy.nvim to load the list of of *.lua files from plugins/
import = "plugins",
-- Dev configuration
dev = {
-- Directory where you store your local plugin projects
path = "~/neovim-plugins/squk/",
-- @type string[] plugins that match these patterns will use your local versions instead of being fetched from GitHub
patterns = { "squk" },
fallback = false, -- Fallback to git when local plugin doesn't exist
},
})
vim.opt.undodir = vim.fn.expand("$HOME") .. "/.undo/"

View File

@ -0,0 +1,9 @@
vim.api.nvim_create_autocmd({ "BufNewFile", "BufRead" }, {
pattern = "*.wgsl",
callback = function()
local lspconfig = require("lspconfig")
lspconfig.wgsl_analyzer.setup({})
vim.bo.filetype = "wgsl"
end,
})

View File

@ -1,17 +0,0 @@
local use_google = require("utils").use_google
return {
{
"Exafunction/codeium.nvim",
-- commit = "b1ff0d6c993e3d87a4362d2ccd6c660f7444599f",
event = "VeryLazy",
-- event = "InsertEnter",
cond = not use_google(),
dependencies = {
"nvim-lua/plenary.nvim",
"hrsh7th/nvim-cmp",
},
config = function()
require("codeium").setup({})
end,
},
}

View File

@ -61,12 +61,11 @@ return {
-- Conform will run multiple formatters sequentially
-- go = { "goimports", "gofmt" },
-- Use a sub-list to run only the first available formatter
-- javascript = { { "prettierd", "prettier" } },
lua = { "stylua" },
-- Conform will run multiple formatters sequentially
python = { "isort", "black" },
python = { "isort" },
-- Use a sub-list to run only the first available formatter
javascript = { { "prettierd", "prettier" } },
javascript = { { "prettier" } },
gdscript = { "gdformat" },
ron = { "ronfmt" },
dashboard = {},

View File

@ -83,7 +83,7 @@ return {
{ "<C-g>", ":lua vim.lsp.buf.signature_help()<CR>", mode = "i" },
},
config = function()
local nvim_lspconfig = require("lspconfig")
local lspconfig = require("lspconfig")
local lsp_configs = require("lspconfig.configs")
lsp_configs.ciderlsp = {
@ -107,18 +107,20 @@ return {
"typescript",
},
offset_encoding = "utf-8",
root_dir = nvim_lspconfig.util.root_pattern(".citc"),
root_dir = lspconfig.util.root_pattern(".citc"),
settings = {},
},
}
if use_google() then
nvim_lspconfig.ciderlsp.setup({})
lspconfig.ciderlsp.setup({})
end
nvim_lspconfig.wgsl_analyzer.setup({})
require("lspconfig").gdscript.setup({})
vim.cmd([[autocmd FileType gdscript setlocal commentstring=#\ %s]])
vim.cmd([[autocmd FileType gdscript setlocal autoindent noexpandtab tabstop=4 shiftwidth=4]])
require("lspconfig").gdshader_lsp.setup({})
end,
},
}

View File

@ -6,6 +6,16 @@ return {
ft = { "rust" },
config = function(_, opts)
vim.g.rustaceanvim = vim.tbl_deep_extend("keep", vim.g.rustaceanvim or {}, opts or {})
for _, method in ipairs({ "textDocument/diagnostic", "workspace/diagnostic" }) do
local default_diagnostic_handler = vim.lsp.handlers[method]
vim.lsp.handlers[method] = function(err, result, context, config)
if err ~= nil and err.code == -32802 then
return
end
return default_diagnostic_handler(err, result, context, config)
end
end
end,
opts = {
server = {

View File

@ -3,45 +3,35 @@ local exec = require("utils").exec
local TableConcat = require("utils").TableConcat
_G.find_files = function(search_dirs)
require("telescope.builtin").find_files({ search_dirs = search_dirs })
require("telescope.builtin").find_files({ search_dirs = search_dirs })
end
-- Helper functions to fetch the current scope and set `search_dirs`
_G.find_dotfiles = function() end
_G.search_cwd = function()
local builtin = require("telescope.builtin")
local utils = require("telescope.utils")
builtin.find_files({ cwd = utils.buffer_dir() })
end
_G.live_grep = function(search_dirs)
require("telescope.builtin").live_grep({
search_dirs = search_dirs,
})
end
_G.live_grep_cword = function(search_dirs)
require("telescope.builtin").live_grep({ search_dirs = search_dirs })
local builtin = require("telescope.builtin")
local utils = require("telescope.utils")
builtin.find_files({ cwd = utils.buffer_dir() })
end
local function exe(cmd)
return vim.split(vim.fn.system(cmd), "\n")
return vim.split(vim.fn.system(cmd), "\n")
end
local function fig_modified()
return exe("chg pstatus -ma -n --no-status --template= | sort")
return exe("chg pstatus -ma -n --no-status --template= | sort")
end
local function fig_all_modified()
return exe("chg status -ma -n --rev p4base --no-status --template= | sort")
return exe("chg status -ma -n --rev p4base --no-status --template= | sort")
end
-- stylua: ignore
local keys = {
{ "<leader>e", ":lua search_cwd()<CR>", desc = "Find Files in Buffer Directory" },
{ "<leader>ts", require('telescope.builtin').live_grep },
{ "<leader>e", ":lua search_cwd()<CR>", desc = "Find Files in Buffer Directory" },
{ "<leader>tb", ":Telescope buffers<CR>" },
{ "<leader>TS", function() require('telescope.builtin').live_grep { default_text = vim.fn.expand("<cword>") } end, },
-- { "<leader>ts", require('telescope.builtin').live_grep },
-- { "<leader>TS", function() require('telescope.builtin').live_grep { default_text = vim.fn.expand("<cword>") } end, },
{
"<leader>t.",
function()
@ -61,8 +51,8 @@ local keys = {
}
if use_google() then
local find_files = require("telescope.builtin").find_files
local cs_query = require("telescope").extensions.codesearch.find_query
local find_files = require("telescope.builtin").find_files
local cs_query = require("telescope").extensions.codesearch.find_query
-- stylua: ignore
TableConcat(keys, {
{ "<leader>tm", function() find_files({ search_dirs = fig_modified() }) end, desc = "list modified Fig files." },
@ -77,144 +67,167 @@ if use_google() then
end
return {
{
"aznhe21/actions-preview.nvim",
config = function()
require("actions-preview").setup({
telescope = {
sorting_strategy = "ascending",
layout_strategy = "vertical",
layout_config = {
width = 0.8,
height = 0.9,
prompt_position = "top",
preview_cutoff = 20,
preview_height = function(_, _, max_lines)
return max_lines - 15
end,
},
},
})
end,
keys = {
{ "?", "<cmd>lua require('actions-preview').code_actions()<cr>" },
},
},
{
"smartpde/telescope-recent-files",
config = function()
require("telescope").load_extension("recent_files")
end,
keys = {
{ "<leader>to", [[<cmd>lua require('telescope').extensions.recent_files.pick()<CR>]] },
},
},
{
"piersolenski/telescope-import.nvim",
dependencies = "nvim-telescope/telescope.nvim",
config = function()
require("telescope").load_extension("import")
end,
keys = function()
if not use_google() then
return {
{ "<leader>i", ":Telescope import<CR>" },
}
end
end,
},
{
"nvim-telescope/telescope.nvim",
dependencies = {
"mfussenegger/nvim-dap",
"smartpde/telescope-recent-files",
"rcarriga/nvim-dap-ui",
},
config = function()
require("telescope").setup({
defaults = {
-- The vertical layout strategy is good to handle long paths like those in
-- google3 repos because you have nearly the full screen to display a file path.
-- The caveat is that the preview area is smaller.
layout_strategy = "vertical",
-- Common paths in google3 repos are collapsed following the example of Cider
-- It is nice to keep this as a user config rather than part of
-- telescope-codesearch because it can be reused by other telescope pickers.
path_display = function(opts, path)
-- Do common substitutions
path = path:gsub("^/google/src/cloud/[^/]+/[^/]+/google3/", "google3/", 1)
path = path:gsub("^google3/java/com/google/", "//j/c/g/", 1)
path = path:gsub("^google3/javatests/com/google/", "//jt/c/g/", 1)
path = path:gsub("^google3/third_party/", "//3p/", 1)
path = path:gsub("^google3/", "//", 1)
{
"aznhe21/actions-preview.nvim",
config = function()
require("actions-preview").setup({
telescope = {
sorting_strategy = "ascending",
layout_strategy = "vertical",
layout_config = {
width = 0.8,
height = 0.9,
prompt_position = "top",
preview_cutoff = 20,
preview_height = function(_, _, max_lines)
return max_lines - 15
end,
},
},
})
end,
keys = {
{ "?", "<cmd>lua require('actions-preview').code_actions()<cr>" },
},
},
{
"smartpde/telescope-recent-files",
config = function()
require("telescope").load_extension("recent_files")
end,
keys = {
{ "<leader>to", [[<cmd>lua require('telescope').extensions.recent_files.pick()<CR>]] },
},
},
{
"piersolenski/telescope-import.nvim",
dependencies = "nvim-telescope/telescope.nvim",
config = function()
require("telescope").load_extension("import")
end,
keys = function()
if not use_google() then
return {
{ "<leader>i", ":Telescope import<CR>" },
}
end
end,
},
{
"nvim-telescope/telescope-live-grep-args.nvim",
keys = {
{
"<leader>ts",
function()
require("telescope").extensions.live_grep_args.live_grep_args()
end,
},
{
"<leader>TS",
function()
require("telescope").extensions.live_grep_args.live_grep_args({
default_text = vim.fn.expand("<cword>"),
})
end,
},
},
config = function()
require("telescope").load_extension("live_grep_args")
end,
},
{
"nvim-telescope/telescope.nvim",
dependencies = {
"nvim-telescope/telescope-live-grep-args.nvim",
"mfussenegger/nvim-dap",
"smartpde/telescope-recent-files",
"rcarriga/nvim-dap-ui",
},
config = function()
require("telescope").setup({
defaults = {
-- The vertical layout strategy is good to handle long paths like those in
-- google3 repos because you have nearly the full screen to display a file path.
-- The caveat is that the preview area is smaller.
layout_strategy = "vertical",
-- Common paths in google3 repos are collapsed following the example of Cider
-- It is nice to keep this as a user config rather than part of
-- telescope-codesearch because it can be reused by other telescope pickers.
path_display = function(opts, path)
-- Do common substitutions
path = path:gsub("^/google/src/cloud/[^/]+/[^/]+/google3/", "google3/", 1)
path = path:gsub("^google3/java/com/google/", "//j/c/g/", 1)
path = path:gsub("^google3/javatests/com/google/", "//jt/c/g/", 1)
path = path:gsub("^google3/third_party/", "//3p/", 1)
path = path:gsub("^google3/", "//", 1)
-- Do truncation. This allows us to combine our custom display formatter
-- with the built-in truncation.
-- `truncate` handler in transform_path memoizes computed truncation length in opts.__length.
-- Here we are manually propagating this value between new_opts and opts.
-- We can make this cleaner and more complicated using metatables :)
local new_opts = {
path_display = {
truncate = true,
},
__length = opts.__length,
}
path = require("telescope.utils").transform_path(new_opts, path)
opts.__length = new_opts.__length
return path
end,
mappings = {
n = {
["<C-c>"] = "close",
["<Esc>"] = "close",
},
i = {
-- ["<cr>"] = function(bufnr)
-- require("telescope.actions.set").edit(bufnr, "tab drop")
-- end,
["<C-c>"] = "close",
["<Esc>"] = "close",
["<S-Down>"] = "cycle_history_next",
["<S-Up>"] = "cycle_history_prev",
},
},
},
extensions = {
codesearch = {
experimental = true, -- enable results from google3/experimental
},
recent_files = {
-- This function rewrites all file paths to the current workspace.
-- For example, if w2 is the current workspace, then
-- /google/.../w1/google3/my_file.cc becomes /google/.../w2/google3/my_file.cc,
transform_file_path = function(path)
local neocitc = require("neocitc")
local path_func = neocitc.path_in_current_workspace_or_head
or neocitc.path_in_current_workspace
return path_func(path)
end,
-- This is a useful option to speed up Telescope by avoiding the check
-- for file existence.
stat_files = false,
-- Ignore common patterns that can show up from other google plugins
ignore_patterns = {
"/%.git/COMMIT_EDITING$",
"/%.git/COMMIT_EDITMSG$",
"/%.git/MERGE_MSG$",
"^/tmp/%.pipertmp-",
"/Related_Files$",
"^term:",
";#toggleterm#",
},
},
persisted = {},
import = {
-- Add imports to the top of the file keeping the cursor in place
insert_at_top = true,
},
},
})
end,
keys = keys,
},
-- Do truncation. This allows us to combine our custom display formatter
-- with the built-in truncation.
-- `truncate` handler in transform_path memoizes computed truncation length in opts.__length.
-- Here we are manually propagating this value between new_opts and opts.
-- We can make this cleaner and more complicated using metatables :)
local new_opts = {
path_display = {
truncate = true,
},
__length = opts.__length,
}
path = require("telescope.utils").transform_path(new_opts, path)
opts.__length = new_opts.__length
return path
end,
mappings = {
n = {
["<C-c>"] = "close",
["<Esc>"] = "close",
},
i = {
-- ["<cr>"] = function(bufnr)
-- require("telescope.actions.set").edit(bufnr, "tab drop")
-- end,
["<C-c>"] = "close",
["<Esc>"] = "close",
["<S-Down>"] = "cycle_history_next",
["<S-Up>"] = "cycle_history_prev",
},
},
},
extensions = {
codesearch = {
experimental = true, -- enable results from google3/experimental
},
recent_files = {
-- This function rewrites all file paths to the current workspace.
-- For example, if w2 is the current workspace, then
-- /google/.../w1/google3/my_file.cc becomes /google/.../w2/google3/my_file.cc,
transform_file_path = function(path)
local neocitc = require("neocitc")
local path_func = neocitc.path_in_current_workspace_or_head
or neocitc.path_in_current_workspace
return path_func(path)
end,
-- This is a useful option to speed up Telescope by avoiding the check
-- for file existence.
stat_files = false,
-- Ignore common patterns that can show up from other google plugins
ignore_patterns = {
"/%.git/COMMIT_EDITING$",
"/%.git/COMMIT_EDITMSG$",
"/%.git/MERGE_MSG$",
"^/tmp/%.pipertmp-",
"/Related_Files$",
"^term:",
";#toggleterm#",
},
},
persisted = {},
import = {
-- Add imports to the top of the file keeping the cursor in place
insert_at_top = true,
},
},
})
end,
keys = keys,
},
}

View File

@ -1,6 +1,19 @@
local use_google = require("utils").use_google
return {
{
"squk/ableton.nvim",
lazy = false,
cond = not use_google(),
priority = 1000,
dir = "~/neovim-plugins/squk/ableton.nvim",
opts = {
variant = "cooler",
},
config = function()
vim.cmd("colorscheme ableton")
end,
},
{
"dgox16/oldworld.nvim",
lazy = false,
@ -10,7 +23,7 @@ return {
variant = "cooler",
},
config = function()
vim.cmd("colorscheme oldworld")
-- vim.cmd("colorscheme oldworld")
end,
},
{