readdet lost configs..
This commit is contained in:
parent
cc2d378fe7
commit
c3c15c3cea
13 changed files with 338 additions and 163 deletions
36
lua/pika/plugins/alpha.lua
Normal file
36
lua/pika/plugins/alpha.lua
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
return {
|
||||||
|
"goolord/alpha-nvim",
|
||||||
|
event = "VimEnter",
|
||||||
|
config = function()
|
||||||
|
local alpha = require("alpha")
|
||||||
|
local dashboard = require("alpha.themes.dashboard")
|
||||||
|
|
||||||
|
-- Set header
|
||||||
|
dashboard.section.header.val = {
|
||||||
|
" ",
|
||||||
|
" ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ",
|
||||||
|
" ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ",
|
||||||
|
" ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ",
|
||||||
|
" ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ",
|
||||||
|
" ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ",
|
||||||
|
" ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ",
|
||||||
|
" ",
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Set menu
|
||||||
|
dashboard.section.buttons.val = {
|
||||||
|
dashboard.button("e", " > New File", "<cmd>ene<CR>"),
|
||||||
|
dashboard.button("SPC ee", " > Toggle file explorer", "<cmd>NvimTreeToggle<CR>"),
|
||||||
|
dashboard.button("SPC ff", " > Find File", "<cmd>Telescope find_files<CR>"),
|
||||||
|
dashboard.button("SPC fs", " > Find Word", "<cmd>Telescope live_grep<CR>"),
|
||||||
|
dashboard.button("SPC wr", " > Restore Session For Current Directory", "<cmd>SessionRestore<CR>"),
|
||||||
|
dashboard.button("q", " > Quit NVIM", "<cmd>qa<CR>"),
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Send config to alpha
|
||||||
|
alpha.setup(dashboard.opts)
|
||||||
|
|
||||||
|
-- Disable folding on alpha buffer
|
||||||
|
vim.cmd([[autocmd FileType alpha setlocal nofoldenable]])
|
||||||
|
end,
|
||||||
|
}
|
16
lua/pika/plugins/auto-session.lua
Normal file
16
lua/pika/plugins/auto-session.lua
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
return {
|
||||||
|
"rmagatti/auto-session",
|
||||||
|
config = function()
|
||||||
|
local auto_session = require("auto-session")
|
||||||
|
|
||||||
|
auto_session.setup({
|
||||||
|
auto_restore_enabled = false,
|
||||||
|
auto_session_suppress_dirs = { "~/", "~/Dev/", "~/Downloads", "~/Documents", "~/Desktop/" },
|
||||||
|
})
|
||||||
|
|
||||||
|
local keymap = vim.keymap
|
||||||
|
|
||||||
|
keymap.set("n", "<leader>wr", "<cmd>SessionRestore<CR>", { desc = "Restore session for cwd" }) -- restore last workspace session for current directory
|
||||||
|
keymap.set("n", "<leader>ws", "<cmd>SessionSave<CR>", { desc = "Save session for auto session root dir" }) -- save workspace session for current working directory
|
||||||
|
end,
|
||||||
|
}
|
|
@ -3,12 +3,11 @@ return {
|
||||||
lazy = false,
|
lazy = false,
|
||||||
priority = 1000, -- Make sure to load this before all the other start plugins.
|
priority = 1000, -- Make sure to load this before all the other start plugins.
|
||||||
config = function()
|
config = function()
|
||||||
require("bamboo.").setup({
|
require("bamboo").setup({
|
||||||
-- ────────────────────────────< optional configuration here >─────────────────────────
|
-- ────────────────────────────< optional configuration here >─────────────────────────
|
||||||
style = "multiplex",
|
|
||||||
code_style = {
|
code_style = {
|
||||||
comments = { italic = false, bold = true },
|
comments = { italic = false, bold = true },
|
||||||
conditionals = { italic = false },
|
conditionals = { italic = true },
|
||||||
keywords = { bold = true },
|
keywords = { bold = true },
|
||||||
functions = {},
|
functions = {},
|
||||||
namespaces = { italic = true },
|
namespaces = { italic = true },
|
||||||
|
|
47
lua/pika/plugins/gitsigns.lua
Normal file
47
lua/pika/plugins/gitsigns.lua
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
return {
|
||||||
|
"lewis6991/gitsigns.nvim",
|
||||||
|
event = { "BufReadPre", "BufNewFile" },
|
||||||
|
opts = {
|
||||||
|
on_attach = function(bufnr)
|
||||||
|
local gs = package.loaded.gitsigns
|
||||||
|
|
||||||
|
local function map(mode, l, r, desc)
|
||||||
|
vim.keymap.set(mode, l, r, { buffer = bufnr, desc = desc })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Navigation
|
||||||
|
map("n", "]h", gs.next_hunk, "Next Hunk")
|
||||||
|
map("n", "[h", gs.prev_hunk, "Prev Hunk")
|
||||||
|
|
||||||
|
-- Actions
|
||||||
|
map("n", "<leader>hs", gs.stage_hunk, "Stage hunk")
|
||||||
|
map("n", "<leader>hr", gs.reset_hunk, "Reset hunk")
|
||||||
|
map("v", "<leader>hs", function()
|
||||||
|
gs.stage_hunk({ vim.fn.line("."), vim.fn.line("v") })
|
||||||
|
end, "Stage hunk")
|
||||||
|
map("v", "<leader>hr", function()
|
||||||
|
gs.reset_hunk({ vim.fn.line("."), vim.fn.line("v") })
|
||||||
|
end, "Reset hunk")
|
||||||
|
|
||||||
|
map("n", "<leader>hS", gs.stage_buffer, "Stage buffer")
|
||||||
|
map("n", "<leader>hR", gs.reset_buffer, "Reset buffer")
|
||||||
|
|
||||||
|
map("n", "<leader>hu", gs.undo_stage_hunk, "Undo stage hunk")
|
||||||
|
|
||||||
|
map("n", "<leader>hp", gs.preview_hunk, "Preview hunk")
|
||||||
|
|
||||||
|
map("n", "<leader>hb", function()
|
||||||
|
gs.blame_line({ full = true })
|
||||||
|
end, "Blame line")
|
||||||
|
map("n", "<leader>hB", gs.toggle_current_line_blame, "Toggle line blame")
|
||||||
|
|
||||||
|
map("n", "<leader>hd", gs.diffthis, "Diff this")
|
||||||
|
map("n", "<leader>hD", function()
|
||||||
|
gs.diffthis("~")
|
||||||
|
end, "Diff this ~")
|
||||||
|
|
||||||
|
-- Text object
|
||||||
|
map({ "o", "x" }, "ih", ":<C-U>Gitsigns select_hunk<CR>", "Gitsigns select hunk")
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
19
lua/pika/plugins/lazygit.lua
Normal file
19
lua/pika/plugins/lazygit.lua
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
return {
|
||||||
|
"kdheepak/lazygit.nvim",
|
||||||
|
cmd = {
|
||||||
|
"LazyGit",
|
||||||
|
"LazyGitConfig",
|
||||||
|
"LazyGitCurrentFile",
|
||||||
|
"LazyGitFilter",
|
||||||
|
"LazyGitFilterCurrentFile",
|
||||||
|
},
|
||||||
|
-- optional for floating window border decoration
|
||||||
|
dependencies = {
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
},
|
||||||
|
-- setting the keybinding for LazyGit with 'keys' is recommended in
|
||||||
|
-- order to load the plugin when the command is run for the first time
|
||||||
|
keys = {
|
||||||
|
{ "<leader>lg", "<cmd>LazyGit<cr>", desc = "Open lazy git" },
|
||||||
|
},
|
||||||
|
}
|
|
@ -91,6 +91,8 @@ return {
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
filetypes = {
|
filetypes = {
|
||||||
"html",
|
"html",
|
||||||
|
"typescriptreact",
|
||||||
|
"javascriptreact",
|
||||||
"css",
|
"css",
|
||||||
"sass",
|
"sass",
|
||||||
"scss",
|
"scss",
|
||||||
|
|
|
@ -27,11 +27,16 @@ return {
|
||||||
mason_lspconfig.setup({
|
mason_lspconfig.setup({
|
||||||
-- list of servers for mason to install
|
-- list of servers for mason to install
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
|
"tsserver",
|
||||||
"html",
|
"html",
|
||||||
"cssls",
|
"cssls",
|
||||||
"tailwindcss",
|
"tailwindcss",
|
||||||
"svelte",
|
"svelte",
|
||||||
"lua_ls",
|
"lua_ls",
|
||||||
|
"graphql",
|
||||||
|
"emmet_ls",
|
||||||
|
"prismals",
|
||||||
|
"pyright",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -39,6 +44,10 @@ return {
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
"prettier", -- prettier formatter
|
"prettier", -- prettier formatter
|
||||||
"stylua", -- lua formatter
|
"stylua", -- lua formatter
|
||||||
|
-- "isort", -- python formatter
|
||||||
|
-- "black", -- python formatter
|
||||||
|
"pylint",
|
||||||
|
"eslint_d",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
|
|
|
@ -63,7 +63,7 @@ return {
|
||||||
formatting = {
|
formatting = {
|
||||||
format = lspkind.cmp_format({
|
format = lspkind.cmp_format({
|
||||||
mode = "symbol_text", -- show symbol text with icons
|
mode = "symbol_text", -- show symbol text with icons
|
||||||
maxwidth = 90,
|
maxwidth = 130,
|
||||||
ellipsis_char = "...",
|
ellipsis_char = "...",
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
|
|
|
@ -35,14 +35,8 @@ return {
|
||||||
["af"] = { query = "@call.outer", desc = "Select outer part of a function call" },
|
["af"] = { query = "@call.outer", desc = "Select outer part of a function call" },
|
||||||
["if"] = { query = "@call.inner", desc = "Select inner part of a function call" },
|
["if"] = { query = "@call.inner", desc = "Select inner part of a function call" },
|
||||||
|
|
||||||
["am"] = {
|
["am"] = { query = "@function.outer", desc = "Select outer part of a method/function definition" },
|
||||||
query = "@function.outer",
|
["im"] = { query = "@function.inner", desc = "Select inner part of a method/function definition" },
|
||||||
desc = "Select outer part of a method/function definition",
|
|
||||||
},
|
|
||||||
["im"] = {
|
|
||||||
query = "@function.inner",
|
|
||||||
desc = "Select inner part of a method/function definition",
|
|
||||||
},
|
|
||||||
|
|
||||||
["ac"] = { query = "@class.outer", desc = "Select outer part of a class" },
|
["ac"] = { query = "@class.outer", desc = "Select outer part of a class" },
|
||||||
["ic"] = { query = "@class.inner", desc = "Select inner part of a class" },
|
["ic"] = { query = "@class.inner", desc = "Select inner part of a class" },
|
||||||
|
@ -106,5 +100,11 @@ return {
|
||||||
-- vim way: ; goes to the direction you were moving.
|
-- vim way: ; goes to the direction you were moving.
|
||||||
vim.keymap.set({ "n", "x", "o" }, ";", ts_repeat_move.repeat_last_move)
|
vim.keymap.set({ "n", "x", "o" }, ";", ts_repeat_move.repeat_last_move)
|
||||||
vim.keymap.set({ "n", "x", "o" }, ",", ts_repeat_move.repeat_last_move_opposite)
|
vim.keymap.set({ "n", "x", "o" }, ",", ts_repeat_move.repeat_last_move_opposite)
|
||||||
|
|
||||||
|
-- Optionally, make builtin f, F, t, T also repeatable with ; and ,
|
||||||
|
vim.keymap.set({ "n", "x", "o" }, "f", ts_repeat_move.builtin_f)
|
||||||
|
vim.keymap.set({ "n", "x", "o" }, "F", ts_repeat_move.builtin_F)
|
||||||
|
vim.keymap.set({ "n", "x", "o" }, "t", ts_repeat_move.builtin_t)
|
||||||
|
vim.keymap.set({ "n", "x", "o" }, "T", ts_repeat_move.builtin_T)
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,60 +1,74 @@
|
||||||
return {
|
return {
|
||||||
"nvim-telescope/telescope.nvim",
|
'nvim-telescope/telescope.nvim',
|
||||||
branch = "0.1.x",
|
branch = '0.1.x',
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"nvim-lua/plenary.nvim",
|
'nvim-lua/plenary.nvim',
|
||||||
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
|
{ 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' },
|
||||||
"nvim-tree/nvim-web-devicons",
|
'nvim-tree/nvim-web-devicons',
|
||||||
"folke/todo-comments.nvim",
|
'folke/todo-comments.nvim',
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
local telescope = require("telescope")
|
local telescope = require 'telescope'
|
||||||
local actions = require("telescope.actions")
|
local actions = require 'telescope.actions'
|
||||||
local transform_mod = require("telescope.actions.mt").transform_mod
|
local transform_mod = require('telescope.actions.mt').transform_mod
|
||||||
|
|
||||||
telescope.setup({
|
local trouble = require 'trouble'
|
||||||
|
local trouble_telescope = require 'trouble.providers.telescope'
|
||||||
|
|
||||||
|
-- or create your custom action
|
||||||
|
local custom_actions = transform_mod {
|
||||||
|
open_trouble_qflist = function(prompt_bufnr)
|
||||||
|
trouble.toggle 'quickfix'
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
||||||
|
local trouble_telescope = require 'trouble.sources.telescope'
|
||||||
|
|
||||||
|
telescope.setup {
|
||||||
defaults = {
|
defaults = {
|
||||||
path_display = { "smart" },
|
path_display = { 'smart' },
|
||||||
mappings = {
|
mappings = {
|
||||||
i = {
|
i = {
|
||||||
["<C-k>"] = actions.move_selection_previous, -- move to prev result
|
['<C-k>'] = actions.move_selection_previous, -- move to prev result
|
||||||
["<C-j>"] = actions.move_selection_next, -- move to next result
|
['<C-j>'] = actions.move_selection_next, -- move to next result
|
||||||
|
['<C-q>'] = actions.send_selected_to_qflist + custom_actions.open_trouble_qflist,
|
||||||
|
['<C-t>'] = trouble_telescope.open, -- Updated line
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
}
|
||||||
|
|
||||||
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
|
-- Telescope mappings
|
||||||
map("n", "<leader>sf", "<cmd>Telescope find_files<CR>", { noremap = true, silent = true, desc = "Find Files" })
|
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>sw', '<cmd>Telescope live_grep<CR>', { noremap = true, silent = true, desc = 'Search Word' })
|
||||||
map("n", "<leader>sn", "<cmd>Telescope neovim<CR>", { noremap = true, silent = true, desc = "Neovim Files" })
|
map('n', '<leader>sn', '<cmd>Telescope neovim<CR>', { noremap = true, silent = true, desc = 'Neovim Files' })
|
||||||
map("n", "<leader><leader>", "<cmd>Telescope buffers<CR>", { noremap = true, silent = true, desc = "Buffers" })
|
map('n', '<leader><leader>', '<cmd>Telescope buffers<CR>', { noremap = true, silent = true, desc = 'Buffers' })
|
||||||
local builtin = require("telescope.builtin")
|
local builtin = require 'telescope.builtin'
|
||||||
|
|
||||||
map("n", "<leader>sn", function()
|
map('n', '<leader>sn', function()
|
||||||
builtin.find_files({ cwd = vim.fn.stdpath("config") })
|
builtin.find_files { cwd = vim.fn.stdpath 'config' }
|
||||||
end, { desc = "[S]earch [N]eovim files" })
|
end, { desc = '[S]earch [N]eovim files' })
|
||||||
map("n", "<leader>ff", builtin.find_files, { desc = "[S]earch [F]iles" })
|
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>sh', builtin.help_tags, { desc = '[S]earch [H]elp' })
|
||||||
map("n", "<leader>sk", builtin.keymaps, { desc = "[S]earch [K]eymaps" })
|
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>sg', builtin.live_grep, { desc = '[S]earch by [G]rep' })
|
||||||
map("n", "<leader>sd", builtin.diagnostics, { desc = "[S]earch [D]iagnostics" })
|
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>sr', builtin.resume, { desc = '[S]earch [R]esume' })
|
||||||
map("n", "<leader>s.", builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' })
|
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><leader>', builtin.buffers, { desc = '[ ] Find existing buffers' })
|
||||||
map("n", "<leader>q", vim.cmd.q)
|
map('n', '<leader>q', vim.cmd.q)
|
||||||
|
|
||||||
-- 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 = '[/] Fuzzily search in current buffer' })
|
||||||
map("n", "<leader>s/", function()
|
map('n', '<leader>s/', 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 = '[S]earch [/] in Open Files' })
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
21
lua/pika/plugins/todo-comments.lua
Normal file
21
lua/pika/plugins/todo-comments.lua
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
return {
|
||||||
|
"folke/todo-comments.nvim",
|
||||||
|
event = { "BufReadPre", "BufNewFile" },
|
||||||
|
dependencies = { "nvim-lua/plenary.nvim" },
|
||||||
|
config = function()
|
||||||
|
local todo_comments = require("todo-comments")
|
||||||
|
|
||||||
|
-- set keymaps
|
||||||
|
local keymap = vim.keymap -- for conciseness
|
||||||
|
|
||||||
|
keymap.set("n", "]t", function()
|
||||||
|
todo_comments.jump_next()
|
||||||
|
end, { desc = "Next todo comment" })
|
||||||
|
|
||||||
|
keymap.set("n", "[t", function()
|
||||||
|
todo_comments.jump_prev()
|
||||||
|
end, { desc = "Previous todo comment" })
|
||||||
|
|
||||||
|
todo_comments.setup()
|
||||||
|
end,
|
||||||
|
}
|
12
lua/pika/plugins/trouble.lua
Normal file
12
lua/pika/plugins/trouble.lua
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
return {
|
||||||
|
"folke/trouble.nvim",
|
||||||
|
dependencies = { "nvim-tree/nvim-web-devicons", "folke/todo-comments.nvim" },
|
||||||
|
keys = {
|
||||||
|
{ "<leader>xx", "<cmd>TroubleToggle<CR>", desc = "Open/close trouble list" },
|
||||||
|
{ "<leader>xw", "<cmd>TroubleToggle workspace_diagnostics<CR>", desc = "Open trouble workspace diagnostics" },
|
||||||
|
{ "<leader>xd", "<cmd>TroubleToggle document_diagnostics<CR>", desc = "Open trouble document diagnostics" },
|
||||||
|
{ "<leader>xq", "<cmd>TroubleToggle quickfix<CR>", desc = "Open trouble quickfix list" },
|
||||||
|
{ "<leader>xl", "<cmd>TroubleToggle loclist<CR>", desc = "Open trouble location list" },
|
||||||
|
{ "<leader>xt", "<cmd>TodoTrouble<CR>", desc = "Open todos in trouble" },
|
||||||
|
},
|
||||||
|
}
|
|
@ -1,9 +1,9 @@
|
||||||
return {
|
return {
|
||||||
"folke/which-key.nvim",
|
'folke/which-key.nvim',
|
||||||
event = "VeryLazy",
|
event = 'VeryLazy',
|
||||||
init = function()
|
init = function()
|
||||||
vim.o.timeout = true
|
vim.o.timeout = true
|
||||||
vim.o.timeoutlen = 350
|
vim.o.timeoutlen = 300
|
||||||
end,
|
end,
|
||||||
opts = {
|
opts = {
|
||||||
-- your configuration comes here
|
-- your configuration comes here
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue