Skip to content
Closed

Temp #1893

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions LuaSnip/Readme.md
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions LuaSnip/all.lua
Original file line number Diff line number Diff line change
@@ -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.' }),
}
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/<your_github_username>/kickstart.nvim.git`
> `https://github.com/<your_github_username>/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
Expand All @@ -74,7 +74,7 @@ too - it's ignored in the kickstart repo to make maintenance easier, but it's
<details><summary> Linux and Mac </summary>

```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
```

</details>
Expand All @@ -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"
```

</details>
Expand Down Expand Up @@ -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

Expand Down
95 changes: 87 additions & 8 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 <silent><expr> <Tab> luasnip#expand_or_jumpable() ? '<Plug>luasnip-expand-or-jump' : '<Tab>'
smap <silent><expr> <Tab> luasnip#jumpable(1) ? '<Plug>luasnip-jump-next' : '<Tab>'

" Use Shift-Tab to jump backwards through snippets
imap <silent><expr> <S-Tab> luasnip#jumpable(-1) ? '<Plug>luasnip-jump-prev' : '<S-Tab>'
smap <silent><expr> <S-Tab> luasnip#jumpable(-1) ? '<Plug>luasnip-jump-prev' : '<S-Tab>'
]]

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).
Expand All @@ -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 = '<Tab>',
}
-- einfache Keymaps
vim.keymap.set({ 'i' }, '<C-k>', function()
luasnip.expand()
end, { silent = true })
vim.keymap.set({ 'i', 's' }, '<C-l>', function()
luasnip.jump(1)
end, { silent = true })
vim.keymap.set({ 'i', 's' }, '<C-h>', 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`.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
},
Expand All @@ -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,
},

Expand Down Expand Up @@ -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 = {
Expand Down Expand Up @@ -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!
Expand Down
11 changes: 10 additions & 1 deletion lua/custom/plugins/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
}