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') require('bootstrap')
-- custom key maps
require('keymaps')
-- load options -- load options
local options = require('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 print("Colorscheme not found: " .. options.ui.theme) -- Print an error message if the colorscheme is not installed
return return
end 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 confirm = true, -- Confirm to save changes before exiting modified buffer
cursorline = true, -- Enable highlighting of the current line cursorline = true, -- Enable highlighting of the current line
ignorecase = true, -- Ignore case ignorecase = true, -- Ignore case
laststatus = 3, -- global statusline
mouse = "a", -- Enable mouse mode mouse = "a", -- Enable mouse mode
number = true, -- Print line number number = true, -- Print line number
pumblend = 0, -- Popup pseudo transparency pumblend = 0, -- Popup pseudo transparency
pumheight = 12, -- Popup height
showmode = false, -- Dont show mode since we have a statusline showmode = false, -- Dont show mode since we have a statusline
smartindent = true, -- Insert indents automatically smartindent = true, -- Insert indents automatically
termguicolors = true, -- True color support termguicolors = true, -- True color support
@ -29,7 +29,16 @@ return {
foldsep = " ", foldsep = " ",
diff = "", diff = "",
eob = " ", eob = " ",
} horiz = '',
horizup = '',
horizdown = '',
vert = '',
vertleft = '',
vertright = '',
verthoriz = '',
},
mousemoveevent = true,
laststatus = 3, -- global statusline
}, },
ui = { ui = {
theme = "vscode", theme = "vscode",

View File

@ -15,24 +15,39 @@ return {
'hrsh7th/vim-vsnip', 'hrsh7th/vim-vsnip',
'onsails/lspkind.nvim' 'onsails/lspkind.nvim'
}, },
config = function(_, opts) config = function(_, _)
local cmp = require("cmp"); local cmp = require("cmp");
cmp.setup({ 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 = { snippet = {
expand = function(args) expand = function(args)
vim.fn["vsnip#anonymous"](args.body) vim.fn["vsnip#anonymous"](args.body)
end, end,
}, },
completion = { completion = {
completeopt = "menu,menuone,noinsert", preselect = 'none',
completeopt = "menu,menuone,noinser,noselectt",
}, },
sources = cmp.config.sources({ sources = cmp.config.sources({
{ name = 'nvim_lsp' }, { name = 'nvim_lsp' },
{ name = 'nvim_lsp_signature_help' },
{ name = 'vsnip' }, { name = 'vsnip' },
{ name = 'buffer' }, { name = 'buffer' },
{ name = 'calc' },
{ name = 'emoji' },
{ name = "path" }, { name = "path" },
{ name = 'calc' },
}, {
{ name = 'emoji' },
{ name = "cmdline" }, { name = "cmdline" },
{ name = "latex_symbols" } { name = "latex_symbols" }
}), }),
@ -41,18 +56,29 @@ return {
['<C-f>'] = cmp.mapping.scroll_docs(4), ['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(), ['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.abort(), ['<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 = { formatting = {
fields = { "kind", "abbr", "menu" }, fields = { "abbr", "kind", "menu" },
format = function(entry, item) format = function(entry, item)
local kind = require("lspkind").cmp_format({ mode = "symbol_text", maxwidth = 50 })(entry, item) return require("lspkind").cmp_format()(entry, item)
local strings = vim.split(kind.kind, "%s", { trimempty = true })
kind.kind = " " .. (strings[1] or "") .. " "
kind.menu = " (" .. (strings[2] or "") .. ")"
return kind
end end
} },
experimental = {
ghost_text = {
hl_group = "NonText",
},
},
}) })
end end
} }

View File

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

View File

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

View File

@ -7,14 +7,44 @@ return {
options = { options = {
theme = "vscode", theme = "vscode",
component_separators = { left = '', right = '' }, component_separators = { left = '', right = '' },
section_separators = { left = '', right = '' },
globalstatus = true
}, },
sections = { sections = {
lualine_a = { 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 = { 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', 'branch',
icon = '󰊤 '
}, },
{ {
'diff', 'diff',
@ -23,9 +53,9 @@ return {
modified = '~', modified = '~',
removed = '-', removed = '-',
} }
} },
}, },
lualine_c = { lualine_x = {
{ {
'diagnostics', 'diagnostics',
symbols = { symbols = {
@ -39,21 +69,10 @@ return {
}, },
update_in_insert = true 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 () function ()
local client_id = vim.lsp.get_client_by_id(1) local client_id = vim.lsp.get_client_by_id(1)
return ' ' .. client_id.name return ' LSP - ' .. client_id.name
end, end,
on_click = function () on_click = function ()
vim.defer_fn(function() vim.defer_fn(function()
@ -98,3 +117,4 @@ return {
end end
} }
} }

View File

@ -1,5 +1,5 @@
return { return {
{ {
"folke/noice.nvim", "folke/noice.nvim",
event = "VeryLazy", event = "VeryLazy",
dependencies = { dependencies = {
@ -29,9 +29,6 @@ return {
col = "50%", col = "50%",
}, },
} }
},
views = {
} }
} }
end 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
}