Move nvim config to submodule

This commit is contained in:
David Senoner 2024-09-15 22:28:10 +02:00
parent 89baa025d7
commit 502027ec33
3 changed files with 4 additions and 109 deletions

1
.config/nvim Submodule

@ -0,0 +1 @@
Subproject commit 44da8a06b60eb1f5fb06bb6854a63ef3d15ad0ab

View file

@ -1,109 +0,0 @@
vim.opt.number = true
vim.opt.expandtab = true
vim.opt.number = true
vim.opt.tabstop = 2
vim.opt.softtabstop = 2
vim.opt.shiftwidth = 2
vim.opt.title = true
vim.opt.whichwrap = "<,>,[,]"
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)
local plugins = {
{ "rebelot/kanagawa.nvim", name = "kanagawa", priority = 1000 },
{
"nvim-telescope/telescope.nvim", tag = "0.1.8",
dependencies = { "nvim-lua/plenary.nvim" }
},
{ "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" },
{ "williamboman/mason.nvim" },
{ "williamboman/mason-lspconfig.nvim" },
{ "neovim/nvim-lspconfig" },
{ "hrsh7th/cmp-nvim-lsp" },
{
"L3MON4D3/LuaSnip",
dependencies = {
"saadparwaiz1/cmp_luasnip",
"rafamadriz/friendly-snippets",
},
},
{ "hrsh7th/nvim-cmp" },
}
require("lazy").setup(plugins, {})
vim.cmd.colorscheme "kanagawa"
local builtin = require("telescope.builtin")
local configs = require("nvim-treesitter.configs")
configs.setup({
ensure_installed = { "asm", "c", "javascript", "latex", "lua", "matlab", "meson", "sql", "toml", "typescript", "vue" },
highlight = { enable = true },
indent = { enable = true }
})
require("mason").setup()
require("mason-lspconfig").setup({
ensure_installed = { "clangd", "texlab", "lua_ls", "matlab_ls", "mesonlsp", "sqlls", "tsserver", "volar" }
})
local lspconfig = require("lspconfig")
lspconfig.clangd.setup({
cmd = { "clangd", "-header-insertion=never" },
})
lspconfig.lua_ls.setup({})
lspconfig.matlab_ls.setup({})
lspconfig.mesonlsp.setup({})
lspconfig.sqlls.setup({})
lspconfig.texlab.setup({})
lspconfig.tsserver.setup({})
lspconfig.volar.setup({})
local cmp = require("cmp")
require("luasnip.loaders.from_vscode").lazy_load()
cmp.setup({
snippet = {
expand = function(args)
require("luasnip").lsp_expand(args.body)
end,
},
window = {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(),
},
mapping = cmp.mapping.preset.insert({
["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.abort(),
["<CR>"] = cmp.mapping.confirm({ select = true }),
}),
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "luasnip" }, -- For luasnip users.
}, {
{ name = "buffer" },
}),
})
vim.keymap.set("n", "T", function() vim.lsp.buf.definition() end, {})
vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, {})
vim.keymap.set("n", "J", function() vim.lsp.buf.type_definition() end, {})
vim.keymap.set("n", "C", function() vim.lsp.buf.code_action() end, {})
vim.keymap.set("n", "<C-p>", builtin.find_files, {})
vim.keymap.set("n", "<C-f>", builtin.live_grep, {})

3
.gitmodules vendored Normal file
View file

@ -0,0 +1,3 @@
[submodule "nvim"]
path = .config/nvim
url = git@github.com:kada49/init.lua.git