Skip to content

Commit

Permalink
feat: tailwind/typescript-tools :P
Browse files Browse the repository at this point in the history
  • Loading branch information
willruggiano committed Sep 12, 2024
1 parent 3022a9b commit 3de63b8
Show file tree
Hide file tree
Showing 7 changed files with 79 additions and 13 deletions.
12 changes: 12 additions & 0 deletions nix/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,12 @@
"rev": "923aea2613c9e7abf81e099d46086f62c7e54896",
"type": "git"
},
"tailwind-tools.nvim": {
"branch": "master",
"repo": "git@github.com:luckasRanarison/tailwind-tools.nvim",
"rev": "a67d4b20eff105fbc234eea227682d15999a7733",
"type": "git"
},
"telescope-docsets.nvim": {
"branch": "main",
"repo": "git@github.com:willruggiano/telescope-docsets.nvim",
Expand Down Expand Up @@ -455,6 +461,12 @@
"rev": "1584c0b0a979b71fd86b18d302ba84e9aba85b1b",
"type": "git"
},
"typescript-tools.nvim": {
"branch": "master",
"repo": "git@github.com:pmizio/typescript-tools.nvim",
"rev": "f8c2e0b36b651c85f52ad5c5373ff8b07adc15a7",
"type": "git"
},
"vim-abolish": {
"branch": "master",
"repo": "git@github.com:tpope/vim-abolish",
Expand Down
3 changes: 3 additions & 0 deletions pkgs/nvim-treesitter/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
# ];
# };
};
css = {
owner = "tree-sitter";
};
dockerfile = {
owner = "camdencheek";
};
Expand Down
11 changes: 11 additions & 0 deletions pkgs/nvim-treesitter/grammars/css.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"url": "https://github.com/tree-sitter/tree-sitter-css",
"rev": "a68fcd1e6b03118d1e92ffa45e7ab7a39d52d3f7",
"date": "2024-09-02T04:29:00-04:00",
"sha256": "1apypprrqn23ghay11w35vz31crpjdby6imjhnxq9cqj9rvhxgx3",
"hash": "sha256-o78Od04Ss4S7hbJG41eTN7Mw/i6Dh+AVfENYnPO9/qo=",
"fetchLFS": false,
"fetchSubmodules": false,
"deepClone": false,
"leaveDotGit": false
}
1 change: 1 addition & 0 deletions plugins/cmp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ return function()
},
formatting = {
format = require("lspkind").cmp_format {
before = require("tailwind-tools.cmp").lspkind_format,
mode = "symbol",
maxwidth = 50,
menu = {
Expand Down
2 changes: 1 addition & 1 deletion plugins/colorizer.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
return function()
vim.opt.termguicolors = true
require("colorizer").setup()
require("colorizer").setup {}
end
44 changes: 38 additions & 6 deletions plugins/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,10 @@ return function()
end,
{ buffer = bufnr, desc = "Type definition" },
},
-- K = {
-- vim.lsp.buf.hover,
-- { buffer = bufnr, desc = "Hover" },
-- },
K = {
vim.lsp.buf.hover,
{ buffer = bufnr, desc = "Hover" },
},
}

keymap.vnoremaps {
Expand Down Expand Up @@ -308,8 +308,8 @@ return function()
"relay_lsp",
"ruff_lsp",
"sqruff",
"tailwindcss",
"ts_ls",
-- "tailwindcss",
-- "ts_ls",
"yamlls",
"zls",
}
Expand Down Expand Up @@ -373,6 +373,38 @@ return function()
}
end

if pcall(require, "tailwind-tools") then
require("tailwind-tools").setup {
server = {
on_attach = on_attach,
},
document_color = {
kind = "foreground",
},
}
else
lspconfig.tailwindcss.setup {
on_init = on_init,
on_attach = on_attach,
capabilities = updated_capabilities,
}
end

if pcall(require, "typescript-tools") then
require("typescript-tools").setup {
on_attach = on_attach,
settings = {
expose_as_code_action = "all",
},
}
else
lspconfig.ts_ls.setup {
on_init = on_init,
on_attach = on_attach,
capabilities = updated_capabilities,
}
end

--
-- null-ls :(
--
Expand Down
19 changes: 13 additions & 6 deletions plugins/spec.nix
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ in rec {
src = sources.nvim-cmp;
config = ./cmp.lua;
dependencies = {
# inherit sg;
inherit tailwind-tools;
cmp-buffer.src = sources.cmp-buffer;
cmp-cmdline.src = sources.cmp-cmdline;
cmp-git = {
Expand Down Expand Up @@ -190,10 +190,10 @@ in rec {
# };
# };

hover = {
src = sources."hover.nvim";
config = ./hover.lua;
};
# hover = {
# src = sources."hover.nvim";
# config = ./hover.lua;
# };

ibl = {
src = sources."indent-blankline.nvim";
Expand Down Expand Up @@ -258,7 +258,7 @@ in rec {
src = sources.nvim-lspconfig;
config = ./lsp.lua;
dependencies = {
inherit conform fun lsp-file-operations lspkind;
inherit conform fun lsp-file-operations lspkind tailwind-tools;
clangd_extensions = {
src = sources."clangd_extensions.nvim";
};
Expand Down Expand Up @@ -288,6 +288,9 @@ in rec {
schemastore = {
src = sources."SchemaStore.nvim";
};
typescript-tools = {
src = sources."typescript-tools.nvim";
};
};
paths = with pkgs;
with config.packages; [
Expand Down Expand Up @@ -468,6 +471,10 @@ in rec {
config = ./tabout.lua;
};

tailwind-tools = {
src = sources."tailwind-tools.nvim";
};

telescope = {
src = sources."telescope.nvim";
config = ./telescope.lua;
Expand Down

0 comments on commit 3de63b8

Please sign in to comment.