diff options
| -rw-r--r-- | lazy-lock.json | 30 | ||||
| -rw-r--r-- | lua/config/remap.lua | 10 | ||||
| -rw-r--r-- | lua/plugins/treesitter.lua | 150 |
3 files changed, 100 insertions, 90 deletions
diff --git a/lazy-lock.json b/lazy-lock.json index 6b4f4ab..2193e3d 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,28 +1,28 @@ { - "LuaSnip": { "branch": "master", "commit": "a62e1083a3cfe8b6b206e7d3d33a51091df25357" }, - "actions-preview.nvim": { "branch": "master", "commit": "2b604b2e8e662c03b716436f6ffebcb19663e66a" }, + "LuaSnip": { "branch": "master", "commit": "0abc8f390b278c3b4aabc4c004ac8a088b65cf24" }, + "actions-preview.nvim": { "branch": "master", "commit": "0ac9c2aa3cfc8c885321c0862b50b6b1c3392405" }, "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" }, "cmp-cmdline": { "branch": "main", "commit": "d126061b624e0af6c3a556428712dd4d4194ec6d" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "cd4ee08a988deb47ac3726f418fb27fe1a95729d" }, "cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" }, "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, - "conform.nvim": { "branch": "master", "commit": "086a40dc7ed8242c03be9f47fbcee68699cc2395" }, - "fidget.nvim": { "branch": "main", "commit": "889e2e96edef4e144965571d46f7a77bcc4d0ddf" }, + "conform.nvim": { "branch": "master", "commit": "016802de402556da54c36bd7359b441266b01cdd" }, + "fidget.nvim": { "branch": "main", "commit": "9e0201673e08e997e7cf52afca5565c70bd117f3" }, "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, "marks.nvim": { "branch": "master", "commit": "f353e8c08c50f39e99a9ed474172df7eddd89b72" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "0a3b42c3e503df87aef6d6513e13148381495c3a" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "55eceab8975036ac43a4176cbfe0d4bf1ddae93f" }, "mason-nvim-dap.nvim": { "branch": "main", "commit": "9a10e096703966335bd5c46c8c875d5b0690dade" }, - "mason.nvim": { "branch": "main", "commit": "b03fb0f20bc1d43daf558cda981a2be22e73ac42" }, - "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, - "nvim-cmp": { "branch": "main", "commit": "a1d504892f2bc56c2e79b65c6faded2fd21f3eca" }, - "nvim-dap": { "branch": "master", "commit": "45a69eba683a2c448dd9ecfc4de89511f0646b5f" }, + "mason.nvim": { "branch": "main", "commit": "2a6940af80375532e5e9e7c1f2fc6319a1b7a69d" }, + "nui.nvim": { "branch": "main", "commit": "10fc361835c856ba4233ef5ea135b919bf3dce97" }, + "nvim-cmp": { "branch": "main", "commit": "fe29aba4117227a6df637bc41e4b4fb4e98864a0" }, + "nvim-dap": { "branch": "master", "commit": "cfa2d58f4537aca6ca83e2de1a0d9f1491121264" }, "nvim-dap-project-configuration": { "branch": "main", "commit": "777ea9233ec7d75c08fad0ce5bbb69e165736634" }, - "nvim-dap-ui": { "branch": "master", "commit": "1a66cabaa4a4da0be107d5eda6d57242f0fe7e49" }, - "nvim-java": { "branch": "main", "commit": "602a5f7fa92f9c1d425a2159133ff9de86842f0a" }, - "nvim-lspconfig": { "branch": "master", "commit": "8a9378a822719346a0288fa004dab302ca3c0a8f" }, - "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, + "nvim-dap-ui": { "branch": "master", "commit": "cc9dd33aade7f20bae414d0cba163bc60d4d4b43" }, + "nvim-java": { "branch": "main", "commit": "db5536b4cb3da153084e50016596fd0e3a319aae" }, + "nvim-lspconfig": { "branch": "master", "commit": "993d048db0d83d8e8ba3f9cb376456321acdcce3" }, + "nvim-nio": { "branch": "master", "commit": "edcc181a875301dd21840189aa2f2f9ad69fc172" }, "nvim-treesitter": { "branch": "master", "commit": "cf12346a3414fa1b06af75c79faebe7f76df080a" }, - "nvim-treesitter-context": { "branch": "master", "commit": "b0c45cefe2c8f7b55fc46f34e563bc428ef99636" }, + "nvim-treesitter-context": { "branch": "master", "commit": "8decd73460d26ef0a0befb745d022dd1fc2c38b8" }, "plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" }, "spring-boot.nvim": { "branch": "main", "commit": "218c0c26c14d99feca778e4d13f5ec3e8b1b60f0" }, "telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }, diff --git a/lua/config/remap.lua b/lua/config/remap.lua index d860c37..1cbc0f5 100644 --- a/lua/config/remap.lua +++ b/lua/config/remap.lua @@ -12,3 +12,13 @@ vim.opt.shiftwidth = 8 vim.opt.number = true vim.opt.relativenumber = true vim.opt.signcolumn = "number" + +vim.api.nvim_create_autocmd("FileType", { + pattern = { "yaml", "yml" }, + callback = function() + vim.opt_local.expandtab = true + vim.opt_local.tabstop = 2 + vim.opt_local.shiftwidth = 2 + vim.opt_local.softtabstop = 2 + end, +}) diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index d0f3f4e..aff21c7 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -1,86 +1,86 @@ return { - { - "nvim-treesitter/nvim-treesitter", - config = function() - require("nvim-treesitter.configs").setup({ - -- A list of parser names, or "all" - ensure_installed = { - "vimdoc", "javascript", "typescript", "c", "lua", "rust", - "jsdoc", "bash", "go", - }, + { + "nvim-treesitter/nvim-treesitter", + config = function() + require("nvim-treesitter.configs").setup({ + -- A list of parser names, or "all" + ensure_installed = { + "vimdoc", "javascript", "typescript", "c", "lua", "rust", + "jsdoc", "bash", "go", + }, - -- Install parsers synchronously (only applied to `ensure_installed`) - sync_install = false, + -- Install parsers synchronously (only applied to `ensure_installed`) + sync_install = false, - -- Automatically install missing parsers when entering buffer - -- Recommendation: set to false if you don"t have `tree-sitter` CLI installed locally - auto_install = true, + -- Automatically install missing parsers when entering buffer + -- Recommendation: set to false if you don"t have `tree-sitter` CLI installed locally + auto_install = true, - indent = { - enable = true - }, + indent = { + enable = true + }, - highlight = { - -- `false` will disable the whole extension - enable = true, - disable = function(lang, buf) - if lang == "html" then - print("disabled") - return true - end + highlight = { + -- `false` will disable the whole extension + enable = true, + disable = function(lang, buf) + if lang == "html" then + print("disabled") + return true + end - local max_filesize = 100 * 1024 -- 100 KB - local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf)) - if ok and stats and stats.size > max_filesize then - vim.notify( - "File larger than 100KB treesitter disabled for performance", - vim.log.levels.WARN, - {title = "Treesitter"} - ) - return true - end - end, + local max_filesize = 100 * 1024 -- 100 KB + local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf)) + if ok and stats and stats.size > max_filesize then + vim.notify( + "File larger than 100KB treesitter disabled for performance", + vim.log.levels.WARN, + {title = "Treesitter"} + ) + return true + end + end, - -- Setting this to true will run `:h syntax` and tree-sitter at the same time. - -- Set this to `true` if you depend on "syntax" being enabled (like for indentation). - -- Using this option may slow down your editor, and you may see some duplicate highlights. - -- Instead of true it can also be a list of languages - additional_vim_regex_highlighting = { "markdown" }, - }, - }) + -- Setting this to true will run `:h syntax` and tree-sitter at the same time. + -- Set this to `true` if you depend on "syntax" being enabled (like for indentation). + -- Using this option may slow down your editor, and you may see some duplicate highlights. + -- Instead of true it can also be a list of languages + additional_vim_regex_highlighting = { "markdown" }, + }, + }) - local treesitter_parser_config = require("nvim-treesitter.parsers").get_parser_configs() - treesitter_parser_config.templ = { - install_info = { - url = "https://github.com/vrischmann/tree-sitter-templ.git", - files = {"src/parser.c", "src/scanner.c"}, - branch = "master", - }, - } + local treesitter_parser_config = require("nvim-treesitter.parsers").get_parser_configs() + treesitter_parser_config.templ = { + install_info = { + url = "https://github.com/vrischmann/tree-sitter-templ.git", + files = {"src/parser.c", "src/scanner.c"}, + branch = "master", + }, + } - vim.treesitter.language.register("templ", "templ") - end - }, + vim.treesitter.language.register("templ", "templ") + end + }, - { - "nvim-treesitter/nvim-treesitter-context", - after = "nvim-treesitter", - config = function() - require'treesitter-context'.setup{ - enable = true, -- Enable this plugin (Can be enabled/disabled later via commands) - multiwindow = false, -- Enable multiwindow support. - max_lines = 0, -- How many lines the window should span. Values <= 0 mean no limit. - min_window_height = 0, -- Minimum editor window height to enable context. Values <= 0 mean no limit. - line_numbers = true, - multiline_threshold = 20, -- Maximum number of lines to show for a single context - trim_scope = 'outer', -- Which context lines to discard if `max_lines` is exceeded. Choices: 'inner', 'outer' - mode = 'cursor', -- Line used to calculate context. Choices: 'cursor', 'topline' - -- Separator between context and content. Should be a single character string, like '-'. - -- When separator is set, the context will only show up when there are at least 2 lines above cursorline. - separator = nil, - zindex = 20, -- The Z-index of the context window - on_attach = nil, -- (fun(buf: integer): boolean) return false to disable attaching - } - end - } + { + "nvim-treesitter/nvim-treesitter-context", + after = "nvim-treesitter", + config = function() + require'treesitter-context'.setup{ + enable = true, -- Enable this plugin (Can be enabled/disabled later via commands) + multiwindow = false, -- Enable multiwindow support. + max_lines = 0, -- How many lines the window should span. Values <= 0 mean no limit. + min_window_height = 0, -- Minimum editor window height to enable context. Values <= 0 mean no limit. + line_numbers = true, + multiline_threshold = 20, -- Maximum number of lines to show for a single context + trim_scope = 'outer', -- Which context lines to discard if `max_lines` is exceeded. Choices: 'inner', 'outer' + mode = 'cursor', -- Line used to calculate context. Choices: 'cursor', 'topline' + -- Separator between context and content. Should be a single character string, like '-'. + -- When separator is set, the context will only show up when there are at least 2 lines above cursorline. + separator = nil, + zindex = 20, -- The Z-index of the context window + on_attach = nil, -- (fun(buf: integer): boolean) return false to disable attaching + } + end + } } |
