GithubHelp home page GithubHelp logo

evesdropper / luasnip-latex-snippets.nvim Goto Github PK

View Code? Open in Web Editor NEW
63.0 4.0 7.0 1.35 MB

A set of preconfigured snippets for LaTeX for the snippet engine LuaSnip.

Home Page: https://evesdropper.dev/files/luasnip/

License: MIT License

Lua 100.00%
latex luasnip neovim-plugin snippets

luasnip-latex-snippets.nvim's Introduction

LuaSnip-LaTeX-Snippets

A set of preconfigured snippets for LaTeX for the snippet engine LuaSnip.

⚠️ Note: My implementation is based on VimTeX for a portion of the functionality; see the acknowledgements section for alternatives if VimTeX is not an option. I'm also hoping to adopt treesitter support later on, as mentioned a while ago in this issue.

luasnip-latex-snippets.mp4

Idea

I’ve created my share of smart snippets for LaTeX, and it might be nice to provide some solid defaults for people using snippets out of the box. Despite this, I would probably recommend others to make their own snippets if they can as the process is far more enjoyable and rewarding. But someone can tell me the same about creating a Neovim plugin while I’m sorely tempted to pay someone off to do the work for me because I really can’t deal with the development process, so do what makes you happy, I guess.

Installation

Use the package manager of your choice, or don't.

Lazy.nvim

{
    "evesdropper/luasnip-latex-snippets.nvim",
},

Packer.nvim

use {
    "evesdropper/luasnip-latex-snippets.nvim",
},

Snippets

See snippets.md for the time being.

Development Plans

Of course, add more snippets. Ideally would also like to expand this to more languages, allow for better user experience in the future; feel free to make a PR to help contribute your own ideas.

Acknowledgements

Some similar snippet resources:

Additionally, I would like to thank Max Mehta for bringing up the idea of creating this plugin and the creator of LuaSnip, L3MON4D3, for helping me debug some of the early stages of the plugin. There are also functions scattered throughout the code which are not made by me, so I've posted acknowledgements for those in the comments of the code.

luasnip-latex-snippets.nvim's People

Contributors

evesdropper avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

luasnip-latex-snippets.nvim's Issues

Using the Snippets in markdown files

Is there any way to make the snippets work in markdown files like they did in here. I use obsidian to take notes so i only use "$$math$$" in the markdown files. I tried to understand how it works but unfortunately im not experienced with custom snippets

Plug in not working as expected

So i installed this plugin plus all the following:

    ● alpha-nvim 0.59ms 
    ● bufferline.nvim 0.26ms 
    ● cmp-nvim-lsp 0.21ms 
    ● cmp_luasnip 0.16ms 
    ● completion-nvim 0.38ms 
    ● impatient.nvim 0.32ms 
    ● indent-blankline.nvim 0.25ms 
    ● kanagawa.nvim 0.16ms 
    ● lazy.nvim 2.35ms  init.lua
    ● lspkind-nvim 0.04ms 
    ● lspsaga.nvim 0.39ms 
    ● lualine.nvim 0.35ms  
    ● LuaSnip 2.83ms  luasnip.loaders.from_lua  luasnip-latex-snippets.nvim
    ● luasnip-latex-snippets.nvim 4.34ms 
    ● markdown-preview.nvim 0.47ms  
    ● nerdcommenter 1.25ms  
    ● nvim-autopairs 0.22ms  
    ● nvim-cmp 1.17ms  
    ● nvim-colorizer.lua 0.09ms 
    ● nvim-lspconfig 4.08ms 
    ● nvim-tree.lua 0.28ms 
    ● nvim-treesitter 3.48ms  
    ● nvim-web-devicons 0.17ms  bufferline.nvim
    ● plenary.nvim 0.22ms  telescope.nvim
    ● sniprun 1.08ms 
    ● symbols-outline.nvim 0.25ms
    ● telescope.nvim 0.77ms 
    ● tex-conceal.vim 0.2ms 
    ● vimtex 0.29ms 
    ● yuck.vim 0.22ms 

and my issue is that every time I open a .tex file, the snippets dont appear. I also have lsp+texlab configured, so i dont know how the issue appears.

Please update the README!

I just wasted half an hour battling with strange errors whenever I wanted to write anything in a .tex file. Then I read the file listing the snippets and saw that the vimtex plugin is needed for most things to work. For the love of god, please mention this in your README, and put vimtex as a dependency in the code snippet showing how to install this plugin. Not only is this not visible at first glance (and it should be), but the file which contains this crucial information isn't even marked as documentation!

Auto snippet matches alpha and \alpha

Hey, just wanted to say I really appreciate this plugin. In math mode, typing alpha turns into \alpha and typing \alpha turns into \\alpha. Is this intended? I would expect typing \alpha to not trigger the snippet and return \alpha (unaffected). This issue is not noticed with \angle, for example.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.