From 2a91b3dc68006c324bf442ab9a9b98224ee22611 Mon Sep 17 00:00:00 2001 From: John Costa Date: Wed, 26 Jul 2023 22:23:47 +0100 Subject: [PATCH] bruh --- Scripts/SlowOpenProdApps.bash | 8 ++++++ nvchad/chadrc.lua | 6 ++-- nvchad/lspconfig.lua | 52 ++++++++++++++++++++++++++++++++++- nvchad/mappings.lua | 5 ++++ nvchad/plugins.lua | 32 +++++++++++++++++++++ 5 files changed, 100 insertions(+), 3 deletions(-) create mode 100755 Scripts/SlowOpenProdApps.bash diff --git a/Scripts/SlowOpenProdApps.bash b/Scripts/SlowOpenProdApps.bash new file mode 100755 index 00000000..f46f3ccd --- /dev/null +++ b/Scripts/SlowOpenProdApps.bash @@ -0,0 +1,8 @@ +#!/bin/bash +sleep 2 + +google-chrome-stable --app="https://linear.app/johntech/team/JOH/active" --class=WebApp-Linear7107 --user-data-dir=/home/johnc/.local/share/ice/profiles/Linear7107 & + +raindrop & + +google-chrome-stable --app="http://calendar.cron.com" --class=WebApp-Cron2444 --user-data-dir=/home/johnc/.local/share/ice/profiles/Cron2444 & diff --git a/nvchad/chadrc.lua b/nvchad/chadrc.lua index 18ab9f92..1d9c1357 100644 --- a/nvchad/chadrc.lua +++ b/nvchad/chadrc.lua @@ -11,12 +11,14 @@ M.options = { } M.ui = { - theme = "everforest", - theme_toggle = { "everforest", "everforest_light" }, + theme = "everblush", + theme_toggle = { "everblush", "everblush" }, lazyload = false, } M.mappings = require "custom.mappings" +-- require("telescope").load_extension "git_worktree" + vim.cmd "autocmd BufRead,BufEnter *.astro set filetype=astro" vim.cmd "set rnu" vim.cmd "autocmd InsertLeave *.tex update" diff --git a/nvchad/lspconfig.lua b/nvchad/lspconfig.lua index 5e63d7c8..e22734ba 100644 --- a/nvchad/lspconfig.lua +++ b/nvchad/lspconfig.lua @@ -2,7 +2,7 @@ local on_attach = require("plugins.configs.lspconfig").on_attach local capabilities = require("plugins.configs.lspconfig").capabilities local lspconfig = require "lspconfig" -local servers = { "tsserver", "tailwindcss", "cssls", "prismals", "gopls", "yamlls", "hls" } +local servers = { "vtsls", "tailwindcss", "cssls", "prismals", "gopls", "yamlls", "hls", "metals", "zls" } for _, lsp in ipairs(servers) do lspconfig[lsp].setup { @@ -10,3 +10,53 @@ for _, lsp in ipairs(servers) do capabilities = capabilities, } end + +require("lspconfig").eslint.setup { + -- Copied from nvim-lspconfig/lua/lspconfig/server_conigurations/eslint.js + root_dir = lspconfig.util.root_pattern( + ".eslintrc", + ".eslintrc.js", + ".eslintrc.cjs", + ".eslintrc.yaml", + ".eslintrc.yml", + ".eslintrc.json" + -- Disabled to prevent "No ESLint configuration found" exceptions + -- 'package.json', + ), +} + +--[[ + +local function filter(arr, fn) + if type(arr) ~= "table" then + return arr + end + + local filtered = {} + for k, v in pairs(arr) do + if fn(v, k, arr) then + table.insert(filtered, v) + end + end + + return filtered +end + +local function filterReactDTS(value) + return string.match(value.targetUri, 'node_modules/@types/react/ts5.0/index.d.ts') == nil +end + +lspconfig.vtsls.setup { + -- other options + handlers = { + ['textDocument/definition'] = function(err, result, method, ...) + if vim.tbl_islist(result) and #result > 1 then + local filtered_result = filter(result, filterReactDTS) + return vim.lsp.handlers['textDocument/definition'](err, filtered_result, method, ...) + end + + vim.lsp.handlers['textDocument/definition'](err, result, method, ...) + end + } +} +]]-- diff --git a/nvchad/mappings.lua b/nvchad/mappings.lua index 1dbbaac1..fdd452fc 100644 --- a/nvchad/mappings.lua +++ b/nvchad/mappings.lua @@ -32,6 +32,11 @@ M.custom = { ["rf"] = { ":lua require('refactoring').select_refactor()", "options" }, ["q"] = { ":lua require('harpoon.mark').add_file()" }, ["fp"] = { ":lua require('harpoon.ui').toggle_quick_menu()" }, + + ["lt"] = { ":lua require('telescope').extensions.git_worktree.git_worktrees()" }, + ["wt"] = { ":lua require('telescope').extensions.git_worktree.create_git_worktree()" }, + ["gr"] = { ":lua require('telescope.builtin').lsp_references()" }, + [""] = { function() if lazyGitted then diff --git a/nvchad/plugins.lua b/nvchad/plugins.lua index dd06c729..e6986b1e 100644 --- a/nvchad/plugins.lua +++ b/nvchad/plugins.lua @@ -15,12 +15,44 @@ return { require "custom.lspconfig" end, }, + { + "windwp/nvim-ts-autotag", + event = "InsertEnter", + config = function() + require("nvim-ts-autotag").setup() + end, + }, { "windwp/nvim-ts-autotag", lazy = false }, { "lervag/vimtex", lazy = false }, { "sindrets/diffview.nvim", lazy = false }, { "ThePrimeagen/harpoon" }, { "christoomey/vim-tmux-navigator", lazy = false }, { "jose-elias-alvarez/null-ls.nvim" }, + { "sainnhe/everforest", lazy = false }, + { + "JohnCosta27/git-worktree.nvim", + config = function() + local Worktree = require "git-worktree" + + -- op = Operations.Switch, Operations.Create, Operations.Delete + -- metadata = table of useful values (structure dependent on op) + -- Switch + -- path = path you switched to + -- prev_path = previous worktree path + -- Create + -- path = path where worktree created + -- branch = branch name + -- upstream = upstream remote name + -- Delete + -- path = path where worktree deleted + + Worktree.on_tree_change(function(op, metadata) + if op ~= Worktree.Operations.Delete then + -- os.execute() + end + end) + end, + }, { "NvChad/nvterm", config = function()