diff --git a/init.lua b/init.lua index 08717d537e6..07108c3a775 100644 --- a/init.lua +++ b/init.lua @@ -22,6 +22,7 @@ What is Kickstart? + Kickstart.nvim is *not* a distribution. Kickstart.nvim is a starting point for your own configuration. @@ -91,7 +92,7 @@ vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' -- Set to true if you have a Nerd Font installed and selected in the terminal -vim.g.have_nerd_font = false +vim.g.have_nerd_font = true -- [[ Setting options ]] -- See `:help vim.opt` @@ -243,6 +244,11 @@ require('lazy').setup({ -- require('gitsigns').setup({ ... }) -- -- See `:help gitsigns` to understand what the configuration keys do + { + 'nvim-tree/nvim-web-devicons', + enabled = true, + lazy = false, + }, { -- Adds git related signs to the gutter, as well as utilities for managing changes 'lewis6991/gitsigns.nvim', opts = { @@ -354,7 +360,6 @@ require('lazy').setup({ { 'nvim-telescope/telescope-ui-select.nvim' }, -- Useful for getting pretty icons, but requires a Nerd Font. - { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font }, }, config = function() -- Telescope is a fuzzy finder that comes with a lot of different things that @@ -462,7 +467,7 @@ require('lazy').setup({ -- Useful status updates for LSP. -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` - { 'j-hui/fidget.nvim', opts = {} }, + { 'j-hui/fidget.nvim', lazy = false, opts = {} }, -- Allows extra capabilities provided by nvim-cmp 'hrsh7th/cmp-nvim-lsp', @@ -553,7 +558,7 @@ require('lazy').setup({ -- -- When you move your cursor, the highlights will be cleared (the second autocommand). local client = vim.lsp.get_client_by_id(event.data.client_id) - if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight) then + if client and client:supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight) then local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false }) vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, { buffer = event.buf, @@ -580,7 +585,7 @@ require('lazy').setup({ -- code, if the language server you are using supports them -- -- This may be unwanted, since they displace some of your code - if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint) then + if client and client:supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint) then map('th', function() vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf }) end, '[T]oggle Inlay [H]ints') @@ -614,6 +619,45 @@ require('lazy').setup({ -- - capabilities (table): Override fields in capabilities. Can be used to disable certain LSP features. -- - settings (table): Override the default settings passed when initializing the server. -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ + vim.lsp.config('gdscript', { + cmd = vim.lsp.rpc.connect('127.0.0.1', 6005), + filetypes = { 'gdscript' }, + root_dir = vim.fs.root(0, { 'project.godot', '.git' }), + }) + vim.lsp.enable 'gdscript' + + vim.lsp.config('basedpyright', { + settings = { + basedpyright = { + analysis = { + typeCheckingMode = 'standard', + autoSearchPaths = true, + useLibraryCodeForTypes = true, + autoImportCompletions = true, + diagnosticMode = 'workspace', -- sobreescribe el "openFilesOnly" del default + }, + }, + }, + }) + + vim.lsp.enable 'basedpyright' + + vim.lsp.config('arduino_language_server', { + cmd = { + 'arduino-language-server', + '-clangd', + vim.fn.exepath 'clangd', + '-cli', + vim.fn.exepath 'arduino-cli', + '-cli-config', + vim.fn.expand '~/.arduino15/arduino-cli.yaml', + '-fqbn', + 'arduino:avr:mega', + }, + }) + + vim.lsp.enable 'arduino_language_server' + local servers = { -- clangd = {}, -- gopls = {}, @@ -668,10 +712,13 @@ require('lazy').setup({ -- by the server configuration above. Useful when disabling -- certain features of an LSP (for example, turning off formatting for ts_ls) server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {}) - require('lspconfig')[server_name].setup(server) + vim.lsp.config(server_name, server) + vim.lsp.enable(server_name) end, }, } + -- GDScript (Godot 4) — el servidor está integrado en Godot, no en Mason + -- Godot debe estar abierto con el proyecto para que el LSP funcione end, }, @@ -695,7 +742,8 @@ require('lazy').setup({ -- Disable "format_on_save lsp_fallback" for languages that don't -- have a well standardized coding style. You can add additional -- languages here or re-enable it for the disabled ones. - local disable_filetypes = { c = true, cpp = true } + -- local disable_filetypes = { c = true, cpp = true } + local disable_filetypes = {} local lsp_format_opt if disable_filetypes[vim.bo[bufnr].filetype] then lsp_format_opt = 'never' @@ -709,6 +757,19 @@ require('lazy').setup({ end, formatters_by_ft = { lua = { 'stylua' }, + go = { 'goimports' }, + python = { 'ruff_format' }, + javascript = { 'prettierd', 'prettier', stop_after_first = true }, + typescript = { 'prettierd', 'prettier', stop_after_first = true }, + javascriptreact = { 'prettierd', 'prettier', stop_after_first = true }, + typescriptreact = { 'prettierd', 'prettier', stop_after_first = true }, + css = { 'prettierd', 'prettier', stop_after_first = true }, + html = { 'prettierd', 'prettier', stop_after_first = true }, + json = { 'prettierd', 'prettier', stop_after_first = true }, + yaml = { 'prettierd', 'prettier', stop_after_first = true }, + markdown = { 'prettierd', 'prettier', stop_after_first = true }, + c = { 'clang_format' }, + cpp = { 'clang_format' }, -- Conform can also run multiple formatters sequentially -- python = { "isort", "black" }, -- @@ -738,12 +799,27 @@ require('lazy').setup({ -- `friendly-snippets` contains a variety of premade snippets. -- See the README about individual language/framework/plugin snippets: -- https://github.com/rafamadriz/friendly-snippets - -- { - -- 'rafamadriz/friendly-snippets', - -- config = function() - -- require('luasnip.loaders.from_vscode').lazy_load() - -- end, - -- }, + { + 'rafamadriz/friendly-snippets', + config = function() + require('luasnip.loaders.from_vscode').lazy_load() + require('luasnip.loaders.from_snipmate').lazy_load() + require('luasnip.loaders.from_lua').lazy_load() + require('luasnip').filetype_extend('typescript', { 'tsdoc' }) + require('luasnip').filetype_extend('javascript', { 'jsdoc' }) + require('luasnip').filetype_extend('lua', { 'luadoc' }) + require('luasnip').filetype_extend('python', { 'pydoc' }) + require('luasnip').filetype_extend('rust', { 'rustdoc' }) + require('luasnip').filetype_extend('cs', { 'csharpdoc' }) + require('luasnip').filetype_extend('java', { 'javadoc' }) + require('luasnip').filetype_extend('c', { 'cdoc' }) + require('luasnip').filetype_extend('cpp', { 'cppdoc' }) + require('luasnip').filetype_extend('php', { 'phpdoc' }) + require('luasnip').filetype_extend('kotlin', { 'kdoc' }) + require('luasnip').filetype_extend('ruby', { 'rdoc' }) + require('luasnip').filetype_extend('sh', { 'shelldoc' }) + end, + }, }, }, 'saadparwaiz1/cmp_luasnip', @@ -789,10 +865,10 @@ require('lazy').setup({ -- If you prefer more traditional completion keymaps, -- you can uncomment the following lines - --[''] = cmp.mapping.confirm { select = true }, - --[''] = cmp.mapping.select_next_item(), - --[''] = cmp.mapping.select_prev_item(), - + [''] = cmp.mapping.confirm { select = true }, + [''] = cmp.mapping.select_next_item(), + [''] = cmp.mapping.select_prev_item(), + -- -- Manually trigger a completion from nvim-cmp. -- Generally you don't need this, because nvim-cmp will display -- completions whenever it has completion options available. @@ -855,68 +931,70 @@ require('lazy').setup({ -- Highlight todo, notes, etc in comments { 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } }, - { -- Collection of various small independent plugins/modules - 'echasnovski/mini.nvim', + { -- Highlight, edit, and navigate code + 'nvim-treesitter/nvim-treesitter', + lazy = false, + build = ':TSUpdate', + branch = 'main', + -- [[ Configure Treesitter ]] See `:help nvim-treesitter-intro` config = function() - -- Better Around/Inside textobjects - -- - -- Examples: - -- - va) - [V]isually select [A]round [)]paren - -- - yinq - [Y]ank [I]nside [N]ext [Q]uote - -- - ci' - [C]hange [I]nside [']quote - require('mini.ai').setup { n_lines = 500 } + -- ensure basic parser are installed + local parsers = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' } + require('nvim-treesitter').install(parsers) + + ---@param buf integer + ---@param language string + local function treesitter_try_attach(buf, language) + -- check if parser exists and load it + if not vim.treesitter.language.add(language) then + return + end + -- enables syntax highlighting and other treesitter features + vim.treesitter.start(buf, language) - -- Add/delete/replace surroundings (brackets, quotes, etc.) - -- - -- - saiw) - [S]urround [A]dd [I]nner [W]ord [)]Paren - -- - sd' - [S]urround [D]elete [']quotes - -- - sr)' - [S]urround [R]eplace [)] ['] - require('mini.surround').setup() - - -- Simple and easy statusline. - -- You could remove this setup call if you don't like it, - -- and try some other statusline plugin - local statusline = require 'mini.statusline' - -- set use_icons to true if you have a Nerd Font - statusline.setup { use_icons = vim.g.have_nerd_font } - - -- You can configure sections in the statusline by overriding their - -- default behavior. For example, here we set the section for - -- cursor location to LINE:COLUMN - ---@diagnostic disable-next-line: duplicate-set-field - statusline.section_location = function() - return '%2l:%-2v' + -- enables treesitter based folds + -- for more info on folds see `:help folds` + vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()' + vim.wo.foldmethod = 'expr' + + -- check if treesitter indentation is available for this language, and if so enable it + -- in case there is no indent query, the indentexpr will fallback to the vim's built in one + local has_indent_query = vim.treesitter.query.get(language, 'indents') ~= nil + + -- enables treesitter based indentation + if has_indent_query then + vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" + end end - -- ... and there is more! - -- Check out: https://github.com/echasnovski/mini.nvim + local available_parsers = require('nvim-treesitter').get_available() + vim.api.nvim_create_autocmd('FileType', { + callback = function(args) + local buf, filetype = args.buf, args.match + + local language = vim.treesitter.language.get_lang(filetype) + if not language then + return + end + + local installed_parsers = require('nvim-treesitter').get_installed 'parsers' + + if vim.tbl_contains(installed_parsers, language) then + -- enable the parser if it is installed + treesitter_try_attach(buf, language) + elseif vim.tbl_contains(available_parsers, language) then + -- if a parser is available in `nvim-treesitter` auto install it, and enable it after the installation is done + require('nvim-treesitter').install(language):await(function() + treesitter_try_attach(buf, language) + end) + else + -- try to enable treesitter features in case the parser exists but is not available from `nvim-treesitter` + treesitter_try_attach(buf, language) + end + end, + }) end, }, - { -- Highlight, edit, and navigate code - 'nvim-treesitter/nvim-treesitter', - build = ':TSUpdate', - main = 'nvim-treesitter.configs', -- Sets main module to use for opts - -- [[ Configure Treesitter ]] See `:help nvim-treesitter` - opts = { - ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }, - -- Autoinstall languages that are not installed - auto_install = true, - highlight = { - enable = true, - -- Some languages depend on vim's regex highlighting system (such as Ruby) for indent rules. - -- If you are experiencing weird indenting issues, add the language to - -- the list of additional_vim_regex_highlighting and disabled languages for indent. - additional_vim_regex_highlighting = { 'ruby' }, - }, - indent = { enable = true, disable = { 'ruby' } }, - }, - -- There are additional nvim-treesitter modules that you can use to interact - -- with nvim-treesitter. You should go explore a few and see what interests you: - -- - -- - Incremental selection: Included, see `:help nvim-treesitter-incremental-selection-mod` - -- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context - -- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects - }, -- The following comments only work if you have downloaded the kickstart repo, not just copy pasted the -- init.lua. If you want these files, they are in the repository, so you can just download them and @@ -927,18 +1005,18 @@ require('lazy').setup({ -- Here are some example plugins that I've included in the Kickstart repository. -- Uncomment any of the lines below to enable them (you will need to restart nvim). -- - -- require 'kickstart.plugins.debug', - -- require 'kickstart.plugins.indent_line', - -- require 'kickstart.plugins.lint', - -- require 'kickstart.plugins.autopairs', + require 'kickstart.plugins.debug', + require 'kickstart.plugins.indent_line', + require 'kickstart.plugins.lint', + require 'kickstart.plugins.autopairs', -- require 'kickstart.plugins.neo-tree', - -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps + require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` -- This is the easiest way to modularize your config. -- -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. - -- { import = 'custom.plugins' }, + { import = 'custom.plugins' }, -- -- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec` -- Or use telescope! @@ -968,3 +1046,494 @@ require('lazy').setup({ -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et + +-- NOTE: addietions +-- +-- +---- Default options: +require('kanagawa').setup { + compile = false, -- enable compiling the colorscheme + undercurl = true, -- enable undercurls + commentStyle = { italic = true }, + functionStyle = {}, + keywordStyle = { italic = true }, + statementStyle = { bold = true }, + typeStyle = {}, + transparent = true, -- do not set background color + dimInactive = true, -- dim inactive window `:h hl-NormalNC` + terminalColors = true, -- define vim.g.terminal_color_{0,17} + colors = { -- add/modify theme and palette colors + palette = {}, + theme = { wave = {}, lotus = {}, dragon = {}, all = { + ui = { + bg_gutter = 'none', + }, + } }, + }, + overrides = function(colors) + local theme = colors.theme + return { + NormalFloat = { bg = 'none' }, + FloatBorder = { bg = 'none' }, + FloatTitle = { bg = 'none' }, + + -- Save an hlgroup with dark background and dimmed foreground + -- so that you can use it where your still want darker windows. + -- E.g.: autocmd TermOpen * setlocal winhighlight=Normal:NormalDark + NormalDark = { fg = theme.ui.fg_dim, bg = theme.ui.bg_m3 }, + + -- Popular plugins that open floats will link to NormalFloat by default; + -- set their background accordingly if you wish to keep them dark and borderless + LazyNormal = { bg = theme.ui.bg_m3, fg = theme.ui.fg_dim }, + MasonNormal = { bg = theme.ui.bg_m3, fg = theme.ui.fg_dim }, + + TelescopeTitle = { fg = theme.ui.special, bold = true }, + TelescopePromptNormal = { bg = theme.ui.bg_p1 }, + TelescopePromptBorder = { fg = theme.ui.bg_p1, bg = theme.ui.bg_p1 }, + TelescopeResultsNormal = { fg = theme.ui.fg_dim, bg = theme.ui.bg_m1 }, + TelescopeResultsBorder = { fg = theme.ui.bg_m1, bg = theme.ui.bg_m1 }, + TelescopePreviewNormal = { bg = theme.ui.bg_dim }, + TelescopePreviewBorder = { bg = theme.ui.bg_dim, fg = theme.ui.bg_dim }, + } + end, + theme = 'dragon', -- Load "wave" theme + background = { -- map the value of 'background' option to a theme + dark = 'dragon', -- try "dragon" ! + light = 'lotus', + }, +} + +-- setup must be called before loading +vim.cmd 'colorscheme kanagawa' +-- +-- +-- NOTE: This are my personal keybinds +-- +-- +vim.g.vimtex_view_method = 'zathura' +vim.g.vimtex_compiler_method = 'latexmk' + +vim.keymap.set('n', 'ee', 'Telescope emoji', { desc = 'Open NerdIcons' }) +vim.cmd [[ + autocmd CmdwinEnter * q +]] +vim.opt.guicursor = 'n-v-c:block,i-ci-ve:hor1-blinkon0' +vim.keymap.set('n', 'n', 'NerdIcons', { desc = 'Open NerdIcons' }) +vim.keymap.set({ 'n', 'v' }, '', '"*p', { desc = 'Paste from selection clipboard' }) +vim.keymap.set({ 'n', 'v' }, 'p', '"+p', { desc = 'Paste from system clipboard' }) +vim.keymap.set({ 'v', 'n' }, 'tt', 'TSBufToggle highlight', { desc = 'Toggle Tree-sitter highlighting' }) +vim.keymap.set({ 'n', 'v', 'x' }, ';', ':') +vim.keymap.set({ 'n', 'v', 'x' }, ':', ';') + +vim.keymap.set({ 'x', 'n' }, '', [[:'<,'>s/]], { desc = 'Enter substitute mode' }) + +-- + +-- NOTE: THESE ARE FROM https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua + +vim.keymap.set({ 'n', 'x' }, 'j', "v:count == 0 ? 'gj' : 'j'", { desc = 'Down', expr = true, silent = true }) +-- vim.keymap.set({ 'n', 'x' }, '', "v:count == 0 ? 'gj' : 'j'", { desc = 'Down', expr = true, silent = true }) +vim.keymap.set({ 'n', 'x' }, 'k', "v:count == 0 ? 'gk' : 'k'", { desc = 'Up', expr = true, silent = true }) +-- vim.keymap.set({ 'n', 'x' }, '', "v:count == 0 ? 'gk' : 'k'", { desc = 'Up', expr = true, silent = true }) + +-- to window using the hjkl keys +-- vim.keymap.set('n', '', 'h', { desc = 'Go to Left Window', remap = true }) +-- vim.keymap.set('n', '', 'j', { desc = 'Go to Lower Window', remap = true }) +-- vim.keymap.set('n', '', 'k', { desc = 'Go to Upper Window', remap = true }) +-- vim.keymap.set('n', '', 'l', { desc = 'Go to Right Window', remap = true }) + +vim.keymap.set('n', '', "execute 'move .+' . v:count1==", { desc = 'Move Down' }) +vim.keymap.set('i', '', 'm .+1==gi', { desc = 'Move Down' }) +vim.keymap.set('v', '', ":execute \"'<,'>move '>+\" . v:count1gv=gv", { desc = 'Move Down' }) +vim.keymap.set('n', '', "execute 'move .-' . (v:count1 + 1)==", { desc = 'Move Up' }) +vim.keymap.set('i', '', 'm .-2==gi', { desc = 'Move Up' }) +vim.keymap.set('v', '', ":execute \"'<,'>move '<-\" . (v:count1 + 1)gv=gv", { desc = 'Move Up' }) + +-- better indenting +vim.keymap.set('v', '<', '', '>gv') + +-- commenting +vim.keymap.set('n', 'gco', 'oVcxnormal gccfxa', { desc = 'Add Comment Below' }) +vim.keymap.set('n', 'gcO', 'OVcxnormal gccfxa', { desc = 'Add Comment Above' }) + +-- windows +vim.keymap.set('n', 'w', '', { desc = 'Windows', remap = true }) +vim.keymap.set('n', '-', 's', { desc = 'Split Window Below', remap = true }) +vim.keymap.set('n', '|', 'v', { desc = 'Split Window Right', remap = true }) +vim.keymap.set('n', 'wd', 'c', { desc = 'Delete Window', remap = true }) + +-- native snippets +if vim.fn.has 'nvim-0.11' == 0 then + vim.keymap.set('s', '', function() + return vim.snippet.active { direction = 1 } and 'lua vim.snippet.jump(1)' or '' + end, { expr = true, desc = 'Jump Next' }) + vim.keymap.set({ 'i', 's' }, '', function() + return vim.snippet.active { direction = -1 } and 'lua vim.snippet.jump(-1)' or '' + end, { expr = true, desc = 'Jump Previous' }) +end +-- inc rename + +vim.keymap.set('n', 'cr', function() + return ':IncRename ' .. vim.fn.expand '' +end, { expr = true, desc = 'Rename' }) + +-- NOTE: END OF LINE CHARS +vim.opt.fillchars = { eob = ' ' } + +require('colorizer').setup { + filetypes = { '*' }, + user_default_options = { + names = true, -- "Name" codes like Blue or blue + RGB = true, -- #RGB hex codes + RRGGBB = true, -- #RRGGBB hex codes + RRGGBBAA = true, -- #RRGGBBAA hex codes + AARRGGBB = true, -- 0xAARRGGBB hex codes + rgb_fn = true, -- CSS rgb() and rgba() functions + hsl_fn = true, -- CSS hsl() and hsla() functions + css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB + css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn + -- Highlighting mode. 'background'|'foreground'|'virtualtext' + mode = 'background', -- Set the display mode + -- Tailwind colors. boolean|'normal'|'lsp'|'both'. True is same as normal + tailwind = 'both', -- Enable tailwind colors + -- parsers can contain values used in |user_default_options| + sass = { enable = true, parsers = { 'css' } }, -- Enable sass colors + -- Virtualtext character to use + virtualtext = '■', + -- Display virtualtext inline with color + virtualtext_inline = true, + -- Virtualtext highlight mode: 'background'|'foreground' + virtualtext_mode = 'foreground', + -- update color values even if buffer is not focused + -- example use: cmp_menu, cmp_docs + always_update = true, + }, + -- all the sub-options of filetypes apply to buftypes + buftypes = {}, + -- Boolean | List of usercommands to enable + user_commands = true, -- Enable all or some usercommands +} + +vim.opt.termguicolors = true +vim.api.nvim_set_hl(0, 'CursorLine', { bg = '#191724' }) -- Use a darker or blended color +vim.wo.relativenumber = true + +vim.opt.conceallevel = 2 + +-- Config noice.nvim +-- +-- +-- + +require('supermaven-nvim').setup { + keymaps = { + accept_suggestion = '', + clear_suggestion = '', + accept_word = '', + }, + -- ignore_filetypes = { cpp = true }, -- or { "cpp", } + color = { + suggestion_color = '#c4a7e7', + + cterm = 244, + }, + log_level = 'info', -- set to "off" to disable logging completely + disable_inline_completion = false, -- disables inline completion for use with cmp + disable_keymaps = false, -- disables built in keymaps for more manual control + condition = function() + return false + end, -- condition to check for stopping supermaven, `true` means to stop supermaven when the condition is true. } +} + +vim.keymap.set('n', 'aa', 'ArduinoAttach', { desc = 'attach to a device' }) +vim.keymap.set('n', 'av', 'ArduinoVerify', { desc = 'verify a sketch' }) +vim.keymap.set('n', 'au', 'ArduinoUpload', { desc = 'upload a sketch' }) +vim.keymap.set('n', 'aU', 'ArduinoUploadAndSerial', { desc = 'upload a sketch and open serial monitor' }) +vim.keymap.set('n', 'as', 'ArduinoSerial', { desc = 'open serial monitor' }) +vim.keymap.set('n', 'ab', 'ArduinoChooseBoard', { desc = 'choose board' }) +vim.keymap.set('n', 'ap', 'ArduinoChooseProgrammer', { desc = 'choose programmer' }) + +-- Autocmd +-- +-- Auto hot reload on save for Dart files +vim.api.nvim_create_autocmd('BufWritePost', { + pattern = '*.dart', + callback = function() + local ok, flutter_tools = pcall(require, 'flutter-tools') + if ok then + flutter_tools.reload() -- this does hot reload + end + end, +}) + +-- ZETTELKASTEN +-- +vim.keymap.set('n', 'nn', function() + local name = vim.fn.input 'Note name: ' + if name == '' then + print 'Aborted' + return + end + name = string.lower(name):gsub('%s+', '-'):gsub('[^%w%-]', '') + + local date = os.date '%Y-%m-%d' + local cwd = vim.fn.getcwd() + + -- Perfect base_dir (already correct in your version) + local base_dir = cwd + if vim.fn.isdirectory(cwd .. '/chapters') == 1 then + base_dir = cwd .. '/chapters' + elseif #vim.fn.glob(cwd .. '/*.tex', false, true) > 0 then + base_dir = vim.fn.fnamemodify(cwd, ':h') + print('Inside existing note → using parent:', base_dir) + end + + -- THIS IS THE ONLY THING THAT WAS WRONG → now 100% correct + local function get_highest_number() + local highest = 0 + -- Use basename so we only see the folder name, not the full path + local folders = vim.fn.systemlist { + 'find', + base_dir, + '-type', + 'd', + '-name', + '[0-9][0-9][0-9]-*', + '-exec', + 'basename', + '{}', + ';', + } + + for _, foldername in ipairs(folders) do + local num = foldername:match '^(%d%d%d)%-' -- ^ = start of string + if num then + local n = tonumber(num) + if n > highest then + highest = n + end + end + end + return highest + end + + local next_num = get_highest_number() + 1 + local num_str = string.format('%03d', next_num) + + local folder = base_dir .. '/' .. num_str .. '-' .. date .. '-' .. name + local texfile = folder .. '/' .. num_str .. '-' .. date .. '-' .. name .. '.tex' + local template = vim.fn.expand '~/git/Clase/template/template.tex' + + vim.fn.mkdir(folder, 'p') + + if vim.fn.filereadable(texfile) == 0 then + if vim.fn.filereadable(template) == 1 then + vim.fn.system { 'cp', template, texfile } + print('Created → ' .. texfile) + else + vim.fn.writefile({ + '\\documentclass{article}', + '\\begin{document}', + '\\title{' .. name .. '}', + '\\date{' .. date .. '}', + '\\maketitle', + '', + '\\end{document}', + }, texfile) + print('Created minimal → ' .. texfile) + end + end + + vim.cmd.edit(vim.fn.fnameescape(texfile)) +end, { desc = 'Zettel: New numbered note — NOW IT REALLY WORKS' }) +------------------------------------------------------------------------------- +-- Modify nvim notify +------------------------------------------------------------------------------- +require('notify').setup { + render = 'minimal', + stages = 'fade_in_slide_out', + top_down = false, + timeout = 4000, + merge_duplicates = true, +} + +-- Open all past notifications with Telescope +vim.keymap.set('n', 'fn', 'Telescope notify', { desc = 'Find notifications' }) + +------------------------------------------------------------------------------- +-- incfig.nvim (Telescope fuzzy search version) +------------------------------------------------------------------------------- +local has_telescope, telescope = pcall(require, 'telescope') +if not has_telescope then + vim.notify('Telescope not found!', vim.log.levels.WARN) + return +end + +local actions = require 'telescope.actions' +local action_state = require 'telescope.actions.state' +local pickers = require 'telescope.pickers' +local finders = require 'telescope.finders' +local conf = require('telescope.config').values + +-- Git root helper +local function git_root() + local file_dir = vim.fn.expand '%:p:h' + local cmd = string.format('cd %s && git rev-parse --show-toplevel 2>/dev/null', vim.fn.shellescape(file_dir)) + local result = vim.fn.systemlist(cmd)[1] + if result and result ~= '' then + return result + end + return nil +end + +-- Spawn Inkscape +local function spawn_inkscape(file_path) + local script_path = vim.fn.expand '~/.config/nvim/inkscape_move_dynamic.sh' + vim.fn.jobstart({ script_path, file_path }, { detach = true }) +end + +-- Insert \incfig[size]{filename} with size prompt +local function insert_incfig(filename) + vim.ui.input({ prompt = 'Enter size for \\incfig[size]{file} (0 < size <= 1): ' }, function(size) + if not size or size == '' then + return + end + local num = tonumber(size) + if not num or num <= 0 or num > 1 then + print 'Invalid size! Must be >0 and <=1' + return + end + local line = vim.api.nvim_win_get_cursor(0)[1] + vim.api.nvim_buf_set_lines(0, line, line, true, { string.format('\\incfig[%s]{%s}', num, filename) }) + end) +end + +-- Open/create SVG with Telescope fuzzy search +local function open_or_create_inkscape_svg() + local repo_root = git_root() or vim.fn.getcwd() + print('raw repo_root:', vim.inspect(repo_root)) -- debug + + -- sanitize repo_root + repo_root = repo_root:gsub('\27%[[%d;]*[A-Za-z]', ''):gsub('%c', ''):gsub('^%s+', ''):gsub('%s+$', '') + print('clean repo_root:', vim.inspect(repo_root)) -- debug + + local images_dir = repo_root .. '/images' + + vim.fn.mkdir(images_dir, 'p') + + local svg_files = vim.fn.globpath(images_dir, '*.svg', false, true) + local filenames = {} + for _, path in ipairs(svg_files) do + table.insert(filenames, vim.fn.fnamemodify(path, ':t:r')) -- base name without extension + end + table.insert(filenames, '▶ New file') -- option to create a new one + + pickers + .new({}, { + prompt_title = 'Select or create SVG', + finder = finders.new_table { results = filenames }, + sorter = conf.generic_sorter {}, + attach_mappings = function(prompt_bufnr, map) + actions.select_default:replace(function() + local selection = action_state.get_selected_entry() + actions.close(prompt_bufnr) + + local template_path = vim.fn.expand '~/git/Clase/templates-inkscape/cross.svg' + if not selection then + return + end + + if selection[1] == '▶ New file' then + vim.ui.input({ prompt = 'Enter new SVG file name: ' }, function(input) + if not input or input == '' then + return + end + local file_path = images_dir .. '/' .. input .. '.svg' + vim.fn.system { 'cp', template_path, file_path } + spawn_inkscape(file_path) + insert_incfig(input) + end) + else + local filename = selection[1] + local file_path = images_dir .. '/' .. filename .. '.svg' + local options = { + 'Open in Inkscape + insert \\incfig', + 'Insert \\incfig only', + 'Open in Inkscape only (edit, no insert)', + 'Do nothing', + } + vim.ui.select(options, { prompt = 'File exists, choose action:' }, function(opt) + if not opt then + return + end + if opt == 'Open in Inkscape + insert \\incfig' then + spawn_inkscape(file_path) + insert_incfig(filename) + elseif opt == 'Insert \\incfig only' then + insert_incfig(filename) + elseif opt == 'Open in Inkscape only (edit, no insert)' then + spawn_inkscape(file_path) + end + end) + end + end) + return true + end, + }) + :find() +end + +-- Keymap +vim.keymap.set('n', 'i', open_or_create_inkscape_svg, { desc = 'Open/create Inkscape SVG + insert \\incfig (fuzzy)' }) +-- Auto-export SVG -> PDF + PDF_TeX asynchronously +local repo_root = git_root() or vim.fn.getcwd() +local images_dir = repo_root .. '/images' +-- TODO: FIX THIS AUTOCMD: it does not export avg into PDF + PDF_TeX on save +vim.api.nvim_create_autocmd('BufWritePost', { + pattern = '*.svg', + callback = function(args) + local svg_file = args.file + if svg_file:sub(1, #images_dir) == images_dir then + local pdf_file = svg_file:gsub('%.svg$', '.pdf') + vim.fn.jobstart { + 'inkscape', + svg_file, + '--export-type=pdf', + '--export-latex', + '--export-filename=' .. pdf_file, + } + end + end, + desc = 'Auto-export SVG to PDF + PDF_TeX asynchronously on save', +}) + +--- Spell checking +--- +-- Enable spell checking +vim.opt_local.spell = true +vim.opt_local.spelllang = { 'es', 'en_us' } + +vim.keymap.set({ 'i', 'n' }, '', function() + vim.cmd 'stopinsert' + vim.cmd 'normal! ma[s1z=`a' +end, { noremap = true, silent = true }) + +vim.diagnostic.config { + float = { + border = 'none', + header = '', + prefix = '', + source = false, + }, +} + +vim.o.updatetime = 250 + +vim.api.nvim_create_autocmd('CursorHold', { + callback = function() + vim.diagnostic.open_float(nil, { focus = false }) + end, +}) + +vim.filetype.add { extension = { ino = 'cpp' } } diff --git a/lazyvim.json b/lazyvim.json new file mode 100644 index 00000000000..7fd2a72064a --- /dev/null +++ b/lazyvim.json @@ -0,0 +1,9 @@ +{ + "extras": [ + + ], + "news": { + "NEWS.md": "7429" + }, + "version": 7 +} \ No newline at end of file diff --git a/lua/chadrc.lua b/lua/chadrc.lua new file mode 100644 index 00000000000..a564707544f --- /dev/null +++ b/lua/chadrc.lua @@ -0,0 +1 @@ +return {} diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua new file mode 100644 index 00000000000..1335e431486 --- /dev/null +++ b/lua/config/lazy.lua @@ -0,0 +1,15 @@ +local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' +if not (vim.uv or vim.loop).fs_stat(lazypath) then + local lazyrepo = 'https://github.com/folke/lazy.nvim.git' + local out = vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath } + if vim.v.shell_error ~= 0 then + vim.api.nvim_echo({ + { 'Failed to clone lazy.nvim:\n', 'ErrorMsg' }, + { out, 'WarningMsg' }, + { '\nPress any key to exit...' }, + }, true, {}) + vim.fn.getchar() + os.exit(1) + end +end +vim.opt.rtp:prepend(lazypath) diff --git a/lua/custom/plugins/alpha.lua b/lua/custom/plugins/alpha.lua new file mode 100644 index 00000000000..b115fb78cfa --- /dev/null +++ b/lua/custom/plugins/alpha.lua @@ -0,0 +1,134 @@ +return { + + 'goolord/alpha-nvim', + dependencies = { + 'nvim-tree/nvim-web-devicons', + }, + config = function() + local alpha = require 'alpha' + local dashboard = require 'alpha.themes.dashboard' + + _Gopts = { + position = 'center', + hl = 'Type', + wrap = 'overflow', + } + + -- DASHBOARD HEADER + + local function getGreeting(name) + local tableTime = os.date '*t' + local datetime = os.date ' %Y-%m-%d-%A  %H:%M:%S ' + local hour = tableTime.hour + local greetingsTable = { + [1] = ' Sleep well', + [2] = ' Good morning', + [3] = ' Good afternoon', + [4] = ' Good evening', + [5] = '󰖔 Good night', + } + local greetingIndex = 0 + if hour == 23 or hour < 7 then + greetingIndex = 1 + elseif hour < 12 then + greetingIndex = 2 + elseif hour >= 12 and hour < 18 then + greetingIndex = 3 + elseif hour >= 18 and hour < 21 then + greetingIndex = 4 + elseif hour >= 21 then + greetingIndex = 5 + end + return datetime .. ' ' .. greetingsTable[greetingIndex] .. ', ' .. name + end + + local logo = [[ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡀⢔⢅⠣⡣⢑⠅⡇⣆⠄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⠤⡐⢌⢆⠣⡱⡨⢂⠕⠬⡨⢪⣠⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢊⠐⠌⠔⣁⢦⣣⢵⢬⡢⣃⠅⡉⠺⡮⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡠⠠⢕⢣⢳⡸⣌⠮⢓⡹⣺⢔⣔⣐⢑⢌⠪⡮⠁⠀⠀⠀⠀⠀⠀⠀⢀⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡀⣀⡦⢗⡞⣟⢮⢥⢀⠣⡗⠉⢳⢹⢪⡫⢞⡮⣖⡥⡣⠺⠀⠀⠀⠀⠀⢀⠠⠈⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡠⢕⡺⡶⡴⣁⡹⡱⢷⡑⡕⢅⠘⠮⣍⢧⢷⡸⡢⡑⢕⠫⡯⡳⣄⠀⠀⡐⠈⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⠀⠀⢀⢪⡨⢓⡐⣈⠫⠓⡆⠍⠅⠣⡘⡈⢧⢸⢵⢱⡱⢩⢝⡔⡢⢑⢽⢝⡮⣳⡨⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⡧⡤⡎⡚⡉⡅⡋⣊⢝⢼⠇⣌⠌⡆⠙⡺⡬⡇⡇⠅⡢⠑⡑⣵⡳⣆⡂⡝⢪⢣⡻⣪⢆⡀⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⡏⡜⢜⠍⠲⠢⡨⡫⡵⠗⢧⣢⡁⠜⠀⡌⢝⢌⡇⠅⠌⠢⡉⡮⡎⠌⢌⠚⣧⡳⣝⢮⡫⣞⡀⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡣⠞⡣⡢⡑⠡⠑⡦⡊⢎⠉⢌⢚⠄⠪⡘⢜⢼⠂⡡⠠⡈⢄⠪⠸⢭⢌⠝⡘⠕⡎⠕⡝⡮⡪⢄⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠰⢐⢊⢚⠧⢚⡵⣌⣑⠅⢨⢑⢐⠀⠡⠡⣀⠁⢄⢇⡧⠠⠐⠅⡂⠌⠂⠀⢓⢕⢮⢰⢅⠹⡨⡊⢎⡎⡎⡆⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠄⠘⣀⣲⢽⣸⡔⠀⣀⠡⠺⠐⠁⡱⡝⣬⢖⡝⠡⢊⢔⢢⠑⡐⠅⡈⠀⠀⢌⢎⠕⡕⡕⣇⠕⡬⡂⠱⡕⡵⡀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠥⠩⡓⡕⡍⣹⠁⠄⡬⢐⢀⢴⢯⣳⢕⠥⡑⣙⢜⢔⠅⠂⠨⠀⡠⠀⠜⠬⡨⣘⠸⣜⢬⠂⡑⢡⢪⢪⢣⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠐⡣⣊⡂⡂⠅⠈⢒⢚⡱⡮⡫⡕⢏⠮⢫⢚⠳⠌⡮⣀⢀⠀⠄⢄⠢⠀⠂⡈⡲⡕⡸⡵⡱⡀⠄⠂⢁⠳⡀⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠊⣗⢾⠴⡐⡐⡯⠏⣪⠦⠬⢥⠏⠦⡡⡝⡣⡨⡌⡄⠌⡈⠄⠕⠌⡐⡀⡴⡕⡼⡱⡓⢔⠐⠈⠀⠨⠈⠂⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢊⢆⢇⢇⡳⢙⢲⠺⠭⠬⡉⣐⢰⡣⣈⢂⠥⡀⢀⠀⢢⢈⠠⠀⢄⡯⢮⢫⡪⡣⣃⠪⠈⠀⠄⢑⠀⠄ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡀⠢⡑⣈⢾⡸⣪⠲⣋⢭⣍⡡⠖⣌⡐⣔⠸⡌⡃⠌⠤⡰⣐⡐⣰⠼⠵⡝⢕⠱⡑⢵⢕⠇⠈⠀⠀⡳⣐⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡂⢐⡡⡔⢖⢕⢬⢤⣫⡈⡧⢆⢕⠪⡆⡪⠈⡔⡉⡪⢨⢪⠪⡢⣣⢣⠫⠡⠱⠡⡑⡌⡇⠏⠀⠠⠈⠀⢀⠠⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠔⡨⢪⠱⠨⠨⢒⢊⠲⡱⣪⠺⣍⢂⠵⡘⣘⡠⡣⡣⡒⡬⠠⢱⠱⣱⢕⠥⡨⡸⠸⢜⢜⠬⠊⠀⢀⠐⡀⠌⠠⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢄⠢⡢⠢⠊⠆⢅⠢⡑⢌⠢⢑⠐⢕⢝⠀⠉⡧⡘⡀⢢⠪⠘⠌⠎⢈⢎⠬⠐⠌⠊⠈⠄⠀⡀⢀⠀⢀⠠⠠⠀⡀⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡀⡠⡴⠼⢜⢌⠪⡠⢥⢁⠪⢐⠔⢄⢕⢌⡀⠐⠀⠡⠉⠎⠊⢀⠐⢀⢠⠅⠇⠋⠨⠀⠂⠁⠀⠀⡈⠠⠀⠄⠠⠀⠄⠀⠅⠊⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⢀⢄⣄⠀⠀⠀⠀⢄⢖⠁⡎⠪⡣⢅⢓⢜⡐⢕⢕⠂⠌⡊⠢⢑⠘⠘⢈⠂⠂⠃⠑⠐⠈⠈⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢐⠐⡨⠀⠢⠈⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠐⢁⠢⢊⡠⢂⠢⡲⠑⡌⠪⠉⠀⠀⠠⠘⠔⢅⠣⠡⠂⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⡀⢀⠀⠀⢀⢓⠃⢂⠡⠴⢑⠗⠠⡅⡮⡨⡂⢝⡥⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠆⠁⠀⠀⠅⡀⠀⠀⠁⠀⠀⠀⠈⠈⠈⠀⠈⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠆⠀⠐⠀⢀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ + ]] + + local userName = 'Lazy' + local greeting = getGreeting(userName) + local marginBottom = 0 + dashboard.section.header.val = vim.split(logo, '\n') + + -- Split logo into lines + local logoLines = {} + for line in logo:gmatch '[^\r\n]+' do + table.insert(logoLines, line) + end + + -- Calculate padding for centering the greeting + local logoWidth = logo:find '\n' - 18 -- Assuming the logo width is the width of the first line + local greetingWidth = #greeting + local padding = math.floor((logoWidth - greetingWidth) / 2) + + -- Generate spaces for padding + local paddedGreeting = string.rep(' ', padding) .. greeting + + -- Add margin lines below the padded greeting + local margin = string.rep('\n', marginBottom) + + -- Concatenate logo, padded greeting, and margin + local adjustedLogo = logo .. '\n' .. paddedGreeting .. margin + + dashboard.section.buttons.val = { + dashboard.button('n', ' New file', ':ene startinsert '), + dashboard.button('f', ' Find file', ':cd $HOME | silent Telescope find_files hidden=true no_ignore=true '), + dashboard.button('t', ' Find text', ':Telescope live_grep '), + dashboard.button('r', '󰄉 Recent files', ':Telescope oldfiles '), + dashboard.button('u', '󱐥 Update plugins', 'Lazy update'), + dashboard.button('c', ' Settings', ':e $HOME/.config/nvim/init.lua'), + dashboard.button('p', ' Projects', ':e $HOME/git '), + dashboard.button('', ' Clase', ':e $HOME/obsidian/Clase/ '), + dashboard.button('d', '󱗼 Dotfiles', ':e $HOME/.dotfiles '), + dashboard.button('q', '󰿅 Quit', 'qa'), + } + + -- local function footer() + -- return "Footer Text" + -- end + + -- dashboard.section.footer.val = vim.split('\n\n' .. getGreeting 'Lazy', '\n') + + vim.api.nvim_create_autocmd('User', { + pattern = 'LazyVimStarted', + desc = 'Add Alpha dashboard footer', + once = true, + callback = function() + local stats = require('lazy').stats() + local ms = math.floor(stats.startuptime * 100 + 0.5) / 100 + dashboard.section.footer.val = { ' ', ' ', ' ', ' Loaded ' .. stats.count .. ' plugins  in ' .. ms .. ' ms ' } + dashboard.section.header.opts.hl = 'DashboardFooter' + pcall(vim.cmd.AlphaRedraw) + end, + }) + + dashboard.opts.opts.noautocmd = true + alpha.setup(dashboard.opts) + end, +} diff --git a/lua/custom/plugins/emoji.lua b/lua/custom/plugins/emoji.lua new file mode 100755 index 00000000000..b96a0a551d5 --- /dev/null +++ b/lua/custom/plugins/emoji.lua @@ -0,0 +1 @@ +return { "xiyaowong/telescope-emoji" } diff --git a/lua/custom/plugins/gitflog.lua b/lua/custom/plugins/gitflog.lua new file mode 100644 index 00000000000..0e815c23545 --- /dev/null +++ b/lua/custom/plugins/gitflog.lua @@ -0,0 +1,8 @@ +return { + "rbong/vim-flog", + lazy = true, + cmd = { "Flog", "Flogsplit", "Floggit" }, + dependencies = { + "tpope/vim-fugitive", + }, +} diff --git a/lua/custom/plugins/gitgraph.lua b/lua/custom/plugins/gitgraph.lua new file mode 100644 index 00000000000..5fb4d6bc16e --- /dev/null +++ b/lua/custom/plugins/gitgraph.lua @@ -0,0 +1,32 @@ +return { + 'isakbm/gitgraph.nvim', + ---@type I.GGConfig + opts = { + symbols = { + merge_commit = 'M', + commit = '*', + + }, + format = { + timestamp = '%H:%M:%S %d-%m-%Y', + fields = { 'hash', 'timestamp', 'author', 'branch_name', 'tag' }, + }, + hooks = { + on_select_commit = function(commit) + print('selected commit:', commit.hash) + end, + on_select_range_commit = function(from, to) + print('selected range:', from.hash, to.hash) + end, + }, + }, + keys = { + { + "gl", + function() + require('gitgraph').draw({}, { all = true, max_count = 5000 }) + end, + desc = "GitGraph - Draw", + }, + }, +} diff --git a/lua/custom/plugins/inc-rename.lua b/lua/custom/plugins/inc-rename.lua new file mode 100644 index 00000000000..cc0089f94ba --- /dev/null +++ b/lua/custom/plugins/inc-rename.lua @@ -0,0 +1,6 @@ +return { + 'smjonas/inc-rename.nvim', + config = function() + require('inc_rename').setup() + end, +} diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index be0eb9d8d7a..12e18418f26 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -2,4 +2,80 @@ -- I promise not to create any merge conflicts in this directory :) -- -- See the kickstart.nvim README for more information -return {} +return { + + { + 'folke/ts-comments.nvim', + opts = { + { + lang = { + astro = '', + axaml = '', + blueprint = '// %s', + c = '// %s', + c_sharp = '// %s', + clojure = { ';; %s', '; %s' }, + cpp = '// %s', + cs_project = '', + cue = '// %s', + fsharp = '// %s', + fsharp_project = '', + gleam = '// %s', + glimmer = '{{! %s }}', + graphql = '# %s', + handlebars = '{{! %s }}', + hcl = '# %s', + html = '', + hyprlang = '# %s', + ini = '; %s', + ipynb = '# %s', + javascript = { + '// %s', -- default commentstring when no treesitter node matches + '/* %s */', + call_expression = '// %s', -- specific commentstring for call_expression + jsx_attribute = '// %s', + jsx_element = '{/* %s */}', + jsx_fragment = '{/* %s */}', + spread_element = '// %s', + statement_block = '// %s', + }, + kdl = '// %s', + php = '// %s', + rego = '# %s', + rescript = '// %s', + rust = { '// %s', '/* %s */' }, + sql = '-- %s', + styled = '/* %s */', + svelte = '', + templ = { + '// %s', + component_block = '', + }, + terraform = '# %s', + tsx = { + '// %s', -- default commentstring when no treesitter node matches + '/* %s */', + call_expression = '// %s', -- specific commentstring for call_expression + jsx_attribute = '// %s', + jsx_element = '{/* %s */}', + jsx_fragment = '{/* %s */}', + spread_element = '// %s', + statement_block = '// %s', + }, + twig = '{# %s #}', + typescript = { '// %s', '/* %s */' }, -- langs can have multiple commentstrings + vue = '', + xaml = '', + }, + }, + }, + event = 'VeryLazy', + enabled = vim.fn.has 'nvim-0.10.0' == 1, + }, + { + 'NvChad/nvim-colorizer.lua', + event = 'BufReadPre', + opts = { -- set to setup table + }, + }, +} diff --git a/lua/custom/plugins/lualine.lua b/lua/custom/plugins/lualine.lua new file mode 100644 index 00000000000..13fff7137be --- /dev/null +++ b/lua/custom/plugins/lualine.lua @@ -0,0 +1,4 @@ +return { + 'nvim-lualine/lualine.nvim', + dependencies = { 'nvim-tree/nvim-web-devicons' }, +} diff --git a/lua/custom/plugins/nerdicons.lua b/lua/custom/plugins/nerdicons.lua new file mode 100644 index 00000000000..6e9b7a2b384 --- /dev/null +++ b/lua/custom/plugins/nerdicons.lua @@ -0,0 +1,7 @@ +return { + "glepnir/nerdicons.nvim", + cmd = "NerdIcons", + config = function() + require("nerdicons").setup({}) + end, +} diff --git a/lua/custom/plugins/noice.lua b/lua/custom/plugins/noice.lua new file mode 100644 index 00000000000..c141131ac37 --- /dev/null +++ b/lua/custom/plugins/noice.lua @@ -0,0 +1,261 @@ +-- lazy.nvim +return { + 'folke/noice.nvim', + event = 'VeryLazy', + opts = { + -- add any options here + }, + dependencies = { + -- if you lazy-load any plugin below, make sure to add proper `module="..."` entries + 'MunifTanjim/nui.nvim', + -- OPTIONAL: + -- `nvim-notify` is only needed, if you want to use the notification view. + -- If not available, we use `mini` as the fallback + 'rcarriga/nvim-notify', + }, + require('noice').setup { + lsp = { + -- override markdown rendering so that **cmp** and other plugins use **Treesitter** + override = { + ['vim.lsp.util.convert_input_to_markdown_lines'] = true, + ['vim.lsp.util.stylize_markdown'] = true, + ['cmp.entry.get_documentation'] = true, -- requires hrsh7th/nvim-cmp + }, + }, + -- you can enable a preset for easier configuration + presets = { + bottom_search = true, -- use a classic bottom cmdline for search + command_palette = true, -- position the cmdline and popupmenu together + long_message_to_split = true, -- long messages will be sent to a split + inc_rename = false, -- enables an input dialog for inc-rename.nvim + lsp_doc_border = false, -- add a border to hover docs and signature help + }, + cmdline = { + format = { + cmdline = { icon = '>' }, + search_down = { icon = '🔍⌄' }, + search_up = { icon = '🔍⌃' }, + filter = { icon = '$' }, + lua = { icon = '☾' }, + help = { icon = '?' }, + }, + }, + format = { + level = { + icons = { + error = '✖', + warn = '▼', + info = '●', + }, + }, + }, + popupmenu = { + kind_icons = false, + }, + inc_rename = { + cmdline = { + format = { + IncRename = { icon = '⟳' }, + }, + }, + }, + { + cmdline = { + enabled = true, -- enables the Noice cmdline UI + view = 'cmdline_popup', -- view for rendering the cmdline. Change to `cmdline` to get a classic cmdline at the bottom + opts = {}, -- global options for the cmdline. See section on views + ---@type table + format = { + -- conceal: (default=true) This will hide the text in the cmdline that matches the pattern. + -- view: (default is cmdline view) + -- opts: any options passed to the view + -- icon_hl_group: optional hl_group for the icon + -- title: set to anything or empty string to hide + cmdline = { pattern = '^:', icon = '', lang = 'vim' }, + search_down = { kind = 'search', pattern = '^/', icon = ' ', lang = 'regex' }, + search_up = { kind = 'search', pattern = '^%?', icon = ' ', lang = 'regex' }, + filter = { pattern = '^:%s*!', icon = '$', lang = 'bash' }, + lua = { pattern = { '^:%s*lua%s+', '^:%s*lua%s*=%s*', '^:%s*=%s*' }, icon = '', lang = 'lua' }, + help = { pattern = '^:%s*he?l?p?%s+', icon = '' }, + input = { view = 'cmdline_input', icon = '󰥻 ' }, -- Used by input() + -- lua = false, -- to disable a format, set to `false` + }, + }, + messages = { + -- NOTE: If you enable messages, then the cmdline is enabled automatically. + -- This is a current Neovim limitation. + enabled = true, -- enables the Noice messages UI + view = 'notify', -- default view for messages + view_error = 'notify', -- view for errors + view_warn = 'notify', -- view for warnings + view_history = 'messages', -- view for :messages + view_search = 'virtualtext', -- view for search count messages. Set to `false` to disable + }, + popupmenu = { + enabled = true, -- enables the Noice popupmenu UI + ---@type 'nui'|'cmp' + backend = 'nui', -- backend to use to show regular cmdline completions + ---@type NoicePopupmenuItemKind|false + -- Icons for completion item kinds (see defaults at noice.config.icons.kinds) + kind_icons = {}, -- set to `false` to disable icons + }, + -- default options for require('noice').redirect + -- see the section on Command Redirection + ---@type NoiceRouteConfig + redirect = { + view = 'popup', + filter = { event = 'msg_show' }, + }, + -- You can add any custom commands below that will be available with `:Noice command` + ---@type table + commands = { + history = { + -- options for the message history that you get with `:Noice` + view = 'split', + opts = { enter = true, format = 'details' }, + filter = { + any = { + { event = 'notify' }, + { error = true }, + { warning = true }, + { event = 'msg_show', kind = { '' } }, + { event = 'lsp', kind = 'message' }, + }, + }, + }, + -- :Noice last + last = { + view = 'popup', + opts = { enter = true, format = 'details' }, + filter = { + any = { + { event = 'notify' }, + { error = true }, + { warning = true }, + { event = 'msg_show', kind = { '' } }, + { event = 'lsp', kind = 'message' }, + }, + }, + filter_opts = { count = 1 }, + }, + -- :Noice errors + errors = { + -- options for the message history that you get with `:Noice` + view = 'popup', + opts = { enter = true, format = 'details' }, + filter = { error = true }, + filter_opts = { reverse = true }, + }, + all = { + -- options for the message history that you get with `:Noice` + view = 'split', + opts = { enter = true, format = 'details' }, + filter = {}, + }, + }, + notify = { + -- Noice can be used as `vim.notify` so you can route any notification like other messages + -- Notification messages have their level and other properties set. + -- event is always "notify" and kind can be any log level as a string + -- The default routes will forward notifications to nvim-notify + -- Benefit of using Noice for this is the routing and consistent history view + enabled = true, + view = 'notify', + }, + lsp = { + progress = { + enabled = true, + -- Lsp Progress is formatted using the builtins for lsp_progress. See config.format.builtin + -- See the section on formatting for more details on how to customize. + --- @type NoiceFormat|string + format = 'lsp_progress', + --- @type NoiceFormat|string + format_done = 'lsp_progress_done', + throttle = 1000 / 30, -- frequency to update lsp progress message + view = 'mini', + }, + override = { + -- override the default lsp markdown formatter with Noice + ['vim.lsp.util.convert_input_to_markdown_lines'] = false, + -- override the lsp markdown formatter with Noice + ['vim.lsp.util.stylize_markdown'] = false, + -- override cmp documentation with Noice (needs the other options to work) + ['cmp.entry.get_documentation'] = false, + }, + hover = { + enabled = true, + silent = false, -- set to true to not show a message if hover is not available + view = nil, -- when nil, use defaults from documentation + ---@type NoiceViewOptions + opts = {}, -- merged with defaults from documentation + }, + signature = { + enabled = true, + auto_open = { + enabled = true, + trigger = true, -- Automatically show signature help when typing a trigger character from the LSP + luasnip = true, -- Will open signature help when jumping to Luasnip insert nodes + throttle = 50, -- Debounce lsp signature help request by 50ms + }, + view = nil, -- when nil, use defaults from documentation + ---@type NoiceViewOptions + opts = {}, -- merged with defaults from documentation + }, + message = { + -- Messages shown by lsp servers + enabled = true, + view = 'notify', + opts = {}, + }, + -- defaults for hover and signature help + documentation = { + view = 'hover', + ---@type NoiceViewOptions + opts = { + lang = 'markdown', + replace = true, + render = 'plain', + format = { '{message}' }, + win_options = { concealcursor = 'n', conceallevel = 3 }, + }, + }, + }, + markdown = { + hover = { + ['|(%S-)|'] = vim.cmd.help, -- vim help links + ['%[.-%]%((%S-)%)'] = require('noice.util').open, -- markdown links + }, + highlights = { + ['|%S-|'] = '@text.reference', + ['@%S+'] = '@parameter', + ['^%s*(Parameters:)'] = '@text.title', + ['^%s*(Return:)'] = '@text.title', + ['^%s*(See also:)'] = '@text.title', + ['{%S-}'] = '@parameter', + }, + }, + health = { + checker = true, -- Disable if you don't want health checks to run + }, + ---@type NoicePresets + presets = { + -- you can enable a preset by setting it to true, or a table that will override the preset config + -- you can also add custom presets that you can enable/disable with enabled=true + bottom_search = false, -- use a classic bottom cmdline for search + command_palette = false, -- position the cmdline and popupmenu together + long_message_to_split = false, -- long messages will be sent to a split + inc_rename = false, -- enables an input dialog for inc-rename.nvim + lsp_doc_border = false, -- add a border to hover docs and signature help + }, + throttle = 1000 / 30, -- how frequently does Noice need to check for ui updates? This has no effect when in blocking mode. + ---@type NoiceConfigViews + views = {}, ---@see section on views + ---@type NoiceRouteConfig[] + routes = {}, --- @see section on routes + ---@type table + status = {}, --- @see section on statusline components + ---@type NoiceFormatOptions + format = {}, --- @see section on formatting + }, + }, +} diff --git a/lua/custom/plugins/oil.lua b/lua/custom/plugins/oil.lua new file mode 100644 index 00000000000..ace20dcc0f8 --- /dev/null +++ b/lua/custom/plugins/oil.lua @@ -0,0 +1,60 @@ +return { + "stevearc/oil.nvim", + config = function() + local oil = require("oil") + oil.setup({ + buf_options = { + buflisted = false, + bufhidden = "hide", + }, + + skip_confirm_for_simple_edits = true, + + view_options = { + -- Show files and directories that start with "." + show_hidden = true, + -- This function defines what is considered a "hidden" file + is_hidden_file = function(name, bufnr) + return vim.startswith(name, ".") + end, + -- This function defines what will never be shown, even when `show_hidden` is set + is_always_hidden = function(name, bufnr) + return false + end, + -- Sort file names in a more intuitive order for humans. Is less performant, + -- so you may want to set to false if you work with large directories. + natural_order = true, + -- Sort file and directory names case insensitive + case_insensitive = false, + sort = { + -- sort order can be "asc" or "desc" + -- see :help oil-columns to see which columns are sortable + { "type", "asc" }, + { "name", "asc" }, + }, + }, + float = { + -- Padding around the floating window + padding = 4, + max_width = 100, + max_height = 15, + border = "rounded", + win_options = { + winblend = 0, + }, + -- optionally override the oil buffers window title with custom function: fun(winid: integer): string + get_win_title = nil, + -- preview_split: Split direction: "auto", "left", "right", "above", "below". + preview_split = "auto", + -- This is the config that will be passed to nvim_open_win. + -- Change values here to customize the layout + override = function(conf) + return conf + end, + }, + }) + + vim.keymap.set("n", "-", "Oil", { desc = "Open oil" }) + vim.keymap.set("n", "-", oil.toggle_float, {}) + end, +} diff --git a/lua/custom/plugins/plugins.lua b/lua/custom/plugins/plugins.lua new file mode 100755 index 00000000000..0f84ddf79e2 --- /dev/null +++ b/lua/custom/plugins/plugins.lua @@ -0,0 +1,9 @@ +return { + "stevearc/aerial.nvim", + opts = {}, + -- Optional dependencies + dependencies = { + "nvim-treesitter/nvim-treesitter", + "nvim-tree/nvim-web-devicons", + }, +} diff --git a/lua/custom/plugins/rose-pine.lua b/lua/custom/plugins/rose-pine.lua new file mode 100644 index 00000000000..28b2599d6d7 --- /dev/null +++ b/lua/custom/plugins/rose-pine.lua @@ -0,0 +1 @@ +return { "rose-pine/neovim", name = "rose-pine" } diff --git a/lua/custom/plugins/snacks.lua b/lua/custom/plugins/snacks.lua new file mode 100644 index 00000000000..7a599fecf83 --- /dev/null +++ b/lua/custom/plugins/snacks.lua @@ -0,0 +1,154 @@ +return { + 'folke/snacks.nvim', + priority = 1000, + lazy = false, + ---@type snacks.Config + opts = { + bigfile = { enabled = true }, + dashboard = { enabled = false }, + notifier = { + enabled = true, + timeout = 3000, + }, + quickfile = { enabled = true }, + statuscolumn = { enabled = false }, + words = { enabled = false }, + styles = { + notification = { + wo = { wrap = true }, -- Wrap notifications + }, + }, + }, + keys = { + { + 'un', + function() + Snacks.notifier.hide() + end, + desc = 'Dismiss All Notifications', + }, + { + 'bd', + function() + Snacks.bufdelete() + end, + desc = 'Delete Buffer', + }, + { + 'gg', + function() + Snacks.lazygit() + end, + desc = 'Lazygit', + }, + { + 'gb', + function() + Snacks.git.blame_line() + end, + desc = 'Git Blame Line', + }, + { + 'gB', + function() + Snacks.gitbrowse() + end, + desc = 'Git Browse', + }, + { + 'gf', + function() + Snacks.lazygit.log_file() + end, + desc = 'Lazygit Current File History', + }, + { + 'gl', + function() + Snacks.lazygit.log() + end, + desc = 'Lazygit Log (cwd)', + }, + { + 'cR', + function() + Snacks.rename.rename_file() + end, + desc = 'Rename File', + }, + { + '', + function() + Snacks.terminal() + end, + desc = 'Toggle Terminal', + }, + { + '', + function() + Snacks.terminal() + end, + desc = 'which_key_ignore', + }, + { + ']]', + function() + Snacks.words.jump(vim.v.count1) + end, + desc = 'Next Reference', + mode = { 'n', 't' }, + }, + { + '[[', + function() + Snacks.words.jump(-vim.v.count1) + end, + desc = 'Prev Reference', + mode = { 'n', 't' }, + }, + { + 'N', + desc = 'Neovim News', + function() + Snacks.win { + file = vim.api.nvim_get_runtime_file('doc/news.txt', false)[1], + width = 0.6, + height = 0.6, + wo = { + spell = false, + wrap = false, + signcolumn = 'yes', + statuscolumn = ' ', + conceallevel = 3, + }, + } + end, + }, + }, + init = function() + vim.api.nvim_create_autocmd('User', { + pattern = 'VeryLazy', + callback = function() + -- Setup some globals for debugging (lazy-loaded) + _G.dd = function(...) + Snacks.debug.inspect(...) + end + _G.bt = function() + Snacks.debug.backtrace() + end + vim.print = _G.dd -- Override print to use snacks for `:=` command + + -- Create some toggle mappings + Snacks.toggle.option('spell', { name = 'Spelling' }):map 'us' + Snacks.toggle.option('wrap', { name = 'Wrap' }):map 'uw' + Snacks.toggle.option('relativenumber', { name = 'Relative Number' }):map 'uL' + Snacks.toggle.diagnostics():map 'ud' + Snacks.toggle.line_number():map 'ul' + Snacks.toggle.option('conceallevel', { off = 0, on = vim.o.conceallevel > 0 and vim.o.conceallevel or 2 }):map 'uc' + Snacks.toggle.treesitter():map 'uT' + Snacks.toggle.option('background', { off = 'light', on = 'dark', name = 'Dark Background' }):map 'ub' + Snacks.toggle.inlay_hints():map 'uh' + end, + }) + end, +} diff --git a/lua/custom/plugins/supermaven.lua b/lua/custom/plugins/supermaven.lua new file mode 100644 index 00000000000..b4518565d24 --- /dev/null +++ b/lua/custom/plugins/supermaven.lua @@ -0,0 +1,26 @@ +return { + { + 'supermaven-inc/supermaven-nvim', + config = function() + require('supermaven-nvim').setup { + keymaps = { + accept_suggestion = '', + clear_suggestion = '', + accept_word = '', + }, + ignore_filetypes = { cpp = true }, -- or { "cpp", } + color = { + suggestion_color = '#c4a7e7', + + cterm = 244, + }, + log_level = 'info', -- set to "off" to disable logging completely + disable_inline_completion = false, -- disables inline completion for use with cmp + disable_keymaps = false, -- disables built in keymaps for more manual control + condition = function() + return false + end, -- condition to check for stopping supermaven, `true` means to stop supermaven when the condition is true. + } + end, + }, +} diff --git a/lua/custom/plugins/tmux-vim.lua b/lua/custom/plugins/tmux-vim.lua new file mode 100755 index 00000000000..9d680e2668b --- /dev/null +++ b/lua/custom/plugins/tmux-vim.lua @@ -0,0 +1,18 @@ +return { + 'christoomey/vim-tmux-navigator', + lazy = false, + cmd = { + 'TmuxNavigateLeft', + 'TmuxNavigateDown', + 'TmuxNavigateUp', + 'TmuxNavigateRight', + 'TmuxNavigatePrevious', + }, + keys = { + { '', 'TmuxNavigateLeft' }, + { '', 'TmuxNavigateDown' }, + { '', 'TmuxNavigateUp' }, + { '', 'TmuxNavigateRight' }, + { '', 'TmuxNavigatePrevious' }, + }, +} diff --git a/lua/custom/plugins/vimtex.lua b/lua/custom/plugins/vimtex.lua new file mode 100644 index 00000000000..d246d642256 --- /dev/null +++ b/lua/custom/plugins/vimtex.lua @@ -0,0 +1,32 @@ +return { + { + "lervag/vimtex", + lazy = false, -- we don't want to lazy load VimTeX + -- tag = "v2.15", -- uncomment to pin to a specific release + init = function() + -- VimTeX configuration goes here, e.g. + vim.g.vimtex_view_general_viewer = "" + vim.g.vimtex_view_general_options = "" + vim.g.vimtex_view_method = "" + vim.g.vimtex_compiler_method = "latexmk" + vim.g.vimtex_view_general_options = '--unique file:@pdf""#src:@line@tex' + vim.g.tex_conceal = "abdmg" + vim.g.tex_flavor = "latex" + vim.g.vimtex_syntax_conceal = { + accents = true, + ligatures = true, + cites = true, + fancy = true, + spacing = true, + greek = true, + math_bounds = true, + math_delimiters = true, + math_fracs = true, + math_super_sub = true, + math_symbols = true, + sections = true, + styles = true, + } + end, + }, +} diff --git a/lua/custom/plugins/wakatime.lua b/lua/custom/plugins/wakatime.lua new file mode 100644 index 00000000000..e151fc34cb4 --- /dev/null +++ b/lua/custom/plugins/wakatime.lua @@ -0,0 +1 @@ +return { "wakatime/vim-wakatime", lazy = false }