first commit

This commit is contained in:
2024-06-05 08:51:46 +02:00
commit 09cf9b8016
12 changed files with 207 additions and 0 deletions

3
lua/teeja/init.lua Normal file
View File

@@ -0,0 +1,3 @@
require("teeja.set")
require("teeja.remap")
require("teeja.lazy-init")

17
lua/teeja/lazy-init.lua Normal file
View File

@@ -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 }
})

72
lua/teeja/lazy/lsp.lua Normal file
View File

@@ -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
['<CR>'] = cmp.mapping.confirm({select = false}),
-- Ctrl+Space to trigger completion menu
['<C-Space>'] = cmp.mapping.complete(),
-- Navigate between snippet placeholder
['<C-f>'] = cmp_action.luasnip_jump_forward(),
['<C-b>'] = cmp_action.luasnip_jump_backward(),
-- Scroll up and down in the completion documentation
['<C-u>'] = cmp.mapping.scroll_docs(-4),
['<C-d>'] = cmp.mapping.scroll_docs(4),
}),
snippet = {
expand = function(args)
require('luasnip').lsp_expand(args.body)
end,
},
sources = {
{ name = 'path' }
}
})
end
}
}

View File

@@ -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', '<leader>sf', builtin.find_files, {})
-- vim.keymap.set('n', '<leader>sg', builtin.live_grep, {})
-- vim.keymap.set('n', '<leader>sh', builtin.help_tags, {})
--end
},
}

View File

@@ -0,0 +1,10 @@
return {
{
"folke/tokyonight.nvim",
lazy = false,
priority = 1000,
config = function()
vim.cmd([[colorscheme tokyonight-storm]])
end
},
}

View File

@@ -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
}
}

View File

@@ -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 = { "<cmd>Telescope find_files<cr>", "Find File" },
g = { "<cmd>Telescope live_grep<cr>", "Grep File" },
h = { "<cmd>Telescope help_tags<cr>", "Help Tags" },
},
f = {
name = "Netrw",
c = { "<cmd>Explore<cr>", "File Browser" },
},
}, { prefix = "<leader>" })
end
}
}

4
lua/teeja/remap.lua Normal file
View File

@@ -0,0 +1,4 @@
vim.g.mapleader = " "
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")

20
lua/teeja/set.lua Normal file
View File

@@ -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"