From ed984140f49c5b015dcceeccbfa1b31d2fa5fa18 Mon Sep 17 00:00:00 2001 From: gwslingerland Date: Wed, 7 Jan 2026 14:02:03 +0100 Subject: [PATCH] removed alpha and added typst specific rules --- ftplugin/typst.lua | 5 +++++ init.lua | 33 +++++++++++++++------------------ lua/custom/plugins/init.lua | 14 +++++++++++++- 3 files changed, 33 insertions(+), 19 deletions(-) create mode 100644 ftplugin/typst.lua diff --git a/ftplugin/typst.lua b/ftplugin/typst.lua new file mode 100644 index 00000000..574e0434 --- /dev/null +++ b/ftplugin/typst.lua @@ -0,0 +1,5 @@ +local opt = vim.opt_local + +opt.wrap = true +opt.linebreak = true +opt.textwidth = 0 diff --git a/init.lua b/init.lua index 4533c503..029b3d75 100644 --- a/init.lua +++ b/init.lua @@ -159,7 +159,7 @@ vim.o.inccommand = 'split' vim.o.cursorline = true -- Minimal number of screen lines to keep above and below the cursor. -vim.o.scrolloff = 0 +vim.o.scrolloff = 5 -- if performing an operation that would fail due to unsaved changes in the buffer (like `:q`), -- instead raise a dialog asking if you wish to save the current file(s) @@ -219,6 +219,18 @@ vim.api.nvim_create_autocmd('TextYankPost', { end, }) +-- Typst line wrapping settings +vim.api.nvim_create_autocmd('FileType', { + pattern = 'typ', -- applies to .typ files + callback = function() + local opt = vim.opt_local + opt.wrap = true -- soft wrap long lines + opt.linebreak = true -- wrap at word boundaries, not mid-word + opt.textwidth = 0 -- disable automatic line breaks + opt.showbreak = '↪ ' -- optional: visual indicator for wrapped lines + end, +}) + -- [[ Install `lazy.nvim` plugin manager ]] -- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' @@ -698,6 +710,7 @@ require('lazy').setup({ }, }, }, + tinymist = {}, } -- Ensure the servers and tools above are installed @@ -918,22 +931,6 @@ require('lazy').setup({ -- - 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' - end - -- ... and there is more! -- Check out: https://github.com/echasnovski/mini.nvim end, @@ -984,7 +981,7 @@ require('lazy').setup({ -- 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! diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index be0eb9d8..08d1ad4e 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -2,4 +2,16 @@ -- I promise not to create any merge conflicts in this directory :) -- -- See the kickstart.nvim README for more information -return {} +return { + { + 'nvim-lualine/lualine.nvim', + dependencies = { 'nvim-tree/nvim-web-devicons' }, + opts = { options = { theme = 'tokyonight' } }, + }, + { + 'chomosuke/typst-preview.nvim', + lazy = false, -- or ft = 'typst' + version = '1.*', + opts = {}, -- lazy.nvim will implicitly calls `setup {}` + }, +}