Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2 typescript speed #1

Merged
merged 7 commits into from
Jan 13, 2025
Prev Previous commit
Next Next commit
fix: duplicate lsp hint was coming. tsserver and typescript turn off …
…and now using tsserver only also removed some comments
  • Loading branch information
anishkumar127 committed Jan 8, 2025
commit 7b2d4c642c0dcf794573cce91c48d8c8e16fc5d1
11 changes: 10 additions & 1 deletion init.lua
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
-- bootstrap lazy.nvim, LazyVim and your plugins
require("config.lazy")
vim.diagnostic.config({ virtual_text = false })
require("config.lazy")

-- vim.opt.shell = "C:\\Program Files\\Git\\bin\\bash.exe"
-- vim.opt.shellcmdflag = "-c"
-- vim.opt.shellquote = ""
-- vim.opt.shellxquote = ""

vim.o.shell = "C:\\Program Files\\Git\\bin\\bash.exe"
vim.o.shellcmdflag = "-s"
3 changes: 2 additions & 1 deletion lazy-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"conform.nvim": { "branch": "master", "commit": "70019124aa4f2e6838be9fbd2007f6d13b27a96d" },
"cyberdream.nvim": { "branch": "main", "commit": "77c27cb822b638d7b332cfff6c6fb09473a7d180" },
"dial.nvim": { "branch": "master", "commit": "46b4375e84e8eb771129bff6b2b1e47746601ef9" },
"ecolog.nvim": { "branch": "main", "commit": "4d255f7026c16f1779fbbb43b87eaeb73941efdc" },
"flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" },
"format-ts-errors.nvim": { "branch": "main", "commit": "9ed21017496f9d380f570e39c7968fecd918535f" },
"friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" },
Expand Down Expand Up @@ -54,9 +53,11 @@
"tailwind-tools": { "branch": "master", "commit": "3703e162d819a04b128902c508276553dae0dfb8" },
"tiny-inline-diagnostic.nvim": { "branch": "main", "commit": "d803d02b95431850470ffd2e1ec8a4949105cca6" },
"todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" },
"toggleterm.nvim": { "branch": "main", "commit": "e76134e682c1a866e3dfcdaeb691eb7b01068668" },
"tokyonight.nvim": { "branch": "main", "commit": "7bb270adaa7692c2c33befc35f5567fc596a2504" },
"trouble.nvim": { "branch": "main", "commit": "46cf952fc115f4c2b98d4e208ed1e2dce08c9bf6" },
"ts-comments.nvim": { "branch": "main", "commit": "872dcfa0418f4a33b7437fb4d9f4e89f2f000d74" },
"tsc.nvim": { "branch": "main", "commit": "59abb6f3f24a3ca80708f694af4e2b727a1a3211" },
"typescript-tools.nvim": { "branch": "master", "commit": "35e397ce467bedbbbb5bfcd0aa79727b59a08d4a" },
"vim-visual-multi": { "branch": "master", "commit": "a6975e7c1ee157615bbc80fc25e4392f71c344d4" },
"which-key.nvim": { "branch": "main", "commit": "1f8d414f61e0b05958c342df9b6a4c89ce268766" },
Expand Down
80 changes: 41 additions & 39 deletions lua/plugins/ecolog.lua
Original file line number Diff line number Diff line change
@@ -1,39 +1,41 @@
return {
"philosofonusus/ecolog.nvim",
event = "VeryLazy",
config = function()
require("ecolog").setup({
integrations = {
lsp = true,
blink_cmp = true,
lspsaga = true,
},
})
end,
-- Optional: you can add some keybindings
-- (I personally use lspsaga so check out lspsaga integration or lsp integration for a smoother experience without separate keybindings)
keys = {
{ "<leader>ge", "<cmd>EcologGoto<cr>", desc = "Go to env file" },
{ "<leader>Ep", "<cmd>EcologPeek<cr>", desc = "Ecolog peek variable" },
{ "<leader>Es", "<cmd>EcologSelect<cr>", desc = "Switch env file" },
},
opts = {
-- Enables shelter mode for sensitive values
shelter = {
configuration = {
partial_mode = false, -- false by default, disables partial mode, for more control check out shelter partial mode
mask_char = "*", -- Character used for masking
},
modules = {
cmp = true, -- Mask values in completion
peek = false, -- Mask values in peek view
files = false, -- Mask values in files
telescope = false, -- Mask values in telescope
},
},
-- true by default, enables built-in types (database_url, url, etc.)
types = true,
path = vim.fn.getcwd(), -- Path to search for .env files
preferred_environment = "development", -- Optional: prioritize specific env files
},
}
if true then return {} end

-- return {
-- "philosofonusus/ecolog.nvim",
-- event = "VeryLazy",
-- config = function()
-- require("ecolog").setup({
-- integrations = {
-- lsp = true,
-- blink_cmp = true,
-- lspsaga = true,
-- },
-- })
-- end,
-- -- Optional: you can add some keybindings
-- -- (I personally use lspsaga so check out lspsaga integration or lsp integration for a smoother experience without separate keybindings)
-- keys = {
-- { "<leader>ge", "<cmd>EcologGoto<cr>", desc = "Go to env file" },
-- { "<leader>Ep", "<cmd>EcologPeek<cr>", desc = "Ecolog peek variable" },
-- { "<leader>Es", "<cmd>EcologSelect<cr>", desc = "Switch env file" },
-- },
-- opts = {
-- -- Enables shelter mode for sensitive values
-- shelter = {
-- configuration = {
-- partial_mode = false, -- false by default, disables partial mode, for more control check out shelter partial mode
-- mask_char = "*", -- Character used for masking
-- },
-- modules = {
-- cmp = true, -- Mask values in completion
-- peek = false, -- Mask values in peek view
-- files = false, -- Mask values in files
-- telescope = false, -- Mask values in telescope
-- },
-- },
-- -- true by default, enables built-in types (database_url, url, etc.)
-- types = true,
-- path = vim.fn.getcwd(), -- Path to search for .env files
-- preferred_environment = "development", -- Optional: prioritize specific env files
-- },
-- }
34 changes: 17 additions & 17 deletions lua/plugins/gitsigns2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@ if true then return {} end

-- Enhance Git Workflow
-- Add gitsigns.nvim for Git Integration
return {
"lewis6991/gitsigns.nvim",
opts = {
signs = {
add = { text = "+" },
change = { text = "~" },
delete = { text = "_" },
topdelete = { text = "‾" },
changedelete = { text = "~" },
},
},
keys = {
{ "<leader>hs", ":Gitsigns stage_hunk<CR>", desc = "Stage Hunk" },
{ "<leader>hu", ":Gitsigns undo_stage_hunk<CR>", desc = "Undo Stage Hunk" },
{ "<leader>hr", ":Gitsigns reset_hunk<CR>", desc = "Reset Hunk" },
},
}
-- return {
-- "lewis6991/gitsigns.nvim",
-- opts = {
-- signs = {
-- add = { text = "+" },
-- change = { text = "~" },
-- delete = { text = "_" },
-- topdelete = { text = "‾" },
-- changedelete = { text = "~" },
-- },
-- },
-- keys = {
-- { "<leader>hs", ":Gitsigns stage_hunk<CR>", desc = "Stage Hunk" },
-- { "<leader>hu", ":Gitsigns undo_stage_hunk<CR>", desc = "Undo Stage Hunk" },
-- { "<leader>hr", ":Gitsigns reset_hunk<CR>", desc = "Reset Hunk" },
-- },
-- }
40 changes: 20 additions & 20 deletions lua/plugins/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@ if true then return {} end

-- Formatter
-- :lua require('conform').format()
require("conform").setup({
formatters_by_ft = {
javascript = { "prettier" },
typescript = { "prettier" },
typescriptreact = { "prettier" }, -- For React (TypeScript)
javascriptreact = { "prettier" }, -- For React (JavaScript)
html = { "prettier" },
css = { "prettier" },
scss = { "prettier" },
jsx = { "prettier" }, -- For React (JSX)
tsx = { "prettier" }, -- For React (TSX)
json = { "prettier" },
-- python = { "black" },
-- go = { "gofmt", "goimports" },
lua = { "stylua" },
proto = { "buf" },
},
debug = true, -- Enable debugging
timeout = 20000, -- Timeout in milliseconds (adjust as needed)
})
-- require("conform").setup({
-- formatters_by_ft = {
-- javascript = { "prettier" },
-- typescript = { "prettier" },
-- typescriptreact = { "prettier" }, -- For React (TypeScript)
-- javascriptreact = { "prettier" }, -- For React (JavaScript)
-- html = { "prettier" },
-- css = { "prettier" },
-- scss = { "prettier" },
-- jsx = { "prettier" }, -- For React (JSX)
-- tsx = { "prettier" }, -- For React (TSX)
-- json = { "prettier" },
-- -- python = { "black" },
-- -- go = { "gofmt", "goimports" },
-- lua = { "stylua" },
-- proto = { "buf" },
-- },
-- debug = true, -- Enable debugging
-- timeout = 20000, -- Timeout in milliseconds (adjust as needed)
-- })

-- Autoformat on save
-- vim.api.nvim_create_autocmd("BufWritePre", {
Expand Down
8 changes: 7 additions & 1 deletion lua/plugins/lspconfig.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
local lspconfig = require("lspconfig")

-- lspconfig.tsserver.setup({
-- on_attach = function(client)
-- client.server_capabilities.diagnosticProvider = false
-- end,
-- })
-- for disable right side inline erorr etc
lspconfig.gdscript.setup({
cmd = { "nc", "localhost", "6005" }, -- Connect to Godot's language server
Expand Down Expand Up @@ -40,7 +46,6 @@ return {
"javascript.jsx",
"typescript",
"typescript.tsx",
"vue",
},
},
codelens = {
Expand All @@ -54,6 +59,7 @@ return {
},
},
{
-- BUG: need to check this its show error bulb.
"nvimdev/lspsaga.nvim",
config = function()
require("lspsaga").setup({
Expand Down
46 changes: 46 additions & 0 deletions lua/plugins/toggleterminal.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
return {
"akinsho/toggleterm.nvim",
-- version = "*"
opts = {
size = 20, -- Height of the terminal window
open_mapping = [[<C-\>]], -- Keybinding to toggle terminal
direction = "horizontal", -- Can be "horizontal", "vertical", or "float"
-- shell = "C:\\Program Files\\Git\\bin\\bash.exe", -- Use Git Bash
shading_factor = 2, -- Adjust terminal shading
persist_size = true, -- Remember terminal size
persist_mode = true, -- Remember terminal mode
-- log_level = "debug",:

},
keys = {
{ "<C-\\>", "<cmd>ToggleTerm<CR>", desc = "Toggle Terminal" }, -- Default terminal
{ "<leader>t1", ":ToggleTerm 1<CR>", desc = "Open Terminal 1" },
{ "<leader>t2", ":ToggleTerm 2<CR>", desc = "Open Terminal 2" },
{ "<leader>t3", ":ToggleTerm 3<CR>", desc = "Open Terminal 3" },
},
}


-- return {
-- {
-- 'akinsho/toggleterm.nvim',
-- version = "*",
-- opts = function()
-- return {
-- require('toggleterm').setup{
-- open_mapping = '<C-\\>',
-- autochdir = false,
-- start_in_insert = true,
-- shell = vim.o.shell,
-- -- direction = 'float',
-- -- float_opt = {
-- -- border = 'shadow',
-- -- width = 80,
-- -- heigh = 120,
-- -- title_pos = 'center',
-- -- }
-- }
-- }
-- end,
-- }
-- }
23 changes: 12 additions & 11 deletions lua/plugins/trouble.lua
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
if true then return {} end
-- Trouble for Diagnostics Navigation
-- Add trouble.nvim for quick navigation through LSP diagnostics:
return {
"folke/trouble.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
opts = {
position = "bottom",
height = 10,
},
keys = {
{ "<leader>xx", ":TroubleToggle<CR>", desc = "Toggle Trouble" },
},
}
-- return {
-- "folke/trouble.nvim",
-- dependencies = { "nvim-tree/nvim-web-devicons" },
-- opts = {
-- position = "bottom",
-- height = 10,
-- -- virtual_text = false,
-- },
-- keys = {
-- { "<leader>xx", ":TroubleToggle<CR>", desc = "Toggle Trouble" },
-- },
-- }
20 changes: 13 additions & 7 deletions lua/plugins/ts.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ return {
dependencies = { "nvim-lua/plenary.nvim", "neovim/nvim-lspconfig" },
enabled = true,
event = { "BufReadPre *.ts", "BufReadPre *.tsx", "BufReadPre *.js", "BufReadPre *.jsx" }, -- Lazy Loading for Performance only loaded when needed
-- ft = {
-- "typescript",
-- "typescriptreact",
-- "javascript",
-- "javascriptreact",
-- },
ft = {
"typescript",
"typescriptreact",
"javascript",
"javascriptreact",
},

config = function(_, opts)
local api = require("typescript-tools.api")
Expand All @@ -27,7 +27,13 @@ return {
80001, -- Ignore this might be converted to a ES export
}),
}

-- Disable tsserver diagnostics if needed
opts.on_attach = function(client)
if client.name == "tsserver" then
client.server_capabilities.diagnosticProvider = false
end
end

require("typescript-tools").setup(opts)
end,
opts = {
Expand Down
Loading