Compare commits

...
Sign in to create a new pull request.

83 commits
legacy ... main

Author SHA1 Message Date
a8051a5cca enable netrw, disable easy window switching, enable fast quickfix- and locationlist movement, autocentering on jumping and searching 2025-07-12 16:12:51 +02:00
d5cb6213a1 fix completion in cmdline 2025-07-08 19:16:06 +02:00
4d56f6f21c make more plugins lazy for faster startup time 2025-07-05 15:10:10 +02:00
395e625bf0 remove commenting plugin, replaced by buildin functions 2025-07-05 14:42:45 +02:00
939e6c2b35 fix completion in cmdline 2025-07-02 21:27:19 +02:00
42d0945517 fix border, obsidian completion and deprecated plugin leftovers 2025-07-01 22:05:24 +02:00
091a472949 change nvim-cmp to blink.cmp 2025-06-29 13:51:25 +02:00
cf67d20daa improve substitution remap 2025-06-27 08:05:20 +02:00
d8d510b0d1 fix substitution remap 2025-06-27 08:02:01 +02:00
42fa80c26b add substitution remap 2025-06-27 08:00:17 +02:00
3b0ce927ab better markdown rendering in lsp-popup, change cursor 2025-06-22 22:27:59 +02:00
c815f1f513 cleanup and remove unused plugins 2025-06-22 21:37:43 +02:00
a98c41f65b disable markdown-rendering for nofile (hoverdoc) 2025-06-16 10:47:22 +02:00
6e884786ed add dap plugin, remove old keymaps 2025-06-16 08:41:20 +02:00
9379ce6b40 add missing '<cr>' 2025-06-06 11:58:18 +02:00
583ab49953 add todo mapping and obsidian search 2025-06-06 11:55:59 +02:00
bf207d7659 enable markdown highlighting 2025-06-06 07:42:26 +02:00
44dbe8a14b fix obsidian mapping 2025-06-04 13:53:27 +02:00
d6e8537105 update markdown rendering 2025-06-04 11:43:08 +02:00
cd0a2d4c3e add markdown rendering 2025-06-04 11:39:10 +02:00
6fe483f173 update obsidian config 2025-06-03 16:10:12 +02:00
dc7663d101 update obsidian config 2025-06-03 16:01:03 +02:00
d962226a0d update obsidian config 2025-06-03 15:41:07 +02:00
b6f5af87e7 update obsidian config 2025-06-01 22:51:08 +02:00
a440c30e2e initial setup of obsidian plugin 2025-06-01 00:52:26 +02:00
2e2e6751fc add obsidian plugin for notetaking 2025-05-31 16:49:26 +02:00
8d0cb98beb update readme 2025-05-31 15:40:10 +02:00
96540f20ba fix lsp capabilities 2025-05-31 14:59:40 +02:00
d990179adf fix signature hover in lsp 2025-03-15 19:34:37 +01:00
0b6e5cc893 fix clangd special handling in lsp 2025-03-15 19:31:06 +01:00
55361c475d add mapping for vertical-resize 2025-03-14 22:53:42 +01:00
adf806489e add mason-null-ls for convinience 2025-03-14 22:43:59 +01:00
7d89c19403 add mapping for editing 2025-03-11 19:53:04 +01:00
ab319539fd fix new mappings 2025-03-06 20:42:15 +01:00
17d733cc09 enable wrap 2025-03-04 11:04:58 +01:00
c633ecd917 more quitting aliases 2025-03-02 20:59:41 +01:00
f5b49f75af add missing <cr> 2025-03-02 20:56:34 +01:00
6be73d9a95 add better mappings for pasting & quitting, removed old mappings 2025-03-02 20:55:04 +01:00
36aa117fbf remove obsolete mappings, add mappings for staging and unstaging of seletcd hunks 2025-03-02 16:46:34 +01:00
46e71b2461 remove fugitive 2025-03-02 16:32:48 +01:00
a5fe01560a fugitive: add mapping for Git cmd 2025-03-02 16:22:03 +01:00
711138561f add fugitive 2025-03-02 16:01:53 +01:00
cfad61efe2 set tabwidth 2025-02-28 21:26:18 +01:00
c371ab161e fix null-ls cppcheck, add buffermappings, better window highlighting 2025-02-27 19:24:02 +01:00
6458c24d8a add sources to null-ls 2025-02-23 22:30:52 +01:00
bdf75e4c1d add lsp and snippets back 2025-02-23 22:11:28 +01:00
49c040e36e update lsp, keymaps, format and some other settings 2025-02-23 19:36:05 +01:00
c8a9410ad7 lsp: update mason path-loading, zen: update window-width 2024-12-25 23:31:23 +01:00
d5009afeff add marks plugin and broader signcolumn 2024-11-20 19:30:58 +01:00
6e5fa5adb9 update cursorline and fix keymap 2024-10-26 22:26:32 +02:00
e5664d42ed remove noice 2024-10-02 13:26:02 +02:00
112f2646f5 update telescope picker views 2024-09-29 17:49:59 +02:00
6a4b41828c minor fixes 2024-09-29 17:40:56 +02:00
8e6acc1a53 add noice as ui-component | add more mappings for harpoon 2024-09-27 23:00:03 +02:00
f742c60750 add mappings for redo and pasting to bin 2024-08-31 21:05:35 +02:00
be5aaacc14 add bin plugin 2024-08-31 18:45:08 +02:00
4bf1e1caae add comments, set width of Filetree and remove fugitive 2024-08-31 18:38:54 +02:00
4aaf17eddf add treesitterr-textobjects plugin 2024-07-26 14:30:59 +02:00
69b19abf8e add surround plugin 2024-07-25 08:22:07 +02:00
6407a15cfd change <leader>/ to telescopes "current buffer fuzzy find" 2024-07-02 21:34:07 +02:00
3ddbd43536 update shortcut for nvimtree 2024-06-20 20:59:36 +02:00
87ce55295b add nvimtree 2024-06-19 07:40:38 +02:00
33f4ce88ef update neovim 2024-06-17 21:39:46 +02:00
1d55d0ec6f update neovim 2024-06-17 21:38:20 +02:00
33c23c282c update trouble after rework 2024-06-17 21:12:05 +02:00
83b15578f1 remove deprecated sign-set func 2024-05-27 12:07:46 +02:00
c87fee0ef6 remove title from floating windows in lspsaga 2024-05-24 21:19:37 +02:00
ff684aba94 updates cursorlinecolor and fixes harpoon 2024-04-08 20:01:42 +02:00
0b08c6a201 update colorline 2024-03-21 21:18:49 +01:00
080b90f430 disable intro message 2024-02-29 21:11:28 +01:00
376fb5df91 general updates to config, minor fixes 2024-02-29 20:33:48 +01:00
68796d499e restucture lsp-setup 2024-01-30 21:30:20 +01:00
14c8746a1f adds lspsaga 2024-01-29 23:04:43 +01:00
3d7e4b5e48 adds zenmode 2024-01-20 21:24:39 +01:00
e11096c071 adds trouble.nvim plugin 2024-01-20 13:31:34 +01:00
5af5240814 adds harpoon plugin 2024-01-02 08:05:14 +01:00
b95c8cf161 removes confusing keymap 2023-12-24 01:04:45 +01:00
1099c2772d updates plugins 2023-12-24 01:00:01 +01:00
007ba4db83 fix broken icon 2023-12-17 13:59:08 +01:00
b21a66b538 changes colors and icons back to working state 2023-12-10 20:01:00 +01:00
7e5c846bc4 fixes description in telescope 2023-12-10 19:31:07 +01:00
db85bcfc33 updates colorscheme settings 2023-12-10 19:28:05 +01:00
7fd18eeda9 updates default colorscheme to everforest 2023-12-10 16:57:09 +01:00
37 changed files with 1172 additions and 801 deletions

1
ftplugin/c.lua Normal file
View file

@ -0,0 +1 @@
vim.opt.colorcolumn = "81"

1
ftplugin/markdown.lua Normal file
View file

@ -0,0 +1 @@
vim.opt.conceallevel = 1

View file

@ -1,3 +1,4 @@
setlocal tabstop = 4
setlocal softtabstop = 4
setlocal shiftwidth = 4
vim.opt.colorcolumn="80"

View file

@ -5,6 +5,7 @@ vim.api.nvim_buf_set_keymap(0, "i", "<F5>", "<esc> :exec 'w' <bar> :exec '!xelat
vim.api.nvim_buf_set_keymap(0, "v", "<F5>", "<esc> :exec 'w' <bar> :exec '!xelatex %'<cr>", {})
-- Open PDF-Viewer from LaTeX-file
vim.api.nvim_buf_set_keymap(0, "n", "<leader>cz", ":silent !zathura --fork %:r.pdf& <cr>", {})
vim.api.nvim_buf_set_keymap(0, "n", "<F6>", ":silent !zathura --fork %:r.pdf& <cr>", {})
vim.api.nvim_buf_set_keymap(0, "i", "<F6>", "<esc> :silent !zathura --fork %:r.pdf& <cr>", {})
vim.api.nvim_buf_set_keymap(0, "v", "<F6>", "<esc> :silent !zathura --fork %:r.pdf& <cr>", {})

View file

@ -22,8 +22,9 @@ require("lazy").setup({
border = "rounded",
},
install = {
colorscheme = { "gruvbox-material" }
colorscheme = { "everforest" }
},
change_detection = { notify = false }
})

View file

@ -2,12 +2,69 @@
-- Disable autocommenting on new lines under commented ones
vim.api.nvim_create_autocmd("Filetype", {
pattern = "*",
command = "setlocal formatoptions-=c formatoptions-=r formatoptions-=o"
local augroup = vim.api.nvim_create_augroup
local autocmd = vim.api.nvim_create_autocmd
local custom_augroup = augroup('custom_augroup', {})
autocmd("Filetype", {
pattern = "*",
command = "setlocal formatoptions-=c formatoptions-=r formatoptions-=o"
})
vim.api.nvim_create_autocmd("FocusLost", {
pattern = "*",
command = ":wa"
-- persistent folds
autocmd({ "BufWinLeave" }, {
group = custom_augroup,
pattern = { "*.*" },
desc = "save view (folds), when closing file",
command = "mkview",
})
autocmd({ "BufWinEnter" }, {
group = custom_augroup,
pattern = { "*.*" },
desc = "load view (folds), when opening file",
command = "silent! loadview"
})
autocmd("WinEnter", {
group = custom_augroup,
callback = function()
vim.wo.cursorline = true
end,
})
autocmd("WinLeave", {
group = custom_augroup,
callback = function()
vim.wo.cursorline = false
end,
})
-- remove trailing whitespace
autocmd({"BufWritePre"}, {
group = custom_augroup,
pattern = "*",
command = [[%s/\s\+$//e]],
})
autocmd("LspAttach", {
group = custom_augroup,
callback = function(e)
-- keymaps --
local opts = { buffer = e.buf }
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts)
vim.keymap.set('n', 'K', function() vim.lsp.buf.hover { border = "rounded" } end, opts)
vim.keymap.set('n', '<space>cl', "<cmd>LspInfo<cr>", opts)
vim.keymap.set('n', '<space>cd', vim.diagnostic.open_float, opts)
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts)
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts)
vim.keymap.set('n', '<space>gr', vim.lsp.buf.references, opts)
vim.keymap.set('n', '<space>cf', function() vim.lsp.buf.format { async = true } end, opts)
vim.keymap.set('v', '<space>cf', function() vim.lsp.buf.format { async = true } end, opts)
vim.keymap.set("n", "<leader>ws", function() vim.lsp.buf.workspace_symbol() end, opts)
vim.keymap.set("i", "<C-s>", function() vim.lsp.buf.signature_help { border = "rounded" } end, opts)
vim.keymap.set('n', '<space>ca', vim.lsp.buf.code_action, opts)
vim.keymap.set("n", "<leader>cw", function() vim.lsp.buf.rename() end, opts)
end,
})

View file

@ -10,18 +10,17 @@ vim.api.nvim_set_keymap("c", "<C-l>", "<Right>", {})
vim.api.nvim_set_keymap("c", "<C-j>", "<Down>", {})
vim.api.nvim_set_keymap("c", "<C-k>", "<Up>", {})
-- split switching
vim.api.nvim_set_keymap("n", "<C-h>", "<C-w>h", {})
vim.api.nvim_set_keymap("n", "<C-j>", "<C-w>j", {})
vim.api.nvim_set_keymap("n", "<C-k>", "<C-w>k", {})
vim.api.nvim_set_keymap("n", "<C-l>", "<C-w>l", {})
-- buffer operations
vim.api.nvim_set_keymap("n", "<leader><tab>", "<C-^>", {})
vim.api.nvim_set_keymap("n", "<leader>on", "<cmd>w <bar> %bd <bar> e#<cr>", {})
vim.api.nvim_set_keymap("n", "<leader>bd", "<cmd>bd<cr>", {})
vim.api.nvim_set_keymap("n", "<S-h>", "<cmd>bprevious<cr>", {})
vim.api.nvim_set_keymap("n", "<S-l>", "<cmd>bnext<cr>", {})
vim.api.nvim_set_keymap("n", "<leader>bn", "<cmd>bnext<cr>", {})
vim.api.nvim_set_keymap("n", "<leader>bp", "<cmd>bprevious<cr>", {})
-- quickfix operations
vim.api.nvim_set_keymap("n", "<leader>qc", "<cmd>ccl<cr>", {})
vim.api.nvim_set_keymap("n", "<leader>qw", "<cmd>cw<cr>", {})
vim.api.nvim_set_keymap("n", "<leader>cn", "<cmd>cnext<cr>", {})
vim.api.nvim_set_keymap("n", "<leader>cp", "<cmd>cprev<cr>", {})
-- moving visual blocks
vim.api.nvim_set_keymap("v", "J", ":m '>+1<cr>gv=gv", {})
@ -31,21 +30,59 @@ vim.api.nvim_set_keymap("v", "K", ":m '<-2<cr>gv=gv", {})
vim.api.nvim_set_keymap("n", "<leader>d", "\"_d", {})
vim.api.nvim_set_keymap("v", "<leader>d", "\"_d", {})
-- paste without yanking selected text
vim.api.nvim_set_keymap("x", "<leader>p", [["_dP]], {})
-- copy to system clipboard
vim.api.nvim_set_keymap("n", "<leader>y", "\"+y", {})
vim.api.nvim_set_keymap("v", "<leader>y", "\"+y", {})
vim.api.nvim_set_keymap("n", "<leader>Y", "\"+Y", {})
-- paste from system clipboard
vim.api.nvim_set_keymap("n", "<leader>p", "\"+p", {})
vim.api.nvim_set_keymap("n", "<leader>P", "\"+p", {})
-- opening explorer
vim.api.nvim_set_keymap("n", "<leader>E", ":20Lexplore<cr>", {})
-- <leader><leader> for fast save
vim.api.nvim_set_keymap("n", "<leader><leader>", ":exec 'w'<cr>", {silent = true})
-- make current file (un)executable
vim.api.nvim_set_keymap("n", "<leader>mx", ":exec 'w'<cr> <bar> <cmd>!chmod +x %<cr>", { silent = true })
vim.api.nvim_set_keymap("n", "<leader>mX", ":exec 'w'<cr> <bar> <cmd>!chmod -x %<cr>", { silent = true })
-- <leader>r for redo
vim.api.nvim_set_keymap("n", "<leader>r", ":redo <cr>", {silent = true})
-- mk- and loadview for view-persistance
vim.api.nvim_set_keymap("n", "<leader>vm", ":exec 'w'<cr> <bar> <cmd>mkview <cr>", {silent = true})
vim.api.nvim_set_keymap("n", "<leader>vl", ":exec 'w'<cr> <bar> <cmd>loadview <cr>", {silent = true})
-- better ZQ
vim.api.nvim_set_keymap("n", "zq", ":q!<cr>", {})
-- even better
vim.api.nvim_set_keymap("n", "<leader>XX", ":qa!<cr>", {})
vim.api.nvim_set_keymap("n", "<leader>XZZ", ":wqa!<cr>", {})
vim.api.nvim_set_keymap("n", "<leader>x", ":q<cr>", {})
-- faster substitution
vim.api.nvim_set_keymap("n", "<leader>s", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]], {})
-- single line
vim.api.nvim_set_keymap("n", "<leader>S", [[:s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]], {})
-- selection mode
vim.api.nvim_set_keymap("v", "<leader>s", [[:s//gI<Left><Left><Left>]], {})
-- vertical resize
vim.api.nvim_set_keymap("n", "<leader>vr", ":vertical-resize ", {})
vim.cmd([[
function! CenterPane()
lefta vnew
wincmd w
exec 'vertical resize '. string(&columns * 0.75)
endfunction
]])
vim.api.nvim_set_keymap("n", "<leader>C", ":call CenterPane()<cr>", {})
vim.api.nvim_set_keymap("n", "<leader>j", "<cmd>lnext<CR>zz", {})
vim.api.nvim_set_keymap("n", "<leader>k", "<cmd>lprev<CR>zz", {})
vim.api.nvim_set_keymap("n", "<C-j>", "<cmd>cnext<CR>zz", {})
vim.api.nvim_set_keymap("n", "<C-k>", "<cmd>cprev<CR>zz", {})
vim.api.nvim_set_keymap("n", "<C-d>", "<C-d>zz", {})
vim.api.nvim_set_keymap("n", "<C-u>", "<C-u>zz", {})
vim.api.nvim_set_keymap("n", "n", "nzzzv", {})
vim.api.nvim_set_keymap("n", "N", "Nzzzv", {})
vim.api.nvim_set_keymap("n", "<leader>E", "<cmd>Ex<cr>", {})

View file

@ -1,7 +1,8 @@
-- Settings
-- cursor
vim.api.nvim_set_option("guicursor","n-v-c-sm:hor20-Cursor,i-ci-ve:ver80-iCursor,r-cr-o:hor40,a:blinkwait700-blinkoff400-blinkon250")
-- cursor
-- vim.api.nvim_set_option("guicursor","n-v-c-sm:hor100-Cursor,i-ci-ve:ver100-iCursor,r-cr-o:hor40,a:blinkwait700-blinkoff400-blinkon250")
vim.api.nvim_set_option("guicursor", "n:block-blinkon500-blinkoff500,o:block,i-ci:ver40-blinkon500-blinkoff500,sm-c-cr-v-ve:hor40-blinkon500-blinkoff500,t:block-blinkon500-blinkoff500-TermCursor")
-- disable mouse
vim.api.nvim_set_option("mouse","")
@ -22,7 +23,13 @@ vim.opt.shiftwidth = 2
vim.opt.expandtab = true
-- enable foldcolumn
vim.wo.foldcolumn = "2"
vim.wo.foldcolumn = "auto:7"
-- enable wrap
vim.opt.wrap = true
-- allow "@" in filenames
vim.opt.isfname:append("@-@")
-- smart indenting by vim
vim.api.nvim_set_option("smartindent",true)
@ -39,7 +46,7 @@ vim.api.nvim_set_option("background", "dark")
-- always center
-- vim.api.nvim_set_option("scrolloff",999)
vim.api.nvim_set_option("scrolloff",15)
vim.opt.scrolloff = 10
-- spellchecking
vim.wo.spell = true
@ -49,15 +56,25 @@ vim.bo.spelllang = "de"
vim.wo.cursorline = true
vim.wo.cursorlineopt = "both"
-- splitting below and right
-- splitting below and right
vim.api.nvim_set_option("splitbelow",true)
vim.api.nvim_set_option("splitright",true)
-- disable Netrw-Banner
vim.g.netrw_banner = 0
-- vim.g.netrw_banner = 0
-- vim.g.netrw_browse_split = 0
vim.g.netrw_winsize = 25
-- undotree file management
vim.opt.swapfile = false
vim.opt.backup = false
vim.opt.undodir = os.getenv("HOME") .. "/.local/share/nvim/undodir"
vim.opt.undofile = true
-- message options
vim.opt.shortmess = "aItTF"
-- hide buffers instead of closing
vim.opt.hidden = true
vim.opt.updatetime = 50

View file

@ -1,7 +1,7 @@
-- statusline
vim.api.nvim_set_option("laststatus", 2)
vim.api.nvim_set_option("laststatus", 3)
vim.api.nvim_set_option("statusline", " ")
-- tabline
-- always show tabline (0 = never, 1 = only with at least 2 tabs, 2 = always) and colors
vim.api.nvim_set_option("showtabline", 2)
vim.api.nvim_set_option("showtabline", 1)

View file

@ -1,27 +0,0 @@
return {
{
"akinsho/bufferline.nvim",
config = function()
require("bufferline").setup({
options = {
offsets = {
{
filetype = "netrw",
text = "File Explorer",
highlight = "Directory",
text_align = 'center',
separator = true
}
},
show_buffer_close_icons = false,
},
highlights = {
buffer_selected = {
fg = "#d8a657",
bg = "#141617",
},
},
})
end,
}
}

161
lua/plugin/cmp.lua Normal file
View file

@ -0,0 +1,161 @@
return {
"saghen/blink.cmp",
build = 'cargo +nightly build --release',
dependencies = {
{ "L3MON4D3/LuaSnip", version = "v2.*" }
},
lazy = true,
opts = {
snippets = { preset = 'luasnip' },
sources = {
default = { 'buffer', 'lsp', 'path', 'snippets' },
},
fuzzy = { implementation = 'prefer_rust' },
appearance = {
nerd_font_variant = 'mono',
kind_icons = {
Text = "",
Method = "󰆧",
Function = "󰊕",
Constructor = "",
Field = "󰇽",
Variable = "󰂡",
Class = "󰠱",
Interface = "",
Module = "",
Property = "󰜢",
Unit = "",
Value = "󰎠",
Enum = "",
Keyword = "󰌋",
Snippet = "",
Color = "󰏘",
File = "󰈙",
Reference = "",
Folder = "󰉋",
EnumMember = "",
Constant = "󰏿",
Struct = "",
Event = "",
Operator = "󰆕",
TypeParameter = "󰅲"
}
},
completion = {
keyword = {
range = 'full'
},
ghost_text = {
enabled = true
},
menu = {
border = 'rounded',
winhighlight = 'Normal:NormalFloat,FloatBorder:FloatBorder,CursorLine:CursorLine,Search:None',
min_width = 40,
max_height = 25,
draw = {
columns = { { 'label', 'label_description', gap = 1 }, { 'kind_icon', 'kind', gap = 1 } },
components = {
label = {
highlight = function(ctx)
-- label and label details
local highlights = {
{ 0, #ctx.label, group = ctx.deprecated and 'DiagnosticFloatingWarn' or 'NormalFloator' },
}
if ctx.label_detail then
table.insert(highlights, { #ctx.label, #ctx.label + #ctx.label_detail, group = 'NormalFloat' })
end
return highlights
end,
},
}
}
},
documentation = {
auto_show = true,
auto_show_delay_ms = 0,
window = {
border = 'rounded',
winhighlight = 'Normal:NormalFloat,FloatBorder:FloatBorder,CursorLine:CursorLine',
}
},
},
keymap = {
['<C-n>'] = { 'hide', 'show', 'fallback' },
['<CR>'] = { 'accept', 'fallback' },
['<Tab>'] = {
function(cmp)
if cmp.snippet_active() then
return cmp.accept()
else
return cmp.select_next()
end
end,
'snippet_forward',
'fallback'
},
['<S-Tab>'] = {
function(cmp)
if cmp.snippet_active() then
return cmp.accept()
else
return cmp.select_prev()
end
end,
'snippet_backward',
'fallback'
},
['<C-k>'] = { 'select_prev', 'fallback' },
['<C-j>'] = { 'select_next', 'fallback' },
['<C-u>'] = { 'scroll_documentation_up', 'fallback' },
['<C-d>'] = { 'scroll_documentation_down', 'fallback' },
['<C-s>'] = { 'show_signature', 'hide_signature', 'fallback' },
},
signature = {
enabled = true,
window = {
border = 'rounded',
winhighlight = 'Normal:NormalFloat,FloatBorder:FloatBorder',
}
},
cmdline = {
keymap = {
preset = 'none',
['<cr>'] = { 'accept_and_enter', 'fallback' },
['Tab'] = { 'select_next'},
['<Tab>'] = { 'show_and_insert', 'select_next' },
['<S-Tab>'] = { 'show_and_insert', 'select_prev' },
['<C-n>'] = { 'hide', 'show'},
},
completion = {
menu = {
auto_show = function()
local type = vim.fn.getcmdtype()
-- Search forward and backward
if type == "/" or type == "?" then
return false
end
-- Commands
if type == ":" then
return true
end
return false
end,
}
},
sources = function()
local type = vim.fn.getcmdtype()
-- Search forward and backward
if type == "/" or type == "?" then
return { "buffer" }
end
-- Commands
if type == ":" then
return { "cmdline" }
end
return {}
end,
},
}
}

View file

@ -1,8 +0,0 @@
return {
{
"echasnovski/mini.comment",
config = function()
require("mini.comment").setup()
end,
},
}

101
lua/plugin/dap.lua Normal file
View file

@ -0,0 +1,101 @@
return {
{
"mfussenegger/nvim-dap",
lazy = true,
dependencies = {
"igorlfs/nvim-dap-view",
opts = {
windows = {
terminal = {
hide = { "c" },
start_hidden = true,
},
}
}
},
config = function()
local dap, dv = require("dap"), require("dap-view")
dap.set_log_level("DEBUG")
vim.keymap.set("n", "<Leader>Dc", dap.continue, { desc = "Debug: Continue" })
vim.keymap.set("n", "<Leader>Dsn", dap.step_over, { desc = "Debug: Step Over (Next)" })
vim.keymap.set("n", "<Leader>Dsi", dap.step_into, { desc = "Debug: Step Into" })
vim.keymap.set("n", "<Leader>Dso", dap.step_out, { desc = "Debug: Step Out" })
vim.keymap.set("n", "<Leader>B", dap.toggle_breakpoint, { desc = "Debug: Toggle Breakpoint" })
vim.keymap.set("n", "<Leader>Dv", "<cmd>DapViewToggle<cr>", { desc = "Debug: Toggle Debug View" })
dap.listeners.before.attach["dap-view-config"] = function()
dv.open()
end
dap.listeners.before.launch["dap-view-config"] = function()
dv.open()
end
dap.listeners.before.event_terminated["dap-view-config"] = function()
dv.close()
end
dap.listeners.before.event_exited["dap-view-config"] = function()
dv.close()
end
dap.adapters.gdb = {
type = "executable",
command = "gdb",
args = { "--interpreter=dap", "--eval-command", "set print pretty on" }
}
dap.configurations.c = {
{
name = "Launch",
type = "gdb",
request = "launch",
program = function()
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
end,
cwd = "${workspaceFolder}",
stopAtBeginningOfMainSubprogram = false,
},
{
name = "Select and attach to process",
type = "gdb",
request = "attach",
program = function()
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
end,
pid = function()
local name = vim.fn.input('Executable name (filter): ')
return require("dap.utils").pick_process({ filter = name })
end,
cwd = '${workspaceFolder}'
},
{
name = 'Attach to gdbserver :1234',
type = 'gdb',
request = 'attach',
target = 'localhost:1234',
program = function()
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
end,
cwd = '${workspaceFolder}'
},
}
end,
},
{
"jay-babu/mason-nvim-dap.nvim",
dependencies = {
"mfussenegger/nvim-dap",
"williamboman/mason.nvim",
},
config = function()
require('mason-nvim-dap').setup({
handlers = {
function(config)
-- all sources with no handler get passed here
-- Keep original functionality
require('mason-nvim-dap').default_setup(config)
end,
},
})
end,
}
}

View file

@ -1,7 +1,7 @@
return {
{
"sainnhe/everforest",
lazy = true,
priority = 1000,
config = function()
-- Settings for colorscheme
vim.api.nvim_set_var("everforest_background", "hard")
@ -16,8 +16,8 @@ return {
-- Settings to override colorscheme
-- vim.api.nvim_set_hl(0, "ModeMsg", { bold = true, fg = "#d8a657"})
-- colors of tabline
vim.api.nvim_set_hl(0, "TabLine", { bg = "#3c3836", fg = "#89b482" })
vim.api.nvim_set_hl(0, "TabLineFil", { bg = "#1d2021" })
vim.api.nvim_set_hl(0, "TabLine", { bg = "#272e33", fg = "#dfa000" })
vim.api.nvim_set_hl(0, "TabLineFil", { bg = "#374145" })
vim.api.nvim_set_hl(0, "TabLineSel", { bold = true, bg = "none", fg = "#d8a657" })
-- color of statusline
vim.api.nvim_set_hl(0, "StatusLine", { bold = false, bg = "#1d2021", fg = "#89b482" })
@ -25,22 +25,22 @@ return {
-- color of vertical split line
vim.api.nvim_set_hl(0, "VertSplit", { bg = "#141617", fg = "#141617" })
-- color of the cursorline and cursorlinenumber
vim.api.nvim_set_hl(0, "Cursorline", { bg = "#141617" })
vim.api.nvim_set_hl(0, "CursorLineNr", { bold = true, bg = "#141617", fg = "#d8a657" })
vim.api.nvim_set_hl(0, "Cursorline", { bg = "#3a464c" })
vim.api.nvim_set_hl(0, "CursorLineNr", { bold = true, fg = "#dbbc7f" })
-- color of Floats and FloatBorders
vim.api.nvim_set_hl(0, "NormalFloat", { bg = none, fg = none })
vim.api.nvim_set_hl(0, "FloatBorder", { bg = none, fg = "#d4be98" })
vim.api.nvim_set_hl(0, "DiagnosticFloatingWarn", { bg = none, fg = "#d8a657" })
vim.api.nvim_set_hl(0, "DiagnosticFloatingError", { bg = none, fg = "#ea6962" })
vim.api.nvim_set_hl(0, "DiagnosticFloatingHint", { bg = none, fg = "#a9b665" })
vim.api.nvim_set_hl(0, "DiagnosticFloatingInfo", { bg = none, fg = "#d4be98" })
vim.api.nvim_set_hl(0, "FloatBorder", { bg = none, fg = "#9da9a0" })
vim.api.nvim_set_hl(0, "DiagnosticFloatingWarn", { bg = none, fg = "#dfa000" })
vim.api.nvim_set_hl(0, "DiagnosticFloatingError", { bg = none, fg = "#f85552" })
vim.api.nvim_set_hl(0, "DiagnosticFloatingHint", { bg = none, fg = "#35a77c" })
vim.api.nvim_set_hl(0, "DiagnosticFloatingInfo", { bg = none, fg = "#8da101" })
-- autocommand for overrides
vim.api.nvim_create_autocmd("ColorScheme", {
pattern = "everforest",
callback = function()
vim.api.nvim_set_hl(0, "TabLine", { bg = "#3c3836", fg = "#89b482" })
vim.api.nvim_set_hl(0, "TabLineFil", { bg = "#1d2021" })
vim.api.nvim_set_hl(0, "TabLine", { bg = "#272e33", fg = "#dfa000" })
vim.api.nvim_set_hl(0, "TabLineFil", { bg = "#374145" })
vim.api.nvim_set_hl(0, "TabLineSel", { bold = true, bg = "none", fg = "#d8a657" })
-- color of statusline
vim.api.nvim_set_hl(0, "StatusLine", { bold = false, bg = "#1d2021", fg = "#89b482" })
@ -48,15 +48,15 @@ return {
-- color of vertical split line
vim.api.nvim_set_hl(0, "VertSplit", { bg = "#141617", fg = "#141617" })
-- color of the cursorline and cursorlinenumber
vim.api.nvim_set_hl(0, "Cursorline", { bg = "#141617" })
vim.api.nvim_set_hl(0, "CursorLineNr", { bold = true, bg = "#141617", fg = "#d8a657" })
vim.api.nvim_set_hl(0, "Cursorline", { bg = "#3c464c" })
vim.api.nvim_set_hl(0, "CursorLineNr", { bold = true, fg = "#dbbc7f" })
-- color of Floats and FloatBorders
vim.api.nvim_set_hl(0, "NormalFloat", { bg = none, fg = none })
vim.api.nvim_set_hl(0, "FloatBorder", { bg = none, fg = "#d4be98" })
vim.api.nvim_set_hl(0, "DiagnosticFloatingWarn", { bg = none, fg = "#d8a657" })
vim.api.nvim_set_hl(0, "DiagnosticFloatingError", { bg = none, fg = "#ea6962" })
vim.api.nvim_set_hl(0, "DiagnosticFloatingHint", { bg = none, fg = "#a9b665" })
vim.api.nvim_set_hl(0, "DiagnosticFloatingInfo", { bg = none, fg = "#d4be98" })
vim.api.nvim_set_hl(0, "FloatBorder", { bg = none, fg = "#9da9a0" })
vim.api.nvim_set_hl(0, "DiagnosticFloatingWarn", { bg = none, fg = "#dfa000" })
vim.api.nvim_set_hl(0, "DiagnosticFloatingError", { bg = none, fg = "#f85552" })
vim.api.nvim_set_hl(0, "DiagnosticFloatingHint", { bg = none, fg = "#35a77c" })
vim.api.nvim_set_hl(0, "DiagnosticFloatingInfo", { bg = none, fg = "#8da101" })
end,
})
end,

View file

@ -1,18 +0,0 @@
return {
{
'tpope/vim-fugitive',
keys = {
{ "<leader>GG", "<cmd>Git <cr>", desc = "git" },
{ "<leader>Gs", "<cmd>Git status <cr>", desc = "git status" },
{ "<leader>Gd", "<cmd>Git diff <cr>", desc = "git diff" },
{ "<leader>GD", "<cmd>Git diff --staged <cr>", desc = "git diff --staged" },
{ "<leader>Gl", "<cmd>Git log --graph <cr>", desc = "git log --graph" },
{ "<leader>Ga", "<cmd>Git add --interactive <cr>", desc = "git add" },
{ "<leader>GA", "<cmd>Git add -A <cr>", desc = "git add -A " },
{ "<leader>Gc", "<cmd>Git commit <cr>", desc = "git commit" },
{ "<leader>GC", "<cmd>Git commit --amend <cr>", desc = "git commit --amend " },
{ "<leader>Gp", "<cmd>Git push <cr>", desc = "git push" },
{ "<leader>GP", "<cmd>Git pull <cr>", desc = "git pull" },
},
}
}

View file

@ -15,35 +15,12 @@ return {
opts.buffer = bufnr
vim.keymap.set(mode, l, r, opts)
end
-- Navigation
map('n', ']c', function()
if vim.wo.diff then return ']c' end
vim.schedule(function() gs.next_hunk() end)
return '<Ignore>'
end, { expr = true })
map('n', '[c', function()
if vim.wo.diff then return '[c' end
vim.schedule(function() gs.prev_hunk() end)
return '<Ignore>'
end, { expr = true })
-- Actions
map({ 'n', 'v' }, '<leader>hs', ':Gitsigns stage_hunk<CR>')
map({ 'n', 'v' }, '<leader>hr', ':Gitsigns reset_hunk<CR>')
map('n', '<leader>hS', gs.stage_buffer)
map('n', '<leader>hu', gs.undo_stage_hunk)
map('n', '<leader>hR', gs.reset_buffer)
map('n', '<leader>hp', gs.preview_hunk)
map('n', '<leader>hb', function() gs.blame_line { full = true } end)
map('n', '<leader>tb', gs.toggle_current_line_blame)
map('n', '<leader>hd', gs.diffthis)
map('n', '<leader>hD', function() gs.diffthis('~') end)
map('n', '<leader>td', gs.toggle_deleted)
-- Text object
map({ 'o', 'x' }, 'ih', ':<C-U>Gitsigns select_hunk<CR>')
map('n', '<leader>gB', function() gs.blame_line { full = true } end)
map('n', '<leader>gb', gs.toggle_current_line_blame)
map('n', '<leader>gs', gs.stage_hunk) -- git stage this
map('v', '<leader>gs', gs.stage_hunk) -- git stage this
map('n', '<leader>gus', gs.undo_stage_hunk) -- git undo stage this
map('v', '<leader>gus', gs.undo_stage_hunk) -- git undo stage this
end
})
end,

View file

@ -1,64 +0,0 @@
return {
{
"sainnhe/gruvbox-material",
priority = 1000,
config = function()
-- Settings for colorscheme
vim.api.nvim_set_var("gruvbox_material_background", "hard")
vim.api.nvim_set_var("gruvbox_material_transparent_background", "1")
vim.api.nvim_set_var("gruvbox_material_ui_contrast", "low")
vim.api.nvim_set_var("gruvbox_material_show_eob", "0")
vim.api.nvim_set_var("gruvbox_material_enable_bold", "1")
vim.api.nvim_set_var("gruvbox_material_enable_italic", "1")
vim.api.nvim_set_var("gruvbox_material_better_performance", "1")
vim.cmd([[colo gruvbox-material]])
-- Settings to override colorscheme
-- vim.api.nvim_set_hl(0, "ModeMsg", { bold = true, fg = "#d8a657"})
-- colors of tabline
vim.api.nvim_set_hl(0, "TabLine", { bg = "#3c3836", fg = "#89b482" })
vim.api.nvim_set_hl(0, "TabLineFil", { bg = "#1d2021" })
vim.api.nvim_set_hl(0, "TabLineSel", { bold = true, bg = "none", fg = "#d8a657" })
-- color of statusline
vim.api.nvim_set_hl(0, "StatusLine", { bold = false, bg = "#1d2021", fg = "#89b482" })
vim.api.nvim_set_hl(0, "StatusLineNC", { bg = "#1d2021", fg = "#5b534d" })
-- color of vertical split line
vim.api.nvim_set_hl(0, "VertSplit", { bg = "#141617", fg = "#141617" })
-- color of the cursorline and cursorlinenumber
vim.api.nvim_set_hl(0, "Cursorline", { bg = "#141617" })
vim.api.nvim_set_hl(0, "CursorLineNr", { bold = true, bg = "#141617", fg = "#d8a657" })
-- color of Floats and FloatBorders
vim.api.nvim_set_hl(0, "NormalFloat", { bg = none, fg = none })
vim.api.nvim_set_hl(0, "FloatBorder", { bg = none, fg = "#d4be98" })
vim.api.nvim_set_hl(0, "DiagnosticFloatingWarn", { bg = none, fg = "#d8a657" })
vim.api.nvim_set_hl(0, "DiagnosticFloatingError", { bg = none, fg = "#ea6962" })
vim.api.nvim_set_hl(0, "DiagnosticFloatingHint", { bg = none, fg = "#a9b665" })
vim.api.nvim_set_hl(0, "DiagnosticFloatingInfo", { bg = none, fg = "#d4be98" })
-- autocommand for overrides
vim.api.nvim_create_autocmd("ColorScheme", {
pattern = "gruvbox-material",
callback = function()
vim.api.nvim_set_hl(0, "TabLine", { bg = "#3c3836", fg = "#89b482" })
vim.api.nvim_set_hl(0, "TabLineFil", { bg = "#1d2021" })
vim.api.nvim_set_hl(0, "TabLineSel", { bold = true, bg = "none", fg = "#d8a657" })
-- color of statusline
vim.api.nvim_set_hl(0, "StatusLine", { bold = false, bg = "#1d2021", fg = "#89b482" })
vim.api.nvim_set_hl(0, "StatusLineNC", { bg = "#1d2021", fg = "#5b534d" })
-- color of vertical split line
vim.api.nvim_set_hl(0, "VertSplit", { bg = "#141617", fg = "#141617" })
-- color of the cursorline and cursorlinenumber
vim.api.nvim_set_hl(0, "Cursorline", { bg = "#141617" })
vim.api.nvim_set_hl(0, "CursorLineNr", { bold = true, bg = "#141617", fg = "#d8a657" })
-- color of Floats and FloatBorders
vim.api.nvim_set_hl(0, "NormalFloat", { bg = none, fg = none })
vim.api.nvim_set_hl(0, "FloatBorder", { bg = none, fg = "#d4be98" })
vim.api.nvim_set_hl(0, "DiagnosticFloatingWarn", { bg = none, fg = "#d8a657" })
vim.api.nvim_set_hl(0, "DiagnosticFloatingError", { bg = none, fg = "#ea6962" })
vim.api.nvim_set_hl(0, "DiagnosticFloatingHint", { bg = none, fg = "#a9b665" })
vim.api.nvim_set_hl(0, "DiagnosticFloatingInfo", { bg = none, fg = "#d4be98" })
end,
})
end,
},
}

32
lua/plugin/harpoon.lua Normal file
View file

@ -0,0 +1,32 @@
return {
{
"ThePrimeagen/harpoon",
branch = "harpoon2",
lazy = true,
dependencies = {
"nvim-lua/plenary.nvim",
lazy = true,
},
config = function()
local harpoon = require("harpoon")
harpoon:setup()
end,
keys = {
{ "<leader>a", function() require("harpoon"):list():add() end, desc = "" },
{ "<C-e>", function() require("harpoon").ui:toggle_quick_menu(require("harpoon"):list()) end, desc = "" },
{ "<leader>n", function() require("harpoon"):list():select(1) end, desc = "" },
{ "<leader>e", function() require("harpoon"):list():select(2) end, desc = "" },
{ "<leader>i", function() require("harpoon"):list():select(3) end, desc = "" },
{ "<leader>o", function() require("harpoon"):list():select(4) end, desc = "" },
{ "<leader>1", function() require("harpoon"):list():select(1) end, desc = "" },
{ "<leader>2", function() require("harpoon"):list():select(2) end, desc = "" },
{ "<leader>3", function() require("harpoon"):list():select(3) end, desc = "" },
{ "<leader>4", function() require("harpoon"):list():select(4) end, desc = "" },
{ "<leader>5", function() require("harpoon"):list():select(5) end, desc = "" },
{ "<leader>6", function() require("harpoon"):list():select(6) end, desc = "" },
{ "<leader>7", function() require("harpoon"):list():select(7) end, desc = "" },
{ "<leader>8", function() require("harpoon"):list():select(8) end, desc = "" },
{ "<leader>9", function() require("harpoon"):list():select(9) end, desc = "" },
},
}
}

117
lua/plugin/lsp.lua Normal file
View file

@ -0,0 +1,117 @@
return {
{
"neovim/nvim-lspconfig",
dependencies = {
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim",
"saghen/blink.cmp",
"nvim-telescope/telescope-ui-select.nvim",
"nvimtools/none-ls.nvim",
'nvim-treesitter/nvim-treesitter',
'nvim-tree/nvim-web-devicons',
"jay-babu/mason-null-ls.nvim",
},
config = function()
-- setup --
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = vim.tbl_deep_extend('force', capabilities, require('blink.cmp').get_lsp_capabilities({}, false))
-- mason --
require("mason").setup({
PATH = "append",
ui = {
border = "rounded",
icons = {
package_installed = "",
package_pending = "",
package_uninstalled = ""
}
}
})
-- mason lspconfig --
require("mason-lspconfig").setup({
ensure_installed = {
"lua_ls",
"clangd",
"rust_analyzer",
},
handlers = {
-- The first entry (without a key) will be the default handler
-- and will be called for each installed server that doesn't have
-- a dedicated handler.
function(server_name) -- default handler (optional)
require("lspconfig")[server_name].setup {
capabilities = capabilities
}
end,
clangd = function()
require("lspconfig").clangd.setup {
capabilities = capabilities,
on_attach = function(client)
client.server_capabilities.documentFormattingProvider = false
client.server_capabilities.documentRangeFormattingProvider = false
end,
}
end,
}
})
-- telescope ui for null-ls
require("telescope").setup {
extensions = {
["ui-select"] = {
}
}
}
require("telescope").load_extension("ui-select")
-- null-ls (none-ls)
local null_ls = require('null-ls')
require("null-ls").setup({
sources = {
null_ls.builtins.diagnostics.trail_space.with {
disabled_filetypes = { "lua" }
},
null_ls.builtins.diagnostics.sqlfluff.with({
extra_args = { "--dialect", "sqlite" },
}),
null_ls.builtins.formatting.sqlfluff.with({
extra_args = { "--dialect", "sqlite" },
}),
null_ls.builtins.formatting.clang_format.with({
extra_args = { "-style={BasedOnStyle: llvm, IndentWidth: 2, BreakBeforeBraces: Linux, ColumnLimit: 0}" }
})
},
})
require("mason-null-ls").setup({
ensure_installed = { "clang_format", "shellharden", "shfmt" }
})
-- config --
vim.diagnostic.config({
update_in_insert = true,
signs = { text = { [vim.diagnostic.severity.ERROR] = "", [vim.diagnostic.severity.WARN] = "", [vim.diagnostic.severity.HINT] = "", [vim.diagnostic.severity.INFO] = "" } },
float = {
focusable = false,
style = "minimal",
border = "rounded",
source = "always",
header = "",
prefix = "",
},
virtual_text = {
prefix = '', -- Could be '●', '■', 'x', '▎', or anything else
},
})
end,
}
}

View file

@ -1,117 +0,0 @@
return {
{
"neovim/nvim-lspconfig",
-- event = "BufReadPre",
config = function()
require('lspconfig.ui.windows').default_options.border = 'rounded'
vim.api.nvim_set_hl(0, "LspInfoBorder", { bg = none, fg = "#d4be98" })
local opts = { noremap = true, silent = true }
vim.keymap.set('n', '<space>cd', vim.diagnostic.open_float, opts)
vim.keymap.set('n', '<space>cl', "<cmd>LspInfo<cr>", opts)
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts)
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts)
-- vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist, opts)
local on_attach = function(client, bufnr)
-- enable completion triggered by <c-x><c-o>
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
-- Mappings.
-- See `:help vim.lsp.*` for documentation on any of the below functions
local bufopts = { noremap = true, silent = true, buffer = bufnr }
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts)
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts)
vim.keymap.set('n', '<leader>k', vim.lsp.buf.hover, bufopts)
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts)
-- vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
vim.keymap.set('n', 'gK', vim.lsp.buf.signature_help, bufopts)
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, bufopts)
vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, bufopts)
vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, bufopts)
vim.keymap.set('n', '<space>wl', function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, bufopts)
vim.keymap.set('n', '<space>gt', vim.lsp.buf.type_definition, bufopts)
vim.keymap.set('n', '<space>cw', vim.lsp.buf.rename, bufopts)
vim.keymap.set('n', '<space>ca', vim.lsp.buf.code_action, bufopts)
vim.keymap.set('n', '<space>cf', function() vim.lsp.buf.format { async = true } end, bufopts)
vim.keymap.set('v', '<space>cf', function() vim.lsp.buf.format { async = true } end, bufopts)
end
local signs = { Error = "", Warn = "", Hint = "", Info = "" }
-- local signs = { Error = "✘ ", Warn = " ", Hint = " ", Info = " " }
-- local signs = { Error = "✘ ", Warn = "⚠ ", Hint = " ", Info = " " } -- Unicode
for type, icon in pairs(signs) do
local hl = "DiagnosticSign" .. type
vim.fn.sign_define(hl, { text = icon, texthl = hl })
end
local border = {
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
}
vim.diagnostic.config({
float = { border = border },
virtual_text = {
prefix = '', -- Could be '●', '■', 'x', '▎'
},
update_in_insert = true
})
-- LSP settings (for overriding per client)
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = border })
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signatureHelp, { border = border })
end,
},
{
"williamboman/mason.nvim",
lazy = true,
cmd = "Mason",
config = function()
require("mason").setup({
ui = {
border = "rounded",
icons = {
package_installed = "",
package_pending = "",
package_uninstalled = ""
}
}
})
end,
},
{
"williamboman/mason-lspconfig.nvim",
-- event = "BufReadPre",
config = function()
require("mason-lspconfig").setup({
ensure_installed = {
"lua_ls",
"clangd",
}
})
require("mason-lspconfig").setup_handlers {
-- The first entry (without a key) will be the default handler
-- and will be called for each installed server that doesn't have
-- a dedicated handler.
function(server_name) -- default handler (optional)
require("lspconfig")[server_name].setup {
on_attach = on_attach,
handlers = handlers,
}
end,
}
end,
},
}

View file

@ -1,152 +1,153 @@
return {
{
"nvim-lualine/lualine.nvim",
config = function()
vim.api.nvim_set_option("showmode", false)
local custom_gruvbox = require 'lualine.themes.gruvbox-material'
custom_gruvbox.normal.a.bg = '#89b482'
custom_gruvbox.normal.c.bg = '#141617'
custom_gruvbox.insert.a.bg = '#d8a657'
custom_gruvbox.visual.a.bg = '#a9b665'
custom_gruvbox.replace.a.bg = '#ea6962'
require('lualine').setup {
options = {
theme = custom_gruvbox,
component_separators = { left = '', right = '' },
section_separators = { left = '', right = '' },
disabled_filetypes = { 'netrw', 'Trouble' }
},
sections = {
lualine_a = {
{
'mode',
padding = 1,
}
},
lualine_b = {
{
'branch',
icon = '',
color = { fg = '#d8a657', bg = '#141617', gui = 'bold' },
padding = 1,
}
},
lualine_c = {
{
'filename',
color = { gui = 'italic', fg = '#d3869b', bg = '#1d2021' },
padding = 1,
path = 1,
}
},
lualine_x = {
{
'filetype',
color = { bg = '#1d2021', fg = '#d4be98', gui = 'italic' },
padding = 1,
fmt = function(str)
return (str:gsub("^%l", string.upper))
end,
},
{
'fileformat',
color = {gui = 'italic'},
symbols = {
unix = '(unix)',
dos = '(dos)',
mac = '(mac)',
},
}
{
"nvim-lualine/lualine.nvim",
config = function()
vim.api.nvim_set_option("showmode", false)
local custom_gruvbox = require 'lualine.themes.gruvbox-material'
custom_gruvbox.normal.a.bg = '#89b482'
custom_gruvbox.normal.c.bg = ''
custom_gruvbox.insert.a.bg = '#d8a657'
custom_gruvbox.visual.a.bg = '#a9b665'
custom_gruvbox.replace.a.bg = '#ea6962'
},
lualine_y = {
{
'diagnostics',
color = { gui = 'bold', bg = '#141617' },
sections = { 'error', 'warn', 'info', 'hint' },
symbols = { error = "", warn = "", info = "", hint = "󰌶 " },
padding = 1,
update_in_insert = true
},
{
'diff',
icon = { '', color = { bg = '#141617', fg = '#d8a657', gui = 'bold' } },
color = { gui = 'bold', bg = '#141617' },
padding = 1,
}
},
lualine_z = {
{
'location',
padding = 1,
}
}
},
require('lualine').setup {
options = {
theme = custom_gruvbox,
globalstatus = true,
component_separators = { left = '', right = '' },
section_separators = { left = '', right = '' },
disabled_filetypes = { 'netrw', 'Trouble' },
},
sections = {
lualine_a = {
{
'mode',
padding = 1,
}
},
lualine_b = {
{
'branch',
icon = '',
color = { fg = '#d8a657', bg = '#141617', gui = 'bold' },
padding = 1,
},
},
lualine_c = {
{
'filename',
color = { gui = 'italic', fg = '#d3869b', bg = '#1d2021' },
padding = 1,
path = 1,
},
},
lualine_x = {
{
'filetype',
color = { bg = '#1d2021', fg = '#d4be98', gui = 'italic' },
padding = 1,
fmt = function(str)
return (str:gsub("^%l", string.upper))
end,
},
{
'fileformat',
color = { gui = 'italic', bg = '#141617' },
symbols = {
unix = '(unix)',
dos = '(dos)',
mac = '(mac)',
},
}
inactive_sections = {
lualine_a = {
{
'mode',
padding = 1,
}
},
lualine_b = {
{
'branch',
icon = '',
padding = 1,
}
},
lualine_c = {
{
'filename',
padding = 1,
path = 1,
}
},
lualine_x = {
{
'filetype',
color = { gui = 'italic' },
padding = 1,
fmt = function(str)
return (str:gsub("^%l", string.upper))
end,
},
{
'fileformat',
color = {gui = 'italic'},
symbols = {
unix = 'Unix',
dos = 'Dos',
mac = 'Mac',
},
},
},
lualine_y = {
{
'diagnostics',
color = { gui = 'bold', bg = '#141617' },
sections = { 'error', 'warn', 'info', 'hint' },
symbols = { error = "", warn = "", info = "", hint = "󰌶 " },
padding = 1,
update_in_insert = true
},
{
'diff',
icon = { '', color = { bg = '#141617', gui = 'bold' } },
color = { gui = 'bold', bg = '#141617' },
padding = 1,
}
},
lualine_z = {
{
'location',
padding = 1,
},
}
},
}
end,
},
},
lualine_y = {
{
'diagnostics',
color = { gui = 'bold', bg = '#141617' },
sections = { 'error', 'warn', 'info', 'hint' },
symbols = { error = "", warn = "", info = "", hint = "" },
padding = 1,
update_in_insert = true
},
{
'diff',
icon = { '', color = { bg = '#141617', fg = '#d8a657', gui = 'bold' } },
color = { gui = 'bold', bg = '#141617' },
padding = 1,
}
},
lualine_z = {
{
'location',
padding = 1,
}
}
},
inactive_sections = {
lualine_a = {
{
'mode',
padding = 1,
}
},
lualine_b = {
{
'branch',
icon = '',
padding = 1,
},
},
lualine_c = {
{
'filename',
padding = 1,
path = 1,
}
},
lualine_x = {
{
'filetype',
color = { gui = 'italic' },
padding = 1,
fmt = function(str)
return (str:gsub("^%l", string.upper))
end,
},
{
'fileformat',
color = { gui = 'italic' },
symbols = {
unix = 'Unix',
dos = 'Dos',
mac = 'Mac',
},
},
},
lualine_y = {
{
'diagnostics',
color = { gui = 'bold', bg = '#141617' },
sections = { 'error', 'warn', 'info', 'hint' },
symbols = { error = "", warn = "", info = "", hint = "󰌶 " },
padding = 1,
update_in_insert = true
},
{
'diff',
icon = { '', color = { bg = '#141617', gui = 'bold' } },
color = { gui = 'bold', bg = '#141617' },
padding = 1,
}
},
lualine_z = {
{
'location',
padding = 1,
},
}
},
}
end,
},
}

86
lua/plugin/markdown.lua Normal file
View file

@ -0,0 +1,86 @@
return {
{
'MeanderingProgrammer/render-markdown.nvim',
dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons
lazy = true,
ft = "markdown",
opts = {
overrides = {
buftype = {
nofile = { heading = { enabled = false }, sign = { enabled = false }, code = { sign = false, width = 'block', left_pad = 0, right_pad = 0, border = 'hide' } },
},
},
completions = { lsp = { enabled = true } },
preset = 'obsidian',
heading = {
backgrounds = {},
position = 'inline',
},
checkbox = {
enabled = true,
render_modes = false,
bullet = false,
right_pad = 1,
unchecked = {
icon = '󰄱 ',
highlight = 'RenderMarkdownUnchecked',
scope_highlight = nil,
},
checked = {
icon = '󰱒 ',
highlight = 'RenderMarkdownChecked',
scope_highlight = nil,
},
custom = {
todo = { raw = '[>]', rendered = '󰥔 ', highlight = 'RenderMarkdownInfo', scope_highlight = nil },
urgent = { raw = '[!]', rendered = '', highlight = 'RenderMarkdownError', scope_highlight = nil },
important = { raw = '[~]', rendered = '󰓎 ', highlight = 'DiagnosticWarn', },
},
},
pipe_table = {
preset = 'round',
head = 'RenderMarkdownTableRow',
},
code = {
border = 'thick',
width = 'block',
left_pad = 2,
right_pad = 2,
min_width = 40,
},
callout = {
-- Callouts are a special instance of a 'block_quote' that start with a 'shortcut_link'.
-- The key is for healthcheck and to allow users to change its values, value type below.
-- | raw | matched against the raw text of a 'shortcut_link', case insensitive |
-- | rendered | replaces the 'raw' value when rendering |
-- | highlight | highlight for the 'rendered' text and quote markers |
-- | quote_icon | optional override for quote.icon value for individual callout |
-- | category | optional metadata useful for filtering |
-- Obsidian: https://help.obsidian.md/Editing+and+formatting/Callouts
abstract = { raw = '[!ABSTRACT]', rendered = '󰨸 Abstract', highlight = 'RenderMarkdownInfo', category = 'obsidian' },
summary = { raw = '[!SUMMARY]', rendered = '󰨸 Summary', highlight = 'RenderMarkdownInfo', category = 'obsidian' },
tldr = { raw = '[!TLDR]', rendered = '󰨸 Tldr', highlight = 'RenderMarkdownInfo', category = 'obsidian' },
info = { raw = '[!INFO]', rendered = '󰋽 Info', highlight = 'RenderMarkdownInfo', category = 'obsidian' },
todo = { raw = '[!TODO]', rendered = '󰗡 Todo', highlight = 'RenderMarkdownInfo', category = 'obsidian' },
hint = { raw = '[!HINT]', rendered = '󰌶 Hint', highlight = 'RenderMarkdownSuccess', category = 'obsidian' },
success = { raw = '[!SUCCESS]', rendered = '󰄬 Success', highlight = 'RenderMarkdownSuccess', category = 'obsidian' },
check = { raw = '[!CHECK]', rendered = '󰄬 Check', highlight = 'RenderMarkdownSuccess', category = 'obsidian' },
done = { raw = '[!DONE]', rendered = '󰄬 Done', highlight = 'RenderMarkdownSuccess', category = 'obsidian' },
question = { raw = '[!QUESTION]', rendered = '󰘥 Question', highlight = 'RenderMarkdownWarn', category = 'obsidian' },
help = { raw = '[!HELP]', rendered = '󰘥 Help', highlight = 'RenderMarkdownWarn', category = 'obsidian' },
faq = { raw = '[!FAQ]', rendered = '󰘥 Faq', highlight = 'RenderMarkdownWarn', category = 'obsidian' },
attention = { raw = '[!ATTENTION]', rendered = '󰀪 Attention', highlight = 'RenderMarkdownWarn', category = 'obsidian' },
failure = { raw = '[!FAILURE]', rendered = '󰅖 Failure', highlight = 'RenderMarkdownError', category = 'obsidian' },
fail = { raw = '[!FAIL]', rendered = '󰅖 Fail', highlight = 'RenderMarkdownError', category = 'obsidian' },
missing = { raw = '[!MISSING]', rendered = '󰅖 Missing', highlight = 'RenderMarkdownError', category = 'obsidian' },
danger = { raw = '[!DANGER]', rendered = '󱐌 Danger', highlight = 'RenderMarkdownError', category = 'obsidian' },
error = { raw = '[!ERROR]', rendered = '󱐌 Error', highlight = 'RenderMarkdownError', category = 'obsidian' },
bug = { raw = '[!BUG]', rendered = '󰨰 Bug', highlight = 'RenderMarkdownError', category = 'obsidian' },
example = { raw = '[!EXAMPLE]', rendered = '󰉹 Example', highlight = 'RenderMarkdownHint', category = 'obsidian' },
quote = { raw = '[!QUOTE]', rendered = '󱆨 Quote', highlight = 'RenderMarkdownQuote', category = 'obsidian' },
cite = { raw = '[!CITE]', rendered = '󱆨 Cite', highlight = 'RenderMarkdownQuote', category = 'obsidian' },
},
},
}
}

12
lua/plugin/marks.lua Normal file
View file

@ -0,0 +1,12 @@
return {
{
"chentoast/marks.nvim",
event = "VeryLazy",
opts = {},
config = function()
require 'marks'.setup({
sign_priority = 5,
})
end,
}
}

View file

@ -1,59 +0,0 @@
return {
{
"nvimtools/none-ls.nvim",
-- event = "BufReadPost",
dependencies = {
{
"nvim-telescope/telescope-ui-select.nvim",
lazy = true,
config = function()
-- This is your opts table
require("telescope").setup {
extensions = {
["ui-select"] = {
-- require("telescope.themes").get_dropdown {
-- -- even more opts
-- }
}
}
}
require("telescope").load_extension("ui-select")
end,
},
},
opts = function()
local null_ls = require('null-ls')
return {
border = 'rounded',
on_attach = function(client, bufnr)
local bufopts = { noremap = true, silent = true, buffer = bufnr }
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts)
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts)
vim.keymap.set('n', '<leader>k', vim.lsp.buf.hover, bufopts)
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts)
vim.keymap.set('n', '<space>gt', vim.lsp.buf.type_definition, bufopts)
vim.keymap.set('n', '<space>cw', vim.lsp.buf.rename, bufopts)
vim.keymap.set('n', '<space>ca', vim.lsp.buf.code_action, bufopts)
-- vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
vim.keymap.set('n', '<space>cf', function() vim.lsp.buf.format { async = true } end, bufopts)
vim.keymap.set('v', '<space>cf', function() vim.lsp.buf.format { async = true } end, bufopts)
end,
sources = {
null_ls.builtins.diagnostics.trail_space.with {
disabled_filetypes = { "lua" }
},
null_ls.builtins.diagnostics.shellcheck,
null_ls.builtins.code_actions.shellcheck,
null_ls.builtins.formatting.jq,
null_ls.builtins.code_actions.gitsigns,
null_ls.builtins.diagnostics.flake8,
null_ls.builtins.diagnostics.yamllint,
null_ls.builtins.formatting.yamlfmt,
null_ls.builtins.formatting.shfmt,
null_ls.builtins.formatting.shellharden,
null_ls.builtins.formatting.beautysh,
},
}
end,
},
}

View file

@ -1,196 +0,0 @@
return {
-- snippets
{
"L3MON4D3/LuaSnip",
lazy = true,
dependencies = {
"rafamadriz/friendly-snippets",
config = function()
require("luasnip.loaders.from_vscode").lazy_load()
vim.api.nvim_set_hl(0, "PmenuSel", { fg = 'NONE', bg = '#141617' })
vim.api.nvim_set_hl(0, "Pmenu", { fg = 'NONE', bg = '#1d2021' })
vim.api.nvim_set_hl(0, "CmpItemMenu", { fg = 'NONE', bg = '#141617' })
vim.api.nvim_set_hl(0, "CmpItemMenuDefault", { fg = 'NONE', bg = '#141617' })
vim.api.nvim_set_hl(0, "CmpItemKindFunction", { fg = '#d3869b', bg = 'NONE', italic = true })
vim.api.nvim_set_hl(0, "CmpItemKindSnippet", { fg = '#d8a657', bg = 'NONE', italic = true })
vim.api.nvim_set_hl(0, "CmpItemKindText", { fg = '#ddc7a1', bg = 'NONE', italic = true })
vim.api.nvim_set_hl(0, "CmpItemKindVariable", { fg = '#7daea3', bg = 'NONE', italic = true })
end,
},
},
-- completion
{
"hrsh7th/nvim-cmp",
version = false,
event = {
-- "InsertEnter",
-- "CmdlineEnter",
"BufWinEnter",
},
dependencies = {
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"hrsh7th/cmp-cmdline",
"saadparwaiz1/cmp_luasnip",
},
opts = function()
-- Set up nvim-cmp with luasnip
local kind_icons = {
Text = "",
Method = "󰆧",
Function = "󰊕",
Constructor = "",
Field = "󰇽",
Variable = "󰂡",
Class = "󰠱",
Interface = "",
Module = "",
Property = "󰜢",
Unit = "",
Value = "󰎠",
Enum = "",
Keyword = "󰌋",
Snippet = "",
Color = "󰏘",
File = "󰈙",
Reference = "",
Folder = "󰉋",
EnumMember = "",
Constant = "󰏿",
Struct = "",
Event = "",
Operator = "󰆕",
TypeParameter = "󰅲"
}
local has_words_before = function()
unpack = unpack or table.unpack
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and
vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
end
local luasnip = require("luasnip")
local cmp = require("cmp")
return {
formatting = {
format = function(entry, vim_item)
-- Kind icons
vim_item.kind = string.format('%s %s', kind_icons[vim_item.kind], vim_item.kind) -- This concatonates the icons with the name of the item kind
-- Source
vim_item.menu = ({
-- buffer = "[Buffer]",
-- nvim_lsp = "[LSP]",
-- luasnip = "[LuaSnip]",
-- nvim_lua = "[Lua]",
-- latex_symbols = "[LaTeX]",
buffer = "",
nvim_lsp = "",
luasnip = "",
nvim_lua = "",
latex_symbols = "",
})[entry.source.name]
return vim_item
end
},
snippet = {
-- REQUIRED - you must specify a snippet engine
expand = function(args)
-- vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
-- require('snippy').expand_snippet(args.body) -- For `snippy` users.
-- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
end,
},
-- completion = {
-- autocomplete = false,
-- },
window = {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(),
},
mapping = cmp.mapping.preset.insert({
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
-- ['<C-Space>'] = cmp.mapping.complete(),
-- ['<C-e>'] = cmp.mapping.abort(),
['<C-e>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.abort()
else
cmp.complete()
end
end),
['<CR>'] = cmp.mapping.confirm({ select = false }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
-- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable()
-- they way you will only jump inside the snippet region
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
elseif has_words_before() then
cmp.complete()
else
fallback()
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { "i", "s" }),
}),
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
-- { name = 'vsnip' }, -- For vsnip users.
{ name = 'luasnip' }, -- For luasnip users.
-- { name = 'ultisnips' }, -- For ultisnips users.
-- { name = 'snippy' }, -- For snippy users.
{
name = 'buffer',
option = {
get_bufnrs = function()
return vim.api.nvim_list_bufs()
end
},
},
}, {
}),
-- Set configuration for specific filetype.
cmp.setup.filetype('gitcommit', {
sources = cmp.config.sources({
{ name = 'cmp_git' }, -- You can specify the `cmp_git` source if you were installed it.
}, {
{ name = 'buffer' },
})
}),
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline({ '/', '?' }, {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = 'buffer' }
}
}),
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = 'path' }
}, {
{ name = 'cmdline' }
})
}),
}
end,
}
}

123
lua/plugin/obsidian.lua Normal file
View file

@ -0,0 +1,123 @@
return {
{
"obsidian-nvim/obsidian.nvim",
version = "*", -- recommended, use latest release instead of latest commit
lazy = true,
ft = "markdown",
-- Replace the above line with this if you only want to load obsidian.nvim for markdown files in your vault:
-- event = {
-- -- If you want to use the home shortcut '~' here you need to call 'vim.fn.expand'.
-- -- E.g. "BufReadPre " .. vim.fn.expand "~" .. "/my-vault/*.md"
-- -- refer to `:h file-pattern` for more examples
-- "BufReadPre path/to/my-vault/*.md",
-- "BufNewFile path/to/my-vault/*.md",
-- },
dependencies = {
"nvim-lua/plenary.nvim",
},
opts = {
workspaces = {
{
name = "notes",
path = "~/notes",
},
},
completion = {
-- Set to false to disable completion.
nvim_cmp = false,
blink = true,
-- Trigger completion at 2 chars.
min_chars = 1,
},
mappings = {
-- Overrides the 'gf' mapping to work on markdown/wiki links within your vault.
["gf"] = {
action = function()
return require("obsidian").util.gf_passthrough()
end,
opts = { noremap = false, expr = true, buffer = true },
},
-- paste image
["<Space>Op"] = {
action = function()
return "<cmd>ObsidianPasteImg<cr>"
end,
opts = { noremap = false, expr = true, buffer = true },
},
["<Space>On"] = {
action = function()
return "<cmd>ObsidianNew<cr>"
end,
opts = { noremap = false, expr = true, buffer = true },
},
["<Space>Os"] = {
action = function()
return "<cmd>ObsidianSearch<cr>"
end,
opts = { noremap = false, expr = true, buffer = true },
},
-- Toggle check-boxes.
["<leader>ch"] = {
action = function()
return require("obsidian").util.toggle_checkbox()
end,
opts = { buffer = true },
},
["<cr>"] = {
action = function()
return require("obsidian").util.smart_action()
end,
opts = { buffer = true, expr = true },
},
["<Space>bl"] = {
action = function()
return "<cmd>ObsidianBacklinks<cr>"
end,
opts = { noremap = false, expr = true, buffer = true },
},
},
new_notes_location = "current_dir",
-- wiki_link_func = "use_alias_only",
wiki_link_func = function(opts)
return require("obsidian.util").wiki_link_id_prefix(opts)
end,
preferred_link_style = "wiki",
note_id_func = function(title)
return title
end,
-- note_id_func = function(title)
-- return tostring(os.date("%Y-%m-%d") .. "-" .. title:gsub(" ", "-"):gsub("[^A-Za-z0-9-]", ""):lower())
-- end,
disable_frontmatter = true,
-- Optional, by default when you use `:ObsidianFollowLink` on a link to an external
-- URL it will be ignored but you can customize this behavior here.
-- ---@param url string
-- follow_url_func = function(url)
-- -- Open the URL in the default web browser.
-- -- vim.fn.jobstart({ "xdg-open", url }) -- linux
-- vim.ui.open(url) -- need Neovim 0.10.0+
-- end,
--
-- -- Optional, by default when you use `:ObsidianFollowLink` on a link to an image
-- -- file it will be ignored but you can customize this behavior here.
-- ---@param img string
-- follow_img_func = function(img)
-- vim.fn.jobstart({ "xdg-open", img }) -- linux
-- end,
attachments = {
-- The default folder to place images in via `:ObsidianPasteImg`.
-- If this is a relative path it will be interpreted as relative to the vault root.
-- You can always override this per image by passing a full path to the command instead of just a filename.
img_folder = "images", -- This is the default
},
ui = { enable = false},
},
}
}

20
lua/plugin/snippets.lua Normal file
View file

@ -0,0 +1,20 @@
return {
{
"L3MON4D3/LuaSnip",
lazy = true,
dependencies = {
"rafamadriz/friendly-snippets",
config = function()
require("luasnip.loaders.from_vscode").lazy_load()
vim.api.nvim_set_hl(0, "PmenuSel", { fg = 'NONE', bg = '#272e33' })
vim.api.nvim_set_hl(0, "Pmenu", { fg = 'NONE', bg = '#1e2326' })
vim.api.nvim_set_hl(0, "CmpItemMenu", { fg = 'NONE', bg = '#272e33' })
vim.api.nvim_set_hl(0, "CmpItemMenuDefault", { fg = 'NONE', bg = '#272e33' })
vim.api.nvim_set_hl(0, "CmpItemKindFunction", { fg = '#d699b6', bg = 'NONE', italic = true })
vim.api.nvim_set_hl(0, "CmpItemKindSnippet", { fg = '#dbbc7f', bg = 'NONE', italic = true })
vim.api.nvim_set_hl(0, "CmpItemKindText", { fg = '#9da9a0', bg = 'NONE', italic = true })
vim.api.nvim_set_hl(0, "CmpItemKindVariable", { fg = '#7fbbb3', bg = 'NONE', italic = true })
end,
},
}
}

View file

@ -1,20 +1,24 @@
return {
{
"echasnovski/mini.surround",
"kylechui/nvim-surround",
version = "*", -- Use for stability; omit to use `main` branch for the latest features
event = "VeryLazy",
opts = {
mappings = {
add = "<leader>sa",
delete = "<leader>sd",
find = "<leader>sf",
find_left = "<leader>sF",
highlight = "<leader>sh",
replace = "<leader>sr",
update_n_lines = "<leader>sn",
},
},
config = function(_, opts)
require("mini.surround").setup(opts)
end,
config = function()
require("nvim-surround").setup({
-- Configuration here, or leave empty to use defaults
})
end
}
}
-- Old text Command New text
-- --------------------------------------------------------------------------------
-- surround_words ysiw) (surround_words)
-- make strings ys$" "make strings"
-- [delete around me!] ds] delete around me!
-- remove <b>HTML tags</b> dst remove HTML tags
-- 'change quotes' cs'" "change quotes"
-- <b>or tag types</b> csth1<CR> <h1>or tag types</h1>
-- delete(function calls) dsf function calls
-- :h nvim-surround.usage

View file

@ -1,21 +1,60 @@
return {
{
"nvim-telescope/telescope.nvim",
lazy = true,
cmd = "Telescope",
version = false,
keys = {
{ "<leader>:", "<cmd>Telescope command_history<cr>", desc = "Command History" },
{ "<leader>,", "<cmd>Telescope buffers show_all_buffers=true<cr>", desc = "Switch Buffer" },
-- find
{ "<leader>ff", "<cmd>Telescope find_files<cr>", desc = "Find Files" },
{ "<leader>fb", "<cmd>Telescope current_buffer_fuzzy_find<cr>", desc = "Find Strings in current Buffer" },
{ "<leader>fg", "<cmd>Telescope live_grep<cr>", desc = "Grep Content in Files" },
{ "<leader>/", "<cmd>Telescope live_grep<cr>", desc = "Grep Content in Files" },
{ "<leader>fl", "<cmd>Telescope grep_string<cr>", desc = "Grep currently hovered String" },
{ "<leader>fG", "<cmd>Telescope git_files<cr>", desc = "Find Git Files" },
{ "<leader>fk", "<cmd>Telescope keymaps<cr>", desc = "Find Git Files" },
{ "<leader>fr", "<cmd>Telescope oldfiles<cr>", desc = "Find Recent Files" },
{
"nvim-telescope/telescope.nvim",
lazy = true,
cmd = "Telescope",
version = false,
config = function()
require('telescope').setup({
pickers = {
find_files = {
layout_config = {
prompt_position = 'top',
},
sorting_strategy = 'ascending',
},
live_grep = {
layout_config = {
prompt_position = 'top',
},
sorting_strategy = 'ascending',
},
current_buffer_fuzzy_find = {
layout_config = {
prompt_position = 'top',
},
sorting_strategy = 'ascending',
},
grep_string = {
layout_config = {
prompt_position = 'top',
},
sorting_strategy = 'ascending',
},
git_files = {
layout_config = {
prompt_position = 'top',
},
sorting_strategy = 'ascending',
},
keymaps = {
layout_config = {
prompt_position = 'top',
},
sorting_strategy = 'ascending',
},
},
})
end,
keys = {
{ "<leader>,", "<cmd>Telescope buffers show_all_buffers=true<cr>", desc = "Switch Buffer" },
{ "<leader>ff", "<cmd>Telescope find_files<cr>", desc = "Find Files" },
{ "<leader>fb", "<cmd>Telescope current_buffer_fuzzy_find<cr>", desc = "Find Strings in current Buffer" },
{ "<leader>fg", "<cmd>Telescope live_grep<cr>", desc = "Grep Content in Files" },
{ "<leader>/", "<cmd>Telescope current_buffer_fuzzy_find<cr>", desc = "Find Strings in current Buffer" },
{ "<leader>fh", "<cmd>Telescope grep_string<cr>", desc = "Grep currently hovered String" },
{ "<leader>fG", "<cmd>Telescope git_files<cr>", desc = "Find Git Files" },
{ "<leader>fk", "<cmd>Telescope keymaps<cr>", desc = "List Keymaps" },
},
},
}

View file

@ -1,11 +0,0 @@
return {
{
"folke/todo-comments.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
opts = {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
}
}
}

View file

@ -1,14 +1,14 @@
return {
{
"nvim-treesitter/nvim-treesitter-context",
event = "VeryLazy",
config = function ()
require('treesitter-context').setup{
enable = true,
max_lines = 0,
min_window_height = 0,
line_numbers = true,
}
end
}
{
"nvim-treesitter/nvim-treesitter-context",
event = "VeryLazy",
config = function()
require('treesitter-context').setup {
enable = true,
max_lines = 0,
min_window_height = 0,
line_numbers = true,
}
end
}
}

View file

@ -0,0 +1,66 @@
return {
{
"nvim-treesitter/nvim-treesitter-textobjects",
dependencies = { "nvim-treesitter/nvim-treesitter" },
opts = {
textobjects = {
select = {
enable = true,
-- Automatically jump forward to textobj, similar to targets.vim
lookahead = true,
keymaps = {
-- You can use the capture groups defined in textobjects.scm
["af"] = "@function.outer",
["if"] = "@function.inner",
["ac"] = "@comment.outer",
["aS"] = "@statement.outer",
["ae"] = "@block.outer",
["al"] = "@loop.outer",
["il"] = "@loop.inner",
["ar"] = "@return.outer",
["ir"] = "@return.inner",
["ia"] = "@assignment.rhs",
["aa"] = "@assignment.inner",
["i?"] = "@conditional.inner",
["a?"] = "@conditional.outer",
["in"] = "@number.inner",
["iC"] = "@class.inner",
["aC"] = "@class.outer",
["ig"] = "@call.inner",
["ag"] = "@call.outer",
-- You can also use captures from other query groups like `locals.scm`
["as"] = { query = "@scope", query_group = "locals", desc = "Select language scope" },
},
-- You can choose the select mode (default is charwise 'v')
--
-- Can also be a function which gets passed a table with the keys
-- * query_string: eg '@function.inner'
-- * method: eg 'v' or 'o'
-- and should return the mode ('v', 'V', or '<c-v>') or a table
-- mapping query_strings to modes.
selection_modes = {
['@parameter.outer'] = 'v', -- charwise
['@function.outer'] = 'V', -- linewise
},
-- If you set this to `true` (default is `false`) then any textobject is
-- extended to include preceding or succeeding whitespace. Succeeding
-- whitespace has priority in order to act similarly to eg the built-in
-- `ap`.
--
-- Can also be a function which gets passed a table with the keys
-- * query_string: eg '@function.inner'
-- * selection_mode: eg 'v'
-- and should return true or false
include_surrounding_whitespace = false,
},
},
},
config = function(_, opts)
require("nvim-treesitter.configs").setup(opts)
end,
}
}

View file

@ -20,9 +20,6 @@ return {
auto_install = true,
highlight = {
enable = true,
disable = {
"markdown",
},
},
},
config = function(_, opts)

View file

@ -1,13 +0,0 @@
return {
"folke/trouble.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
opts = {},
config = function()
vim.keymap.set("n", "<leader>xx", function() require("trouble").toggle() end)
vim.keymap.set("n", "<leader>xw", function() require("trouble").toggle("workspace_diagnostics") end)
vim.keymap.set("n", "<leader>xd", function() require("trouble").toggle("document_diagnostics") end)
vim.keymap.set("n", "<leader>xq", function() require("trouble").toggle("quickfix") end)
vim.keymap.set("n", "<leader>xl", function() require("trouble").toggle("loclist") end)
vim.keymap.set("n", "gr", function() require("trouble").open("lsp_references") end)
end
}

View file

@ -1,14 +1,13 @@
return {
{
"mbbill/undotree",
keys = {
{ "<leader>u", "<cmd>UndotreeToggle<cr>", desc = "toggle undotree" },
},
config = function()
vim.g.undotree_WindowLayout = 4
vim.g.undotree_SplitWidth = 40
vim.g.undotree_SetFocusWhenToggle = 1
end
}
{
"mbbill/undotree",
keys = {
{ "<leader>u", "<cmd>UndotreeToggle<cr>", desc = "toggle undotree" },
},
config = function()
vim.g.undotree_WindowLayout = 4
vim.g.undotree_SplitWidth = 40
vim.g.undotree_SetFocusWhenToggle = 1
end
}
}

23
lua/plugin/zen.lua Normal file
View file

@ -0,0 +1,23 @@
return {
{
"folke/zen-mode.nvim",
lazy = true,
opts = {
window = {
backdrop = 1,
width = 120,
},
plugins = {
options = {
enabled = true,
showcmd = true,
laststatus = 3,
},
gitsigns = { enabled = false }
},
},
keys = {
{"<leader>zz", function() require("zen-mode").toggle() end, desc = "toggle zenmode"}
}
}
}

View file

@ -1 +1,11 @@
# Neovim Configfiles
## Dependencies
- [ripgrep](https://github.com/BurntSushi/ripgrep)
- [fd](https://github.com/sharkdp/fd)
- [fzf](https://github.com/junegunn/fzf)
- [git](https://git-scm.com/)
- [wget](https://www.gnu.org/software/wget/)
- [wl-clipboard](https://github.com/bugaevc/wl-clipboard)
- [zathura](https://github.com/pwmt/zathura) (only for pdf-viewing)
- [rust](https://www.rust-lang.org/) (for downloading with mason)