commit 09cf9b801639fe32e11a68c300ecf0d6b6a80dff Author: Jackal Date: Wed Jun 5 08:51:46 2024 +0200 first commit diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..ec73309 --- /dev/null +++ b/init.lua @@ -0,0 +1,2 @@ +require("teeja") + diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 0000000..b66be0f --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,16 @@ +{ + "LuaSnip": { "branch": "master", "commit": "de1a287c9cb525ae52bc846e8f6207e5ef1da5ac" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "lazy.nvim": { "branch": "main", "commit": "8f19915175395680808de529e4220da8dafc0759" }, + "lsp-zero.nvim": { "branch": "v3.x", "commit": "f12d50716e8e59ea9f5cf484eac6968c33a95917" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "a4caa0d083aab56f6cd5acf2d42331b74614a585" }, + "mason.nvim": { "branch": "main", "commit": "49ff59aded1047a773670651cfa40e76e63c6377" }, + "nvim-cmp": { "branch": "main", "commit": "5260e5e8ecadaf13e6b82cf867a909f54e15fd07" }, + "nvim-lspconfig": { "branch": "master", "commit": "eadcee1573ca9d0e0cd36a49f620186a8dfdc607" }, + "nvim-treesitter": { "branch": "master", "commit": "30de5e7e9486fb1b1b8c2a1e71052b13f94f1cb0" }, + "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, + "telescope.nvim": { "branch": "master", "commit": "6312868392331c9c0f22725041f1ec2bef57c751" }, + "tokyonight.nvim": { "branch": "main", "commit": "b9b494fa7f7bbf2fe0747b47fa290fb7a4eddcc7" }, + "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } +} \ No newline at end of file diff --git a/lua/teeja/init.lua b/lua/teeja/init.lua new file mode 100644 index 0000000..090a565 --- /dev/null +++ b/lua/teeja/init.lua @@ -0,0 +1,3 @@ +require("teeja.set") +require("teeja.remap") +require("teeja.lazy-init") diff --git a/lua/teeja/lazy-init.lua b/lua/teeja/lazy-init.lua new file mode 100644 index 0000000..eba8370 --- /dev/null +++ b/lua/teeja/lazy-init.lua @@ -0,0 +1,17 @@ +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) + +require("lazy").setup({ + spec = "teeja.lazy", + change_detection = { notify = false } +}) diff --git a/lua/teeja/lazy/lsp.lua b/lua/teeja/lazy/lsp.lua new file mode 100644 index 0000000..c01f5e4 --- /dev/null +++ b/lua/teeja/lazy/lsp.lua @@ -0,0 +1,72 @@ +return { + { + 'VonHeikemen/lsp-zero.nvim', branch = 'v3.x', + dependencies = { + "neovim/nvim-lspconfig", + "williamboman/mason.nvim", + "williamboman/mason-lspconfig.nvim", + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/nvim-cmp", + "hrsh7th/cmp-path", + "L3MON4D3/LuaSnip" + }, + + config = function() + local lsp_zero = require('lsp-zero') + lsp_zero.extend_lspconfig() + lsp_zero.on_attach(function(client, bufnr) + lsp_zero.default_keymaps({buffer = bufnr}) + end) + + require("mason").setup() + require("mason-lspconfig").setup { + ensure_installed = { + "lua_ls", + "bashls", + "cssls", + "cssmodules_ls", + "css_variables", + "unocss", + "html", + "dockerls", + "docker_compose_language_service", + "intelephense" + } + } + require("mason-lspconfig").setup_handlers { + function (server_name) + require("lspconfig")[server_name].setup ({}) + end, + } + + local cmp = require('cmp') + local cmp_action = lsp_zero.cmp_action() + + cmp.setup({ + mapping = cmp.mapping.preset.insert({ + -- `Enter` key to confirm completion + [''] = cmp.mapping.confirm({select = false}), + + -- Ctrl+Space to trigger completion menu + [''] = cmp.mapping.complete(), + + -- Navigate between snippet placeholder + [''] = cmp_action.luasnip_jump_forward(), + [''] = cmp_action.luasnip_jump_backward(), + + -- Scroll up and down in the completion documentation + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + }), + snippet = { + expand = function(args) + require('luasnip').lsp_expand(args.body) + end, + }, + sources = { + { name = 'path' } + } + }) + end + } +} diff --git a/lua/teeja/lazy/telescope.lua b/lua/teeja/lazy/telescope.lua new file mode 100644 index 0000000..5d88f9c --- /dev/null +++ b/lua/teeja/lazy/telescope.lua @@ -0,0 +1,12 @@ +return { + { + 'nvim-telescope/telescope.nvim', tag = '0.1.6', + dependencies = { 'nvim-lua/plenary.nvim' }, + --config = function () + -- local builtin = require('telescope.builtin') + -- vim.keymap.set('n', 'sf', builtin.find_files, {}) + -- vim.keymap.set('n', 'sg', builtin.live_grep, {}) + -- vim.keymap.set('n', 'sh', builtin.help_tags, {}) + --end + }, +} diff --git a/lua/teeja/lazy/tokyonight.lua b/lua/teeja/lazy/tokyonight.lua new file mode 100644 index 0000000..bf82336 --- /dev/null +++ b/lua/teeja/lazy/tokyonight.lua @@ -0,0 +1,10 @@ +return { + { + "folke/tokyonight.nvim", + lazy = false, + priority = 1000, + config = function() + vim.cmd([[colorscheme tokyonight-storm]]) + end + }, +} diff --git a/lua/teeja/lazy/treesitter.lua b/lua/teeja/lazy/treesitter.lua new file mode 100644 index 0000000..3b71287 --- /dev/null +++ b/lua/teeja/lazy/treesitter.lua @@ -0,0 +1,26 @@ +return { + { + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + config = function () + local configs = require("nvim-treesitter.configs") + configs.setup({ + ensure_installed = { + "lua", + "vim", + "html", + "css", + "bash", + "json", + "php", + "dockerfile", + "yaml", + "toml" + }, + sync_install = false, + highlight = { enable = true }, + indent = { enable = true }, + }) + end + } +} diff --git a/lua/teeja/lazy/which-key.lua b/lua/teeja/lazy/which-key.lua new file mode 100644 index 0000000..eb0ff5d --- /dev/null +++ b/lua/teeja/lazy/which-key.lua @@ -0,0 +1,25 @@ +return { + { + "folke/which-key.nvim", + event = "VeryLazy", + init = function() + vim.o.timeout = true + vim.o.timeoutlen = 500 + end, + config = function () + local wk = require("which-key") + wk.register({ + s = { + name = "Telescope", + f = { "Telescope find_files", "Find File" }, + g = { "Telescope live_grep", "Grep File" }, + h = { "Telescope help_tags", "Help Tags" }, + }, + f = { + name = "Netrw", + c = { "Explore", "File Browser" }, + }, + }, { prefix = "" }) + end + } +} diff --git a/lua/teeja/remap.lua b/lua/teeja/remap.lua new file mode 100644 index 0000000..95d68a4 --- /dev/null +++ b/lua/teeja/remap.lua @@ -0,0 +1,4 @@ +vim.g.mapleader = " " + +vim.keymap.set("v", "J", ":m '>+1gv=gv") +vim.keymap.set("v", "K", ":m '<-2gv=gv") diff --git a/lua/teeja/set.lua b/lua/teeja/set.lua new file mode 100644 index 0000000..e8287f0 --- /dev/null +++ b/lua/teeja/set.lua @@ -0,0 +1,20 @@ +vim.opt.nu = true +vim.opt.relativenumber = true + +vim.opt.tabstop = 4 +vim.opt.softtabstop = 4 +vim.opt.shiftwidth = 4 +vim.opt.expandtab = true + +vim.opt.smartindent = true + +vim.opt.hlsearch = false +vim.opt.incsearch = true + +vim.opt.termguicolors = true + +vim.opt.scrolloff = 8 + +vim.opt.updatetime = 50 + +vim.opt.colorcolumn = "80"