some nice changes
This commit is contained in:
parent
2086e7e5d3
commit
19fc44af80
6 changed files with 58 additions and 79 deletions
2
init.lua
2
init.lua
|
@ -9,5 +9,5 @@ else
|
||||||
-- │ themes are under ./lua/pika/plugins/colorschemes.lua │
|
-- │ themes are under ./lua/pika/plugins/colorschemes.lua │
|
||||||
-- ╰──────────────────────────────────────────────────────╯
|
-- ╰──────────────────────────────────────────────────────╯
|
||||||
|
|
||||||
vim.cmd.colorscheme("cyberdream")
|
vim.cmd.colorscheme("rose-pine-moon")
|
||||||
end
|
end
|
||||||
|
|
|
@ -7,7 +7,6 @@ nomap("n", "<C-k>", "")
|
||||||
nomap("n", "q", "")
|
nomap("n", "q", "")
|
||||||
nomap("v", "q", "")
|
nomap("v", "q", "")
|
||||||
nomap("v", "<leader>S", "")
|
nomap("v", "<leader>S", "")
|
||||||
nomap({ "i", "v", "n" }, "<C-q>", "")
|
|
||||||
|
|
||||||
local map = vim.keymap.set
|
local map = vim.keymap.set
|
||||||
|
|
||||||
|
@ -58,33 +57,3 @@ map("n", "<leader>R", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]])
|
||||||
-- window management
|
-- window management
|
||||||
map("n", "<leader>sv", "<C-w>v", { desc = "Split window vertically" }) -- split window vertically
|
map("n", "<leader>sv", "<C-w>v", { desc = "Split window vertically" }) -- split window vertically
|
||||||
map("n", "<leader>sh", "<C-w>s", { desc = "Split window horizontally" }) -- split window horizontally
|
map("n", "<leader>sh", "<C-w>s", { desc = "Split window horizontally" }) -- split window horizontally
|
||||||
|
|
||||||
vim.keymap.set({ "n", "i" }, "<leader>tt", function()
|
|
||||||
-- Frage den Shell-Command ab
|
|
||||||
vim.ui.input({ prompt = "Shell Command: " }, function(cmd)
|
|
||||||
if cmd == nil or cmd == "" then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local result = vim.fn.system(cmd)
|
|
||||||
local exit_code = vim.v.shell_error
|
|
||||||
|
|
||||||
if exit_code ~= 0 then
|
|
||||||
vim.notify("Shell Error:\n" .. result, vim.log.levels.ERROR, { title = "Shell Command Failed" })
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local lines = vim.split(result, "\n", { trimempty = true })
|
|
||||||
|
|
||||||
-- Insert at cursor position
|
|
||||||
local row, col = unpack(vim.api.nvim_win_get_cursor(0))
|
|
||||||
if #lines == 1 then
|
|
||||||
-- Insert inline if the result is a single line
|
|
||||||
local current_line = vim.api.nvim_get_current_line()
|
|
||||||
local new_line = current_line:sub(1, col) .. lines[1] .. current_line:sub(col + 1)
|
|
||||||
vim.api.nvim_set_current_line(new_line)
|
|
||||||
else
|
|
||||||
vim.api.nvim_buf_set_lines(0, row, row, false, lines)
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
end, { desc = "Insert Shell Output at Cursor" })
|
|
||||||
|
|
|
@ -1,19 +1,15 @@
|
||||||
return {
|
return {
|
||||||
{ "folke/tokyonight.nvim" },
|
{ "rose-pine/neovim", name = "rose-pine" },
|
||||||
{ "fynnfluegge/monet.nvim", name = "monet" },
|
|
||||||
{ "L-Colombo/oldschool.nvim", config = "true" },
|
{ "L-Colombo/oldschool.nvim", config = "true" },
|
||||||
|
{ "ptdewey/darkearth-nvim" },
|
||||||
-- { "catppuccin/nvim", name = "catppuccin" },
|
-- { "catppuccin/nvim", name = "catppuccin" },
|
||||||
|
-- { "folke/tokyonight.nvim" },
|
||||||
|
-- { "fynnfluegge/monet.nvim", name = "monet" },
|
||||||
|
-- { "AlexvZyl/nordic.nvim" },
|
||||||
|
-- { "eldritch-theme/eldritch.nvim" },
|
||||||
-- { "EdenEast/nightfox.nvim" },
|
-- { "EdenEast/nightfox.nvim" },
|
||||||
-- { "DanWlker/primeppuccin", name = "primeppuccin" },
|
-- { "DanWlker/primeppuccin", name = "primeppuccin" },
|
||||||
-- { "rose-pine/neovim", name = "rose-pine" },
|
|
||||||
{ "AlexvZyl/nordic.nvim" },
|
|
||||||
{ "eldritch-theme/eldritch.nvim" },
|
|
||||||
-- { "sainnhe/sonokai" },
|
-- { "sainnhe/sonokai" },
|
||||||
{ "samharju/synthweave.nvim" },
|
|
||||||
{ "sainnhe/gruvbox-material" },
|
|
||||||
{ "pauchiner/pastelnight.nvim" },
|
|
||||||
{ "ptdewey/darkearth-nvim" },
|
|
||||||
{ "marko-cerovac/material.nvim" },
|
|
||||||
-- {
|
-- {
|
||||||
-- "ferdinandrau/lavish.nvim",
|
-- "ferdinandrau/lavish.nvim",
|
||||||
-- opts = {
|
-- opts = {
|
||||||
|
|
|
@ -29,14 +29,14 @@ return {
|
||||||
-- },
|
-- },
|
||||||
{
|
{
|
||||||
-- Open in the current working directory
|
-- Open in the current working directory
|
||||||
"<leader>Lf",
|
"<leader>tLf",
|
||||||
"<cmd>Yazi cwd<cr>",
|
"<cmd>Yazi cwd<cr>",
|
||||||
desc = "Open the file manager in nvim's working directory",
|
desc = "Open the file manager in nvim's working directory",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
-- NOTE: this requires a version of yazi that includes
|
-- NOTE: this requires a version of yazi that includes
|
||||||
-- https://github.com/sxyazi/yazi/pull/1305 from 2024-07-18
|
-- https://github.com/sxyazi/yazi/pull/1305 from 2024-07-18
|
||||||
"<leader>lf",
|
"<leader>tlf",
|
||||||
"<cmd>Yazi toggle<cr>",
|
"<cmd>Yazi toggle<cr>",
|
||||||
desc = "Resume the last yazi session",
|
desc = "Resume the last yazi session",
|
||||||
},
|
},
|
||||||
|
|
|
@ -71,13 +71,12 @@ return {
|
||||||
use_nvim_cmp_as_default = true,
|
use_nvim_cmp_as_default = true,
|
||||||
},
|
},
|
||||||
|
|
||||||
-- (Default) Only show the documentation popup when manually triggered
|
|
||||||
completion = {
|
completion = {
|
||||||
documentation = {
|
documentation = {
|
||||||
auto_show = false,
|
auto_show = false,
|
||||||
auto_show_delay_ms = 230,
|
auto_show_delay_ms = 230,
|
||||||
update_delay_ms = 50,
|
update_delay_ms = 50,
|
||||||
treesitter_highlighting = false,
|
treesitter_highlighting = true,
|
||||||
draw = function(opts)
|
draw = function(opts)
|
||||||
opts.default_implementation()
|
opts.default_implementation()
|
||||||
end,
|
end,
|
||||||
|
@ -125,13 +124,13 @@ return {
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
-- kind = {
|
kind = {
|
||||||
-- -- (optional) use highlights from mini.icons
|
-- (optional) use highlights from mini.icons
|
||||||
-- highlight = function(ctx)
|
highlight = function(ctx)
|
||||||
-- local _, hl, _ = require("mini.icons").get("lsp", ctx.kind)
|
local _, hl, _ = require("mini.icons").get("lsp", ctx.kind)
|
||||||
-- return hl
|
return hl
|
||||||
-- end,
|
end,
|
||||||
-- },
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -140,7 +139,15 @@ return {
|
||||||
-- Default list of enabled providers defined so that you can extend it
|
-- Default list of enabled providers defined so that you can extend it
|
||||||
-- elsewhere in your config, without redefining it, due to `opts_extend`
|
-- elsewhere in your config, without redefining it, due to `opts_extend`
|
||||||
sources = {
|
sources = {
|
||||||
default = { "lsp", "path", "snippets", "buffer" },
|
default = { "lazydev", "lsp", "path", "snippets", "buffer" },
|
||||||
|
providers = {
|
||||||
|
lazydev = {
|
||||||
|
name = "LazyDev",
|
||||||
|
module = "lazydev.integrations.blink",
|
||||||
|
-- make lazydev completions top priority (see `:h blink.cmp`)
|
||||||
|
score_offset = 100,
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
-- (Default) Rust fuzzy matcher for typo resistance and significantly better performance
|
-- (Default) Rust fuzzy matcher for typo resistance and significantly better performance
|
||||||
|
@ -332,4 +339,17 @@ return {
|
||||||
-- })
|
-- })
|
||||||
-- end,
|
-- end,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
-- ───────────────────────────────────────< extras >───────────────────────────────────────
|
||||||
|
{
|
||||||
|
"folke/lazydev.nvim",
|
||||||
|
ft = "lua", -- only load on lua files
|
||||||
|
opts = {
|
||||||
|
library = {
|
||||||
|
-- See the configuration section for more details
|
||||||
|
-- Load luvit types when the `vim.uv` word is found
|
||||||
|
{ path = "${3rd}/luv/library", words = { "vim%.uv" } },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,38 +25,32 @@ return {
|
||||||
|
|
||||||
telescope.load_extension("fzf")
|
telescope.load_extension("fzf")
|
||||||
|
|
||||||
-- set keymaps
|
-- ─< set keymaps >─────────────────────────────────────────────────────────────────────
|
||||||
local map = vim.keymap.set -- for conciseness
|
local map = vim.keymap.set -- for conciseness
|
||||||
|
|
||||||
-- Telescope mappings
|
|
||||||
map("n", "<leader>sf", "<cmd>Telescope find_files<CR>", { noremap = true, silent = true, desc = "Find Files" })
|
|
||||||
map("n", "<leader>sw", "<cmd>Telescope live_grep<CR>", { noremap = true, silent = true, desc = "Search Word" })
|
|
||||||
map("n", "<leader><leader>", "<cmd>Telescope buffers<CR>", { noremap = true, silent = true, desc = "Buffers" })
|
|
||||||
local builtin = require("telescope.builtin")
|
local builtin = require("telescope.builtin")
|
||||||
|
-- ─────────────────────────────────< Telescope mappings >─────────────────────────────────
|
||||||
map("n", "<leader>sn", function()
|
|
||||||
builtin.find_files({ cwd = vim.fn.stdpath("config") })
|
|
||||||
end, { desc = "[S]earch [N]eovim files" })
|
|
||||||
map("n", "<leader>ff", builtin.find_files, { desc = "[S]earch [F]iles" })
|
|
||||||
map("n", "<leader>sh", builtin.help_tags, { desc = "[S]earch [H]elp" })
|
|
||||||
map("n", "<leader>sk", builtin.keymaps, { desc = "[S]earch [K]eymaps" })
|
|
||||||
map("n", "<leader>sg", builtin.live_grep, { desc = "[S]earch by [G]rep" })
|
|
||||||
map("n", "<leader>sd", builtin.diagnostics, { desc = "[S]earch [D]iagnostics" })
|
|
||||||
-- map("n", "<leader>sr", builtin.resume, { desc = "[S]earch [R]esume" })
|
|
||||||
map("n", "<leader>s.", builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' })
|
|
||||||
map("n", "<leader><leader>", builtin.buffers, { desc = "[ ] Find existing buffers" })
|
|
||||||
map("n", "<leader>sR", function()
|
|
||||||
require("telescope.builtin").oldfiles()
|
|
||||||
end)
|
|
||||||
map("n", "<leader>T", "<cmd>Telescope colorscheme<CR>")
|
map("n", "<leader>T", "<cmd>Telescope colorscheme<CR>")
|
||||||
map("n", "<leader>q", vim.cmd.q)
|
|
||||||
|
map("n", "<leader>ff", "<cmd>Telescope find_files<CR>", { noremap = true, silent = true, desc = "Find Files" })
|
||||||
|
-- map("n", "<leader>ff", builtin.find_files, { desc = "Find Files" })
|
||||||
|
map("n", "<leader>fw", "<cmd>Telescope live_grep<CR>", { noremap = true, silent = true, desc = "Find Word" })
|
||||||
|
-- map("n", "<leader>fw", builtin.live_grep, { desc = "Find word" })
|
||||||
|
-- map("n", "<leader>fb", "<cmd>Telescope buffers<CR>", { noremap = true, silent = true, desc = "Find Buffers" })
|
||||||
|
map("n", "<leader><leader>", builtin.buffers, { desc = "[ ] Find existing buffers" })
|
||||||
|
map("n", "<leader>fn", function()
|
||||||
|
builtin.find_files({ cwd = vim.fn.stdpath("config") })
|
||||||
|
end, { desc = "Find Neovim files" })
|
||||||
|
map("n", "<leader>fh", builtin.help_tags, { desc = "Find Help" })
|
||||||
|
map("n", "<leader>fk", builtin.keymaps, { desc = "Find Keymaps" })
|
||||||
|
map("n", "<leader>fd", builtin.diagnostics, { desc = "Find Diagnostics" })
|
||||||
|
map("n", "<leader>fo", builtin.oldfiles, { desc = "Find old/Recent Files" })
|
||||||
|
|
||||||
-- Additional custom mappings
|
-- Additional custom mappings
|
||||||
map("n", "<leader>/", function()
|
map("n", "<leader>/", function()
|
||||||
builtin.current_buffer_fuzzy_find(require("telescope.themes").get_dropdown())
|
builtin.current_buffer_fuzzy_find(require("telescope.themes").get_dropdown())
|
||||||
end, { desc = "[/] Fuzzily search in current buffer" })
|
end, { desc = "Search in current buffer" })
|
||||||
map("n", "<leader>s/", function()
|
map("n", "<leader>f/", function()
|
||||||
builtin.live_grep({ grep_open_files = true, prompt_title = "Live Grep in Open Files" })
|
builtin.live_grep({ grep_open_files = true, prompt_title = "Live Grep in Open Files" })
|
||||||
end, { desc = "[S]earch [/] in Open Files" })
|
end, { desc = "Search in Open Files" })
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue