mirror of
https://github.com/nmasur/dotfiles
synced 2024-12-24 02:34:52 +00:00
add vscode tf snippets, fix tf tree-sitter
This commit is contained in:
parent
38480e0c0c
commit
d4e203a04c
17
flake.lock
generated
17
flake.lock
generated
@ -413,6 +413,7 @@
|
||||
"telescope-nvim-src": "telescope-nvim-src",
|
||||
"telescope-project-nvim-src": "telescope-project-nvim-src",
|
||||
"toggleterm-nvim-src": "toggleterm-nvim-src",
|
||||
"vscode-terraform-snippets": "vscode-terraform-snippets",
|
||||
"wallpapers": "wallpapers",
|
||||
"wsl": "wsl"
|
||||
}
|
||||
@ -522,6 +523,22 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"vscode-terraform-snippets": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1688666727,
|
||||
"narHash": "sha256-qw6/N1nDPgZXQ2T0DRK2WoNC2KLkNTJRVm5yNqzMcIg=",
|
||||
"owner": "nmasur",
|
||||
"repo": "vscode-terraform-snippets",
|
||||
"rev": "6e37735ef6fdd72352e4b73e2bfaa3706fcff7e0",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nmasur",
|
||||
"repo": "vscode-terraform-snippets",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"wallpapers": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
|
@ -103,6 +103,10 @@
|
||||
url = "github:kyazdani42/nvim-tree.lua";
|
||||
flake = false;
|
||||
};
|
||||
vscode-terraform-snippets = {
|
||||
url = "github:nmasur/vscode-terraform-snippets";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
@ -135,6 +135,13 @@
|
||||
};
|
||||
|
||||
lua = ''
|
||||
-- Load snippets
|
||||
-- Check status: :lua require("luasnip").log.open()
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
require("luasnip.loaders.from_vscode").lazy_load({ paths = { "${
|
||||
builtins.toString pkgs.vscode-terraform-snippets
|
||||
}" } })
|
||||
|
||||
-- Use buffer source for `/`
|
||||
require('cmp').setup.cmdline("/", {
|
||||
sources = {
|
||||
|
@ -1,4 +1,4 @@
|
||||
{ pkgs, ... }: {
|
||||
{ pkgs, lib, ... }: {
|
||||
|
||||
plugins = [
|
||||
(pkgs.vimPlugins.nvim-treesitter.withPlugins (_plugins:
|
||||
@ -49,4 +49,10 @@
|
||||
};
|
||||
};
|
||||
|
||||
# Use mkAfter to ensure tree-sitter is already loaded
|
||||
lua = lib.mkAfter ''
|
||||
-- Use HCL parser with .tf files
|
||||
vim.treesitter.language.register('hcl', 'terraform')
|
||||
'';
|
||||
|
||||
}
|
||||
|
@ -4,8 +4,8 @@
|
||||
|
||||
vim.filetype.add({
|
||||
pattern = {
|
||||
[".*%.tfvars"] = "hcl",
|
||||
[".*%.tf"] = "hcl",
|
||||
[".*%.tfvars"] = "terraform",
|
||||
[".*%.tf"] = "terraform",
|
||||
[".*%.rasi"] = "css",
|
||||
},
|
||||
})
|
||||
|
@ -17,6 +17,7 @@ let
|
||||
in {
|
||||
|
||||
nil = inputs.nil.packages.${prev.system}.nil;
|
||||
vscode-terraform-snippets = inputs.vscode-terraform-snippets;
|
||||
|
||||
nvim-lspconfig =
|
||||
(withSrc prev.vimPlugins.nvim-lspconfig inputs.nvim-lspconfig);
|
||||
|
Loading…
Reference in New Issue
Block a user