feat: move config to single init.lua file
This commit is contained in:
@@ -1,14 +0,0 @@
|
|||||||
local telescope = require('telescope.builtin')
|
|
||||||
vim.keymap.set('n', '<leader>ff', telescope.find_files, {})
|
|
||||||
vim.keymap.set('n', '<leader>fg', telescope.live_grep, {})
|
|
||||||
vim.keymap.set('n', '<leader>fb', telescope.buffers, {})
|
|
||||||
vim.keymap.set('n', '<leader>fh', telescope.help_tags, {})
|
|
||||||
|
|
||||||
|
|
||||||
vim.keymap.set('n', '<leader>q', ':q<CR>', {})
|
|
||||||
vim.keymap.set('n', '<leader>w', ':w<CR>', {})
|
|
||||||
|
|
||||||
vim.keymap.set('n', '<leader>c', ':noh<CR>', {})
|
|
||||||
|
|
||||||
vim.keymap.set('n', '<leader>en', vim.diagnostic.goto_next, {})
|
|
||||||
vim.keymap.set('n', '<leader>ep', vim.diagnostic.goto_prev, {})
|
|
||||||
172
init.lua
172
init.lua
@@ -12,9 +12,161 @@ end
|
|||||||
vim.opt.rtp:prepend(lazypath)
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
|
|
||||||
vim.g.mapleader = " "
|
require("lazy").setup({
|
||||||
|
spec = {
|
||||||
|
{
|
||||||
|
'windwp/nvim-ts-autotag',
|
||||||
|
lazy = false,
|
||||||
|
config = true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'terrortylor/nvim-comment',
|
||||||
|
lazy = false,
|
||||||
|
config = function()
|
||||||
|
require('nvim_comment').setup({
|
||||||
|
hook = function()
|
||||||
|
require('ts_context_commentstring.internal').update_commentstring()
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
dependencies = {
|
||||||
|
-- To customize commentstring for e.g. svelte files, as the commentstring is depending on cursor position
|
||||||
|
'JoosepAlviste/nvim-ts-context-commentstring'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
{
|
||||||
|
'williamboman/mason.nvim',
|
||||||
|
lazy = false,
|
||||||
|
config = true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'williamboman/mason-lspconfig.nvim',
|
||||||
|
lazy = false,
|
||||||
|
config = function()
|
||||||
|
local lsp_zero = require('lsp-zero')
|
||||||
|
|
||||||
require("lazy").setup("plugins")
|
lsp_zero.extend_lspconfig()
|
||||||
|
|
||||||
|
lsp_zero.on_attach(function(_, bufnr)
|
||||||
|
-- see :help lsp-zero-keybindings
|
||||||
|
-- to learn the available actions
|
||||||
|
lsp_zero.default_keymaps({ buffer = bufnr })
|
||||||
|
end)
|
||||||
|
|
||||||
|
require('mason-lspconfig').setup {
|
||||||
|
ensure_installed = { 'rust_analyzer', 'lua_ls' },
|
||||||
|
handlers = {
|
||||||
|
lsp_zero.default_setup
|
||||||
|
} }
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
{ 'VonHeikemen/lsp-zero.nvim' },
|
||||||
|
{ 'neovim/nvim-lspconfig' },
|
||||||
|
{ 'hrsh7th/cmp-nvim-lsp' },
|
||||||
|
{
|
||||||
|
'hrsh7th/nvim-cmp',
|
||||||
|
lazy = false,
|
||||||
|
config = function()
|
||||||
|
local cmp = require('cmp')
|
||||||
|
|
||||||
|
cmp.setup({
|
||||||
|
mapping = cmp.mapping.preset.insert({
|
||||||
|
-- add Ctrl+z to default keymap from lsp-zero as replacement to Ctrl+y on german keyboard layout
|
||||||
|
['<C-z>'] = cmp.mapping.confirm({ select = true }),
|
||||||
|
})
|
||||||
|
})
|
||||||
|
end
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'stevearc/conform.nvim',
|
||||||
|
lazy = false,
|
||||||
|
opts = {
|
||||||
|
notify_on_error = true,
|
||||||
|
formatters_by_ft = {
|
||||||
|
templ = { "templ" },
|
||||||
|
},
|
||||||
|
format_on_save = {
|
||||||
|
lsp_fallback = true,
|
||||||
|
timeout_ms = 1500,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
config = function(_, opts)
|
||||||
|
local plug = require('conform')
|
||||||
|
plug.setup(opts)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
-- status line
|
||||||
|
'nvim-lualine/lualine.nvim',
|
||||||
|
lazy = false,
|
||||||
|
config = true,
|
||||||
|
opts = {
|
||||||
|
options = {
|
||||||
|
theme = "everforest",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
dependencies = { 'nvim-tree/nvim-web-devicons' }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'rcarriga/nvim-notify',
|
||||||
|
lazy = false,
|
||||||
|
config = function()
|
||||||
|
vim.notify = require('notify')
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'stevearc/oil.nvim',
|
||||||
|
lazy = false,
|
||||||
|
config = function()
|
||||||
|
require('oil').setup({
|
||||||
|
view_options = {
|
||||||
|
show_hidden = true,
|
||||||
|
sort = {
|
||||||
|
{ "type", "asc" },
|
||||||
|
{ "name", "asc" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
vim.keymap.set("n", "-", "<CMD>Oil<CR>", { desc = "Open parent directory" })
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'nvim-telescope/telescope.nvim',
|
||||||
|
opts = {
|
||||||
|
defaults = {
|
||||||
|
path_display = { "smart" },
|
||||||
|
file_ignore_patterns = { "node%_modules/.*" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sainnhe/everforest",
|
||||||
|
priority = 1000, -- make sure to load this before all the other start plugins
|
||||||
|
config = function()
|
||||||
|
vim.cmd([[colorscheme everforest]])
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
config = function()
|
||||||
|
require("nvim-treesitter.configs").setup {
|
||||||
|
auto_install = true,
|
||||||
|
highlight = {
|
||||||
|
enable = true,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
vim.cmd([[TSUpdate]])
|
||||||
|
end
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
vim.g.mapleader = " "
|
||||||
|
|
||||||
-- line numbers
|
-- line numbers
|
||||||
vim.opt.rnu = true
|
vim.opt.rnu = true
|
||||||
@@ -35,6 +187,9 @@ vim.opt.foldlevel = 99
|
|||||||
--clipboard
|
--clipboard
|
||||||
vim.opt.clipboard = "unnamedplus"
|
vim.opt.clipboard = "unnamedplus"
|
||||||
|
|
||||||
|
-- other
|
||||||
|
vim.opt.signcolumn = "yes"
|
||||||
|
|
||||||
-- colortheme
|
-- colortheme
|
||||||
vim.opt.termguicolors = true
|
vim.opt.termguicolors = true
|
||||||
|
|
||||||
@@ -47,3 +202,16 @@ vim.api.nvim_create_autocmd('TextYankPost', {
|
|||||||
})
|
})
|
||||||
|
|
||||||
vim.filetype.add({ extension = { templ = "templ" } })
|
vim.filetype.add({ extension = { templ = "templ" } })
|
||||||
|
|
||||||
|
|
||||||
|
vim.keymap.set('n', '<leader>q', ':q<CR>', {})
|
||||||
|
vim.keymap.set('n', '<leader>w', ':w<CR>', {})
|
||||||
|
vim.keymap.set('n', '<leader>c', ':noh<CR>', {})
|
||||||
|
vim.keymap.set('n', '<leader>en', vim.diagnostic.goto_next, {})
|
||||||
|
vim.keymap.set('n', '<leader>ep', vim.diagnostic.goto_prev, {})
|
||||||
|
|
||||||
|
local telescope = require('telescope.builtin')
|
||||||
|
vim.keymap.set('n', '<leader>ff', telescope.find_files, {})
|
||||||
|
vim.keymap.set('n', '<leader>fg', telescope.live_grep, {})
|
||||||
|
vim.keymap.set('n', '<leader>fb', telescope.buffers, {})
|
||||||
|
vim.keymap.set('n', '<leader>fh', telescope.help_tags, {})
|
||||||
|
|||||||
@@ -2,15 +2,12 @@
|
|||||||
"LuaSnip": { "branch": "master", "commit": "66b5c2707e624dcd2cd3605676c64a2efe47e9d1" },
|
"LuaSnip": { "branch": "master", "commit": "66b5c2707e624dcd2cd3605676c64a2efe47e9d1" },
|
||||||
"cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" },
|
"cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" },
|
||||||
"conform.nvim": { "branch": "master", "commit": "973f3cb73887d510321653044791d7937c7ec0fa" },
|
"conform.nvim": { "branch": "master", "commit": "973f3cb73887d510321653044791d7937c7ec0fa" },
|
||||||
"copilot.vim": { "branch": "release", "commit": "12995dffe10282b29b8335650bf3e7457f4870e7" },
|
|
||||||
"everforest": { "branch": "master", "commit": "f40c2e6c8784c99c57c79edc94cd180e76450222" },
|
"everforest": { "branch": "master", "commit": "f40c2e6c8784c99c57c79edc94cd180e76450222" },
|
||||||
"hardtime.nvim": { "branch": "main", "commit": "cde2e68986a3679e61383180e0007b3d5bc51aa7" },
|
|
||||||
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
|
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
|
||||||
"lsp-zero.nvim": { "branch": "v4.x", "commit": "d388e2b71834c826e61a3eba48caec53d7602510" },
|
"lsp-zero.nvim": { "branch": "v4.x", "commit": "d388e2b71834c826e61a3eba48caec53d7602510" },
|
||||||
"lualine.nvim": { "branch": "master", "commit": "a94fc68960665e54408fe37dcf573193c4ce82c9" },
|
"lualine.nvim": { "branch": "master", "commit": "a94fc68960665e54408fe37dcf573193c4ce82c9" },
|
||||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "a9c876d72d82b6640266f8b248ac05a63630b1d9" },
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "bb3a17efc797c34c054463174e5522442576ebd8" },
|
||||||
"mason.nvim": { "branch": "main", "commit": "8024d64e1330b86044fed4c8494ef3dcd483a67c" },
|
"mason.nvim": { "branch": "main", "commit": "8024d64e1330b86044fed4c8494ef3dcd483a67c" },
|
||||||
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
|
|
||||||
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
|
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
|
||||||
"nvim-comment": { "branch": "main", "commit": "e9ac16ab056695cad6461173693069ec070d2b23" },
|
"nvim-comment": { "branch": "main", "commit": "e9ac16ab056695cad6461173693069ec070d2b23" },
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "7a88e3024a616e153b8760d64b3541e3a166c27f" },
|
"nvim-lspconfig": { "branch": "master", "commit": "7a88e3024a616e153b8760d64b3541e3a166c27f" },
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
return {
|
|
||||||
'windwp/nvim-ts-autotag',
|
|
||||||
lazy = false,
|
|
||||||
config = true,
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
return {
|
|
||||||
'terrortylor/nvim-comment',
|
|
||||||
lazy = false,
|
|
||||||
config = function()
|
|
||||||
require('nvim_comment').setup({
|
|
||||||
hook = function()
|
|
||||||
require('ts_context_commentstring.internal').update_commentstring()
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
dependencies = {
|
|
||||||
-- To customize commentstring for e.g. svelte files, as the commentstring is depending on cursor position
|
|
||||||
'JoosepAlviste/nvim-ts-context-commentstring'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
return {
|
|
||||||
'stevearc/conform.nvim',
|
|
||||||
lazy = false,
|
|
||||||
opts = {
|
|
||||||
notify_on_error = true,
|
|
||||||
formatters_by_ft = {
|
|
||||||
templ = { "templ" },
|
|
||||||
},
|
|
||||||
format_on_save = {
|
|
||||||
lsp_fallback = true,
|
|
||||||
timeout_ms = 1500,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
config = function(_, opts)
|
|
||||||
local plug = require('conform')
|
|
||||||
plug.setup(opts)
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
return {}
|
|
||||||
-- return {
|
|
||||||
-- "github/copilot.vim",
|
|
||||||
-- config = function()
|
|
||||||
-- vim.g.copilot_filetypes = { markdown = true }
|
|
||||||
-- end,
|
|
||||||
-- }
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
return {
|
|
||||||
{
|
|
||||||
'williamboman/mason.nvim',
|
|
||||||
lazy = false,
|
|
||||||
config = true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'williamboman/mason-lspconfig.nvim',
|
|
||||||
lazy = false,
|
|
||||||
config = function()
|
|
||||||
local lsp_zero = require('lsp-zero')
|
|
||||||
|
|
||||||
lsp_zero.extend_lspconfig()
|
|
||||||
|
|
||||||
lsp_zero.on_attach(function(_, bufnr)
|
|
||||||
-- see :help lsp-zero-keybindings
|
|
||||||
-- to learn the available actions
|
|
||||||
lsp_zero.default_keymaps({ buffer = bufnr })
|
|
||||||
end)
|
|
||||||
|
|
||||||
require('mason-lspconfig').setup {
|
|
||||||
ensure_installed = { 'rust_analyzer', 'lua_ls' },
|
|
||||||
handlers = {
|
|
||||||
lsp_zero.default_setup
|
|
||||||
} }
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
{ 'VonHeikemen/lsp-zero.nvim' },
|
|
||||||
{ 'neovim/nvim-lspconfig' },
|
|
||||||
{ 'hrsh7th/cmp-nvim-lsp' },
|
|
||||||
{
|
|
||||||
'hrsh7th/nvim-cmp',
|
|
||||||
lazy = false,
|
|
||||||
config = function()
|
|
||||||
local cmp = require('cmp')
|
|
||||||
|
|
||||||
cmp.setup({
|
|
||||||
mapping = cmp.mapping.preset.insert({
|
|
||||||
-- add Ctrl+z to default keymap from lsp-zero as replacement to Ctrl+y on german keyboard layout
|
|
||||||
['<C-z>'] = cmp.mapping.confirm({ select = true }),
|
|
||||||
})
|
|
||||||
})
|
|
||||||
end
|
|
||||||
},
|
|
||||||
{ 'L3MON4D3/LuaSnip' },
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
return {
|
|
||||||
-- status line
|
|
||||||
'nvim-lualine/lualine.nvim',
|
|
||||||
lazy = false,
|
|
||||||
config = true,
|
|
||||||
opts = {
|
|
||||||
options = {
|
|
||||||
theme = "everforest",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
dependencies = { 'nvim-tree/nvim-web-devicons' }
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
return {
|
|
||||||
'rcarriga/nvim-notify',
|
|
||||||
lazy = false,
|
|
||||||
config = function()
|
|
||||||
vim.notify = require('notify')
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
return {
|
|
||||||
'stevearc/oil.nvim',
|
|
||||||
lazy = false,
|
|
||||||
config = function()
|
|
||||||
require('oil').setup({
|
|
||||||
view_options = {
|
|
||||||
show_hidden = true,
|
|
||||||
sort = {
|
|
||||||
{ "type", "asc" },
|
|
||||||
{ "name", "asc" },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
vim.keymap.set("n", "-", "<CMD>Oil<CR>", { desc = "Open parent directory" })
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
return {
|
|
||||||
'nvim-telescope/telescope.nvim',
|
|
||||||
opts = {
|
|
||||||
defaults = {
|
|
||||||
path_display = { "smart" },
|
|
||||||
file_ignore_patterns = { "node%_modules/.*" }
|
|
||||||
}
|
|
||||||
},
|
|
||||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
return {
|
|
||||||
"sainnhe/everforest",
|
|
||||||
priority = 1000, -- make sure to load this before all the other start plugins
|
|
||||||
config = function()
|
|
||||||
vim.cmd([[colorscheme everforest]])
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
return {
|
|
||||||
"nvim-treesitter/nvim-treesitter",
|
|
||||||
config = function()
|
|
||||||
require("nvim-treesitter.configs").setup {
|
|
||||||
auto_install = true,
|
|
||||||
highlight = {
|
|
||||||
enable = true,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
vim.cmd([[TSUpdate]])
|
|
||||||
end
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user