my dotfiles for arch

nvim settings

+29 -49
+1 -1
private_dot_config/nvim/lua/plugins/gitsigns.lua
··· 39 39 map("n", "<leader>gp", gitsigns.preview_hunk, { desc = "Preview hunk" }) 40 40 -- map('n', '<leader>hb', function() gitsigns.blame_line { full = true } end) 41 41 -- map('n', '<leader>tb', gitsigns.toggle_current_line_blame) 42 - -- map("n", "<leader>gd", gitsigns.diffthis, { desc = "Diff this" }) 42 + map("n", "<leader>gD", gitsigns.diffthis, { desc = "Diff this" }) 43 43 -- map('n', '<leader>hD', function() gitsigns.diffthis('~') end) 44 44 -- map('n', '<leader>td', gitsigns.toggle_deleted) 45 45
+28 -48
private_dot_config/nvim/lua/plugins/treesitter.lua
··· 1 1 return { 2 2 -- Highlight, edit, and navigate code 3 3 "nvim-treesitter/nvim-treesitter", 4 + lazy = false, 4 5 build = ":TSUpdate", 5 - main = "nvim-treesitter.configs", -- Sets main module to use for opts 6 - -- [[ Configure Treesitter ]] See `:help nvim-treesitter` 7 6 config = function() 8 7 require("nvim-treesitter").setup({ 9 - -- A list of parser names, or "all" 10 - ensure_installed = { 11 - "vimdoc", 12 - "javascript", 13 - "typescript", 14 - "c", 15 - "lua", 16 - "rust", 17 - "jsdoc", 18 - "bash", 19 - "svelte", 20 - "astro", 21 - "vue", 22 - "css", 23 - "scss", 24 - "gdscript", 25 - }, 26 - 27 - -- Install parsers synchronously (only applied to `ensure_installed`) 28 - sync_install = false, 29 - 30 - -- Automatically install missing parsers when entering buffer 31 - -- Recommendation: set to false if you don"t have `tree-sitter` CLI installed locally 32 - auto_install = true, 33 - 34 - indent = { 35 - enable = true, 36 - disable = { "gdscript" }, 37 - }, 38 - 39 - highlight = { 40 - -- `false` will disable the whole extension 41 - enable = true, 42 - 43 - -- Setting this to true will run `:h syntax` and tree-sitter at the same time. 44 - -- Set this to `true` if you depend on "syntax" being enabled (like for indentation). 45 - -- Using this option may slow down your editor, and you may see some duplicate highlights. 46 - -- Instead of true it can also be a list of languages 47 - additional_vim_regex_highlighting = { "markdown" }, 48 - }, 8 + install_dir = vim.fn.stdpath("data") .. "/site", 49 9 }) 50 10 51 - -- vim.filetype.add({ 52 - -- extension = { 53 - -- mdx = "mdx", 54 - -- }, 55 - -- }) 11 + -- Install parsers (async, no-op if already installed) 12 + require("nvim-treesitter").install({ 13 + "vimdoc", 14 + "javascript", 15 + "typescript", 16 + "tsx", 17 + "ripple", 18 + "c", 19 + "lua", 20 + "rust", 21 + "jsdoc", 22 + "bash", 23 + "svelte", 24 + "astro", 25 + "vue", 26 + "css", 27 + "scss", 28 + "gdscript", 29 + }) 56 30 57 - -- vim.treesitter.language.register("markdown", "mdx") 31 + -- Enable treesitter highlighting and indentation 32 + vim.api.nvim_create_autocmd("FileType", { 33 + callback = function() 34 + pcall(vim.treesitter.start) 35 + vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" 36 + end, 37 + }) 58 38 end, 59 39 }