diff --git a/LuaSnip/Readme.md b/LuaSnip/Readme.md new file mode 100644 index 00000000000..cb3e5af1575 --- /dev/null +++ b/LuaSnip/Readme.md @@ -0,0 +1,10 @@ +# Example LuaSnip directory structure +${HOME}/.config/nvim/LuaSnip/ +├── all.lua +├── markdown.lua +├── python.lua +└── tex + ├── delimiters.lua + ├── environments.lua + ├── fonts.lua + └── math.lua diff --git a/LuaSnip/all.lua b/LuaSnip/all.lua new file mode 100644 index 00000000000..ca2efbdd569 --- /dev/null +++ b/LuaSnip/all.lua @@ -0,0 +1,8 @@ +return { + -- A snippet that expands the trigger "hi" into the string "Hello, world!". + require('luasnip').snippet({ trig = 'hi' }, { t 'Hello, world!' }), + + -- To return multiple snippets, use one `return` statement per snippet file + -- and return a table of Lua snippets. + require('luasnip').snippet({ trig = 'foo' }, { t 'Another snippet.' }), +} diff --git a/README.md b/README.md index 4113950550d..5287c97faf5 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ fork to your machine using one of the commands below, depending on your OS. > [!NOTE] > Your fork's URL will be something like this: -> `https://github.com//kickstart.nvim.git` +> `https://github.com//kickstart.nvim.jenson` You likely want to remove `lazy-lock.json` from your fork's `.gitignore` file too - it's ignored in the kickstart repo to make maintenance easier, but it's @@ -74,7 +74,7 @@ too - it's ignored in the kickstart repo to make maintenance easier, but it's
Linux and Mac ```sh -git clone https://github.com/nvim-lua/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim +git clone https://github.com/jensonjohnathon/kickstart.nvim.jenson "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim ```
@@ -84,13 +84,13 @@ git clone https://github.com/nvim-lua/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HO If you're using `cmd.exe`: ``` -git clone https://github.com/nvim-lua/kickstart.nvim.git "%localappdata%\nvim" +git clone https://github.com/jensonjohnathon/kickstart.nvim.jenson "%localappdata%\nvim" ``` If you're using `powershell.exe` ``` -git clone https://github.com/nvim-lua/kickstart.nvim.git "${env:LOCALAPPDATA}\nvim" +git clone https://github.com/jensonjohnathon/kickstart.nvim.jenson "${env:LOCALAPPDATA}\nvim" ``` @@ -147,8 +147,8 @@ examples of adding popularly requested plugins. same functionality is available here: * [kickstart-modular.nvim](https://github.com/dam9000/kickstart-modular.nvim) * Discussions on this topic can be found here: - * [Restructure the configuration](https://github.com/nvim-lua/kickstart.nvim/issues/218) - * [Reorganize init.lua into a multi-file setup](https://github.com/nvim-lua/kickstart.nvim/pull/473) + * [Restructure the configuration](https://github.com/jensonjohnathon/kickstart.nvim/issues/218) + * [Reorganize init.lua into a multi-file setup](https://github.com/jensonjohnathon/kickstart.nvim/pull/473) ### Install Recipes diff --git a/init.lua b/init.lua index b98ffc6198a..e80dadebe51 100644 --- a/init.lua +++ b/init.lua @@ -118,6 +118,19 @@ vim.schedule(function() vim.o.clipboard = 'unnamedplus' end) +vim.g.clipboard = { + name = 'wl-clipboard', + copy = { + ['+'] = 'wl-copy', + ['*'] = 'wl-copy', + }, + paste = { + ['+'] = 'wl-paste', + ['*'] = 'wl-paste', + }, + cache_enabled = true, +} + -- Enable break indent vim.o.breakindent = true @@ -244,6 +257,22 @@ rtp:prepend(lazypath) -- To update plugins you can run -- :Lazy update -- +-- Yes, we're just executing a bunch of Vimscript, but this is the officially +-- endorsed method; see https://github.com/L3MON4D3/LuaSnip#keymaps +vim.cmd [[ +" Use Tab to expand and jump through snippets +imap luasnip#expand_or_jumpable() ? 'luasnip-expand-or-jump' : '' +smap luasnip#jumpable(1) ? 'luasnip-jump-next' : '' + +" Use Shift-Tab to jump backwards through snippets +imap luasnip#jumpable(-1) ? 'luasnip-jump-prev' : '' +smap luasnip#jumpable(-1) ? 'luasnip-jump-prev' : '' +]] + +vim.cmd [[ + filetype plugin indent on +]] + -- NOTE: Here is where you install your plugins. require('lazy').setup({ -- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link). @@ -266,6 +295,50 @@ require('lazy').setup({ -- }) -- end, -- } + { + 'lervag/vimtex', + ft = { 'tex', 'plaintex', 'latex' }, -- lazy-load nur bei TeX + init = function() + -- Viewer (WSL/Ubuntu mit WSLg): z.B. zathura + vim.g.vimtex_view_method = 'zathura' -- Alternativen: "sioyek", "skim"(mac), "sumatrapdf"(win), "general" + vim.g.vimtex_quickfix_mode = 0 -- Quickfix nur bei echten Fehlern, nicht bei Warnungen + -- optional: lokaler Leader in TeX-Buffern + end, + }, + -- LuaSnip (Snippet Engine) + { + 'L3MON4D3/LuaSnip', + version = 'v2.*', -- stabile Version + build = 'make install_jsregexp', -- optional, für advanced regex + config = function() + local luasnip = require 'luasnip' + -- Lade VSCode-kompatible Snippets, falls du welche hast + require('luasnip.loaders.from_vscode').lazy_load() + require('luasnip.loaders.from_lua').load { paths = '~/.config/nvim/LuaSnip/' } + + require('luasnip').config.set_config { -- Setting LuaSnip config + + -- Enable autotriggered snippets + enable_autosnippets = true, + + -- Use Tab (or some other key if you prefer) to trigger visual selection + store_selection_keys = '', + } + -- einfache Keymaps + vim.keymap.set({ 'i' }, '', function() + luasnip.expand() + end, { silent = true }) + vim.keymap.set({ 'i', 's' }, '', function() + luasnip.jump(1) + end, { silent = true }) + vim.keymap.set({ 'i', 's' }, '', function() + luasnip.jump(-1) + end, { silent = true }) + end, + }, + + -- Optionale Snippet-Sammlung + { 'rafamadriz/friendly-snippets' }, -- -- Here is a more advanced example where we pass configuration -- options to `gitsigns.nvim`. @@ -482,8 +555,8 @@ require('lazy').setup({ -- Automatically install LSPs and related tools to stdpath for Neovim -- Mason must be loaded before its dependents so we need to set it up here. -- NOTE: `opts = {}` is the same as calling `require('mason').setup({})` - { 'mason-org/mason.nvim', opts = {} }, - 'mason-org/mason-lspconfig.nvim', + { 'williamboman/mason.nvim', opts = {} }, + 'williamboman/mason-lspconfig.nvim', 'WhoIsSethDaniel/mason-tool-installer.nvim', -- Useful status updates for LSP. @@ -672,7 +745,7 @@ require('lazy').setup({ -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ local servers = { -- clangd = {}, - -- gopls = {}, + gopls = {}, -- pyright = {}, -- rust_analyzer = {}, -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs @@ -881,11 +954,13 @@ require('lazy').setup({ -- change the command in the config to whatever the name of that colorscheme is. -- -- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`. - 'folke/tokyonight.nvim', + -- 'folke/tokyonight.nvim', + -- 'navarasu/onedark.nvim', + 'scottmckendry/cyberdream.nvim', priority = 1000, -- Make sure to load this before all the other start plugins. config = function() ---@diagnostic disable-next-line: missing-fields - require('tokyonight').setup { + require('cyberdream').setup { styles = { comments = { italic = false }, -- Disable italics in comments }, @@ -894,7 +969,7 @@ require('lazy').setup({ -- Load the colorscheme here. -- Like many other themes, this one has different styles, and you could load -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'. - vim.cmd.colorscheme 'tokyonight-night' + vim.cmd.colorscheme 'cyberdream' end, }, @@ -942,9 +1017,12 @@ require('lazy').setup({ 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate', main = 'nvim-treesitter.configs', -- Sets main module to use for opts + init = function() + require('nvim-treesitter.install').prefer_git = false + end, -- [[ Configure Treesitter ]] See `:help nvim-treesitter` opts = { - ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }, + ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc', 'go', 'latex' }, -- Autoinstall languages that are not installed auto_install = true, highlight = { @@ -984,7 +1062,8 @@ 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 be0eb9d8d7a..db658aad170 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -2,4 +2,13 @@ -- I promise not to create any merge conflicts in this directory :) -- -- See the kickstart.nvim README for more information -return {} +return { + { + 'davidmh/mdx.nvim', + dependencies = { 'nvim-treesitter/nvim-treesitter' }, + lazy = false, + config = function() + require('mdx').setup() + end, + }, +}