updated files

This commit is contained in:
Sven Vogel 2024-03-01 18:57:06 +01:00
parent 6d0e50f053
commit 69123b9bf0
9 changed files with 189 additions and 43 deletions

View File

@ -1,6 +1,4 @@
require('bootstrap')
-- custom key maps
require('keymaps')
-- load options
local options = require('options')
@ -16,3 +14,9 @@ if not status then
print("Colorscheme not found: " .. options.ui.theme) -- Print an error message if the colorscheme is not installed
return
end
-- apply keymap
local keymap = require('keymap')
for _, v in pairs(keymap) do
vim.keymap.set(v[1], v[2], v[3], v[4])
end

57
lua/keymap.lua Normal file
View File

@ -0,0 +1,57 @@
return {
{
{ 'i', 'x', 'n', 's' }, "<C-s>", "<cmd>w<cr><esc>", { desc = "Save file" }
},
{
{ 'n' }, "<C-t>", "<cmd>enew<cr>", { desc = "New File" }
},
{
{ 'n', 'i' }, '<C-z>', '<cmd>u<CR>', { desc = "Undo" }
},
{
{ 'n', 'i' }, '<C-y>', '<cmd>redo<CR>', { desc = "Undo" }
},
{
{ 'n', 'i' }, '<S-tab>', '<cmd><<CR>', { desc = "Remove Tab" }
},
{
{ 'n', 'i' }, '<C-g>', '<cmd>Telescope<CR>', { desc = "Open Telescope" }
},
{
{ 'n', 'i' }, '<S-ScrollWheelUp>', '<ScrollWheelLeft>', { desc = "Scroll sideways" }
},
{
{ 'n', 'i' }, '<S-ScrollWheelDown>', '<ScrollWheelRight>', { desc = "Scroll sideways" }
},
{
{ 'n' }, "<S-Tab>", "<Plug>(cokeline-focus-prev)", { desc = "Next Tab", silent = false }
},
{
{ 'n' }, "<Tab>", "<Plug>(cokeline-focus-next)", { desc = "Previous Tab", silent = false }
},
{
{ 'n' }, '<C-w>', '', { desc = "Disable STRG+w" }
},
{
{ 'n' }, '<C-w>v', '<cmd>vsplit<CR>', { desc = "Split Vertical", noremap = true }
},
{
{ 'n' }, '<C-w>h', '<cmd>split<CR>', { desc = "Split Horizontal", noremap = true }
},
{
{ 'n' }, '<C-w>q', '<cmd>q<CR>', { desc = "Quit Window" }
},
{
{ 'n' }, '<C-w><Left>', '<cmd>wincmd h<CR>', { desc = "Window Left" }
},
{
{ 'n' }, '<C-w><Down>', '<cmd>wincmd j<CR>', { desc = "Window Down" }
},
{
{ 'n' }, '<C-w><Up>', '<cmd>wincmd k<CR>', { desc = "Window Up" }
},
{
{ 'n' }, '<C-w><Right>', '<cmd>wincmd l<CR>', { desc = "Window Right" }
}
}

View File

@ -9,10 +9,10 @@ return {
confirm = true, -- Confirm to save changes before exiting modified buffer
cursorline = true, -- Enable highlighting of the current line
ignorecase = true, -- Ignore case
laststatus = 3, -- global statusline
mouse = "a", -- Enable mouse mode
number = true, -- Print line number
pumblend = 0, -- Popup pseudo transparency
pumheight = 12, -- Popup height
showmode = false, -- Dont show mode since we have a statusline
smartindent = true, -- Insert indents automatically
termguicolors = true, -- True color support
@ -29,7 +29,16 @@ return {
foldsep = " ",
diff = "",
eob = " ",
}
horiz = '',
horizup = '',
horizdown = '',
vert = '',
vertleft = '',
vertright = '',
verthoriz = '',
},
mousemoveevent = true,
laststatus = 3, -- global statusline
},
ui = {
theme = "vscode",

View File

@ -15,24 +15,39 @@ return {
'hrsh7th/vim-vsnip',
'onsails/lspkind.nvim'
},
config = function(_, opts)
config = function(_, _)
local cmp = require("cmp");
cmp.setup({
window = {
completion = {
border = "single",
scrollbar = false,
winhighlight = "Normal:CmpPmenu,FloatBorder:FloatBorder,Search:None"
},
documentation = {
border = "single",
scrollbar = false,
winhighlight = "Normal:CmpPmenu,FloatBorder:FloatBorder,Search:None"
},
},
snippet = {
expand = function(args)
vim.fn["vsnip#anonymous"](args.body)
end,
},
completion = {
completeopt = "menu,menuone,noinsert",
preselect = 'none',
completeopt = "menu,menuone,noinser,noselectt",
},
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'nvim_lsp_signature_help' },
{ name = 'vsnip' },
{ name = 'buffer' },
{ name = 'calc' },
{ name = 'emoji' },
{ name = "path" },
{ name = 'calc' },
}, {
{ name = 'emoji' },
{ name = "cmdline" },
{ name = "latex_symbols" }
}),
@ -41,18 +56,29 @@ return {
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.abort(),
['<CR>'] = cmp.mapping.confirm({ select = false }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
["<CR>"] = cmp.mapping({
i = function(fallback)
if cmp.visible() and cmp.get_active_entry() then
cmp.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = false })
else
fallback()
end
end,
s = cmp.mapping.confirm({ select = true }),
c = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true }),
}),
}),
formatting = {
fields = { "kind", "abbr", "menu" },
fields = { "abbr", "kind", "menu" },
format = function(entry, item)
local kind = require("lspkind").cmp_format({ mode = "symbol_text", maxwidth = 50 })(entry, item)
local strings = vim.split(kind.kind, "%s", { trimempty = true })
kind.kind = " " .. (strings[1] or "") .. " "
kind.menu = " (" .. (strings[2] or "") .. ")"
return kind
return require("lspkind").cmp_format()(entry, item)
end
}
},
experimental = {
ghost_text = {
hl_group = "NonText",
},
},
})
end
}

View File

@ -1,13 +1,18 @@
return {
{
{
"willothy/nvim-cokeline",
config = true,
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons"
},
opts = {
fill_hl = "NeoTreeTabInactive",
show_if_buffers_are_at_least = 1,
buffers = {
focus_on_delete = "next",
new_buffers_position = 'last',
delete_on_right_click = false
},
mappings = {
disable_mouse = false,
@ -38,7 +43,7 @@ return {
fg = function(buffer) return buffer.devicon.color end
},
{
text = function(buffer) return buffer.devicon.icon end,
text = function(buffer) return ' ' .. buffer.devicon.icon end,
fg = function(buffer) return buffer.devicon.color end,
},
{
@ -173,16 +178,23 @@ return {
}
},
},
rhs = {
{
text = "󰓩 2 tabs"
}
},
sidebar = {
filetype = { "NvimTree", "neo-tree", "SidebarNvim" },
filetype = {
'neo-tree'
},
components = {
{
text = "",
bg = "NeoTreeTabInactive",
fg = "NeoTreeTabInactive"
text = '',
fg = "NeoTreeTabInactive",
bg = "NeoTreeTabInactive"
}
},
},
}
}
}
}
}

View File

@ -48,6 +48,8 @@ return {
end
vim.diagnostic.config(vim.deepcopy(opts.diagnostics))
require'lspconfig'.gdscript.setup{}
end
}
}

View File

@ -7,14 +7,44 @@ return {
options = {
theme = "vscode",
component_separators = { left = '', right = '' },
section_separators = { left = '', right = '' },
globalstatus = true
},
sections = {
lualine_a = {
'mode',
{
function ()
return ''
end,
separator = { left = '', right = '' },
padding = 1,
fmt = function (text)
return string.gsub(text, "%s+", "")
end
},
{
'mode',
padding = 0,
fmt = function (text)
return string.gsub(text, "%s+", "") .. ' '
end
}
},
lualine_b = {
{
'filename',
symbols = {
modified = '', -- Text to show when the file is modified.
readonly = '', -- Text to show when the file is non-modifiable or readonly.
unnamed = '', -- Text to show for unnamed buffers.
newfile = '[New]', -- Text to show for newly created file before first write
}
}
},
lualine_c = {
{
'branch',
icon = '󰊤 '
},
{
'diff',
@ -23,9 +53,9 @@ return {
modified = '~',
removed = '-',
}
}
},
},
lualine_c = {
lualine_x = {
{
'diagnostics',
symbols = {
@ -39,21 +69,10 @@ return {
},
update_in_insert = true
},
{
'filename',
symbols = {
modified = '', -- Text to show when the file is modified.
readonly = '', -- Text to show when the file is non-modifiable or readonly.
unnamed = '', -- Text to show for unnamed buffers.
newfile = '[New]', -- Text to show for newly created file before first write
}
}
},
lualine_x = {
{
function ()
local client_id = vim.lsp.get_client_by_id(1)
return ' ' .. client_id.name
return ' LSP - ' .. client_id.name
end,
on_click = function ()
vim.defer_fn(function()
@ -98,3 +117,4 @@ return {
end
}
}

View File

@ -1,5 +1,5 @@
return {
{
{
"folke/noice.nvim",
event = "VeryLazy",
dependencies = {
@ -29,9 +29,6 @@ return {
col = "50%",
},
}
},
views = {
}
}
end

19
lua/plugins/trouble.lua Normal file
View File

@ -0,0 +1,19 @@
return {
"folke/trouble.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
opts = function (_)
local options = require('options')
return {
padding = false,
indent_lines = false,
auto_jump = { },
signs = {
error = options.lsp.icons.Error,
warning = options.lsp.icons.Warn,
hint = options.lsp.icons.Hint,
information = options.lsp.icons.Info,
other = options.lsp.icons.Info,
},
}
end
}