This commit is contained in:
DavidOnTop 2024-04-18 19:17:22 +02:00
parent ac6ba45b85
commit b053b742ab
No known key found for this signature in database
GPG key ID: 5D05538A45D5149F
11 changed files with 195 additions and 178 deletions

View file

@ -174,3 +174,12 @@ vim.api.nvim_create_user_command("Justt", function()
end
}):find()
end, {})
vim.api.nvim_create_autocmd('TextYankPost', {
desc = 'Highlight when yanking (copying) text',
group = vim.api.nvim_create_augroup('HightlightYank', { clear = true }),
callback = function()
vim.highlight.on_yank()
end,
})

View file

@ -1,4 +1,4 @@
require("config.pmstrap")
require("config.sets")
require("config.keymap")
require("config.commands")
require("config.commands")

View file

@ -1,18 +1,19 @@
local wk = require("which-key")
local keys = {
a = {"<cmd>Copilot suggestion accept<cr>", "Accept Copilot"},
e = {
name = "Toggle",
e = {"<cmd>NeoTreeFloatToggle<CR>", "NeoTree"},
w = {vim.cmd.Ex, "netrw"},
s = {"<cmd>NeoTreeShowToggle<CR>", "neotree sidebar"},
g = {"<cmd>NeoTreeFloatToggle git_status<CR>", "Git Status"},
b = {"<cmd>NeoTreeFloatToggle buffers<CR>", "Buffers"},
-- b = {"<cmd>NeoTreeFloatToggle buffers<CR>", "Buffers"},
c = {"<cmd>NeoTreeClose<CR>" , "Close"},
u = {vim.cmd.UndotreeToggle, "UndoTree"},
},
c = {
name = "LSP",
f = {function () vim.lsp.buf.format() end, "Format"},
w = {function () vim.lsp.buf.workspace_symbol("") end, "workspace symbol"},
d = {function () vim.diagnostic.open_float() end, "diagnostic"},
a = {function () vim.lsp.buf.code_action() end, "code actions"},
@ -28,15 +29,6 @@ local keys = {
s = {"<cmd>LspStart<cr>", "Start"},
r = {"<cmd>LspRestart<cr>", "Restart"},
},
c = {
name = "Copilot",
a = {"<cmd>Copilot suggestion accept<cr>", "Accept"},
d = {"<cmd>Copilot suggestion dismiss<cr>", "Dismiss"},
l = {"<cmd>Copilot suggestion accept_line<cr>", "Line"},
w = {"<cmd>Copilot suggestion accept_word<cr>", "Word"},
n = {"<cmd>Copilot suggestion next<cr>", "Next"},
p = {"<cmd>Copilot suggestion prev<cr>", "Previous"},
}
},
b = {
name = "Buffer",
@ -46,6 +38,11 @@ local keys = {
L = {vim.cmd.blast, "Last"},
b = {require("telescope.builtin").buffers, "Picker"},
c = {"<cmd>:bp | sp | bn | bd<cr>", "Close"},
C = {"<cmd>:bp | sp | bn | bd!<cr>", "Close Force"},
d = {function() vim.cmd("bd") end, "Delete buffer"},
D = {function() vim.cmd("bd!") end, "Delete buffer Force"},
o = {function() vim.cmd("BDelete other") end, "Delete other buffers"},
m = {function() vim.cmd("BDelete select") end, "Select buffer to delete"},
},
f = {
name = "Telescope & fzf",
@ -71,12 +68,6 @@ local keys = {
vim.opt.nu = true
vim.opt.relativenumber = true
end, "Fix number and relative numbers"},
m = {function ()
vim.cmd[[
highlight CursorColumn guibg=none ctermbg=none
highlight link CursorColumn CursorLine
]]
end, "Fix cursor highlight"},
},
h = {
name = "Hop",
@ -106,8 +97,8 @@ local keys = {
q = {
name = "Quick nav",
q = {require("harpoon.ui").toggle_quick_menu, "Menu"},
a = {require("harpoon.mark").add_file, "Add file"},
r = {require("harpoon.mark").rm_file, "Remove File"},
a = {function () require("harpoon"):list():append() end, "Add file"},
r = {function () require("harpoon"):list():remove() end, "Remove File"},
},
}
@ -162,7 +153,7 @@ end, {desc = "fuzzy find"})
vim.keymap.set('i', '<C-Space>f?', require('telescope.builtin').oldfiles, { desc = 'Find recently opened files' })
for i = 9, 1, -1 do
vim.keymap.set("n", "<M-" .. i .. ">", function() require("harpoon.ui").nav_file(i) end, {desc = ""})
vim.keymap.set("i", "<M-" .. i .. ">", function() require("harpoon.ui").nav_file(i) end, {desc = ""})
vim.keymap.set("v", "<M-" .. i .. ">", function() require("harpoon.ui").nav_file(i) end, {desc = ""})
vim.keymap.set("n", "<M-" .. i .. ">", function() require("harpoon"):list():select(i) end, {desc = ""})
vim.keymap.set("i", "<M-" .. i .. ">", function() require("harpoon"):list():select(i) end, {desc = ""})
vim.keymap.set("v", "<M-" .. i .. ">", function() require("harpoon"):list():select(i) end, {desc = ""})
end

View file

@ -14,7 +14,6 @@ return {
},
{
"j-hui/fidget.nvim",
tag = "legacy",
dependencies = {
"neovim/nvim-lspconfig",
},
@ -41,6 +40,18 @@ return {
"rafamadriz/friendly-snippets"
},
},
{
"nvimtools/none-ls.nvim"
},
{
"jinzhongjia/LspUI.nvim",
branch = "legacy",
config = function()
require("LspUI").setup({
prompt = false
})
end
},
-- syntax highlighting
{
@ -66,13 +77,13 @@ return {
"nvim-telescope/telescope-fzf-native.nvim",
build = "make",
},
"nvim-lua/popup.nvim",
-- debugging
"mfussenegger/nvim-dap",
"jay-babu/mason-nvim-dap.nvim",
{
"rcarriga/nvim-dap-ui",
tag = "v4.0.0",
dependencies = {
"mfussenegger/nvim-dap"
},
@ -86,7 +97,6 @@ return {
"lvimuser/lsp-inlayhints.nvim",
"echasnovski/mini.nvim",
{'kazhala/close-buffers.nvim', config = true},
{'stevearc/dressing.nvim', opts = {}},
{
'anuvyklack/pretty-fold.nvim',
opts = {
@ -111,7 +121,13 @@ return {
opts = {}
},
{
"ThePrimeagen/harpoon"
"ThePrimeagen/harpoon",
branch = "harpoon2",
dependencies = { "nvim-lua/plenary.nvim" },
init = function ()
local harpoon = require("harpoon")
harpoon:setup()
end
},
{
"sQVe/sort.nvim",
@ -150,20 +166,11 @@ return {
},
},
{
"rcarriga/nvim-notify",
"rcarriga/nvim-notify",
config = function ()
vim.notify = require("notify")
end
},
{
"nvim-neo-tree/neo-tree.nvim",
branch = "v2.x",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons",
"MunifTanjim/nui.nvim",
},
},
{
"kevinhwang91/nvim-bqf",
event = { "BufRead", "BufNew" },
@ -275,11 +282,12 @@ return {
end,
},
{
"zbirenbaum/copilot.lua",
opts = {
suggestion = {
auto_trigger = true,
}
"nvim-neo-tree/neo-tree.nvim",
branch = "v2.x",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons",
"MunifTanjim/nui.nvim",
},
},
@ -302,18 +310,8 @@ return {
},
-- lenguage specific
-- just
{
"IndianBoy42/tree-sitter-just",
opts = {}
},
-- swift
{
"apple/swift",
config = function(plugin)
vim.opt.rtp:append(plugin.dir .. "/utils/vim")
end
},
-- f#
{"ionide/Ionide-vim"},
-- go
{"joerdav/templ.vim"},
{
@ -347,20 +345,11 @@ return {
"nvim-lua/plenary.nvim"
},
},
-- slint
{"slint-ui/vim-slint"},
-- zig
"ziglang/zig.vim",
{
"NTBBloodbath/zig-tools.nvim",
ft = "zig",
opts = {
integrations = {
zls = {
hints = true,
}
}
}
},
-- glsl
"tikhomirov/vim-glsl",
@ -368,11 +357,9 @@ return {
-- java
"mfussenegger/nvim-jdtls",
-- c && c++ && cmake
"cdelledonne/vim-cmake",
-- themes
"xiyaowong/transparent.nvim",
"savq/melange-nvim",
"EdenEast/nightfox.nvim",
"luisiacc/gruvbox-baby",
@ -383,11 +370,11 @@ return {
"yazeed1s/oh-lucy.nvim",
"sainnhe/sonokai",
"rebelot/kanagawa.nvim",
{
"catppuccin/nvim",
{
"catppuccin/nvim",
priority = 1000,
name = "catppuccin",
config = function()
name = "catppuccin",
config = function()
require("catppuccin").setup{
flavor = "mocha",
navic = {

View file

@ -19,6 +19,6 @@ require("lazy").setup("config.packages", {
lazy = false
},
install = {
colorscheme = { "monokai-pro" },
colorscheme = { "melange" },
}
})

View file

@ -1,13 +1,10 @@
-- numbers
vim.opt.nu = true
vim.opt.number = true
vim.opt.relativenumber = true
-- tab && indent
vim.opt.tabstop = 4
vim.opt.softtabstop = 0
--vim.opt.noexpandtab = true
vim.cmd("set expandtab")
vim.opt.shiftwidth = 4
vim.opt.smartindent = true
vim.o.breakindent = true
@ -32,14 +29,9 @@ vim.o.smartcase = true
-- colors
vim.opt.termguicolors = true
vim.cmd("colorscheme monokai-pro")
vim.cmd.colorscheme "melange"
vim.opt.cursorline = true
vim.opt.cursorcolumn = true
vim.cmd[[
highlight CursorColumn guibg=none ctermbg=none
highlight link CursorColumn CursorLine
]]
-- misc
vim.opt.swapfile = false
@ -49,9 +41,12 @@ vim.opt.sidescrolloff = 8
vim.opt.signcolumn = "yes"
vim.opt.isfname:append("@-@")
vim.opt.updatetime = 50
vim.opt.timeoutlen = 300
vim.o.mouse = "a"
vim.opt.showmode = false
vim.g.have_nerd_font = true
vim.o.completeopt = "menuone,noselect"
vim.filetype.add({extension = {leaf = 'html'}})
-- vim.filetype.add({extension = {leaf = 'html'}})