diff --git a/lua/plugins/coding.lua b/lua/plugins/coding.lua index a82cd91..706ba04 100644 --- a/lua/plugins/coding.lua +++ b/lua/plugins/coding.lua @@ -80,56 +80,6 @@ return { end, }, - -- auto pairs - { - 'windwp/nvim-autopairs', - event = 'InsertEnter', - config = function() - local npairs = require('nvim-autopairs') - local Rule = require('nvim-autopairs.rule') - local conds = require('nvim-autopairs.conds') - - npairs.setup() - - -- Autoclosing angle-brackets. - npairs.add_rule(Rule('<', '>', { - -- Avoid conflicts with nvim-ts-autotag. - '-html', - '-javascriptreact', - '-typescriptreact', - }):with_pair(conds.before_regex('%a+:?:?$', 3)):with_move(function(opts) - return opts.char == '>' - end)) - end, - }, - - -- auto tag - { - 'windwp/nvim-ts-autotag', - ft = { - 'html', - 'xml', - 'javascript', - 'typescript', - 'javascriptreact', - 'typescriptreact', - 'jsx', - 'tsx', - 'vue', - 'svelte', - 'markdown', - 'htmldjango', - }, - event = 'InsertEnter', - lazy = true, - opts = { - -- Defaults - enable_close = true, -- Auto close tags - enable_rename = true, -- Auto rename pairs of tags - enable_close_on_slash = false, -- Auto close on trailing , - ', - watch_gitdir = { - follow_files = true, - }, - current_line_blame_opts = { - virt_text = true, - virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align' - delay = 1000, - ignore_whitespace = false, - virt_text_priority = 100, - use_focus = true, - }, - signs = { - add = { text = ' ' }, - change = { text = '󱗜 ' }, - delete = { text = '󰍵 ' }, - topdelete = { text = '󱥨 ' }, - changedelete = { text = '󰾟 ' }, - untracked = { text = '󰰧 ' }, - }, - }, - }, - - -- lazygit integration - { - 'kdheepak/lazygit.nvim', - lazy = true, - enabled = true, - cmd = { - 'LazyGit', - 'LazyGitConfig', - 'LazyGitCurrentFile', - 'LazyGitFilter', - 'LazyGitFilterCurrentFile', - }, - keys = { - { 'lg', 'LazyGit', desc = 'LazyGit' }, - }, - config = function() - vim.g.lazygit_floating_window_winblend = 0 - vim.g.lazygit_floating_window_scaling_factor = 0.9 - vim.g.lazygit_floating_window_border_chars = { '╭', '─', '╮', '│', '╯', '─', '╰', '│' } - end, - }, -- Todo Comments { @@ -162,70 +103,6 @@ return { }, }, - -- Better folding - { - 'kevinhwang91/nvim-ufo', - dependencies = 'kevinhwang91/promise-async', - event = 'BufReadPost', - keys = { - { - 'zR', - function() - require('ufo').openAllFolds() - end, - }, - { - 'zM', - function() - require('ufo').closeAllFolds() - end, - }, - { - 'zr', - function() - require('ufo').openFoldsExceptKinds() - end, - }, - { - 'zm', - function() - require('ufo').closeFoldsWith() - end, - }, - }, - config = function() - vim.o.foldcolumn = '1' - vim.o.foldlevel = 99 - vim.o.foldlevelstart = 99 - vim.o.foldenable = true - - require('ufo').setup({ - provider_selector = function() - return { 'treesitter', 'indent' } - end, - }) - end, - }, - - -- rendering for html and markdown - { - 'OXY2DEV/markview.nvim', - lazy = false, - -- to load before treesitter - priority = 45, - config = function() - require('markview').setup({ - preview = { - icon_provider = 'mini', - enable = false, - }, - }) - end, - keys = { - { 'cv', 'Markview toggle', desc = 'Toggle markdown preview', mode = 'n' }, - }, - }, - -- markdown preview { 'iamcco/markdown-preview.nvim', diff --git a/lua/plugins/git.lua b/lua/plugins/git.lua new file mode 100644 index 0000000..5ea01a8 --- /dev/null +++ b/lua/plugins/git.lua @@ -0,0 +1,61 @@ +return { + -- gitignore generator + { + 'wintermute-cell/gitignore.nvim', + cmd = { 'Gitignore' }, + opts = {}, + }, + + -- git signs + { + 'lewis6991/gitsigns.nvim', + events = { 'BufReadPost', 'BufNewFile' }, + opts = { + signcolumn = true, + current_line_blame = true, + attach_to_untracked = false, + current_line_blame_formatter = ', - ', + watch_gitdir = { + follow_files = true, + }, + current_line_blame_opts = { + virt_text = true, + virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align' + delay = 1000, + ignore_whitespace = false, + virt_text_priority = 100, + use_focus = true, + }, + signs = { + add = { text = ' ' }, + change = { text = '󱗜 ' }, + delete = { text = '󰍵 ' }, + topdelete = { text = '󱥨 ' }, + changedelete = { text = '󰾟 ' }, + untracked = { text = '󰰧 ' }, + }, + }, + }, + + -- lazygit integration + { + 'kdheepak/lazygit.nvim', + lazy = true, + enabled = true, + cmd = { + 'LazyGit', + 'LazyGitConfig', + 'LazyGitCurrentFile', + 'LazyGitFilter', + 'LazyGitFilterCurrentFile', + }, + keys = { + { 'lg', 'LazyGit', desc = 'LazyGit' }, + }, + config = function() + vim.g.lazygit_floating_window_winblend = 0 + vim.g.lazygit_floating_window_scaling_factor = 0.9 + vim.g.lazygit_floating_window_border_chars = { '╭', '─', '╮', '│', '╯', '─', '╰', '│' } + end, + }, +} diff --git a/lua/plugins/syntax.lua b/lua/plugins/syntax.lua new file mode 100644 index 0000000..e4e9fb2 --- /dev/null +++ b/lua/plugins/syntax.lua @@ -0,0 +1,78 @@ +return { + + -- treesitter + { + 'nvim-treesitter/nvim-treesitter', + build = ':TSUpdate', + event = { 'BufReadPost', 'BufNewFile' }, + config = function() + require('nvim-treesitter.configs').setup({ + ensure_installed = require('config.extensions').ts_parsers, + auto_install = true, + highlight = { + enable = true, + additional_vim_regex_highlighting = true, + }, + indent = { + enable = true, + }, + }) + end, + }, + + -- auto pairs + { + 'windwp/nvim-autopairs', + event = 'InsertEnter', + config = function() + local npairs = require('nvim-autopairs') + local Rule = require('nvim-autopairs.rule') + local conds = require('nvim-autopairs.conds') + + npairs.setup() + + -- Autoclosing angle-brackets. + npairs.add_rule(Rule('<', '>', { + -- Avoid conflicts with nvim-ts-autotag. + '-html', + '-javascriptreact', + '-typescriptreact', + }):with_pair(conds.before_regex('%a+:?:?$', 3)):with_move(function(opts) + return opts.char == '>' + end)) + end, + }, + + -- auto tag + { + 'windwp/nvim-ts-autotag', + ft = { + 'html', + 'xml', + 'javascript', + 'typescript', + 'javascriptreact', + 'typescriptreact', + 'jsx', + 'tsx', + 'vue', + 'svelte', + 'markdown', + 'htmldjango', + }, + event = 'InsertEnter', + lazy = true, + opts = { + -- Defaults + enable_close = true, -- Auto close tags + enable_rename = true, -- Auto rename pairs of tags + enable_close_on_slash = false, -- Auto close on trailing cv', 'Markview toggle', desc = 'Toggle markdown preview', mode = 'n' }, + }, + }, + + -- Better folding + { + 'kevinhwang91/nvim-ufo', + dependencies = 'kevinhwang91/promise-async', + event = 'BufReadPost', + keys = { + { + 'zR', + function() + require('ufo').openAllFolds() + end, + }, + { + 'zM', + function() + require('ufo').closeAllFolds() + end, + }, + { + 'zr', + function() + require('ufo').openFoldsExceptKinds() + end, + }, + { + 'zm', + function() + require('ufo').closeFoldsWith() + end, + }, + }, + config = function() + vim.o.foldcolumn = '1' + vim.o.foldlevel = 99 + vim.o.foldlevelstart = 99 + vim.o.foldenable = true + + require('ufo').setup({ + provider_selector = function() + return { 'treesitter', 'indent' } + end, + }) + end, + }, + + -- smooth scrolling + { + 'karb94/neoscroll.nvim', + opts = {}, + }, + + -- Smart column (colorcolumn only when needed) + { + 'm4xshen/smartcolumn.nvim', + event = { 'BufReadPost', 'BufNewFile' }, + opts = { + colorcolumn = '120', + disabled_filetypes = { + 'help', + 'text', + 'markdown', + 'dashboard', + 'snacks_dashboard', + 'lazy', + 'mason', + 'oil', + }, + }, + }, + + -- Screenshot Tool + { + 'mistricky/codesnap.nvim', + build = 'make', + cmd = { + 'CodeSnap', + 'CodeSnapSave', + 'CodeSnapHighlight', + 'CodeSnapSaveHighlight', + 'CodeSnapASCII', + }, + opts = { + bg_theme = 'dusk', + code_font_family = 'JetBrainsMono Nerd Font', + save_path = os.getenv('XDG_SCREENSHOTS_DIR') or (os.getenv('HOME') .. '/Pictures'), + watermark = 'SANKALP', + watermark_font_family = 'Anurati', + has_breadcrumbs = true, + breadcrumbs_separator = '/', + has_line_number = true, + }, + }, +} diff --git a/lua/plugins/util.lua b/lua/plugins/util.lua index afcd2e3..9a34470 100644 --- a/lua/plugins/util.lua +++ b/lua/plugins/util.lua @@ -72,12 +72,6 @@ return { end, }, - -- smooth scrolling - { - 'karb94/neoscroll.nvim', - opts = {}, - }, - -- discord presence -- { -- "vyfor/cord.nvim", @@ -117,29 +111,6 @@ return { opts = {}, }, - -- Screenshot Tool - { - 'mistricky/codesnap.nvim', - build = 'make', - cmd = { - 'CodeSnap', - 'CodeSnapSave', - 'CodeSnapHighlight', - 'CodeSnapSaveHighlight', - 'CodeSnapASCII', - }, - opts = { - bg_theme = 'dusk', - code_font_family = 'JetBrainsMono Nerd Font', - save_path = os.getenv('XDG_SCREENSHOTS_DIR') or (os.getenv('HOME') .. '/Pictures'), - watermark = 'SANKALP', - watermark_font_family = 'Anurati', - has_breadcrumbs = true, - breadcrumbs_separator = '/', - has_line_number = true, - }, - }, - -- buffer manager { 'serhez/bento.nvim',