From 3db7c943e7c954c6e22ef6077b8d6ae489c91edc Mon Sep 17 00:00:00 2001 From: Jacob McDonnell Date: Tue, 7 Oct 2025 13:52:08 -0400 Subject: Better Module Structure and knap live preview --- .config/nvim/lua/plugins.lua | 42 --------------------------------- .config/nvim/lua/plugins/download.lua | 25 ++++++++++++++++++++ .config/nvim/lua/plugins/init.lua | 5 ++++ .config/nvim/lua/plugins/knap.lua | 8 +++++++ .config/nvim/lua/plugins/lsp.lua | 3 +++ .config/nvim/lua/plugins/treesitter.lua | 16 +++++++++++++ .config/nvim/lua/remaps.lua | 10 ++++++++ 7 files changed, 67 insertions(+), 42 deletions(-) delete mode 100644 .config/nvim/lua/plugins.lua create mode 100644 .config/nvim/lua/plugins/download.lua create mode 100644 .config/nvim/lua/plugins/init.lua create mode 100644 .config/nvim/lua/plugins/knap.lua create mode 100644 .config/nvim/lua/plugins/lsp.lua create mode 100644 .config/nvim/lua/plugins/treesitter.lua (limited to '.config/nvim/lua') diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua deleted file mode 100644 index fb1ed73..0000000 --- a/.config/nvim/lua/plugins.lua +++ /dev/null @@ -1,42 +0,0 @@ --- Lazy.nvim plugin manager -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not vim.loop.fs_stat(lazypath) then - vim.fn.system({ - "git", - "clone", - "--filter=blob:none", - "https://github.com/folke/lazy.nvim.git", - "--branch=stable", -- latest stable release - lazypath, - }) -end -vim.opt.rtp:prepend(lazypath) - - -require("lazy").setup({ - { 'nvim-telescope/telescope.nvim', tag = '0.1.6', dependencies = { 'nvim-lua/plenary.nvim' } }, - { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" }, - { "mbbill/undotree" }, - {'neovim/nvim-lspconfig'}, - { "sainnhe/everforest" }, - {"Civitasv/cmake-tools.nvim"}, -}) - --- Enable preconfigured LSP's -vim.lsp.enable({"clangd", "gopls", "texlab"}) - -require'nvim-treesitter.configs'.setup { - ensure_installed = { "c" }, - sync_install = false, - auto_install = true, - - highlight = { - enable = true, - - -- Setting this to true will run `:h syntax` and tree-sitter at the same time. - -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). - -- Using this option may slow down your editor, and you may see some duplicate highlights. - -- Instead of true it can also be a list of languages - additional_vim_regex_highlighting = false, - }, -} diff --git a/.config/nvim/lua/plugins/download.lua b/.config/nvim/lua/plugins/download.lua new file mode 100644 index 0000000..0241f26 --- /dev/null +++ b/.config/nvim/lua/plugins/download.lua @@ -0,0 +1,25 @@ +-- Lazy.nvim plugin manager +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", -- latest stable release + lazypath, + }) +end +vim.opt.rtp:prepend(lazypath) + + +require("lazy").setup({ + { 'nvim-telescope/telescope.nvim', tag = '0.1.6', dependencies = { 'nvim-lua/plenary.nvim' } }, + { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" }, + { "mbbill/undotree" }, + {'neovim/nvim-lspconfig'}, + { "sainnhe/everforest" }, + {"Civitasv/cmake-tools.nvim"}, + {"frabjous/knap"}, +}) + diff --git a/.config/nvim/lua/plugins/init.lua b/.config/nvim/lua/plugins/init.lua new file mode 100644 index 0000000..c4b8ea8 --- /dev/null +++ b/.config/nvim/lua/plugins/init.lua @@ -0,0 +1,5 @@ +require("plugins.download") +require("plugins.treesitter") +require("plugins.lsp") +require("plugins.knap") + diff --git a/.config/nvim/lua/plugins/knap.lua b/.config/nvim/lua/plugins/knap.lua new file mode 100644 index 0000000..6ee24c1 --- /dev/null +++ b/.config/nvim/lua/plugins/knap.lua @@ -0,0 +1,8 @@ +local gknapsettings = { + texoutputext = "pdf", + textopdf = "tectonic %docroot%", + textopdfviewerlaunch = "sioyek %outputfile%", + textopdfviewerrefresh = "kill -HUP %pid%" +} +vim.g.knap_settings = gknapsettings + diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua new file mode 100644 index 0000000..84d4aec --- /dev/null +++ b/.config/nvim/lua/plugins/lsp.lua @@ -0,0 +1,3 @@ +-- Enable preconfigured LSP's +vim.lsp.enable({"clangd", "gopls", "texlab"}) + diff --git a/.config/nvim/lua/plugins/treesitter.lua b/.config/nvim/lua/plugins/treesitter.lua new file mode 100644 index 0000000..b75b2b3 --- /dev/null +++ b/.config/nvim/lua/plugins/treesitter.lua @@ -0,0 +1,16 @@ +require'nvim-treesitter.configs'.setup { + ensure_installed = { "c" }, + sync_install = false, + auto_install = true, + + highlight = { + enable = true, + + -- Setting this to true will run `:h syntax` and tree-sitter at the same time. + -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). + -- Using this option may slow down your editor, and you may see some duplicate highlights. + -- Instead of true it can also be a list of languages + additional_vim_regex_highlighting = false, + }, +} + diff --git a/.config/nvim/lua/remaps.lua b/.config/nvim/lua/remaps.lua index e2cbea9..304a6c0 100644 --- a/.config/nvim/lua/remaps.lua +++ b/.config/nvim/lua/remaps.lua @@ -36,3 +36,13 @@ end) vim.keymap.set("n", "u", vim.cmd.UndotreeToggle) +-- Knap Keybinds +-- F5 processes the document once, and refreshes the view +vim.keymap.set({ 'n', 'v', 'i' },'kp', function() require("knap").process_once() end) + +-- F6 closes the viewer application, and allows settings to be reset +vim.keymap.set({ 'n', 'v', 'i' },'ks', function() require("knap").close_viewer() end) + +-- F7 toggles the auto-processing on and off +vim.keymap.set({ 'n', 'v', 'i' },'ka', function() require("knap").toggle_autopreviewing() end) + -- cgit v1.2.3