diff --git a/init.lua b/init.lua index 371510b..b993b34 100644 --- a/init.lua +++ b/init.lua @@ -91,7 +91,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` @@ -155,9 +155,10 @@ vim.opt.inccommand = 'split' vim.opt.cursorline = true -- Minimal number of screen lines to keep above and below the cursor. -vim.opt.scrolloff = 10 +vim.opt.scrolloff = 5 vim.opt.linebreak = true +vim.opt.fixeol = false -- [[ Basic Keymaps ]] -- See `:help vim.keymap.set()` @@ -199,6 +200,16 @@ vim.keymap.set('n', 'pv', vim.cmd.Ex, { desc = 'File explorer' }) vim.keymap.set('n', '', vim.cmd.cnext, { desc = 'Quick fix list next' }) vim.keymap.set('n', '', vim.cmd.cprev, { desc = 'Quick fix list previous' }) +-- [[ User Commands ]] + +-- Align markdown table +vim.api.nvim_create_user_command('MDTableAlign', function(args) + print(args.line1 .. '-' .. args.line2 .. ' pizzas') + local command = string.format("%d,%d! tr -s \" \" | column -t -s '|' -o '|'", args.line1, args.line2) + vim.cmd('silent ' .. command) + --vim.cmd("! tr -s \" \" | column -t -s '|' -o '|'") +end, { range = true, bang = false }) + -- [[ Basic Autocommands ]] -- See `:help lua-guide-autocommands`