From a97049a1d1a24e6cab07d7f3ae025c0b3d41fd1d Mon Sep 17 00:00:00 2001 From: pika Date: Sat, 17 Aug 2024 20:25:24 +0200 Subject: [PATCH] initial commit for dev-env --- after/queries/ecma/textobjects.scm | 5 -- cd-project.nvim.json | 1 - init.lua | 13 ++-- lua/pika/core/keymaps.lua | 2 +- lua/pika/lazy.lua | 47 ++++++++------ lua/pika/plugins/alpha.lua | 36 ----------- lua/pika/plugins/auto-session.lua | 16 ----- lua/pika/plugins/bufferline.lua | 1 + lua/pika/plugins/cd-project.lua | 41 ------------- lua/pika/plugins/colorschemes.lua | 17 +++--- lua/pika/plugins/dashboard.lua | 78 ++++++++++++++++++++++++ lua/pika/plugins/dressing.lua | 4 -- lua/pika/plugins/formatting.lua | 41 ------------- lua/pika/plugins/gitsigns.lua | 47 -------------- lua/pika/plugins/lazygit.lua | 19 ------ lua/pika/plugins/linting.lua | 35 ----------- lua/pika/plugins/{lsp => }/lspconfig.lua | 0 lua/pika/plugins/lualine.lua.disabled | 71 --------------------- lua/pika/plugins/markdown.lua | 10 --- lua/pika/plugins/{lsp => }/mason.lua | 0 lua/pika/plugins/neo-tree.lua | 22 +++++++ lua/pika/plugins/nvim-tree.lua | 65 -------------------- lua/pika/plugins/telescope.lua | 26 ++------ lua/pika/plugins/todo-comments.lua | 21 ------- lua/pika/plugins/treesitter.lua | 1 + lua/pika/plugins/trouble.lua | 12 ---- 26 files changed, 153 insertions(+), 478 deletions(-) delete mode 100644 after/queries/ecma/textobjects.scm delete mode 100644 cd-project.nvim.json delete mode 100644 lua/pika/plugins/alpha.lua delete mode 100644 lua/pika/plugins/auto-session.lua delete mode 100644 lua/pika/plugins/cd-project.lua create mode 100644 lua/pika/plugins/dashboard.lua delete mode 100644 lua/pika/plugins/dressing.lua delete mode 100644 lua/pika/plugins/formatting.lua delete mode 100644 lua/pika/plugins/gitsigns.lua delete mode 100644 lua/pika/plugins/lazygit.lua delete mode 100644 lua/pika/plugins/linting.lua rename lua/pika/plugins/{lsp => }/lspconfig.lua (100%) delete mode 100644 lua/pika/plugins/lualine.lua.disabled delete mode 100644 lua/pika/plugins/markdown.lua rename lua/pika/plugins/{lsp => }/mason.lua (100%) create mode 100644 lua/pika/plugins/neo-tree.lua delete mode 100644 lua/pika/plugins/nvim-tree.lua delete mode 100644 lua/pika/plugins/todo-comments.lua delete mode 100644 lua/pika/plugins/trouble.lua diff --git a/after/queries/ecma/textobjects.scm b/after/queries/ecma/textobjects.scm deleted file mode 100644 index baac449..0000000 --- a/after/queries/ecma/textobjects.scm +++ /dev/null @@ -1,5 +0,0 @@ -; extends -(object - (pair - key: (_) @property.lhs - value: (_) @property.inner @property.rhs) @property.outer) diff --git a/cd-project.nvim.json b/cd-project.nvim.json deleted file mode 100644 index 4e80fd3..0000000 --- a/cd-project.nvim.json +++ /dev/null @@ -1 +0,0 @@ -[{"name": "pika", "path": "/home/pika"}, {"name": ".config", "path": "/home/pika/.config/"}, {"name": "gitea", "path": "/home/pika/gitea/"}] \ No newline at end of file diff --git a/init.lua b/init.lua index fb057ff..af191c2 100644 --- a/init.lua +++ b/init.lua @@ -1,8 +1,3 @@ --- ─< Function to apply the colorscheme >─────────────────────────────────────────────── -local function apply_colorscheme(name) - vim.cmd.colorscheme(name) -end - require("pika.core") require("pika.lazy") @@ -10,4 +5,10 @@ require("pika.lazy") -- ╭──────────────────────────────────────────────────────╮ -- │ themes are under ./lua/pika/plugins/colorschemes.lua │ -- ╰──────────────────────────────────────────────────────╯ -apply_colorscheme("melange") -- Change "witch" to your desired colorscheme name + +-- ─< Function to apply the colorscheme >─────────────────────────────────────────────── +local function apply_colorscheme(name) + vim.cmd.colorscheme(name) +end + +apply_colorscheme("eldritch") -- Change "witch" to your desired colorscheme name diff --git a/lua/pika/core/keymaps.lua b/lua/pika/core/keymaps.lua index d931f98..c1f3524 100644 --- a/lua/pika/core/keymaps.lua +++ b/lua/pika/core/keymaps.lua @@ -42,7 +42,7 @@ map("n", "x", "bd!") map("n", "C", "ColorizerToggle") --─< Toggle NvimTree >───────────────────────────────────────────────────────────────── -map("n", "e", ":NvimTreeToggle", { noremap = true, silent = true, desc = "[e]xplorer" }) +map("n", "e", ":Neotree toggle", { noremap = true, silent = true, desc = "[e]xplorer" }) -- ─< Disable arrow keys in normal mode >─────────────────────────────────────────────── map("n", "", 'echo "Use h to move!!"') diff --git a/lua/pika/lazy.lua b/lua/pika/lazy.lua index cf32538..0582fc7 100644 --- a/lua/pika/lazy.lua +++ b/lua/pika/lazy.lua @@ -1,22 +1,35 @@ +-- Bootstrap lazy.nvim local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not vim.loop.fs_stat(lazypath) then - vim.fn.system({ - "git", - "clone", - "--filter=blob:none", - "https://github.com/folke/lazy.nvim.git", - "--branch=stable", -- latest stable release - lazypath, - }) +if not (vim.uv or vim.loop).fs_stat(lazypath) then + local lazyrepo = "https://github.com/folke/lazy.nvim.git" + local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) + if vim.v.shell_error ~= 0 then + vim.api.nvim_echo({ + { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, + { out, "WarningMsg" }, + { "\nPress any key to exit..." }, + }, true, {}) + vim.fn.getchar() + os.exit(1) + end end vim.opt.rtp:prepend(lazypath) -require("lazy").setup({ { import = "pika.plugins" }, { import = "pika.plugins.lsp" } }, { - checker = { - enabled = true, - notify = true, - }, - change_detection = { - notify = true, - }, +-- Make sure to setup `mapleader` and `maplocalleader` before +-- loading lazy.nvim so that mappings are correct. +-- This is also a good place to setup other settings (vim.opt) +vim.g.mapleader = " " +vim.g.maplocalleader = "\\" + +-- Setup lazy.nvim +require("lazy").setup({ + spec = { + -- import your plugins + { import = "pika.plugins" }, + }, + -- Configure any other settings here. See the documentation for more details. + -- colorscheme that will be used when installing plugins. + install = { colorscheme = { "eldritch" } }, + -- automatically check for plugin updates + checker = { enabled = true }, }) diff --git a/lua/pika/plugins/alpha.lua b/lua/pika/plugins/alpha.lua deleted file mode 100644 index 33ce78e..0000000 --- a/lua/pika/plugins/alpha.lua +++ /dev/null @@ -1,36 +0,0 @@ -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", "ene"), - dashboard.button("SPC ee", " > Toggle file explorer", "NvimTreeToggle"), - dashboard.button("SPC ff", "󰱼 > Find File", "Telescope find_files"), - dashboard.button("SPC fs", " > Find Word", "Telescope live_grep"), - dashboard.button("SPC wr", "󰁯 > Restore Session For Current Directory", "SessionRestore"), - dashboard.button("q", " > Quit NVIM", "qa"), - } - - -- Send config to alpha - alpha.setup(dashboard.opts) - - -- Disable folding on alpha buffer - vim.cmd([[autocmd FileType alpha setlocal nofoldenable]]) - end, -} diff --git a/lua/pika/plugins/auto-session.lua b/lua/pika/plugins/auto-session.lua deleted file mode 100644 index adeff79..0000000 --- a/lua/pika/plugins/auto-session.lua +++ /dev/null @@ -1,16 +0,0 @@ -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", "wr", "SessionRestore", { desc = "Restore session for cwd" }) -- restore last workspace session for current directory - keymap.set("n", "ws", "SessionSave", { desc = "Save session for auto session root dir" }) -- save workspace session for current working directory - end, -} diff --git a/lua/pika/plugins/bufferline.lua b/lua/pika/plugins/bufferline.lua index f7a90de..e4fa7dd 100644 --- a/lua/pika/plugins/bufferline.lua +++ b/lua/pika/plugins/bufferline.lua @@ -20,3 +20,4 @@ return { vim.keymap.set("n", "", "BufferLineCyclePrev") end, } + diff --git a/lua/pika/plugins/cd-project.lua b/lua/pika/plugins/cd-project.lua deleted file mode 100644 index 7673e51..0000000 --- a/lua/pika/plugins/cd-project.lua +++ /dev/null @@ -1,41 +0,0 @@ --- using lazy.nvim -return { - "LintaoAmons/cd-project.nvim", - config = function() - require("cd-project").setup({ - -- this json file is acting like a database to update and read the projects in real time. - -- So because it's just a json file, you can edit directly to add more paths you want manually - projects_config_filepath = vim.fs.normalize(vim.fn.stdpath("config") .. "/cd-project.nvim.json"), - -- this controls the behaviour of `CdProjectAdd` command about how to get the project directory - project_dir_pattern = { ".git", ".gitignore", "Cargo.toml", "package.json", "go.mod" }, - choice_format = "both", -- optional, you can switch to "name" or "path" - projects_picker = "vim-ui", -- optional, you can switch to `telescope` - auto_register_project = false, -- optional, toggle on/off the auto add project behaviour - -- do whatever you like by hooks - hooks = { - { - callback = function(dir) - vim.notify("switched to dir: " .. dir) - end, - }, - { - callback = function(_) - vim.cmd("Telescope find_files") - end, - }, - { - callback = function(dir) - vim.notify("switched to dir: " .. dir) - end, -- required, action when trigger the hook - name = "cd hint", -- optional - order = 1, -- optional, the exection order if there're multiple hooks to be trigger at one point - pattern = "cd-project.nvim", -- optional, trigger hook if contains pattern - trigger_point = "DISABLE", -- optional, enum of trigger_points, default to `AFTER_CD` - match_rule = function(dir) -- optional, a function return bool. if have this fields, then pattern will be ignored - return true - end, - }, - }, - }) - end, -} diff --git a/lua/pika/plugins/colorschemes.lua b/lua/pika/plugins/colorschemes.lua index d70253e..5a25580 100644 --- a/lua/pika/plugins/colorschemes.lua +++ b/lua/pika/plugins/colorschemes.lua @@ -4,9 +4,7 @@ return { "sontungexpt/witch", -- priority = 1000, lazy = false, - config = function(_, opts) - require("witch").setup(opts) - end, + opts = {}, }, { "savq/melange-nvim" }, @@ -37,10 +35,11 @@ return { }) end, }, - { - "LazyVim/LazyVim", - opts = { - colorscheme = "melange", - }, - }, + +{ + "eldritch-theme/eldritch.nvim", + lazy = false, + opts = {}, +} + } diff --git a/lua/pika/plugins/dashboard.lua b/lua/pika/plugins/dashboard.lua new file mode 100644 index 0000000..964be0b --- /dev/null +++ b/lua/pika/plugins/dashboard.lua @@ -0,0 +1,78 @@ +return{ +{ + "nvimdev/dashboard-nvim", + lazy = false, -- As https://github.com/nvimdev/dashboard-nvim/pull/450, dashboard-nvim shouldn't be lazy-loaded to properly handle stdin. + opts = function() + local logo = [[ + ██╗ █████╗ ███████╗██╗ ██╗██╗ ██╗██╗███╗ ███╗ Z + ██║ ██╔══██╗╚══███╔╝╚██╗ ██╔╝██║ ██║██║████╗ ████║ Z + ██║ ███████║ ███╔╝ ╚████╔╝ ██║ ██║██║██╔████╔██║ z + ██║ ██╔══██║ ███╔╝ ╚██╔╝ ╚██╗ ██╔╝██║██║╚██╔╝██║ z + ███████╗██║ ██║███████╗ ██║ ╚████╔╝ ██║██║ ╚═╝ ██║ + ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ + ]] + + logo = string.rep("\n", 8) .. logo .. "\n\n" + + local opts = { + theme = "doom", + hide = { + -- this is taken care of by lualine + -- enabling this messes up the actual laststatus setting after loading a file + statusline = false, + }, + config = { + header = vim.split(logo, "\n"), + -- stylua: ignore + center = { + { action = 'lua LazyVim.pick()()', desc = " Find File", icon = " ", key = "f" }, + { action = "ene | startinsert", desc = " New File", icon = " ", key = "n" }, + { action = 'lua LazyVim.pick("oldfiles")()', desc = " Recent Files", icon = " ", key = "r" }, + { action = 'lua LazyVim.pick("live_grep")()', desc = " Find Text", icon = " ", key = "g" }, + { action = 'lua LazyVim.pick.config_files()()', desc = " Config", icon = " ", key = "c" }, + { action = 'lua require("persistence").load()', desc = " Restore Session", icon = " ", key = "s" }, + { action = "LazyExtras", desc = " Lazy Extras", icon = " ", key = "x" }, + { action = "Lazy", desc = " Lazy", icon = "󰒲 ", key = "l" }, + { action = function() vim.api.nvim_input("qa") end, desc = " Quit", icon = " ", key = "q" }, + }, + footer = function() + local stats = require("lazy").stats() + local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100) + return { "⚡ Neovim loaded " .. stats.loaded .. "/" .. stats.count .. " plugins in " .. ms .. "ms" } + end, + }, + } + + for _, button in ipairs(opts.config.center) do + button.desc = button.desc .. string.rep(" ", 43 - #button.desc) + button.key_format = " %s" + end + + -- open dashboard after closing lazy + if vim.o.filetype == "lazy" then + vim.api.nvim_create_autocmd("WinClosed", { + pattern = tostring(vim.api.nvim_get_current_win()), + once = true, + callback = function() + vim.schedule(function() + vim.api.nvim_exec_autocmds("UIEnter", { group = "dashboard" }) + end) + end, + }) + end + + return opts + end, +}, +{ + "folke/persistence.nvim", + event = "BufReadPre", + opts = {}, + -- stylua: ignore + keys = { + { "qs", function() require("persistence").load() end, desc = "Restore Session" }, + { "ql", function() require("persistence").load({ last = true }) end, desc = "Restore Last Session" }, + { "qd", function() require("persistence").stop() end, desc = "Don't Save Current Session" }, + }, +} +} diff --git a/lua/pika/plugins/dressing.lua b/lua/pika/plugins/dressing.lua deleted file mode 100644 index 105f7e5..0000000 --- a/lua/pika/plugins/dressing.lua +++ /dev/null @@ -1,4 +0,0 @@ -return { - "stevearc/dressing.nvim", - event = "VeryLazy", -} diff --git a/lua/pika/plugins/formatting.lua b/lua/pika/plugins/formatting.lua deleted file mode 100644 index 382906e..0000000 --- a/lua/pika/plugins/formatting.lua +++ /dev/null @@ -1,41 +0,0 @@ -return { - "stevearc/conform.nvim", - event = { "BufReadPre", "BufNewFile" }, - config = function() - local conform = require("conform") - - conform.setup({ - formatters_by_ft = { - javascript = { "prettier" }, - typescript = { "prettier" }, - javascriptreact = { "prettier" }, - typescriptreact = { "prettier" }, - svelte = { "prettier" }, - css = { "prettier" }, - -- html = { 'prettier' }, - fish = { "fish_indent" }, - php = { "pretty-php" }, - json = { "yq" }, - yaml = { "yq" }, - markdown = { "prettier" }, - graphql = { "prettier" }, - liquid = { "prettier" }, - sh = { "shfmt" }, - lua = { "stylua" }, - }, - format_on_save = { - lsp_fallback = false, - async = false, - timeout_ms = 1000, - }, - }) - - vim.keymap.set({ "n", "v" }, "mp", function() - conform.format({ - lsp_fallback = true, - async = false, - timeout_ms = 1000, - }) - end, { desc = "Format file or range (in visual mode)" }) - end, -} diff --git a/lua/pika/plugins/gitsigns.lua b/lua/pika/plugins/gitsigns.lua deleted file mode 100644 index 7daca01..0000000 --- a/lua/pika/plugins/gitsigns.lua +++ /dev/null @@ -1,47 +0,0 @@ -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", "hs", gs.stage_hunk, "Stage hunk") - map("n", "hr", gs.reset_hunk, "Reset hunk") - map("v", "hs", function() - gs.stage_hunk({ vim.fn.line("."), vim.fn.line("v") }) - end, "Stage hunk") - map("v", "hr", function() - gs.reset_hunk({ vim.fn.line("."), vim.fn.line("v") }) - end, "Reset hunk") - - map("n", "hS", gs.stage_buffer, "Stage buffer") - map("n", "hR", gs.reset_buffer, "Reset buffer") - - map("n", "hu", gs.undo_stage_hunk, "Undo stage hunk") - - map("n", "hp", gs.preview_hunk, "Preview hunk") - - map("n", "hb", function() - gs.blame_line({ full = true }) - end, "Blame line") - map("n", "hB", gs.toggle_current_line_blame, "Toggle line blame") - - map("n", "hd", gs.diffthis, "Diff this") - map("n", "hD", function() - gs.diffthis("~") - end, "Diff this ~") - - -- Text object - map({ "o", "x" }, "ih", ":Gitsigns select_hunk", "Gitsigns select hunk") - end, - }, -} diff --git a/lua/pika/plugins/lazygit.lua b/lua/pika/plugins/lazygit.lua deleted file mode 100644 index 5d3f334..0000000 --- a/lua/pika/plugins/lazygit.lua +++ /dev/null @@ -1,19 +0,0 @@ -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 = { - { "lg", "LazyGit", desc = "Open lazy git" }, - }, -} diff --git a/lua/pika/plugins/linting.lua b/lua/pika/plugins/linting.lua deleted file mode 100644 index ace3b89..0000000 --- a/lua/pika/plugins/linting.lua +++ /dev/null @@ -1,35 +0,0 @@ -return { - "mfussenegger/nvim-lint", - event = { "BufReadPre", "BufNewFile" }, - config = function() - local lint = require("lint") - - lint.linters_by_ft = { - javascript = { "eslint_d" }, - typescript = { "eslint_d" }, - javascriptreact = { "eslint_d" }, - typescriptreact = { "eslint_d" }, - git = { "gitlint" }, - json = { "jsonlint" }, - markdown = { "vale" }, - fish = { "fish" }, - php = { "php" }, - yaml = { "yamllint" }, - css = { "stylelint" }, - sh = { "shellcheck" }, - } - - local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true }) - - vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, { - group = lint_augroup, - callback = function() - lint.try_lint() - end, - }) - - vim.keymap.set("n", "l", function() - lint.try_lint() - end, { desc = "Trigger linting for current file" }) - end, -} diff --git a/lua/pika/plugins/lsp/lspconfig.lua b/lua/pika/plugins/lspconfig.lua similarity index 100% rename from lua/pika/plugins/lsp/lspconfig.lua rename to lua/pika/plugins/lspconfig.lua diff --git a/lua/pika/plugins/lualine.lua.disabled b/lua/pika/plugins/lualine.lua.disabled deleted file mode 100644 index aed533d..0000000 --- a/lua/pika/plugins/lualine.lua.disabled +++ /dev/null @@ -1,71 +0,0 @@ --- return { --- "nvim-lualine/lualine.nvim", --- dependencies = { "nvim-tree/nvim-web-devicons" }, --- config = function() --- local lualine = require("lualine") --- local lazy_status = require("lazy.status") -- to configure lazy pending updates count --- --- local colors = { --- blue = "#57a5e5", --- green = "#70c2be", --- violet = "#aaaaff", --- yellow = "#dbb651", --- red = "#e75a7c", --- fg = "#f1e9dc", --- bg = "#31332e", --- inactive_bg = "#3a3d37", --- } --- --- local my_lualine_theme = { --- normal = { --- a = { bg = colors.blue, fg = colors.bg, gui = "bold" }, --- b = { bg = colors.bg, fg = colors.fg }, --- c = { bg = colors.bg, fg = colors.fg }, --- }, --- insert = { --- a = { bg = colors.green, fg = colors.bg, gui = "bold" }, --- b = { bg = colors.bg, fg = colors.fg }, --- c = { bg = colors.bg, fg = colors.fg }, --- }, --- visual = { --- a = { bg = colors.violet, fg = colors.bg, gui = "bold" }, --- b = { bg = colors.bg, fg = colors.fg }, --- c = { bg = colors.bg, fg = colors.fg }, --- }, --- command = { --- a = { bg = colors.yellow, fg = colors.bg, gui = "bold" }, --- b = { bg = colors.bg, fg = colors.fg }, --- c = { bg = colors.bg, fg = colors.fg }, --- }, --- replace = { --- a = { bg = colors.red, fg = colors.bg, gui = "bold" }, --- b = { bg = colors.bg, fg = colors.fg }, --- c = { bg = colors.bg, fg = colors.fg }, --- }, --- inactive = { --- a = { bg = colors.inactive_bg, fg = colors.semilightgray, gui = "bold" }, --- b = { bg = colors.inactive_bg, fg = colors.semilightgray }, --- c = { bg = colors.inactive_bg, fg = colors.semilightgray }, --- }, --- } --- --- -- configure lualine with modified theme --- lualine.setup({ --- options = { --- theme = my_lualine_theme, --- }, --- sections = { --- lualine_x = { --- { --- lazy_status.updates, --- cond = lazy_status.has_updates, --- color = { fg = "#ff9e64" }, --- }, --- { "encoding" }, --- { "fileformat" }, --- { "filetype" }, --- }, --- }, --- }) --- end, --- } diff --git a/lua/pika/plugins/markdown.lua b/lua/pika/plugins/markdown.lua deleted file mode 100644 index ca6585b..0000000 --- a/lua/pika/plugins/markdown.lua +++ /dev/null @@ -1,10 +0,0 @@ -return { - "MeanderingProgrammer/markdown.nvim", - name = "render-markdown", -- Only needed if you have another plugin named markdown.nvim - dependencies = { "nvim-treesitter/nvim-treesitter", "echasnovski/mini.nvim" }, -- if you use the mini.nvim suite - -- dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.icons' }, -- if you use standalone mini plugins - -- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons - config = function() - require("render-markdown").setup({}) - end, -} diff --git a/lua/pika/plugins/lsp/mason.lua b/lua/pika/plugins/mason.lua similarity index 100% rename from lua/pika/plugins/lsp/mason.lua rename to lua/pika/plugins/mason.lua diff --git a/lua/pika/plugins/neo-tree.lua b/lua/pika/plugins/neo-tree.lua new file mode 100644 index 0000000..84a7885 --- /dev/null +++ b/lua/pika/plugins/neo-tree.lua @@ -0,0 +1,22 @@ +return { + { + "nvim-neo-tree/neo-tree.nvim", + opts = { + window = { + mappings = { + ["l"] = "open", + ["o"] = "open", + ["h"] = "close_node", + ["C-v"] = "open_split", + }, + }, + branch = "v3.x", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended + -- "MunifTanjim/nui.nvim", + "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information + } + } + } +} diff --git a/lua/pika/plugins/nvim-tree.lua b/lua/pika/plugins/nvim-tree.lua deleted file mode 100644 index e44e472..0000000 --- a/lua/pika/plugins/nvim-tree.lua +++ /dev/null @@ -1,65 +0,0 @@ -return { - 'nvim-tree/nvim-tree.lua', - dependencies = 'nvim-tree/nvim-web-devicons', - config = function() - local nvimtree = require 'nvim-tree' - - -- recommended settings from nvim-tree documentation - vim.g.loaded_netrw = 1 - vim.g.loaded_netrwPlugin = 1 - - nvimtree.setup { - view = { - width = 24, - relativenumber = true, - }, - -- change folder arrow icons - renderer = { - indent_markers = { - enable = true, - -- icons = { - -- corner = '󱞩', -- Light Arc Up and Right - -- edge = '', -- Box Drawings Heavy Vertical - -- item = '', -- Box Drawings Heavy Vertical and Right - -- none = ' ', -- default: (empty space) - -- }, - }, - icons = { - glyphs = { - folder = { - arrow_closed = '', -- arrow when folder is closed - arrow_open = '', -- arrow when folder is open - }, - default = '', - symlink = '', - git = { - unstaged = '', - staged = '', - unmerged = '', - renamed = '󰘦', - untracked = '󰓒', - deleted = '', - -- ignored = '󱥸', - }, - }, - }, - }, - -- -- disable window_picker for - -- -- explorer to work well with - -- -- window splits - -- actions = { - -- open_file = { - -- window_picker = { - -- enable = false, - -- }, - -- }, - -- }, - filters = { - custom = { '.DS_Store' }, - }, - git = { - ignore = false, - }, - } - end, -} diff --git a/lua/pika/plugins/telescope.lua b/lua/pika/plugins/telescope.lua index e8bdba6..a9ec226 100644 --- a/lua/pika/plugins/telescope.lua +++ b/lua/pika/plugins/telescope.lua @@ -4,25 +4,12 @@ return { dependencies = { "nvim-lua/plenary.nvim", { "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, - "nvim-tree/nvim-web-devicons", - "folke/todo-comments.nvim", + "echasnovski/mini.icons", }, config = function() local telescope = require("telescope") local actions = require("telescope.actions") - local transform_mod = require("telescope.actions.mt").transform_mod - - 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") + -- local transform_mod = require("telescope.actions.mt").transform_mod telescope.setup({ defaults = { @@ -31,8 +18,6 @@ return { i = { [""] = actions.move_selection_previous, -- move to prev result [""] = actions.move_selection_next, -- move to next result - [""] = actions.send_selected_to_qflist + custom_actions.open_trouble_qflist, - [""] = trouble_telescope.open, -- Updated line }, }, }, @@ -46,7 +31,6 @@ return { -- Telescope mappings map("n", "sf", "Telescope find_files", { noremap = true, silent = true, desc = "Find Files" }) map("n", "sw", "Telescope live_grep", { noremap = true, silent = true, desc = "Search Word" }) - map("n", "sn", "Telescope neovim", { noremap = true, silent = true, desc = "Neovim Files" }) map("n", "", "Telescope buffers", { noremap = true, silent = true, desc = "Buffers" }) local builtin = require("telescope.builtin") @@ -58,11 +42,11 @@ return { map("n", "sk", builtin.keymaps, { desc = "[S]earch [K]eymaps" }) map("n", "sg", builtin.live_grep, { desc = "[S]earch by [G]rep" }) map("n", "sd", builtin.diagnostics, { desc = "[S]earch [D]iagnostics" }) - map("n", "sr", builtin.resume, { desc = "[S]earch [R]esume" }) + -- map("n", "sr", builtin.resume, { desc = "[S]earch [R]esume" }) map("n", "s.", builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) map("n", "", builtin.buffers, { desc = "[ ] Find existing buffers" }) - - map("n", "T", ":Telescope colorscheme") + map("n", "T", "Telescope colorscheme") + map("n", "q", vim.cmd.q) -- Additional custom mappings map("n", "/", function() diff --git a/lua/pika/plugins/todo-comments.lua b/lua/pika/plugins/todo-comments.lua deleted file mode 100644 index f74baa9..0000000 --- a/lua/pika/plugins/todo-comments.lua +++ /dev/null @@ -1,21 +0,0 @@ -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, -} diff --git a/lua/pika/plugins/treesitter.lua b/lua/pika/plugins/treesitter.lua index bc296ba..b7bc751 100644 --- a/lua/pika/plugins/treesitter.lua +++ b/lua/pika/plugins/treesitter.lua @@ -62,3 +62,4 @@ return { }) end, } + diff --git a/lua/pika/plugins/trouble.lua b/lua/pika/plugins/trouble.lua deleted file mode 100644 index 9418960..0000000 --- a/lua/pika/plugins/trouble.lua +++ /dev/null @@ -1,12 +0,0 @@ -return { - "folke/trouble.nvim", - dependencies = { "nvim-tree/nvim-web-devicons", "folke/todo-comments.nvim" }, - keys = { - { "xx", "TroubleToggle", desc = "Open/close trouble list" }, - { "xw", "TroubleToggle workspace_diagnostics", desc = "Open trouble workspace diagnostics" }, - { "xd", "TroubleToggle document_diagnostics", desc = "Open trouble document diagnostics" }, - { "xq", "TroubleToggle quickfix", desc = "Open trouble quickfix list" }, - { "xl", "TroubleToggle loclist", desc = "Open trouble location list" }, - { "xt", "TodoTrouble", desc = "Open todos in trouble" }, - }, -}