Merge branch 'main' of github.com:MasterGordon/neovim-config

This commit is contained in:
MasterGordon 2024-08-15 17:44:34 +02:00
commit a7e2fe3ea0
6 changed files with 97 additions and 45 deletions

View File

@ -13,7 +13,6 @@
"crates.nvim": { "branch": "main", "commit": "d1be10c1fcf4adb1eed2f2f510176db035efc68d" },
"cspell.nvim": { "branch": "main", "commit": "508b64a23bd8f9473c59d083a92712486f6f138d" },
"editorconfig-vim": { "branch": "master", "commit": "8b7da79e9daee7a3f3a8d4fe29886b9756305aff" },
"fastaction.nvim": { "branch": "master", "commit": "89c64a4906df97e766208640f6e80a96d5e4abb4" },
"fidget.nvim": { "branch": "main", "commit": "d855eed8a06531a7e8fd0684889b2943f373c469" },
"formatter.nvim": { "branch": "master", "commit": "ad246d34ce7a32f752071ed81b09b94e6b127fad" },
"gitsigns.nvim": { "branch": "main", "commit": "f074844b60f9e151970fbcdbeb8a2cd52b6ef25a" },
@ -57,6 +56,7 @@
"presence.nvim": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" },
"statuscol.nvim": { "branch": "main", "commit": "93d8bcda516fc86e11c03f9ef577bae9a72fba0e" },
"supermaven-nvim": { "branch": "main", "commit": "d71257f431e190d9236d7f30da4c2d659389e91f" },
"tailwind-tools.nvim": { "branch": "master", "commit": "48523580c6af449a7a57610ce5596c716cf4363a" },
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
"telescope.nvim": { "branch": "master", "commit": "10b8a82b042caf50b78e619d92caf0910211973d" },
"template-string.nvim": { "branch": "main", "commit": "419bfb2e4d5f0e6ddd0d4435f85b69da0d88d524" },

View File

@ -43,43 +43,16 @@ vim.api.nvim_set_keymap("", "<A-Left>", "<C-w><Left>", {silent = true})
vim.api.nvim_set_keymap("", "<A-Up>", "<C-w><Up>", {silent = true})
vim.api.nvim_set_keymap("", "<A-Down>", "<C-w><Down>", {silent = true})
vim.api.nvim_set_keymap("", "<A-Right>", "<C-w><Right>", {silent = true})
vim.api.nvim_set_keymap("", "<C-p>", "<C-i>", {silent = true})
vim.api.nvim_set_keymap("", "<C-p>", "<C-i>", {silent = true, noremap = true})
function _G.toggle_venn()
local venn_enabled = vim.inspect(vim.b.venn_enabled)
if (venn_enabled == "nil") then
vim.b.venn_enabled = true
vim.cmd [[setlocal ve=all]]
-- draw a line on HJKL keystokes
vim.api.nvim_buf_set_keymap(0, "n", "J", "<C-v>j:VBox<cr>", {noremap = true})
vim.api.nvim_buf_set_keymap(0, "n", "K", "<C-v>k:VBox<cr>", {noremap = true})
vim.api.nvim_buf_set_keymap(0, "n", "L", "<C-v>l:VBox<cr>", {noremap = true})
vim.api.nvim_buf_set_keymap(0, "n", "H", "<C-v>h:VBox<cr>", {noremap = true})
-- draw a box by pressing "b" with visual selection
vim.api.nvim_buf_set_keymap(0, "v", "b", ":VBox<cr>", {noremap = true})
else
vim.cmd [[setlocal ve=]]
vim.cmd [[mapclear <buffer>]]
vim.b.venn_enabled = nil
local insert_random_uuid = function()
local id, _ = vim.fn.system("uuidgen"):gsub("\n", ""):gsub("-", ""):upper()
vim.api.nvim_put({id}, "c", true, true)
end
local insert_random_uuid_dashed = function()
local id, _ = vim.fn.system("uuidgen"):gsub("\n", ""):upper()
vim.api.nvim_put({id}, "c", true, true)
end
-- toggle keymappings for venn using <leader>v
vim.api.nvim_set_keymap("n", "<leader>v", ":lua toggle_venn()<cr>", {noremap = true})
vim.api.nvim_set_keymap(
"v",
"<Leader>mc",
"<Cmd>lua require('nvim-magic.flows').append_completion(require('nvim-magic').backends.default)<CR>",
{}
)
vim.api.nvim_set_keymap(
"v",
"<Leader>ma",
"<Cmd>lua require('nvim-magic.flows').suggest_alteration(require('nvim-magic').backends.default)<CR>",
{}
)
vim.api.nvim_set_keymap(
"v",
"<Leader>md",
"<Cmd>lua require('nvim-magic.flows').suggest_docstring(require('nvim-magic').backends.default)<CR>",
{}
)
vim.keymap.set("n", "<leader>u", insert_random_uuid, {noremap = true, silent = true})
vim.keymap.set("n", "<leader>U", insert_random_uuid_dashed, {noremap = true, silent = true})

View File

@ -13,10 +13,6 @@ if not vim.loop.fs_stat(lazypath) then
end
vim.opt.rtp:prepend(lazypath)
local quick_prompts = {
["Code actions"] = true
}
require("lazy").setup(
{
"wbthomason/packer.nvim",
@ -87,6 +83,28 @@ require("lazy").setup(
"jay-babu/mason-null-ls.nvim"
}
},
{
"luckasRanarison/tailwind-tools.nvim",
dependencies = {"nvim-treesitter/nvim-treesitter"},
opts = {
document_color = {
enabled = true, -- can be toggled by commands
kind = "inline", -- "inline" | "foreground" | "background"
inline_symbol = "󰝤 ", -- only used in inline mode
debounce = 200 -- in milliseconds, only applied in insert mode
},
conceal = {
enabled = false, -- can be toggled by commands
min_length = nil, -- only conceal classes exceeding the provided length
symbol = "󱏿", -- only a single character is allowed
highlight = {
-- extmark highlight options, see :h 'highlight'
fg = "#38BDF8"
}
},
custom_filetypes = {} -- see the extension section to learn how it works
} -- your configuration
},
{
"nvim-telescope/telescope.nvim",
config = function()

View File

@ -95,3 +95,12 @@ vim.api.nvim_create_autocmd(
group = formatGrp
}
)
-- local function organize_imports()
-- local params = {
-- command = "typescript.organizeImports",
-- arguments = {vim.api.nvim_buf_get_name(0)},
-- title = ""
-- }
-- vim.lsp.buf.execute_command(params)
-- end

View File

@ -33,7 +33,8 @@ local extra_servers = {
"eslint",
"jsonls",
"omnisharp",
"rust_analyzer"
"rust_analyzer",
"tailwindcss"
}
-- Ensure that required tools are installed
@ -172,6 +173,54 @@ for _, lsp in ipairs(common_servers) do
}
end
local path = vim.uv.cwd()
local config_path = path .. "/.vscode/settings.json"
local tailwindcss_settings = {}
function patch_tailwindcss_settings()
if vim.uv.fs_stat(config_path) then
local file = vim.fn.readfile(config_path)
local vscode_settings = vim.fn.json_decode(file)
tailwindcss_settings =
vim.tbl_deep_extend(
"force",
tailwindcss_settings,
{
tailwindCSS = {
rootFontSize = vscode_settings["tailwindCSS.rootFontSize"]
}
}
)
end
end
pcall(patch_tailwindcss_settings)
nvim_lsp.tailwindcss.setup {
on_attach = on_attach,
flags = {
debounce_text_changes = 150
},
capabilities = capabilities,
-- on_init = function(client)
-- local path = client.workspace_folders and client.workspace_folders[1] and client.workspace_folders[1].name
-- local config_path = path .. "/.vscode/settings.json"
-- if vim.uv.fs_stat(config_path) then
-- local file = vim.fn.readfile(config_path)
-- local vscode_settings = vim.fn.json_decode(file)
-- client.config.settings =
-- vim.tbl_deep_extend(
-- "force",
-- client.config.settings,
-- {
-- tailwindCSS = {
-- rootFontSize = vscode_settings["tailwindCSS.rootFontSize"]
-- }
-- }
-- )
-- client.notify(vim.lsp.protocol.Methods.workspace_didChangeConfiguration, {settings = client.config.settings})
-- end
-- end,
settings = tailwindcss_settings
}
nvim_lsp.omnisharp.setup {
cmd = {"OmniSharp"},
enable_editorconfig_support = true,

View File

@ -3,7 +3,10 @@ require("neotest").setup(
adapters = {
require("neotest-jest")(
{
jestCommand = "npx jest"
jestCommand = "npx jest --bail --ci",
env = {
NODE_OPTIONS = "--no-deprecation"
}
}
),
require("neotest-zig")