Compare commits

...

19 Commits

Author SHA1 Message Date
Ward Truyen
3fbfc5bd2b feat: alpha-dashboard added 2025-11-29 23:20:34 +01:00
Ward Truyen
470b1012f1 fix: catppucin/neovide terminal colors 2025-11-27 13:17:37 +01:00
Ward Truyen
dec548e1d7 feat: Updated lineNr colors 2025-11-21 13:11:44 +01:00
Ward Truyen
b25bc2d63a docs: Wrote something in README.md 2025-10-19 11:48:58 +02:00
Ward Truyen
64d0992a24 feat: added instal-zsh-optionals for instaling (AUR) packages for zsh configuration 2025-10-19 10:45:41 +02:00
Ward Truyen
e2c6a96e18 feat: improved make instal-optionals to include nvim vim tree and --needed instal arguement 2025-10-11 11:27:24 +02:00
Ward Truyen
ca05e88876 chore: improved keybinds 2025-10-10 07:10:03 +02:00
Ward Truyen
93b9162d16 chore: added refresh gitsigns keybind 2025-08-17 22:38:35 +02:00
Ward Truyen
3bce3cb3ed fix: simplified and fixed a lot of keymaps 2025-07-26 17:37:35 +02:00
Ward Truyen
71edd9843a chore: more Standardized remap 2025-07-22 16:31:05 +02:00
Ward Truyen
369cc7db08 chore: removed quit when last buffer closes 2025-07-22 16:29:45 +02:00
Ward Truyen
71b3491efb chore: improved system copy&paste 2025-07-20 15:08:15 +02:00
Ward Truyen
2ea28a4253 chore: format + mason fix 2025-07-20 14:40:45 +02:00
Ward Truyen
3250e086e5 chore: format and cleanup 2025-07-19 22:35:41 +02:00
Ward Truyen
3ed6529711 Chore: moved lineNumberColors to Setup 2025-07-07 22:26:23 +02:00
Ward Truyen
ce889c3d17 fixes and neovide suport 2025-07-04 22:52:36 +02:00
Ward Truyen
1aa0e3034d small comment updates 2025-06-02 15:05:56 +02:00
Ward Truyen
bf6e8e038b Added bufdel and render-markdown plugins, and fixed dap issues 2025-05-28 17:17:09 +02:00
Ward Truyen
28576e17d5 Chore: bugfixes terminal and search 2025-05-26 22:14:14 +02:00
21 changed files with 515 additions and 145 deletions

View File

@@ -0,0 +1 @@
# NeoVim config repository from Ward Truyen 2025

View File

@@ -7,3 +7,10 @@ require("ward.remap")
--$ instal/load Lazy plugin manager --$ instal/load Lazy plugin manager
require("ward.lazy") require("ward.lazy")
--$ Neovide configuration if used
if vim.g.neovide then
vim.g.neovide_opacity = 0.75
vim.g.neovide_window_blurred = true
vim.o.guifont = "Source Code Pro:h14"
end

View File

@@ -0,0 +1,191 @@
return {
"goolord/alpha-nvim",
dependencies = {
"nvim-telescope/telescope.nvim",
-- "nvim-telescope/telescope-project.nvim",
},
priority = 2000,
lazy = false,
config = function()
-- require("telescope").load_extension("project")
local alpha = require("alpha")
local dashboard = require("alpha.themes.dashboard")
local datetime = tonumber(os.date(" %H "))
local stats = require("lazy").stats()
local total_plugins = stats.count
local function button(sc, txt, keybind, keybind_opts)
local b = dashboard.button(sc, txt, keybind, keybind_opts)
b.opts.hl_shortcut = "MiniIconsPurple"
return b
end
local logo = [[
_
_ __ ___ _____ _(_)_ __ ___
| '_ \ / _ \/ _ \ \ / / | '_ ` _ \
| | | | __/ (_) \ V /| | | | | | |
|_| |_|\___|\___/ \_/ |_|_| |_| |_|
]]
dashboard.section.header.val = vim.split(logo, "\n")
dashboard.section.buttons.val = {
-- button("p", " Find project", ":lua require'telescope'.extensions.project.project{}<CR>"),
button("n", " New file", ":ene <BAR> startinsert <CR>"),
button("f", " Find Files", ":Telescope find_files <CR>"),
button("o", " Recent Files", "<cmd>Telescope oldfiles<cr>"),
button("t", " Find text", ":Telescope live_grep <CR>"),
button("m", " Bookmarks", ":Telescope marks <CR>"),
button("c", " Neovim config", "<cmd>e ~/.config/nvim/ | cd %:p:h<cr>"),
button("l", "󰒲 Lazy", "<cmd>Lazy<cr>"),
button("q", " Quit NVIM", ":qa<CR>"),
}
local function footer()
local footer_datetime = os.date(" %m-%d-%Y  %H:%M:%S")
local version = vim.version()
local nvim_version_info = "  v" .. version.major .. "." .. version.minor .. "." .. version.patch
-- local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
local value = footer_datetime .. "  Plugins " .. total_plugins .. nvim_version_info
return value
end
-- Append the footer string below the ASCII art
local count = 0
for _ in pairs(dashboard.section.header.val) do
count = count + 1
end
local extraline = count - 14
print(extraline)
for _ = 1, extraline do
table.insert(dashboard.section.header.val, 1, "")
end
-- table.insert(dashboard.section.header.val, footer())
-- dashboard.section.footer.val = require("alpha.fortune")()
dashboard.section.footer.val = footer()
local greeting = function()
-- Determine the appropriate greeting based on the hour
local mesg
local username = os.getenv("USER")
if datetime >= 0 and datetime < 6 then
mesg = "Dreaming..󰒲 󰒲 "
elseif datetime >= 6 and datetime < 12 then
mesg = "🌅 Hi " .. username .. ", Good Morning ☀️"
elseif datetime >= 12 and datetime < 18 then
mesg = "🌞 Hi " .. username .. ", Good Afternoon ☕️"
elseif datetime >= 18 and datetime < 21 then
mesg = "🌆 Hi " .. username .. ", Good Evening 🌙"
else
mesg = "Hi " .. username .. ", it's getting late, get some sleep 😴"
end
return mesg
end
local function capture(cmd, raw)
local f = assert(io.popen(cmd, "r"))
local s = assert(f:read("*a"))
f:close()
if raw then
return s
end
s = string.gsub(s, "^%s+", "")
s = string.gsub(s, "%s+$", "")
s = string.gsub(s, "[\n\r]+", " ")
return s
end
local function split(source, sep)
local result, i = {}, 1
while true do
local a, b = source:find(sep)
if not a then
break
end
local candidat = source:sub(1, a - 1)
if candidat ~= "" then
result[i] = candidat
end
i = i + 1
source = source:sub(b + 1)
end
if source ~= "" then
result[i] = source
end
return result
end
local bottom_section = {
type = "text",
val = greeting,
opts = {
position = "center",
},
}
local section = {
header = dashboard.section.header,
bottom_section = bottom_section,
buttons = dashboard.section.buttons,
footer = dashboard.section.footer,
}
local opts = {
layout = {
{ type = "padding", val = 1 },
section.header,
{ type = "padding", val = 1 },
section.buttons,
{ type = "padding", val = 1 },
section.bottom_section,
{ type = "padding", val = 1 },
section.footer,
},
}
dashboard.opts.opts.noautocmd = true
-- close Lazy and re-open when the dashboard is ready
if vim.o.filetype == "lazy" then
vim.cmd.close()
vim.api.nvim_create_autocmd("User", {
once = true,
pattern = "AlphaReady",
callback = function()
require("lazy").show()
end,
})
end
alpha.setup(opts)
-- don't show status line in alpha dashboard
vim.api.nvim_create_autocmd({ "User" }, {
pattern = { "AlphaReady" },
callback = function()
vim.cmd([[ set laststatus=0 | autocmd BufUnload <buffer> set laststatus=3 ]])
end,
})
-- onefetch header for alpha dashboard if onefetch is installed and git repo is present
vim.api.nvim_create_augroup("vimrc_alpha", { clear = true })
vim.api.nvim_create_autocmd({ "User" }, {
group = "vimrc_alpha",
pattern = "AlphaReady",
callback = function()
if vim.fn.executable("onefetch") == 1 then
local header = split(
capture(
[[onefetch 2>/dev/null | sed 's/\x1B[@A-Z\\\]^_]\|\x1B\[[0-9:;<=>?]*[-!"#$%&'"'"'()*+,.\/]*[][\\@A-Z^_`a-z{|}~]//g']],
true
),
"\n"
)
if next(header) ~= nil then
require("alpha.themes.dashboard").section.header.val = header
require("alpha").redraw()
end
end
end,
once = true,
})
end,
}

View File

@@ -1,9 +1,9 @@
--$ autocomplete for C++ Rust and Lua --$ autocomplete for C++, Rust, Lua, etc
--$ URL: https://github.com/hrsh7th/nvim-cmp --$ URL: https://github.com/hrsh7th/nvim-cmp
--$ help: nvim-cmp --$ help: nvim-cmp
return { return {
"hrsh7th/nvim-cmp", "hrsh7th/nvim-cmp",
event = "InsertEnter", -- event = "InsertEnter",
dependencies = { dependencies = {
-- Snippet Engine & its associated nvim-cmp source -- Snippet Engine & its associated nvim-cmp source
{ {

View File

@@ -0,0 +1,13 @@
--$ This allows buffers to be closed but not the window
--$ URL: https://github.com/ojroques/nvim-bufdel
return {
"ojroques/nvim-bufdel",
version = "*",
config = function()
require('bufdel').setup {
next = 'tabs',
quit = false,
}
vim.keymap.set("n", "<leader>bc", vim.cmd.BufDel)
end,
}

View File

@@ -6,7 +6,11 @@ return {
priority = 1000, priority = 1000,
config = function() config = function()
require("catppuccin").setup({}) require("catppuccin").setup({
transparent_backgroud = true,
term_colors = true,
})
vim.cmd.colorscheme("catppuccin") vim.cmd.colorscheme("catppuccin")
LineNumberColors()
end, end,
} }

View File

@@ -17,6 +17,16 @@ return {
dap.listeners.before.event_exited.dapui_config = function() dap.listeners.before.event_exited.dapui_config = function()
dapui.close() dapui.close()
end end
vim.api.nvim_create_autocmd("LspAttach", {
group = vim.api.nvim_create_augroup("UserDapUIConfig", {}),
callback = function(event)
local wk = require("which-key")
wk.add({
{ "<leader>dd", desc = "Toggle DAP UI" },
})
vim.keymap.set('n', '<Leader>dd', function() require('dapui').toggle() end) vim.keymap.set('n', '<Leader>dd', function() require('dapui').toggle() end)
end, end,
})
end,
} }

View File

@@ -1,4 +1,3 @@
---@type NvPluginSpec
-- NOTE: Debug Adapter Protocol -- NOTE: Debug Adapter Protocol
-- URL: https://github.com/mfussenegger/nvim-dap/wiki/Debug-Adapter-installation -- URL: https://github.com/mfussenegger/nvim-dap/wiki/Debug-Adapter-installation
return { return {
@@ -7,23 +6,27 @@ return {
-- NOTE: Check out this for guide -- NOTE: Check out this for guide
vim.fn.sign_define("DapBreakpoint", { text = "", texthl = "DiagnosticSignError", linehl = "", numhl = "" }) vim.fn.sign_define("DapBreakpoint", { text = "", texthl = "DiagnosticSignError", linehl = "", numhl = "" })
-- These dap keybinds only load when an LSP is attatched to the buffer.
vim.api.nvim_create_autocmd("LspAttach", {
group = vim.api.nvim_create_augroup("UserDapConfig", {}),
callback = function(event)
local wk = require("which-key") local wk = require("which-key")
wk.add({ wk.add({
{"<leader>d", group = "DAP"}, { "<leader>d", group = "DAP" },
{"<leader>dd", desc = "Toggle DAP UI"}, { "<leader>dd", desc = "Toggle DAP UI" },
{"<leader>db", desc = "Toggle breakpoint"}, { "<leader>db", desc = "Toggle breakpoint" },
{"<leader>dB", desc = "Set breakpoint"}, { "<leader>dB", desc = "Set breakpoint" },
{"<leader>dm", desc = "message point"}, { "<leader>dm", desc = "message point" },
{"<leader>dr", desc = "Open repl"}, { "<leader>dr", desc = "Open repl" },
{"<leader>dl", desc = "Run last"}, { "<leader>dl", desc = "Run last" },
{"<leader>dh", desc = "Hover widgets"}, { "<leader>dh", desc = "Hover widgets" },
{"<leader>dp", desc = "Preview widgets"}, { "<leader>dp", desc = "Preview widgets" },
{"<leader>df", desc = "Float frames"}, { "<leader>df", desc = "Float frames" },
{"<leader>ds", desc = "Float scopes"}, { "<leader>ds", desc = "Float scopes" },
{"<leader>d<F5>", desc = "Debug start/continue"}, { "<leader>d<F5>", desc = "Debug start/continue" },
{"<leader>d<F6>", desc = "Debug step over"}, { "<leader>d<F6>", desc = "Debug step over" },
{"<leader>d<F7>", desc = "Debug step into"}, { "<leader>d<F7>", desc = "Debug step into" },
{"<leader>d<F8>", desc = "Debug step out"}, { "<leader>d<F8>", desc = "Debug step out" },
}) })
vim.keymap.set('n', '<F5>', function() require('dap').continue() end) vim.keymap.set('n', '<F5>', function() require('dap').continue() end)
vim.keymap.set('n', '<F6>', function() require('dap').step_over() end) vim.keymap.set('n', '<F6>', function() require('dap').step_over() end)
@@ -49,8 +52,12 @@ return {
local widgets = require('dap.ui.widgets') local widgets = require('dap.ui.widgets')
widgets.centered_float(widgets.scopes) widgets.centered_float(widgets.scopes)
end) end)
end,
})
-- configure C/C++
-- NOTE: Make sure to install the needed files/exectubles through mason -- NOTE: Make sure to install the needed files/exectubles through mason
local dap = require("dap") local dap = require("dap")
dap.adapters.gdb = { dap.adapters.gdb = {
@@ -65,7 +72,20 @@ return {
type = "gdb", type = "gdb",
request = "launch", request = "launch",
program = function() program = function()
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file") local storedValue = vim.g['mydap_program']
local preFill = vim.fn.getcwd() .. "/"
if storedValue ~= nil then preFill = storedValue end
local newValue = vim.fn.input("Path to executable: ", preFill, "file")
vim.g['mydap_program'] = newValue
return newValue
end,
args = function()
local storedValue = vim.g['mydap_args']
local preFill = ""
if storedValue ~= nil then preFill = storedValue end
local newValue = vim.fn.input("Arguements: ", preFill)
vim.g['mydap_args'] = newValue
return newValue
end, end,
cwd = "${workspaceFolder}", cwd = "${workspaceFolder}",
stopAtBeginningOfMainSubprogram = false, stopAtBeginningOfMainSubprogram = false,

View File

@@ -1,3 +1,4 @@
--Note: this will show what part of a file was changed deleted or added in a git repo
return { return {
"lewis6991/gitsigns.nvim", "lewis6991/gitsigns.nvim",
-- event = "BufReadPre", -- event = "BufReadPre",
@@ -15,5 +16,9 @@ return {
numhl = true, -- Toggle with `:Gitsigns toggle_numhl` numhl = true, -- Toggle with `:Gitsigns toggle_numhl`
linehl = false, -- Toggle with `:Gitsigns toggle_linehl` linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
} }
vim.keymap.set('n', '<Leader>xs', function()
require("gitsigns").refresh();
end, { desc = "Gitsigns refresh" })
end, end,
} }

View File

@@ -1,3 +1,5 @@
-- NOTE: this adds a Language Server Provider for source files like C++, Java/-Script, etc.
-- It will check the code for errors, warnings, variables and structures and give suggestions.
return { return {
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
version = "*", version = "*",
@@ -26,9 +28,23 @@ return {
} }
lspconfig.clangd.setup({ lspconfig.clangd.setup({
keys = {
{ "<leader>pc", "<cmd>ClangdSwitchSourceHeader<cr>", desc = "Switch Source/Header (C/C++)" },
},
cmd = { cmd = {
"clangd", "clangd",
"--offset-encoding=utf-16", "--offset-encoding=utf-16",
"--background-index",
"--clang-tidy",
"--header-insertion=iwyu",
"--completion-style=detailed",
"--function-arg-placeholders",
"-j4",
"--fallback-style=llvm",
},
filetypes = { "c", "cpp", "objc", "objcpp", "cuda", "proto", "hpp" },
init_options = {
fallbackFlags = { '-std=c17' },
}, },
handlers = handlers, handlers = handlers,
}) })
@@ -88,6 +104,11 @@ return {
-- To jump back, press <C-t>. -- To jump back, press <C-t>.
map("gd", require("telescope.builtin").lsp_definitions, "[G]oto [D]efinition") map("gd", require("telescope.builtin").lsp_definitions, "[G]oto [D]efinition")
-- WARN: This is not Goto Definition, this is Goto Declaration.
-- For example, in C this would take you to the header.
map("gD", vim.lsp.buf.declaration, "[G]oto [D]eclaration")
-- Find references for the word under your cursor. -- Find references for the word under your cursor.
map("gr", require("telescope.builtin").lsp_references, "[G]oto [R]eferences") map("gr", require("telescope.builtin").lsp_references, "[G]oto [R]eferences")
@@ -100,6 +121,11 @@ return {
-- the definition of its *type*, not where it was *defined*. -- the definition of its *type*, not where it was *defined*.
map("<leader>ld", require("telescope.builtin").lsp_type_definitions, "Type [D]efinition") map("<leader>ld", require("telescope.builtin").lsp_type_definitions, "Type [D]efinition")
-- Jump to the type of the word under your cursor.
-- Useful when you're not sure what type a variable is and you want to see
-- the definition of its *type*, not where it was *defined*.
map("<leader>lD", vim.lsp.buf.declaration, "Go to [D]eclaration")
-- Fuzzy find all the symbols in your current document. -- Fuzzy find all the symbols in your current document.
-- Symbols are things like variables, functions, types, etc. -- Symbols are things like variables, functions, types, etc.
map("<leader>ls", require("telescope.builtin").lsp_document_symbols, "document [S]ymbols") map("<leader>ls", require("telescope.builtin").lsp_document_symbols, "document [S]ymbols")
@@ -114,6 +140,7 @@ return {
require("telescope.builtin").lsp_dynamic_workspace_symbols, require("telescope.builtin").lsp_dynamic_workspace_symbols,
"[W]orkspace symbols" "[W]orkspace symbols"
) )
map("<leader>li", vim.cmd.LspInfo, "Show lsp info")
map("<leader>lp", vim.diagnostic.goto_prev, "Go to [P]revious diagnostic message") map("<leader>lp", vim.diagnostic.goto_prev, "Go to [P]revious diagnostic message")
map("<leader>ln", vim.diagnostic.goto_next, "Go to [N]ext diagnostic message") map("<leader>ln", vim.diagnostic.goto_next, "Go to [N]ext diagnostic message")
@@ -134,10 +161,6 @@ return {
-- Opens a popup that displays documentation about the word under your cursor -- Opens a popup that displays documentation about the word under your cursor
-- See `:help K` for why this keymap. -- See `:help K` for why this keymap.
-- WARN: This is not Goto Definition, this is Goto Declaration.
-- For example, in C this would take you to the header.
map("gD", vim.lsp.buf.declaration, "[G]oto [D]eclaration")
map("<leader>th", function() map("<leader>th", function()
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({ bufnr = event.buf })) vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({ bufnr = event.buf }))
end, "[T]oggle Inlay [H]ints") end, "[T]oggle Inlay [H]ints")

View File

@@ -2,18 +2,18 @@
--$ URL: https://github.com/williamboman/mason.nvim --$ URL: https://github.com/williamboman/mason.nvim
--$ :Mason --$ :Mason
return { return {
"williamboman/mason.nvim", {
"mason-org/mason-lspconfig.nvim",
opts = {},
dependencies = {
{
"mason-org/mason.nvim",
config = function() config = function()
require("mason").setup() require("mason").setup()
vim.keymap.set("n", "<leader>xm", vim.cmd.Mason, { desc = "Mason" })
end, end,
},
opts = { "neovim/nvim-lspconfig",
ensure_installed = {
--C / C++
"clangd",
"clang-format",
"codelldb",
}, },
}, },
} }

View File

@@ -15,9 +15,34 @@ return {
require("nvim-tree").setup({ require("nvim-tree").setup({
view = { view = {
width = 32, width = 32,
relativenumber = true,
}, },
filters = {
git_ignored = false,
},
actions = {
open_file = {
quit_on_open = true,
},
},
on_attach = function(bufnr)
local api = require "nvim-tree.api"
local function opts(desc)
return { desc = "nvim-tree: " .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true }
end
-- default mappings
api.config.mappings.default_on_attach(bufnr)
-- custom mappings
vim.keymap.set('n', '<Esc>', vim.cmd.NvimTreeClose, opts('Close Explorer'))
-- vim.keymap.set('n', '<C-t>', api.tree.change_root_to_parent, opts('Up'))
vim.keymap.set('n', '?', api.tree.toggle_help, opts('Help'))
end,
}) })
vim.keymap.set("n", "<leader>e", vim.cmd.NvimTreeToggle)
vim.api.nvim_create_autocmd({"QuitPre"}, { callback = function() vim.cmd("NvimTreeClose") end, }) vim.keymap.set("n", "<leader>e", vim.cmd.NvimTreeToggle, { desc = "Explorer" })
vim.api.nvim_create_autocmd({ "QuitPre" }, { callback = function() vim.cmd("NvimTreeClose") end, })
end, end,
} }

View File

@@ -0,0 +1,9 @@
-- NOTE: This plugin activly shows the result of your markdown while you're typing it
-- URL: https://https://github.com/MeanderingProgrammer/render-markdown.nvim
return {
'MeanderingProgrammer/render-markdown.nvim',
-- dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.nvim' }, -- if you use the mini.nvim suite
-- dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.icons' }, -- if you use standalone mini plugins
dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons
opts = {},
}

View File

@@ -10,20 +10,24 @@ return {
require('telescope').setup() require('telescope').setup()
local builtin = require('telescope.builtin') local builtin = require('telescope.builtin')
vim.keymap.set('n', '<leader>pf', builtin.find_files, {}) local wk = require("which-key")
vim.keymap.set('n', '<leader>pg', builtin.git_files, {}) wk.add({
vim.keymap.set('n', '<leader>pws', function() { "<leader>p", group = "Project" },
})
vim.keymap.set('n', '<leader>pf', builtin.find_files, { desc = "Find file" })
vim.keymap.set('n', '<leader>pg', builtin.git_files, { desc = "Git files" })
vim.keymap.set('n', '<leader>pw', function()
local word = vim.fn.expand("<cword>") local word = vim.fn.expand("<cword>")
builtin.grep_string({ search = word }) builtin.grep_string({ search = word })
end) end, { desc = "Grep word search" })
vim.keymap.set('n', '<leader>pWs', function() vim.keymap.set('n', '<leader>pW', function()
local word = vim.fn.expand("<cWORD>") local word = vim.fn.expand("<cWORD>")
builtin.grep_string({ search = word }) builtin.grep_string({ search = word })
end) end, { desc = "Grep WORD search" })
vim.keymap.set('n', '<leader>ps', function() vim.keymap.set('n', '<leader>ps', function()
builtin.grep_string({ search = vim.fn.input("Grep > ") }) builtin.grep_string({ search = vim.fn.input("Grep > ") })
end) end, { desc = "Grep string search" })
vim.keymap.set('n', '<leader>vh', builtin.help_tags, {desc = "Search [H]elp"}) vim.keymap.set('n', '<leader>vh', builtin.help_tags, { desc = "Search [H]elp" })
vim.keymap.set('n', '<leader>vk', builtin.keymaps, {desc = "Search [K]eymaps"}) vim.keymap.set('n', '<leader>vk', builtin.keymaps, { desc = "Search [K]eymaps" })
end end
} }

View File

@@ -1,7 +1,7 @@
--$ adds a toggelable terminal --$ adds a toggelable terminal
--$ URL: https://github.com/akinsho/toggleterm.nvim --$ URL: https://github.com/akinsho/toggleterm.nvim
--$ :help toggleterm --$ :help toggleterm
return{ return {
'akinsho/toggleterm.nvim', 'akinsho/toggleterm.nvim',
version = "*", version = "*",
@@ -16,7 +16,7 @@ return{
return 20 return 20
end, end,
}) })
vim.keymap.set('n', '<leader>t', ":ToggleTerm name=BottomTerm<cr>") vim.keymap.set('n', '<leader>`', ":ToggleTerm name=BottomTerm<cr>", { desc = "ToggleTerm" })
--vim.keymap.set('n', '<leader>tv', ":ToggleTerm direction=vertical name=VerticalTerm<cr>") --vim.keymap.set('n', '<leader>tv', ":ToggleTerm direction=vertical name=VerticalTerm<cr>")
--vim.keymap.set('n', '<leader>tf', ":ToggleTerm direction=float name=FloatTerm<cr>") --vim.keymap.set('n', '<leader>tf', ":ToggleTerm direction=float name=FloatTerm<cr>")
end, end,

View File

@@ -0,0 +1,39 @@
--$ URL: https://github.com/folke/trouble.nvim
--# :help trouble
return {
"folke/trouble.nvim",
opts = {}, -- for default options, refer to the configuration section for custom setup.
cmd = "Trouble",
keys = {
{
"<leader>tx",
"<cmd>Trouble diagnostics toggle<cr>",
desc = "Diagnostics (Trouble)",
},
{
"<leader>tq",
"<cmd>Trouble diagnostics toggle filter.buf=0<cr>",
desc = "Buffer Diagnostics (Trouble)",
},
{
"<leader>ts",
"<cmd>Trouble symbols toggle focus=false<cr>",
desc = "Symbols (Trouble)",
},
{
"<leader>tl",
"<cmd>Trouble lsp toggle focus=false win.position=right<cr>",
desc = "LSP Definitions / references / ... (Trouble)",
},
{
"<leader>tL",
"<cmd>Trouble loclist toggle<cr>",
desc = "Location List (Trouble)",
},
{
"<leader>tq",
"<cmd>Trouble qflist toggle<cr>",
desc = "Quickfix List (Trouble)",
},
},
}

View File

@@ -21,33 +21,18 @@ return {
--# Structure of my standard keys --# Structure of my standard keys
local wk = require("which-key") local wk = require("which-key")
wk.add({ wk.add({
{"<leader>w", desc = "Write"}, { "<leader>b", group = "Buffers" },
{"<leader>q", desc = "Quit"}, { "<leader>t", group = "Trouble" },
{"<leader>e", desc = "Explore"}, { "<leader>v", group = "Vim" },
{"<leader><TAB>", desc = "Switch window"}, { "<leader>l", group = "LSP" },
{"<leader>n", desc = "Next buffer"}, { "<leader>x", group = "Plugins" },
{"<leader>b", group = "Buffers"}, -- group { "<leader>xl", vim.cmd.Lazy, desc = "Lazy" },
{"<leader>bn", desc = "Next buffer"}, { "<leader>xw", vim.cmd.WhichKey, desc = "Which-key" },
{"<leader>bp", desc = "Pervious buffer"}, { "<leader>w", function()
{"<leader>bb", desc = "Pervious buffer"}, wk.show({ keys = "<c-w>" })
{"<leader>bl", desc = "Buffer list"}, end,
{"<leader>bc", desc = "Close buffer"}, desc = "Windows"
{"<leader>t", group = "Terminal"}, },
{"<leader>tt", desc = "Bottom Terminal"},
{"<leader>tv", desc = "Vertical Terminal"},
{"<leader>tf", desc = "Floating Terminal"},
{"<leader>p", group = "Project"},
{"<leader>pf", desc = "Find file"},
{"<leader>pg", desc = "Git files"},
{"<leader>ps", desc = "Grep string search"},
{"<leader>pw", desc = "Grep word search"},
{"<leader>pW", desc = "Grep WORD search"},
{"<leader>v", group = "Vim"},
{"<leader>vh", desc = "Help search" },
{"<leader>vm", "<Cmd>marks<Cr>", desc = "Marks", },
{"<leader>vr", "<Cmd>registers<Cr>", desc = "Registers" },
{"<leader>h", "<Cmd>nohlsearch<Cr>", desc = "Stop Highlight" },
{"<leader>l", group = "LSP"},
}) })
end, end,
} }

View File

@@ -3,22 +3,26 @@
vim.g.mapleader = " " vim.g.mapleader = " "
vim.g.maplocalleader = "\\" vim.g.maplocalleader = "\\"
vim.keymap.set("n", "<leader>w", vim.cmd.w) vim.keymap.set("n", "<leader>bn", vim.cmd.bnext, { desc = "Next buffer" })
vim.keymap.set("n", "<leader>q", vim.cmd.q) vim.keymap.set("n", "<leader>n", vim.cmd.bnext, { desc = "Next buffer" })
vim.keymap.set("n", "<leader>bn", vim.cmd.bnext) vim.keymap.set("n", "<leader>bw", vim.cmd.w, { desc = "Write buffer" })
vim.keymap.set("n", "<leader>n", vim.cmd.bnext) vim.keymap.set("n", "<leader>bp", vim.cmd.bprevious, { desc = "Previous buffer" })
vim.keymap.set("n", "<leader>bp", vim.cmd.bprevious) vim.keymap.set("n", "<leader>bb", vim.cmd.bprevious, { desc = "Previous buffer" })
vim.keymap.set("n", "<leader>bb", vim.cmd.bprevious) vim.keymap.set("n", "<leader>bl", vim.cmd.buffers, { desc = "List buffers" })
vim.keymap.set("n", "<leader>bl", vim.cmd.buffers) vim.keymap.set("n", "<leader>bc", vim.cmd.bdelete, { desc = "Close buffer" })
vim.keymap.set("n", "<leader>bc", vim.cmd.bdelete) vim.keymap.set("n", "<leader>e", vim.cmd.Ex, { desc = "Explore" })
vim.keymap.set("n", "<leader>e", vim.cmd.Ex) vim.keymap.set("n", "<leader>vq", vim.cmd.qall, { desc = "Quit vim" })
vim.keymap.set("n", "<leader><TAB>", [[<C-w>w]]) vim.keymap.set("n", "<leader>vm", "<Cmd>marks<Cr>", {desc = "Marks"})
vim.keymap.set("n", "<leader>vm", "<Cmd>marks<Cr>") vim.keymap.set("n", "<leader>vr", "<Cmd>registers<Cr>", {desc = "Registers"})
vim.keymap.set("n", "<leader>vr", "<Cmd>registers<Cr>") vim.keymap.set("n", "<leader>h", "<Cmd>nohlsearch<Cr>", {desc = "Stop Highlight"})
vim.keymap.set("n", "<leader>h", "<Cmd>nohlsearch<Cr>") vim.keymap.set("n", "<leader><TAB>", [[<C-w>w]], { desc = "Next Window" })
-- vim.keymap.set("n", "<leader>wh", [[<C-w>h]], { desc = "Window left" })
-- vim.keymap.set("n", "<leader>wl", [[<C-w>l]], { desc = "Window right" })
-- vim.keymap.set("n", "<leader>wj", [[<C-w>j]], { desc = "Window down" })
-- vim.keymap.set("n", "<leader>wk", [[<C-w>k]], { desc = "Window up" })
--"$ map exit terminal mode to Escape --"$ map exit terminal mode to Escape
vim.keymap.set("t", "<Esc>", [[<C-\><C-n>]]) vim.keymap.set("t", "<Esc>", [[<C-\><C-n>]], { desc = "Escape terminal" })
--"$ normal mappings --"$ normal mappings
--"$ up/down half a page centered --"$ up/down half a page centered
@@ -27,7 +31,12 @@ vim.keymap.set("n", "<C-u>", [[<C-u>zz]])
--nnoremap <C-d> <C-d>zz --nnoremap <C-d> <C-d>zz
--nnoremap <C-u> <C-u>zz --nnoremap <C-u> <C-u>zz
--"$centered next/prev find --"$centered next/prev find
vim.keymap.set("n", "n", [[nzzv]]) vim.keymap.set("n", "n", [[nzz]])
vim.keymap.set("n", "N", [[Nzzv]]) vim.keymap.set("n", "N", [[Nzz]])
--nnoremap n nzzzv --nnoremap n nzzzv
--nnoremap N Nzzzv --nnoremap N Nzzzv
vim.keymap.set({ "n", "x", "c", "v" }, "<C-S-C>", '"+y', { desc = "Copy system clipboard" }) -- ctrl+shift+c
vim.keymap.set({ "i", "c" }, "<C-S-V>", '<C-R>+', { desc = "Paste system clipboard" }) -- ctrl+shift+v
vim.keymap.set({ "n", "x" }, "<C-S-V>", '"+P', { desc = "Paste system clipboard" }) -- ctrl+shift+v
vim.keymap.set({ "i", "n", "x", "c", "v" }, "<C-S>", vim.cmd.w) -- save=crtl+s

View File

@@ -1,6 +1,6 @@
vim.g.have_nerd_font = true -- use nerd_font vim.g.have_nerd_font = true -- use nerd_font
vim.opt.clipboard = 'unnamedplus' -- use system keyboard for yank vim.opt.clipboard = "unnamedplus" -- use system keyboard for yank
vim.opt.nu = true -- set line numbers vim.opt.nu = true -- set line numbers
vim.opt.relativenumber = true -- use relative line numbers vim.opt.relativenumber = true -- use relative line numbers
@@ -17,8 +17,20 @@ vim.opt.wrap = false
--vim.opt.colorcolumn= 110 --vim.opt.colorcolumn= 110
vim.api.nvim_set_option_value("colorcolumn", "110", {}) vim.api.nvim_set_option_value("colorcolumn", "110", {})
vim.opt.confirm = true vim.opt.confirm = true -- confirm on quit with unsave changes
vim.opt.hlsearch = true vim.opt.hlsearch = true -- highlight search
vim.opt.incsearch = true -- incremental search vim.opt.incsearch = true -- incremental search
vim.opt.termguicolors = true vim.opt.termguicolors = true
--set shell=/usr/bin/zsh
vim.opt.shell='/usr/bin/zsh'
-- Sets colors to line numbers Above, Current and Below in this order
function LineNumberColors()
vim.api.nvim_set_hl(0, "LineNrAbove", { fg = "#51B3EC", bold = false })
vim.api.nvim_set_hl(0, "LineNr", { fg = white, bold = true })
vim.api.nvim_set_hl(0, "LineNrBelow", { fg = "#FB508F", bold = false })
end
LineNumberColors()

View File

@@ -6,6 +6,8 @@ help : print-help
print-help : print-help :
@echo -e "Help!?!?" @echo -e "Help!?!?"
@echo -e "Use 'make instal' to instal this config to your home config" @echo -e "Use 'make instal' to instal this config to your home config"
@echo -e "Use 'make instal-optionals' to instal additional interesting packages: nvim, neovide, wl-clipboard"
@echo -e "Use 'make instal-zsh-optionals' to instal additional interesting packages: zsh, easy-zsh-config, oh-my-posh"
@echo -e "Use 'make code' to get code from your config to this project" @echo -e "Use 'make code' to get code from your config to this project"
@echo -e "ConfigPath=$(NVIM_CONFIG)" @echo -e "ConfigPath=$(NVIM_CONFIG)"
@@ -14,6 +16,17 @@ instal :
cp ./*.lua $(NVIM_CONFIG) cp ./*.lua $(NVIM_CONFIG)
cp -r ./lua $(NVIM_CONFIG) cp -r ./lua $(NVIM_CONFIG)
instal-optionals :
sudo pacman -S --needed vim nvim tree
sudo pacman -S --needed wl-clipboard #Use clipboard in wayland
# sudo pacman -S --needed xsel #Use clipboard in X11
sudo pacman -S --needed neovide #Neovim in graphical enviorment
instal-zsh-optionals :
sudo pacman -S --needed zsh #zsh shell environment
yay -S --needed easy-zsh-config #zsh suggestion/command-completion and syntax higlighting
yay -S --needed oh-my-posh #zsh theme provider
code : code :
@echo -e "Getting code from $(NVIM_CONFIG)" @echo -e "Getting code from $(NVIM_CONFIG)"
cp $(NVIM_CONFIG)*.lua ./ cp $(NVIM_CONFIG)*.lua ./