diff --git a/.config/nvim b/.config/nvim new file mode 160000 index 0000000..44da8a0 --- /dev/null +++ b/.config/nvim @@ -0,0 +1 @@ +Subproject commit 44da8a06b60eb1f5fb06bb6854a63ef3d15ad0ab diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua deleted file mode 100644 index 72dffd9..0000000 --- a/.config/nvim/init.lua +++ /dev/null @@ -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({ - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.complete(), - [""] = cmp.mapping.abort(), - [""] = 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", "", builtin.find_files, {}) -vim.keymap.set("n", "", builtin.live_grep, {}) diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..c4ca70e --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "nvim"] + path = .config/nvim + url = git@github.com:kada49/init.lua.git