diff --git a/after/plugin/catppuccin-config.lua b/after/plugin/catppuccin-config.lua new file mode 100644 index 00000000..8572757a --- /dev/null +++ b/after/plugin/catppuccin-config.lua @@ -0,0 +1,46 @@ +require('catppuccin').setup { + flavour = 'macchiato', -- mocha, frappe, latte, mocha + background = { -- :h background + light = 'latte', + dark = 'mocha', + }, + transparent_background = false, -- disables setting the background color. + show_end_of_buffer = false, -- shows the '~' characters after the end of buffers + term_colors = false, -- sets terminal colors (e.g. `g:terminal_color_0`) + dim_inactive = { + enabled = false, -- dims the background color of inactive window + shade = 'dark', + percentage = 0.15, -- percentage of the shade to apply to the inactive window + }, + no_italic = false, -- Force no italic + no_bold = false, -- Force no bold + no_underline = false, -- Force no underline + styles = { -- Handles the styles of general hi groups (see `:h highlight-args`): + comments = { 'italic' }, -- Change the style of comments + conditionals = { 'italic' }, + loops = {}, + functions = {}, + keywords = {}, + strings = {}, + variables = {}, + numbers = {}, + booleans = {}, + properties = {}, + types = {}, + operators = {}, + }, + color_overrides = {}, + custom_highlights = {}, + integrations = { + cmp = true, + gitsigns = true, + nvimtree = true, + treesitter = true, + notify = false, + mini = { + enabled = true, + indentscope_color = '', + }, + -- For more plugins integrations please scroll down (https://github.com/catppuccin/nvim#integrations) + }, +} diff --git a/after/plugin/cmp.lua b/after/plugin/cmp.lua index d3a415d9..77179d4b 100644 --- a/after/plugin/cmp.lua +++ b/after/plugin/cmp.lua @@ -1,5 +1,6 @@ -- [[ Configure nvim-cmp ]] -- See `:help cmp` +vim.api.nvim_set_hl(0, 'CmpGhostText', { link = 'Comment', default = true }) local cmp = require 'cmp' local luasnip = require 'luasnip' require('luasnip.loaders.from_vscode').lazy_load() @@ -43,5 +44,9 @@ cmp.setup { sources = { { name = 'nvim_lsp' }, { name = 'luasnip' }, + { name = 'path' }, + { + { name = 'buffer' }, + }, }, } diff --git a/after/plugin/lsp-config.lua b/after/plugin/lsp-config.lua index af64bd57..d0e73710 100644 --- a/after/plugin/lsp-config.lua +++ b/after/plugin/lsp-config.lua @@ -42,9 +42,6 @@ lsp.set_preferences { lsp.on_attach(function(_, bufnr) local opts = { buffer = bufnr, remap = false } - vim.keymap.set('n', 'gd', function() - vim.lsp.buf.definition() - end, opts) vim.keymap.set('n', 'gD', function() vim.lsp.buf.declaration() end, opts) @@ -57,23 +54,39 @@ lsp.on_attach(function(_, bufnr) vim.keymap.set('n', 'vd', function() vim.diagnostic.open_float() end, opts) + vim.keymap.set('n', '[d', function() vim.diagnostic.goto_next() end, opts) vim.keymap.set('n', ']d', function() vim.diagnostic.goto_prev() end, opts) + vim.keymap.set('n', 'ca', function() vim.lsp.buf.code_action() end, opts) + + vim.keymap.set('n', 'gd', require('telescope.builtin').lsp_definitions, opts) vim.keymap.set('n', 'gr', require('telescope.builtin').lsp_references, opts) + vim.keymap.set('n', 'rn', function() vim.lsp.buf.rename() end, opts) - --[[ vim.keymap.set("i", "", function() vim.lsp.buf.signature_help() end, opts) ]] + vim.keymap.set('n', 'lf', function() require('conform').format() end, { desc = 'Format Buffer' }) + + -- Add WorkSpace + vim.keymap.set('n', 'wa', vim.lsp.buf.add_workspace_folder, opts) + + -- Remove WorkSpace + vim.keymap.set('n', 'wr', vim.lsp.buf.remove_workspace_folder, opts) + + -- List WorkSpace + vim.keymap.set('n', 'wl', function() + print(vim.inspect(vim.lsp.buf.list_workspace_folders())) + end, opts) end) lsp.setup() diff --git a/after/plugin/mini-comment-config.lua b/after/plugin/mini-comment-config.lua new file mode 100644 index 00000000..4a078ac9 --- /dev/null +++ b/after/plugin/mini-comment-config.lua @@ -0,0 +1,39 @@ +require('mini.comment').setup { + -- Options which control module behavior + options = { + -- Function to compute custom 'commentstring' (optional) + custom_commentstring = function() + return require('ts_context_commentstring.internal').calculate_commentstring() or vim.bo.commentstring + end, + + -- Whether to ignore blank lines + ignore_blank_line = false, + + -- Whether to recognize as comment only lines without indent + start_of_line = false, + + -- Whether to ensure single space pad for comment parts + pad_comment_parts = true, + }, + + -- Module mappings. Use `''` (empty string) to disable one. + mappings = { + -- Toggle comment (like `gcip` - comment inner paragraph) for both + -- Normal and Visual modes + comment = '++', + + -- Toggle comment on current line + comment_line = '++', + + -- Define 'comment' textobject (like `dgc` - delete whole comment block) + textobject = '++', + }, + + -- Hook functions to be executed at certain stage of commenting + hooks = { + -- Before successful commenting. Does nothing by default. + pre = function() end, + -- After successful commenting. Does nothing by default. + post = function() end, + }, +} diff --git a/after/plugin/treesitter-config.lua b/after/plugin/treesitter-config.lua index ee753c3d..583435f5 100644 --- a/after/plugin/treesitter-config.lua +++ b/after/plugin/treesitter-config.lua @@ -19,9 +19,25 @@ } end, 0) ]] -require'nvim-treesitter.configs'.setup { +require('nvim-treesitter.configs').setup { -- A list of parser names, or "all" - ensure_installed = { "vimdoc", "javascript", "typescript", "c", "lua", "rust", "go", "python", "tsx", "vim" }, + ensure_installed = { + 'c', + 'css', + 'lua', + 'rust', + 'go', + 'python', + 'vim', + 'vimdoc', + 'tsx', + 'html', + 'javascript', + 'typescript', + }, + context_commentstring = { + enable = true, + }, -- Install parsers synchronously (only applied to `ensure_installed`) sync_install = false, @@ -40,4 +56,59 @@ require'nvim-treesitter.configs'.setup { -- Instead of true it can also be a list of languages additional_vim_regex_highlighting = false, }, + + incremental_selection = { + enable = true, + keymaps = { + init_selection = '', + node_incremental = '', + scope_incremental = '', + node_decremental = '', + }, + }, + + textobjects = { + select = { + enable = true, + lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim + keymaps = { + -- You can use the capture groups defined in textobjects.scm + ['aa'] = '@parameter.outer', + ['ia'] = '@parameter.inner', + ['af'] = '@function.outer', + ['if'] = '@function.inner', + ['ac'] = '@class.outer', + ['ic'] = '@class.inner', + }, + }, + move = { + enable = true, + set_jumps = true, -- whether to set jumps in the jumplist + goto_next_start = { + [']m'] = '@function.outer', + [']]'] = '@class.outer', + }, + goto_next_end = { + [']M'] = '@function.outer', + [']['] = '@class.outer', + }, + goto_previous_start = { + ['[m'] = '@function.outer', + ['[['] = '@class.outer', + }, + goto_previous_end = { + ['[M'] = '@function.outer', + ['[]'] = '@class.outer', + }, + }, + swap = { + enable = true, + swap_next = { + ['a'] = '@parameter.inner', + }, + swap_previous = { + ['A'] = '@parameter.inner', + }, + }, + }, } diff --git a/after/plugin/ts-context-commentstring.lua b/after/plugin/ts-context-commentstring.lua new file mode 100644 index 00000000..c12dbaa8 --- /dev/null +++ b/after/plugin/ts-context-commentstring.lua @@ -0,0 +1 @@ +require('ts_context_commentstring').setup {} diff --git a/lazy-lock.json b/lazy-lock.json index 8a696e67..4a5b1ea9 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,39 +1,41 @@ { - "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, - "LuaSnip": { "branch": "master", "commit": "0df29db3543837f8b41597f2640397c5ec792b7b" }, + "LuaSnip": { "branch": "master", "commit": "80a8528f084a97b624ae443a6f50ff8074ba486b" }, "alpha-nvim": { "branch": "main", "commit": "234822140b265ec4ba3203e3e0be0e0bb826dff5" }, + "catppuccin": { "branch": "main", "commit": "b359f3eec32dcc6b7c9a26901dc235bbb6cd8a0b" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" }, "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "conform.nvim": { "branch": "master", "commit": "1281e26948fc06994e0e0cdcaafdd9bbd28929e7" }, + "conform.nvim": { "branch": "master", "commit": "f7766d2fbe23f0f22a3db1513beba7d03a8dc261" }, "friendly-snippets": { "branch": "main", "commit": "43727c2ff84240e55d4069ec3e6158d74cb534b6" }, - "gitsigns.nvim": { "branch": "main", "commit": "5a9a6ac29a7805c4783cda21b80a1e361964b3f2" }, - "lazy.nvim": { "branch": "main", "commit": "7613ab2abb1bd99e039ae02030bc2c48b7626925" }, + "gitsigns.nvim": { "branch": "main", "commit": "af0f583cd35286dd6f0e3ed52622728703237e50" }, + "lazy.nvim": { "branch": "main", "commit": "16603c6917435d8446f7357cb61095138a417085" }, "lazygit.nvim": { "branch": "main", "commit": "de35012036d43bca03628d40d083f7c02a4cda3f" }, - "lsp-zero.nvim": { "branch": "v1.x", "commit": "60b0e84f3793f7e8bcc9ec52f9c239fd497b2cd2" }, - "lualine.nvim": { "branch": "master", "commit": "1a3f6bba410aff5a51bf8c84287aaa3a8ba30d0d" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "e7b64c11035aa924f87385b72145e0ccf68a7e0a" }, + "lsp-zero.nvim": { "branch": "v1.x", "commit": "c51a9104de7fddff2351361d2dbcbd8d08600ef4" }, + "lualine.nvim": { "branch": "master", "commit": "2248ef254d0a1488a72041cfb45ca9caada6d994" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "40301e1c74bc0946eece13edf2b1c561cc497491" }, "mason.nvim": { "branch": "main", "commit": "cd7835b15f5a4204fc37e0aa739347472121a54c" }, + "mini.ai": { "branch": "main", "commit": "fc9ce93eb8d58ce1a39101928fb5ea8f8b97844c" }, + "mini.comment": { "branch": "main", "commit": "e4320af992cd053a7da2f33d9f63a86c2ab6ce59" }, + "mini.surround": { "branch": "main", "commit": "862cfaef72d789d320625ec34e2488a5cc8fd423" }, "neo-tree.nvim": { "branch": "v3.x", "commit": "71f1841ba6c652908678cece623f52c1fea8a6cd" }, "nui.nvim": { "branch": "main", "commit": "c0c8e347ceac53030f5c1ece1c5a5b6a17a25b32" }, - "nvim-autopairs": { "branch": "master", "commit": "f6c71641f6f183427a651c0ce4ba3fb89404fa9e" }, - "nvim-cmp": { "branch": "main", "commit": "5dce1b778b85c717f6614e3f4da45e9f19f54435" }, - "nvim-lspconfig": { "branch": "master", "commit": "e49b1e90c1781ce372013de3fa93a91ea29fc34a" }, - "nvim-treesitter": { "branch": "master", "commit": "9c4fc86b67c1d68141cef57846d24cbee9b74fb0" }, - "nvim-treesitter-context": { "branch": "master", "commit": "82c695951612911421e8e21068ba5fc2c2e2c212" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "78c49ca7d2f7ccba2115c11422c037713c978ad1" }, + "nvim-autopairs": { "branch": "master", "commit": "0f04d78619cce9a5af4f355968040f7d675854a1" }, + "nvim-cmp": { "branch": "main", "commit": "51260c02a8ffded8e16162dcf41a23ec90cfba62" }, + "nvim-lspconfig": { "branch": "master", "commit": "d0467b9574b48429debf83f8248d8cee79562586" }, + "nvim-treesitter": { "branch": "master", "commit": "efec7115d8175bdb6720eeb4e26196032cb52593" }, + "nvim-treesitter-context": { "branch": "master", "commit": "2806d83e3965017382ce08792ee527e708fa1bd4" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "e69a504baf2951d52e1f1fbb05145d43f236cbf1" }, "nvim-ts-autotag": { "branch": "main", "commit": "6be1192965df35f94b8ea6d323354f7dc7a557e4" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "92e688f013c69f90c9bbd596019ec10235bc51de" }, - "nvim-web-devicons": { "branch": "master", "commit": "3af745113ea537f58c4b1573b64a429fefad9e07" }, - "onedark.nvim": { "branch": "master", "commit": "826fb77e9ca92d3c0f3d937328663d4a6dc7fee1" }, + "nvim-web-devicons": { "branch": "master", "commit": "5de460ca7595806044eced31e3c36c159a493857" }, "plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" }, "telescope.nvim": { "branch": "0.1.x", "commit": "7011eaae0ac1afe036e30c95cf80200b8dc3f21a" }, - "undotree": { "branch": "master", "commit": "0e11ba7325efbbb3f3bebe06213afa3e7ec75131" }, - "vim-fugitive": { "branch": "master", "commit": "cbe9dfa162c178946afa689dd3f42d4ea8bf89c1" }, + "undotree": { "branch": "master", "commit": "170aa9e516b6926e6bddfe21bbf01f2283a00e7d" }, + "vim-fugitive": { "branch": "master", "commit": "46eaf8918b347906789df296143117774e827616" }, "vim-rhubarb": { "branch": "master", "commit": "ee69335de176d9325267b0fd2597a22901d927b1" }, "vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" }, - "which-key.nvim": { "branch": "main", "commit": "6962dae3565369363b59dd51fb206051555fcb4d" } + "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } } \ No newline at end of file diff --git a/lua/plugins/comments.lua b/lua/plugins/comments.lua deleted file mode 100644 index 06f1809b..00000000 --- a/lua/plugins/comments.lua +++ /dev/null @@ -1,18 +0,0 @@ -return { - 'numToStr/Comment.nvim', - opts = { - toggler = { - ---Line-comment toggle keymap - line = '++', - ---Block-comment toggle keymap - block = '++', - }, - opleader = { - ---Line-comment keymap - line = '++', - ---Block-comment keymap - block = '++', - }, - }, - lazy = false, -} diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index 179bd8d3..ca3fb910 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -1,90 +1,98 @@ return { - -- NOTE: First, some plugins that don't require any configuration + -- NOTE: First, some plugins that don't require any configuration - -- Git related plugins - 'tpope/vim-fugitive', - 'tpope/vim-rhubarb', + -- Git related plugins + 'tpope/vim-fugitive', + 'tpope/vim-rhubarb', - -- Detect tabstop and shiftwidth automatically - 'tpope/vim-sleuth', + -- Detect tabstop and shiftwidth automatically + 'tpope/vim-sleuth', - -- Useful plugin to show you pending keybinds. - { 'folke/which-key.nvim', opts = {} }, + -- Useful plugin to show you pending keybinds. + { 'folke/which-key.nvim', opts = {} }, - { "mbbill/undotree" }, + { 'mbbill/undotree' }, - { - -- Theme inspired by Atom - 'navarasu/onedark.nvim', - priority = 1000, - config = function() - vim.cmd.colorscheme 'onedark' - end, - }, + -- { + -- -- Theme inspired by Atom + -- 'navarasu/onedark.nvim', + -- priority = 1000, + -- config = function() + -- vim.cmd.colorscheme 'onedark' + -- end, + -- }, + -- + { + 'catppuccin/nvim', + name = 'catppuccin', + priority = 1000, + config = function() + vim.cmd.colorscheme 'catppuccin' + end, + }, - { - -- Set lualine as statusline - 'nvim-lualine/lualine.nvim', - -- See `:help lualine.txt` - opts = { - options = { - icons_enabled = false, - theme = 'onedark', - component_separators = '|', - section_separators = '', - }, - }, + { + -- Set lualine as statusline + 'nvim-lualine/lualine.nvim', + -- See `:help lualine.txt` + opts = { + options = { + icons_enabled = false, + theme = 'onedark', + component_separators = '|', + section_separators = '', + }, }, + }, - { - -- Autocompletion - 'hrsh7th/nvim-cmp', - dependencies = { - -- Snippet Engine & its associated nvim-cmp source - 'L3MON4D3/LuaSnip', - 'saadparwaiz1/cmp_luasnip', + { + -- Autocompletion + 'hrsh7th/nvim-cmp', + dependencies = { + -- Snippet Engine & its associated nvim-cmp source + 'L3MON4D3/LuaSnip', + 'saadparwaiz1/cmp_luasnip', - -- Adds LSP completion capabilities - 'hrsh7th/cmp-nvim-lsp', + -- Adds LSP completion capabilities + 'hrsh7th/cmp-nvim-lsp', - -- Adds a number of user-friendly snippets - 'rafamadriz/friendly-snippets', - }, + -- Adds a number of user-friendly snippets + 'rafamadriz/friendly-snippets', }, + }, - -- Fuzzy Finder (files, lsp, etc) - { - 'nvim-telescope/telescope.nvim', - branch = '0.1.x', - dependencies = { - 'nvim-lua/plenary.nvim', - -- Fuzzy Finder Algorithm which requires local dependencies to be built. - -- Only load if `make` is available. Make sure you have the system - -- requirements installed. - { - 'nvim-telescope/telescope-fzf-native.nvim', - -- NOTE: If you are having trouble with this installation, - -- refer to the README for telescope-fzf-native for more instructions. - build = 'make', - cond = function() - return vim.fn.executable 'make' == 1 - end, - }, - }, + -- Fuzzy Finder (files, lsp, etc) + { + 'nvim-telescope/telescope.nvim', + branch = '0.1.x', + dependencies = { + 'nvim-lua/plenary.nvim', + -- Fuzzy Finder Algorithm which requires local dependencies to be built. + -- Only load if `make` is available. Make sure you have the system + -- requirements installed. + { + 'nvim-telescope/telescope-fzf-native.nvim', + -- NOTE: If you are having trouble with this installation, + -- refer to the README for telescope-fzf-native for more instructions. + build = 'make', + cond = function() + return vim.fn.executable 'make' == 1 + end, + }, }, + }, + -- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart + -- These are some example plugins that I've included in the kickstart repository. + -- Uncomment any of the lines below to enable them. + --[[ require 'kickstart.plugins.autoformat', ]] + --[[ require 'kickstart.plugins.debug', ]] - -- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart - -- These are some example plugins that I've included in the kickstart repository. - -- Uncomment any of the lines below to enable them. - --[[ require 'kickstart.plugins.autoformat', ]] - --[[ require 'kickstart.plugins.debug', ]] - - -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` - -- You can use this folder to prevent any conflicts with this init.lua if you're interested in keeping - -- up-to-date with whatever is in the kickstart repo. - -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. - -- - -- For additional information see: https://github.com/folke/lazy.nvim#-structuring-your-plugins - -- { import = 'custom.plugins' }, + -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` + -- You can use this folder to prevent any conflicts with this init.lua if you're interested in keeping + -- up-to-date with whatever is in the kickstart repo. + -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. + -- + -- For additional information see: https://github.com/folke/lazy.nvim#-structuring-your-plugins + -- { import = 'custom.plugins' }, }, {} diff --git a/lua/plugins/mini-ai.lua b/lua/plugins/mini-ai.lua new file mode 100644 index 00000000..83d0110d --- /dev/null +++ b/lua/plugins/mini-ai.lua @@ -0,0 +1,22 @@ +return { + 'echasnovski/mini.ai', + -- keys = { + -- { "a", mode = { "x", "o" } }, + -- { "i", mode = { "x", "o" } }, + -- }, + opts = function() + local ai = require 'mini.ai' + return { + n_lines = 500, + custom_textobjects = { + o = ai.gen_spec.treesitter({ + a = { '@block.outer', '@conditional.outer', '@loop.outer' }, + i = { '@block.inner', '@conditional.inner', '@loop.inner' }, + }, {}), + f = ai.gen_spec.treesitter({ a = '@function.outer', i = '@function.inner' }, {}), + c = ai.gen_spec.treesitter({ a = '@class.outer', i = '@class.inner' }, {}), + t = { '<([%p%w]-)%f[^<%w][^<>]->.-', '^<.->().*()$' }, + }, + } + end, +} diff --git a/lua/plugins/mini-comment.lua b/lua/plugins/mini-comment.lua new file mode 100644 index 00000000..3c1cfdc8 --- /dev/null +++ b/lua/plugins/mini-comment.lua @@ -0,0 +1,11 @@ +return { + 'echasnovski/mini.comment', + event = 'VeryLazy', + opts = { + options = { + custom_commentstring = function() + return require('ts_context_commentstring.internal').calculate_commentstring() or vim.bo.commentstring + end, + }, + }, +} diff --git a/lua/plugins/surrond.lua b/lua/plugins/surrond.lua new file mode 100644 index 00000000..64cd6a0b --- /dev/null +++ b/lua/plugins/surrond.lua @@ -0,0 +1,14 @@ +return { + 'echasnovski/mini.surround', + opts = { + mappings = { + add = 'gsa', -- Add surrounding in Normal and Visual modes + delete = 'gsd', -- Delete surrounding + find = 'gsf', -- Find surrounding (to the right) + find_left = 'gsF', -- Find surrounding (to the left) + highlight = 'gsh', -- Highlight surrounding + replace = 'gsr', -- Replace surrounding + update_n_lines = 'gsn', -- Update `n_lines` + }, + }, +} diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index 6012d3ea..1eec17cb 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -1,36 +1,36 @@ return { - -- Highlight, edit, and navigate code - 'nvim-treesitter/nvim-treesitter', - dependencies = { - 'nvim-treesitter/nvim-treesitter-textobjects', - "windwp/nvim-ts-autotag", - "JoosepAlviste/nvim-ts-context-commentstring", - "nvim-treesitter/nvim-treesitter-context", - }, - cmd = { - "TSBufDisable", - "TSBufEnable", - "TSBufToggle", - "TSDisable", - "TSEnable", - "TSToggle", - "TSInstall", - "TSInstallInfo", - "TSInstallSync", - "TSModuleInfo", - "TSUninstall", - "TSUpdate", - "TSUpdateSync", - }, - build = ":TSUpdate", - opts = { - highlight = { - enable = true, - disable = function(_, bufnr) return vim.api.nvim_buf_line_count(bufnr) > 10000 end, - }, - incremental_selection = { enable = true }, - indent = { enable = true }, - autotag = { enable = true }, - context_commentstring = { enable = true, enable_autocmd = false }, + -- Highlight, edit, and navigate code + 'nvim-treesitter/nvim-treesitter', + dependencies = { + 'nvim-treesitter/nvim-treesitter-textobjects', + 'windwp/nvim-ts-autotag', + 'JoosepAlviste/nvim-ts-context-commentstring', + 'nvim-treesitter/nvim-treesitter-context', + }, + cmd = { + 'TSBufDisable', + 'TSBufEnable', + 'TSBufToggle', + 'TSDisable', + 'TSEnable', + 'TSToggle', + 'TSInstall', + 'TSInstallInfo', + 'TSInstallSync', + 'TSModuleInfo', + 'TSUninstall', + 'TSUpdate', + 'TSUpdateSync', + }, + build = ':TSUpdate', + opts = { + highlight = { + enable = true, + -- disable = function(_, bufnr) return vim.api.nvim_buf_line_count(bufnr) > 10000 end, }, + incremental_selection = { enable = true }, + indent = { enable = true }, + autotag = { enable = true }, + context_commentstring = { enable = true, enable_autocmd = false }, + }, } diff --git a/lua/thrillee/splits.lua b/lua/thrillee/splits.lua index b4e20b64..a241c6fd 100644 --- a/lua/thrillee/splits.lua +++ b/lua/thrillee/splits.lua @@ -2,34 +2,39 @@ vim.opt.splitbelow = true vim.opt.splitright = true -vim.keymap.set("n", "||", "vsplit", { desc = 'Vertical Split' }) -vim.keymap.set("n", "--", "split", { desc = 'Horinzontal Split' }) +vim.keymap.set('n', '||', 'vsplit', { desc = 'Vertical Split' }) +vim.keymap.set('n', '--', 'split', { desc = 'Horinzontal Split' }) -vim.keymap.set("n", "", "h", { desc = "Navigate to the left" }) -vim.keymap.set("n", "", "", { desc = "Navigate below" }) -vim.keymap.set("n", "", "k", { desc = "Navigate up" }) -vim.keymap.set("n", "", "l", { desc = "Navigate right" }) +vim.keymap.set('n', '', 'h', { desc = 'Navigate to the left' }) +vim.keymap.set('n', '', '', { desc = 'Navigate below' }) +vim.keymap.set('n', '', 'k', { desc = 'Navigate up' }) +vim.keymap.set('n', '', 'l', { desc = 'Navigate right' }) -vim.keymap.set("n", "hh", ":vertical resize +3", { silent = true }) -vim.keymap.set("n", "ll", ":vertical resize -3", { silent = true }) -vim.keymap.set("n", "kk", ":resize +3", { silent = true }) -vim.keymap.set("n", "jj", ":resize -3", { silent = true }) +vim.keymap.set('n', 'sh', 'h', { desc = 'Navigate to the left' }) +vim.keymap.set('n', 'sw', '', { desc = 'Navigate below' }) +vim.keymap.set('n', 'sk', 'k', { desc = 'Navigate up' }) +vim.keymap.set('n', 'sl', 'l', { desc = 'Navigate right' }) + +vim.keymap.set('n', 'hh', ':vertical resize +3', { silent = true }) +vim.keymap.set('n', 'll', ':vertical resize -3', { silent = true }) +vim.keymap.set('n', 'kk', ':resize +3', { silent = true }) +vim.keymap.set('n', 'jj', ':resize -3', { silent = true }) vim.g.original_size = nil function Toggle_maximize_pane() - local winnr = vim.api.nvim_get_current_win() - local width = vim.api.nvim_win_get_width(winnr) - local height = vim.api.nvim_win_get_height(winnr) - if vim.g.original_size == nil then - vim.g.original_size = { width, height } - vim.api.nvim_win_set_width(winnr, vim.o.columns) - vim.api.nvim_win_set_height(winnr, vim.o.lines) - else - vim.api.nvim_win_set_width(winnr, vim.g.original_size[1]) - vim.api.nvim_win_set_height(winnr, vim.g.original_size[2]) - vim.g.original_size = nil - end + local winnr = vim.api.nvim_get_current_win() + local width = vim.api.nvim_win_get_width(winnr) + local height = vim.api.nvim_win_get_height(winnr) + if vim.g.original_size == nil then + vim.g.original_size = { width, height } + vim.api.nvim_win_set_width(winnr, vim.o.columns) + vim.api.nvim_win_set_height(winnr, vim.o.lines) + else + vim.api.nvim_win_set_width(winnr, vim.g.original_size[1]) + vim.api.nvim_win_set_height(winnr, vim.g.original_size[2]) + vim.g.original_size = nil + end end -vim.keymap.set("n", "", 'lua Toggle_maximize_pane()', { noremap = true, desc = "Maximize Current Split" }) +vim.keymap.set('n', '', 'lua Toggle_maximize_pane()', { noremap = true, desc = 'Maximize Current Split' })