commit 6e42660d6d83e27888ff1fb7f9b47d7449cbd890 Author: pika Date: Fri Mar 21 19:58:13 2025 +0100 batman diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..55d79fe --- /dev/null +++ b/.gitignore @@ -0,0 +1,17 @@ +# ---> Linux +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +lazy-lock.json +cd-project.nvim.json diff --git a/.vimrc b/.vimrc new file mode 100644 index 0000000..607ef34 --- /dev/null +++ b/.vimrc @@ -0,0 +1,100 @@ +" minivimrc +" +" Minimal VIM configuration that does not depend on any 3rd party / plugins etc. +" to drop into foreign boxes +" based on my regular [.vimrc](https://github.com/hannenz/dotfiles/files/.vimrc) +" as of 2019-08-22 +" +set nocompatible + +filetype plugin indent on " filetype detection[ON] plugin[ON] indent[OFF] +syntax enable " enable syntax highlighting (previously syntax on). + +colorscheme habamax + +set path+=** +set wildmenu +set relativenumber +set hidden " allows to change bufferfs even if there are unsaved changes +set laststatus=2 " last window always has a statusline +set nohlsearch " Don't continue to highlight searched phrases. +set incsearch " But do highlight as you type your search. +"set ruler " Always show info along bottom. +set autoindent +set previewheight=30 +set textwidth=80 " text width to hard-fold (gq) +set tabstop=2 +set noexpandtab +set shiftwidth=2 +set ignorecase " ignorecase must be set for smartcase to work -- wtf? +set smartcase " smartcase in search: case sensitive as soon as a capital letter is in the query +set nowrap " don't wrap text +set wildmode=longest,list " Tab-completion like in bash +set lazyredraw " Don't redraw the screen when executing macros etc. +set splitright +set splitbelow +set autoread " Re-read file if it has been edited outside vim and not inside +set scrolloff=6 " Keep at least 6 line visible at top/bottom when scrolling +if &listchars ==# 'eol:$' + set listchars=tab:>\ ,trail:-,extends:>,precedes:<,nbsp:+ +endif +set timeout timeoutlen=5000 ttimeoutlen=100 +set backspace=indent,eol,start +set foldmethod=manual +set formatoptions-=t +" Sane line joins +if v:version > 703 || v:version == 703 && has('patch541') + set formatoptions+=j +endif + +if has('patch-8.1.360') + set diffopt=filler,internal,vertical,algorithm:patience,indent-heuristic " Always vertical diffs +endif + +let mapleader=' ' +let g:netrw_banner = 0 " Disable banner of netrw +let g:netrw_liststyle = 3 " Tree view +let g:netrw_winsize = -40 " Window size + +augroup my_indent_options + autocmd! + autocmd FileType * setlocal noexpandtab + autocmd FileType * setlocal shiftwidth=2 +augroup END +augroup text_wrap + autocmd! + autocmd FileType txt,markdown, setlocal textwidth=70 + autocmd FileType txt,markdown, setlocal formatoptions+=t +augroup END + +imap jj +imap kj +imap jk +nmap :w +imap :wa + +" fileexplorer +nnoremap e :Lexplore +nnoremap lf :Lexplore + +" nnoremap b :ls:b +nnoremap :ls:b + +iabbrev + + +"Use 24-bit (true-color) mode in Vim/Neovim when outside tmux. +"If you're using tmux version 2.2 or later, you can remove the outermost $TMUX check and use tmux's 24-bit color support +"(see < http://sunaku.github.io/tmux-24bit-color.html#usage > for more information.) +if (empty($TMUX) && getenv('TERM_PROGRAM') != 'Apple_Terminal') + if (has("nvim")) + "For Neovim 0.1.3 and 0.1.4 < https://github.com/neovim/neovim/pull/2198 > + let $NVIM_TUI_ENABLE_TRUE_COLOR=1 + endif + "For Neovim > 0.1.5 and Vim > patch 7.4.1799 < https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162 > + "Based on Vim patch 7.4.1770 (`guicolors` option) < https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd > + " < https://github.com/neovim/neovim/wiki/Following-HEAD#20160511 > + if (has("termguicolors")) + set termguicolors + endif +endif diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..68f2a4d --- /dev/null +++ b/init.lua @@ -0,0 +1,44 @@ +require("pika.core") +require("pika.lazy") + +-- ─< Call the function to set the desired colorscheme >──────────────────────────────── +-- ╭──────────────────────────────────────────────────────╮ +-- │ themes are under ./lua/pika/plugins/colorschemes.lua │ +-- ╰──────────────────────────────────────────────────────╯ + +vim.cmd.colorscheme("oldschool") + +-- Keybind for saving clipboard screenshot and inserting a Markdown link +vim.api.nvim_set_keymap("n", "ps", ":lua SaveScreenshotAndInsertLink()", { noremap = true, silent = true }) + +function SaveScreenshotAndInsertLink() + -- Prompt for Hugo base directory if needed + + -- Define the Hugo base directory and screenshot subfolder path + local base_dir + local current_file_dir = vim.fn.expand("%:p:h") + + -- Detect base dir by looking for the Hugo structure, or prompt if not found + if current_file_dir:match("/content/") then + base_dir = current_file_dir:match("(.*)/content/") + else + -- Prompt for Hugo base directory if automatic detection fails + base_dir = vim.fn.input("Enter base directory of your Hugo site: ", "", "file") + end + + local img_folder = base_dir .. "/static/images/screenshots/" + vim.fn.mkdir(img_folder, "p") -- Ensure the directory exists + + -- Define the image name and full path + local img_name = os.date("%Y-%m-%d_%H-%M-%S") .. ".png" + local full_path = img_folder .. img_name + + -- Save clipboard image as binary PNG file using wl-paste + os.execute("wl-paste --type image/png > " .. full_path) + + -- Insert markdown image link at cursor position + local img_markdown = "![](/images/screenshots/" .. img_name .. ")\n" + vim.api.nvim_put({ img_markdown }, "c", true, true) + + print("Screenshot saved and link added: " .. full_path) +end diff --git a/lua/pika/core/init.lua b/lua/pika/core/init.lua new file mode 100644 index 0000000..3ab7175 --- /dev/null +++ b/lua/pika/core/init.lua @@ -0,0 +1,2 @@ +require("pika.core.options") +require("pika.core.keymaps") diff --git a/lua/pika/core/keymaps.lua b/lua/pika/core/keymaps.lua new file mode 100644 index 0000000..6f205cd --- /dev/null +++ b/lua/pika/core/keymaps.lua @@ -0,0 +1,82 @@ +vim.g.mapleader = " " + +-- ─< lua/keymaps.lua >───────────────────────────────────────────────────────────────── +local nomap = vim.keymap.set +nomap("i", "", "") +nomap("n", "", "") +nomap("n", "q", "") +nomap("v", "q", "") +nomap("v", "S", "") + +local map = vim.keymap.set + +map("n", "", "nohlsearch") + +-- ─< Comment >───────────────────────────────────────────────────────────────────────── +map("n", "", "gcc", { desc = "comment toggle", remap = true }) +map("v", "", "gc", { desc = "comment toggle", remap = true }) + +-- ─< Terminal >──────────────────────────────────────────────────────────────────────── +map("t", "", "", { desc = "terminal escape terminal mode" }) + +-- ─< Movement while in "insert"-mode >───────────────────────────────────────────────── +map("i", "", "^i", { desc = "move beginning of line" }) +map("i", "", "", { desc = "move end of line" }) +map("i", "", "", { desc = "move left" }) +map("i", "", "", { desc = "move right" }) +map("i", "", "", { desc = "move down" }) +map("i", "", "", { desc = "move up" }) + +map("n", ";", ":", { desc = "CMD enter command mode" }) +map("i", "jk", "") +map("i", "", "") +map("n", "", "") +map("v", "", "") + +map("n", "x", "bd!") + +-- ─< Disable arrow keys in normal mode >─────────────────────────────────────────────── +map("n", "", 'echo "Use h to move!!"') +map("n", "", 'echo "Use l to move!!"') +map("n", "", 'echo "Use k to move!!"') +map("n", "", 'echo "Use j to move!!"') + +map("n", "l", "", { desc = "Move focus to the right window" }) +map("n", "h", "", { desc = "Move focus to the left window" }) +map("n", "j", "", { desc = "Move focus to the lower window" }) +map("n", "k", "", { desc = "Move focus to the upper window" }) + +-- map("n", "p", vim.cmd.Ex) +map("n", "q", vim.cmd.q) +map("n", "s", vim.cmd.w) +map("n", "", vim.cmd.w) + +-- ─< rename word under cursor >─────────────────────────────────────────────────────────── +map("n", "R", [[:%s/\<\>//gI]]) + +-- window management +map("n", "sv", "v", { desc = "Split window vertically" }) -- split window vertically +map("n", "sh", "s", { desc = "Split window horizontally" }) -- split window horizontally + +vim.keymap.set({ "n", "i" }, "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)) + vim.api.nvim_buf_set_lines(0, row, row, false, lines) + end) +end, { desc = "Insert Shell Output at Cursor" }) diff --git a/lua/pika/core/options.lua b/lua/pika/core/options.lua new file mode 100644 index 0000000..fa3fc11 --- /dev/null +++ b/lua/pika/core/options.lua @@ -0,0 +1,85 @@ +vim.cmd("let g:netrw_liststyle = 3") + +local o = vim.opt + +o.relativenumber = true +o.number = true + +-- Minimal number of screen lines to keep above and below the cursor. +o.scrolloff = 8 + +-- tabs & indentation +o.tabstop = 2 -- 2 spaces for tabs (prettier default) +o.shiftwidth = 2 -- 2 spaces for indent width +o.softtabstop = 2 +-- o.tabstop = 4 -- for TitusWorkings +-- o.shiftwidth = 4 -- for TitusWorkings +-- o.softtabstop = 4 -- for TitusWorkings +o.expandtab = true -- expand tab to spaces +o.autoindent = true -- copy indent from current line when starting new one + +o.mouse = "a" +o.mousemoveevent = true +o.wrap = false + +-- search settings +o.ignorecase = true -- ignore case when searching +o.smartcase = true -- if you include mixed case in your search, assumes you want case-sensitive + +o.cursorline = true + +-- Don't show the mode, since it's already in the status line +o.showmode = false + +-- turn on termguicolors for tokyonight colorscheme to work +-- (have to use iterm2 or any other true color terminal) +o.termguicolors = true +o.background = "dark" -- colorschemes that can be light or dark will be made dark +o.signcolumn = "yes" -- show sign column so that text doesn't shift + +-- backspace +o.backspace = "indent,eol,start" -- allow backspace on indent, end of line or insert mode start position + +-- clipboard +o.clipboard:append("unnamedplus") -- use system clipboard as default register + +-- split windows +o.splitright = true -- split vertical window to the right +o.splitbelow = true -- split horizontal window to the bottom +o.splitkeep = "screen" +o.laststatus = 3 + +-- turn off swapfile +o.swapfile = false + +-- Disable the tilde on empty lines +o.fillchars = { eob = " " } + +-- SudaRead automatic if file is inaccessible +vim.g.suda_smart_edit = 1 + +vim.api.nvim_create_autocmd("TextYankPost", { + desc = "Highlight when yanking (copying) text", + group = vim.api.nvim_create_augroup("kickstart-highlight-yank", { clear = true }), + callback = function() + vim.highlight.on_yank() + end, +}) + +-- Set cursor to beam when entering Neovim +vim.cmd([[ + augroup ChangeCursorShape + autocmd! + autocmd VimEnter * set guicursor=n-v-c-sm:block,i-ci-ve:ver25,r-cr-o:hor20 + autocmd VimLeave * set guicursor=a:ver25 + augroup END +]]) + +if vim.g.neovide then + -- vim.g.neovide_transparency = 0.35 + vim.g.neovide_transparency = 1 + vim.g.neovide_theme = "dark" + vim.g.neovide_refresh_rate = 90 + vim.g.neovide_cursor_vfx_mode = "torpedo" + vim.g.neovide_cursor_smooth_blink = true +end diff --git a/lua/pika/lazy.lua b/lua/pika/lazy.lua new file mode 100644 index 0000000..d56a156 --- /dev/null +++ b/lua/pika/lazy.lua @@ -0,0 +1,36 @@ +-- Bootstrap lazy.nvim +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +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) + +-- 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" }, + { import = "pika.plugins.lsp" }, + }, + -- Configure any other settings here. See the documentation for more details. + -- colorscheme that will be used when installing plugins. + install = { colorscheme = { "nord" } }, + -- automatically check for plugin updates + checker = { enabled = true }, +}) diff --git a/lua/pika/plugins/colorschemes.lua b/lua/pika/plugins/colorschemes.lua new file mode 100644 index 0000000..d977b29 --- /dev/null +++ b/lua/pika/plugins/colorschemes.lua @@ -0,0 +1,78 @@ +return { + { "folke/tokyonight.nvim" }, + { "fynnfluegge/monet.nvim", name = "monet" }, + { "L-Colombo/oldschool.nvim", config = "true" }, + -- { "catppuccin/nvim", name = "catppuccin" }, + -- { "EdenEast/nightfox.nvim" }, + -- { "DanWlker/primeppuccin", name = "primeppuccin" }, + -- { "rose-pine/neovim", name = "rose-pine" }, + { "AlexvZyl/nordic.nvim" }, + { "eldritch-theme/eldritch.nvim" }, + -- { "sainnhe/sonokai" }, + { "samharju/synthweave.nvim" }, + { "sainnhe/gruvbox-material" }, + { "pauchiner/pastelnight.nvim" }, + { "ptdewey/darkearth-nvim" }, + { "marko-cerovac/material.nvim" }, + -- { + -- "ferdinandrau/lavish.nvim", + -- opts = { + -- style = { + -- italic_comments = false, + -- italic_strings = false, + -- transparent = false, + -- }, + -- }, + -- }, + { + "neko-night/nvim", + lazy = false, + -- priority = 1000, + opts = { + transparent = false, -- Enable this to disable setting the background color + terminal_colors = true, -- Configure the colors used when opening a `:terminal` in Neovim + styles = { + -- Style to be applied to different syntax groups + -- Value is any valid attr-list value for `:help nvim_set_hl` + comments = { italic = true }, + keywords = { italic = true }, + functions = { bold = true }, + variables = { bold = true }, + -- Background styles. Can be "dark", "transparent" or "normal" + sidebars = "dark", -- style for sidebars, see below + floats = "dark", -- style for floating windows + }, + }, + }, + { + "scottmckendry/cyberdream.nvim", + name = "cyberdream", + lazy = false, + opts = { + transparent = true, + hide_fillchars = true, + terminal_colors = true, + }, + }, + { + "ribru17/bamboo.nvim", + opts = { + -- ────────────────────────────< optional configuration here >───────────────────────── + code_style = { + comments = { italic = false, bold = true }, + conditionals = { italic = true }, + keywords = { bold = true }, + functions = {}, + namespaces = { italic = true }, + parameters = { italic = true }, + strings = {}, + variables = { bold = true }, + }, + -- ─< Custom Highlights -- >──────────────────────────────────────────────────────────── + colors = {}, -- Override default colors + highlights = { -- Override highlight groups + ["@comment"] = { fg = "#555653" }, + }, + }, + }, +} diff --git a/lua/pika/plugins/dashboard.lua b/lua/pika/plugins/dashboard.lua new file mode 100644 index 0000000..27e84fa --- /dev/null +++ b/lua/pika/plugins/dashboard.lua @@ -0,0 +1,128 @@ +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 = [[ + ▐ ▄ ▄▄▄ . ▌ ▐·▪ • ▌ ▄ ·. + •█▌▐█▀▄.▀·▪ ▪█·█▌██ ·██ ▐███▪ + ▐█▐▐▌▐▀▀▪▄ ▄█▀▄ ▐█▐█•▐█·▐█ ▌▐▌▐█· + ██▐█▌▐█▄▄▌▐█▌.▐▌ ███ ▐█▌██ ██▌▐█▌ + ▀▀ █▪ ▀▀▀ ▀█▄▀▪. ▀ ▀▀▀▀▀ █▪▀▀▀ + ]] + + -- local logo = [[ + --  + -- ████ ██████ █████ ██ + -- ███████████ █████  + -- █████████ ███████████████████ ███ ███████████ + -- █████████ ███ █████████████ █████ ██████████████ + -- █████████ ██████████ █████████ █████ █████ ████ █████ + -- ███████████ ███ ███ █████████ █████ █████ ████ █████ + -- ██████ █████████████████████ ████ █████ █████ ████ ██████ + -- ]] + + logo = string.rep("\n", 8) .. logo .. "\n\n" + + local opts = { + theme = "doom", + hide = { + statusline = false, + }, + config = { + header = vim.split(logo, "\n"), + center = { + { + action = function() + require("telescope.builtin").find_files() + end, + desc = " Find File", + icon = " ", + key = "f", + }, + { action = "ene | startinsert", desc = " New File", icon = " ", key = "n" }, + { + action = function() + require("telescope.builtin").oldfiles() + end, + desc = " Recent Files", + icon = " ", + key = "r", + }, + { + action = function() + require("telescope.builtin").live_grep() + end, + desc = " Find Text", + icon = " ", + key = "g", + }, + { + action = function() + require("telescope.builtin").find_files({ cwd = vim.fn.stdpath("config") }) + end, + desc = " Search Neovim files", + 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, + dependencies = { + "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" }, + { "db", ":Dashboard", desc = "Dashboard"} + }, + }, + }, +} diff --git a/lua/pika/plugins/explorer.lua b/lua/pika/plugins/explorer.lua new file mode 100644 index 0000000..6791427 --- /dev/null +++ b/lua/pika/plugins/explorer.lua @@ -0,0 +1,125 @@ +return { + -- ─< neotree - fallback >──────────────────────────────────────────────────────────────────────── + { + "nvim-neo-tree/neo-tree.nvim", + 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 + }, + vim.keymap.set("n", "e", ":Neotree toggle"), + vim.keymap.set("n", "Ee", ":Neotree left"), + vim.keymap.set("n", "Ef", ":Neotree float"), + vim.keymap.set("n", "Eg", ":Neotree git_status float"), + vim.keymap.set("n", "Eb", ":Neotree buffers position=top"), + }, + + ---@type LazySpec + { + "mikavilpas/yazi.nvim", + event = "VeryLazy", + keys = { + -- 👇 in this section, choose your own keymappings! + -- { + -- "lf", + -- "Yazi", + -- desc = "Open yazi at the current file", + -- }, + { + -- Open in the current working directory + "Lf", + "Yazi cwd", + desc = "Open the file manager in nvim's working directory", + }, + { + -- NOTE: this requires a version of yazi that includes + -- https://github.com/sxyazi/yazi/pull/1305 from 2024-07-18 + "lf", + "Yazi toggle", + desc = "Resume the last yazi session", + }, + }, + ---@type YaziConfig + opts = { + -- if you want to open yazi instead of netrw, see below for more info + open_for_directories = true, + keymaps = { + show_help = "", + }, + }, + }, + + -- { + -- "kelly-lin/ranger.nvim", + -- config = function() + -- local ranger_nvim = require("ranger-nvim") + -- ranger_nvim.setup({ + -- enable_cmds = false, + -- replace_netrw = false, + -- keybinds = { + -- [""] = ranger_nvim.OPEN_MODE.vsplit, + -- [""] = ranger_nvim.OPEN_MODE.split, + -- ["ot"] = ranger_nvim.OPEN_MODE.tabedit, + -- ["or"] = ranger_nvim.OPEN_MODE.rifle, + -- }, + -- ui = { + -- border = "none", + -- height = 0.7, + -- width = 0.7, + -- x = 0.5, + -- y = 0.5, + -- }, + -- }) + -- require("ranger-nvim").setup({ replace_netrw = true }) + -- vim.api.nvim_set_keymap("n", "lf", "", { + -- noremap = true, + -- callback = function() + -- require("ranger-nvim").open(true) + -- end, + -- }) + -- end, + -- }, + + -- { + -- "lmburns/lf.nvim", + -- dependencies = { + -- "akinsho/toggleterm.nvim", + -- }, + -- config = function() + -- -- This feature will not work if the plugin is lazy-loaded + -- vim.g.lf_netrw = 1 + -- + -- require("lf").setup({ + -- default_action = "drop", -- default action when `Lf` opens a file + -- default_actions = { -- default action keybindings + -- [""] = "tabedit", + -- [""] = "split", + -- [""] = "vsplit", + -- [""] = "tab drop", + -- }, + -- winblend = 30, -- psuedotransparency level + -- direction = "float", -- window type: float horizontal vertical + -- border = "curved", -- border kind: single double shadow curved + -- escape_quit = true, -- map escape to the quit command (so it doesn't go into a meta normal mode) + -- focus_on_open = true, -- focus the current file when opening Lf (experimental) + -- mappings = true, -- whether terminal buffer mapping is enabled + -- tmux = false, -- tmux statusline can be disabled on opening of Lf + -- default_file_manager = true, -- make lf default file manager + -- disable_netrw_warning = true, -- don't display a message when opening a directory with `default_file_manager` as true + -- }) + -- + -- -- Set keymap for Lf + -- vim.keymap.set("n", "lf", "Lf") + -- + -- -- Create autocmd for LfTermEnter + -- vim.api.nvim_create_autocmd("User", { + -- pattern = "LfTermEnter", + -- callback = function(a) + -- vim.api.nvim_buf_set_keymap(a.buf, "t", "q", "q", { nowait = true }) + -- end, + -- }) + -- end, + -- }, +} diff --git a/lua/pika/plugins/git.lua b/lua/pika/plugins/git.lua new file mode 100644 index 0000000..b6cfc5c --- /dev/null +++ b/lua/pika/plugins/git.lua @@ -0,0 +1,212 @@ +return { + { + "tanvirtin/vgit.nvim", + dependencies = { "nvim-lua/plenary.nvim", "nvim-tree/nvim-web-devicons" }, + -- Lazy loading on 'VimEnter' event is necessary. + event = "VimEnter", + config = function() + require("vgit").setup( + -- keymaps = { + -- ["n "] = { + -- function() + -- require("vgit").hunk_up() + -- end, + -- desc = "VGit Hunk Up", + -- }, + -- ["n "] = { + -- function() + -- require("vgit").hunk_down() + -- end, + -- desc = "VGit Hunk Down", + -- }, + -- ["n gs"] = { + -- function() + -- require("vgit").buffer_hunk_stage() + -- end, + -- desc = "VGit Stage Hunk", + -- }, + -- ["n gr"] = { + -- function() + -- require("vgit").buffer_hunk_reset() + -- end, + -- desc = "VGit Reset Hunk", + -- }, + -- ["n gp"] = { + -- function() + -- require("vgit").buffer_hunk_preview() + -- end, + -- desc = "VGit Preview Hunk", + -- }, + -- ["n gb"] = { + -- function() + -- require("vgit").buffer_blame_preview() + -- end, + -- desc = "VGit Blame Preview", + -- }, + -- ["n gf"] = { + -- function() + -- require("vgit").buffer_diff_preview() + -- end, + -- desc = "VGit Diff Preview", + -- }, + -- ["n gh"] = { + -- function() + -- require("vgit").buffer_history_preview() + -- end, + -- desc = "VGit History Preview", + -- }, + -- ["n gu"] = { + -- function() + -- require("vgit").buffer_reset() + -- end, + -- desc = "VGit Reset Buffer", + -- }, + -- ["n gcm"] = { + -- function() + -- require("vgit").project_commit_preview() + -- end, + -- desc = "VGit Commit Preview", + -- }, + -- ["n gcc"] = { + -- function() + -- require("vgit").project_commits_preview() + -- end, + -- desc = "VGit Commits Preview", + -- }, + -- ["n gcl"] = { + -- function() + -- require("vgit").project_logs_preview() + -- end, + -- desc = "VGit Logs Preview", + -- }, + -- ["n gd"] = { + -- function() + -- require("vgit").project_diff_preview() + -- end, + -- desc = "VGit Project Diff", + -- }, + -- ["n gx"] = { + -- function() + -- require("vgit").toggle_diff_preference() + -- end, + -- desc = "VGit Toggle Diff Preference", + -- }, + -- }, + ) + end, + + vim.keymap.set("n", "", function() + require("vgit").hunk_up() + end, { desc = "VGit Hunk Up" }), + + vim.keymap.set("n", "", function() + require("vgit").hunk_down() + end, { desc = "VGit Hunk Down" }), + + vim.keymap.set("n", "gs", function() + require("vgit").buffer_hunk_stage() + end, { desc = "VGit Stage Hunk" }), + + vim.keymap.set("n", "gr", function() + require("vgit").buffer_hunk_reset() + end, { desc = "VGit Reset Hunk" }), + + vim.keymap.set("n", "gp", function() + require("vgit").buffer_hunk_preview() + end, { desc = "VGit Preview Hunk" }), + + vim.keymap.set("n", "gb", function() + require("vgit").buffer_blame_preview() + end, { desc = "VGit Blame Preview" }), + + vim.keymap.set("n", "gf", function() + require("vgit").buffer_diff_preview() + end, { desc = "VGit Diff Preview" }), + + vim.keymap.set("n", "gh", function() + require("vgit").buffer_history_preview() + end, { desc = "VGit History Preview" }), + + vim.keymap.set("n", "gu", function() + require("vgit").buffer_reset() + end, { desc = "VGit Reset Buffer" }), + + vim.keymap.set("n", "gcm", function() + require("vgit").project_commit_preview() + end, { desc = "VGit Commit Preview" }), + + vim.keymap.set("n", "gcc", function() + require("vgit").project_commits_preview() + end, { desc = "VGit Commits Preview" }), + + vim.keymap.set("n", "gcl", function() + require("vgit").project_logs_preview() + end, { desc = "VGit Logs Preview" }), + + vim.keymap.set("n", "gd", function() + require("vgit").project_diff_preview() + end, { desc = "VGit Project Diff" }), + + vim.keymap.set("n", "gx", function() + require("vgit").toggle_diff_preference() + end, { desc = "VGit Toggle Diff Preference" }), + }, + + { + "lewis6991/gitsigns.nvim", + opts = { + signs = { + add = { text = "┃" }, + change = { text = "┃" }, + delete = { text = "_" }, + topdelete = { text = "‾" }, + changedelete = { text = "~" }, + untracked = { text = "┆" }, + }, + signs_staged = { + add = { text = "┃" }, + change = { text = "┃" }, + delete = { text = "_" }, + topdelete = { text = "‾" }, + changedelete = { text = "~" }, + untracked = { text = "┆" }, + }, + signs_staged_enable = true, + signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` + numhl = true, -- Toggle with `:Gitsigns toggle_numhl` + linehl = false, -- Toggle with `:Gitsigns toggle_linehl` + word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` + watch_gitdir = { + follow_files = true, + }, + auto_attach = true, + attach_to_untracked = false, + current_line_blame = true, -- Toggle with `:Gitsigns toggle_current_line_blame` + current_line_blame_opts = { + virt_text = true, + virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align' + delay = 300, + ignore_whitespace = true, + virt_text_priority = 100, + }, + current_line_blame_formatter = ", - ", + sign_priority = 6, + update_debounce = 100, + status_formatter = nil, -- Use default + max_file_length = 40000, -- Disable if file is longer than this (in lines) + preview_config = { + -- Options passed to nvim_open_win + border = "single", + style = "minimal", + relative = "cursor", + row = 0, + col = 1, + }, + + vim.keymap.set("n", "gr", "Gitsigns refresh", { desc = "Gitsigns Refresh" }), + vim.keymap.set("n", "gs", "Gitsigns toggle_signs", { desc = "Gitsigns ToggleSigns" }), + vim.keymap.set("n", "gl", "Gitsigns toggle_linehl", { desc = "Gitsigns ToggleLine" }), + vim.keymap.set("n", "gw", "Gitsigns toggle_word_diff", { desc = "Gitsigns ToggleWord" }), + }, + }, +} diff --git a/lua/pika/plugins/init.lua b/lua/pika/plugins/init.lua new file mode 100644 index 0000000..4269770 --- /dev/null +++ b/lua/pika/plugins/init.lua @@ -0,0 +1,32 @@ +return { + "nvim-lua/plenary.nvim", -- lua functions that many plugins use + "christoomey/vim-tmux-navigator", -- tmux & split window navigation + "dstein64/nvim-scrollview", + "folke/lsp-colors.nvim", + "jghauser/mkdir.nvim", + "jghauser/follow-md-links.nvim", + "lambdalisue/vim-suda", -- open files with sudo if needed + -- ╭───────────╮ + -- │ maximizer │ + -- ╰───────────╯ + { + "szw/vim-maximizer", + keys = { + { "", "MaximizerToggle", desc = "Maximize/minimize a split" }, + }, + }, + + -- ╭───────────────╮ + -- │ colored icons │ + -- ╰───────────────╯ + { + "rachartier/tiny-devicons-auto-colors.nvim", + dependencies = { + "nvim-tree/nvim-web-devicons", + }, + event = "VeryLazy", + config = function() + require("tiny-devicons-auto-colors").setup() + end, + }, +} diff --git a/lua/pika/plugins/lsp/formatting.lua b/lua/pika/plugins/lsp/formatting.lua new file mode 100644 index 0000000..e5fa4c7 --- /dev/null +++ b/lua/pika/plugins/lsp/formatting.lua @@ -0,0 +1,43 @@ +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" }, + zsh = { "shfmt" }, + batch = { "shfmt", "prettier" }, + 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/lsp/lspconfig.lua b/lua/pika/plugins/lsp/lspconfig.lua new file mode 100644 index 0000000..4b68229 --- /dev/null +++ b/lua/pika/plugins/lsp/lspconfig.lua @@ -0,0 +1,132 @@ +return { + "neovim/nvim-lspconfig", + event = { "BufReadPre", "BufNewFile" }, + dependencies = { + { + "hrsh7th/nvim-cmp", + dependencies = { "hrsh7th/cmp-nvim-lsp", "L3MON4D3/LuaSnip", "saadparwaiz1/cmp_luasnip" }, + }, + { "antosha417/nvim-lsp-file-operations", config = true }, + { "folke/neodev.nvim", opts = {} }, + }, + + config = function() + local lspconfig = require("lspconfig") + local mason_lspconfig = require("mason-lspconfig") + local cmp_nvim_lsp = require("cmp_nvim_lsp") + local keymap = vim.keymap + + vim.api.nvim_create_autocmd("LspAttach", { + group = vim.api.nvim_create_augroup("UserLspConfig", {}), + callback = function(ev) + -- Buffer local mappings. + -- See `:help vim.lsp.*` for documentation on any of the below functions + local opts = { buffer = ev.buf, silent = true } + + opts.desc = "See available code actions" + keymap.set({ "n", "v" }, "ca", vim.lsp.buf.code_action, opts) -- see available code actions, in visual mode will apply to selection + + opts.desc = "Smart rename" + keymap.set("n", "rn", vim.lsp.buf.rename, opts) -- smart rename + + opts.desc = "Show buffer diagnostics" + keymap.set("n", "D", "Telescope diagnostics bufnr=0", opts) -- show diagnostics for file + + opts.desc = "Show line diagnostics" + keymap.set("n", "d", vim.diagnostic.open_float, opts) -- show diagnostics for line + + opts.desc = "Show documentation for what is under cursor" + keymap.set("n", "K", vim.lsp.buf.hover, opts) -- show documentation for what is under cursor + + opts.desc = "Restart LSP" + keymap.set("n", "rs", ":LspRestart", opts) -- mapping to restart lsp if necessary + end, + }) + -- used to enable autocompletion (assign to every lsp server config) + local capabilities = cmp_nvim_lsp.default_capabilities() + + -- Change the Diagnostic symbols in the sign column (gutter) + -- (not in youtube nvim video) + local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " } + for type, icon in pairs(signs) do + local hl = "DiagnosticSign" .. type + vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" }) + end + + mason_lspconfig.setup_handlers({ + function(server_name) + lspconfig[server_name].setup({ + capabilities = capabilities, + }) + end, + ["svelte"] = function() + lspconfig["svelte"].setup({ + capabilities = capabilities, + on_attach = function(client, bufnr) + vim.api.nvim_create_autocmd("BufWritePost", { + pattern = { "*.js", "*.ts" }, + callback = function(ctx) + client.notify("$/onDidChangeTsOrJsFile", { uri = ctx.match }) + end, + }) + end, + }) + end, + ["graphql"] = function() + lspconfig["graphql"].setup({ + capabilities = capabilities, + filetypes = { "graphql", "gql", "svelte", "typescriptreact", "javascriptreact" }, + }) + end, + ["emmet_ls"] = function() + lspconfig["emmet_ls"].setup({ + capabilities = capabilities, + filetypes = { + "html", + "typescriptreact", + "javascriptreact", + "css", + "sass", + "scss", + "less", + "svelte", + }, + }) + end, + ["lua_ls"] = function() + lspconfig["lua_ls"].setup({ + capabilities = capabilities, + settings = { + Lua = { + diagnostics = { + globals = { "vim" }, + }, + completion = { + callSnippet = "Replace", + }, + }, + }, + }) + end, + ["cssls"] = function() + lspconfig["cssls"].setup({ + capabilities = capabilities, + filetypes = { "css", "scss" }, + }) + end, + ["intelephense"] = function() + lspconfig["intelephense"].setup({ + capabilities = capabilities, + filetypes = { "php", "blade.php" }, + }) + end, + -- ["tsserver"] = function() + -- -- Replace tsserver with typescript-language-server + -- lspconfig["typescript-language-server"].setup({ + -- capabilities = capabilities, + -- filetypes = { "typescript", "typescriptreact", "javascript", "javascriptreact" }, + -- }) + -- end, + }) + end, +} diff --git a/lua/pika/plugins/lsp/mason.lua b/lua/pika/plugins/lsp/mason.lua new file mode 100644 index 0000000..d5fcf86 --- /dev/null +++ b/lua/pika/plugins/lsp/mason.lua @@ -0,0 +1,61 @@ +return { + "williamboman/mason.nvim", + dependencies = { + "williamboman/mason-lspconfig.nvim", + "WhoIsSethDaniel/mason-tool-installer.nvim", + }, + config = function() + -- import mason + local mason = require("mason") + + -- import mason-lspconfig + local mason_lspconfig = require("mason-lspconfig") + + local mason_tool_installer = require("mason-tool-installer") + + -- enable mason and configure icons + mason.setup({ + ui = { + icons = { + package_installed = "", + package_pending = "", + package_uninstalled = "", + }, + }, + }) + + mason_lspconfig.setup({ + -- list of servers for mason to install + ensure_installed = { + "html", + "cssls", + "svelte", + "lua_ls", + "emmet_ls", + "hyprls", + "yamlls", + -- "intelephense", + -- "graphql", + -- "typos_lsp", + -- "textlsp", + -- "prismals", + -- "pyright", + -- "lemminx", + -- "tailwindcss", + }, + }) + + mason_tool_installer.setup({ + ensure_installed = { + "shfmt", + "prettier", + "stylua", + "blade-formatter", + "html-lsp", + "docker-compose-language-service", + "pylint", + "eslint_d", + }, + }) + end, +} diff --git a/lua/pika/plugins/lsp/nvim-cmp.lua b/lua/pika/plugins/lsp/nvim-cmp.lua new file mode 100644 index 0000000..704a168 --- /dev/null +++ b/lua/pika/plugins/lsp/nvim-cmp.lua @@ -0,0 +1,139 @@ +return { + { + "hrsh7th/nvim-cmp", + event = "InsertEnter", + dependencies = { + "hrsh7th/cmp-buffer", -- source for text in buffer + "hrsh7th/cmp-path", -- source for file system paths + { + "L3MON4D3/LuaSnip", + version = "v2.*", -- latest release of LuaSnip + build = "make install_jsregexp", -- optional regex support for LuaSnip + }, + "saadparwaiz1/cmp_luasnip", -- for autocompletion + "rafamadriz/friendly-snippets", -- useful snippets + "onsails/lspkind.nvim", -- vs-code like pictograms + }, + config = function() + local cmp = require("cmp") + local luasnip = require("luasnip") + local lspkind = require("lspkind") + + -- Load snippets from friendly-snippets and custom directory + require("luasnip.loaders.from_vscode").lazy_load() + require("luasnip.loaders.from_vscode").lazy_load({ paths = { "~/.config/nvim/snippets" } }) + + cmp.setup({ + completion = { + completeopt = "menu,menuone,preview,noselect", + }, + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) + end, + }, + mapping = cmp.mapping.preset.insert({ + -- [""] = cmp.mapping({ + -- cmp.mapping.complete({ + -- config = { + -- sources = cmp.config.sources({ + -- { name = "cmp_ai" }, + -- }), + -- }, + -- }), + -- { "i" }, + -- }), + + [""] = cmp.mapping.select_prev_item(), -- previous suggestion + [""] = cmp.mapping.select_next_item(), -- next suggestion + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), -- show completion suggestions + [""] = cmp.mapping.abort(), -- close completion window + [""] = cmp.mapping.confirm({ select = false }), + + -- Tab to complete + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.confirm({ select = true }) -- confirm selection + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + else + fallback() + end + end, { "i", "s" }), + }), + -- sources for autocompletion + sources = cmp.config.sources({ + { name = "nvim_lsp" }, + { name = "luasnip" }, -- snippets + { name = "buffer" }, -- text within current buffer + { name = "path" }, -- file system paths + -- { name = "cmp_ai" }, -- AI completion + }), + -- configure lspkind for vs-code like pictograms in completion menu + formatting = { + format = lspkind.cmp_format({ + mode = "symbol_text", -- show symbol text with icons + maxwidth = 130, + ellipsis_char = "...", + }), + }, + -- Enable rounded borders + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + }, + experimental = { + ghost_text = true, -- This enables the inline ghost text + }, + }) + end, + }, + + -- { + -- -- ─< for ai use >────────────────────────────────────────────────────────────────────── + -- "tzachar/cmp-ai", + -- dependencies = { + -- "hrsh7th/nvim-cmp", + -- "tzachar/cmp-ai", + -- }, + -- + -- config = function() + -- local cmp = require("cmp") + -- local cmp_ai = require("cmp_ai.config") + -- + -- -- Setup cmp-ai configuration + -- cmp_ai:setup({ + -- max_lines = 100, + -- provider = "Ollama", + -- -- provider_options = { + -- -- model = "codellama:7b-code", + -- -- auto_unload = false, + -- -- raw_response_cb = function(response) + -- -- vim.notify(vim.inspect(response)) + -- -- vim.g.ai_raw_response = response + -- -- end, + -- -- }, + -- provider_options = { + -- model = "qwen2.5-coder:7b-base-q6_K", + -- prompt = function(lines_before, lines_after) + -- return "<|fim_prefix|>" .. lines_before .. "<|fim_suffix|>" .. lines_after .. "<|fim_middle|>" + -- end, + -- raw_response_cb = function(response) + -- vim.notify(vim.inspect(response)) + -- vim.g.ai_raw_response = response + -- end, + -- }, + -- notify = true, + -- notify_callback = function(msg) + -- vim.notify(msg) + -- end, + -- run_on_every_keystroke = true, + -- ignored_file_types = { + -- txt = true, + -- }, + -- }) + -- end, + -- }, +} diff --git a/lua/pika/plugins/lsp/nvim-treesitter-text-objects.lua b/lua/pika/plugins/lsp/nvim-treesitter-text-objects.lua new file mode 100644 index 0000000..68d5164 --- /dev/null +++ b/lua/pika/plugins/lsp/nvim-treesitter-text-objects.lua @@ -0,0 +1,110 @@ +return { + "nvim-treesitter/nvim-treesitter-textobjects", + lazy = true, + config = function() + require("nvim-treesitter.configs").setup({ + 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 + ["a="] = { query = "@assignment.outer", desc = "Select outer part of an assignment" }, + ["i="] = { query = "@assignment.inner", desc = "Select inner part of an assignment" }, + ["l="] = { query = "@assignment.lhs", desc = "Select left hand side of an assignment" }, + ["r="] = { query = "@assignment.rhs", desc = "Select right hand side of an assignment" }, + + -- works for javascript/typescript files (custom capture I created in after/queries/ecma/textobjects.scm) + ["a:"] = { query = "@property.outer", desc = "Select outer part of an object property" }, + ["i:"] = { query = "@property.inner", desc = "Select inner part of an object property" }, + ["l:"] = { query = "@property.lhs", desc = "Select left part of an object property" }, + ["r:"] = { query = "@property.rhs", desc = "Select right part of an object property" }, + + ["aa"] = { query = "@parameter.outer", desc = "Select outer part of a parameter/argument" }, + ["ia"] = { query = "@parameter.inner", desc = "Select inner part of a parameter/argument" }, + + ["ai"] = { query = "@conditional.outer", desc = "Select outer part of a conditional" }, + ["ii"] = { query = "@conditional.inner", desc = "Select inner part of a conditional" }, + + ["al"] = { query = "@loop.outer", desc = "Select outer part of a loop" }, + ["il"] = { query = "@loop.inner", desc = "Select inner part of a loop" }, + + ["af"] = { query = "@call.outer", desc = "Select outer part of a function call" }, + ["if"] = { query = "@call.inner", desc = "Select inner part of a function call" }, + + ["am"] = { query = "@function.outer", 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" }, + ["ic"] = { query = "@class.inner", desc = "Select inner part of a class" }, + }, + }, + swap = { + enable = true, + swap_next = { + ["na"] = "@parameter.inner", -- swap parameters/argument with next + ["n:"] = "@property.outer", -- swap object property with next + ["nm"] = "@function.outer", -- swap function with next + }, + swap_previous = { + ["pa"] = "@parameter.inner", -- swap parameters/argument with prev + ["p:"] = "@property.outer", -- swap object property with prev + ["pm"] = "@function.outer", -- swap function with previous + }, + }, + move = { + enable = true, + set_jumps = true, -- whether to set jumps in the jumplist + goto_next_start = { + ["]f"] = { query = "@call.outer", desc = "Next function call start" }, + ["]m"] = { query = "@function.outer", desc = "Next method/function def start" }, + ["]c"] = { query = "@class.outer", desc = "Next class start" }, + ["]i"] = { query = "@conditional.outer", desc = "Next conditional start" }, + ["]l"] = { query = "@loop.outer", desc = "Next loop start" }, + + -- You can pass a query group to use query from `queries//.scm file in your runtime path. + -- Below example nvim-treesitter's `locals.scm` and `folds.scm`. They also provide highlights.scm and indent.scm. + ["]s"] = { query = "@scope", query_group = "locals", desc = "Next scope" }, + ["]z"] = { query = "@fold", query_group = "folds", desc = "Next fold" }, + }, + goto_next_end = { + ["]F"] = { query = "@call.outer", desc = "Next function call end" }, + ["]M"] = { query = "@function.outer", desc = "Next method/function def end" }, + ["]C"] = { query = "@class.outer", desc = "Next class end" }, + ["]I"] = { query = "@conditional.outer", desc = "Next conditional end" }, + ["]L"] = { query = "@loop.outer", desc = "Next loop end" }, + }, + goto_previous_start = { + ["[f"] = { query = "@call.outer", desc = "Prev function call start" }, + ["[m"] = { query = "@function.outer", desc = "Prev method/function def start" }, + ["[c"] = { query = "@class.outer", desc = "Prev class start" }, + ["[i"] = { query = "@conditional.outer", desc = "Prev conditional start" }, + ["[l"] = { query = "@loop.outer", desc = "Prev loop start" }, + }, + goto_previous_end = { + ["[F"] = { query = "@call.outer", desc = "Prev function call end" }, + ["[M"] = { query = "@function.outer", desc = "Prev method/function def end" }, + ["[C"] = { query = "@class.outer", desc = "Prev class end" }, + ["[I"] = { query = "@conditional.outer", desc = "Prev conditional end" }, + ["[L"] = { query = "@loop.outer", desc = "Prev loop end" }, + }, + }, + }, + }) + + local ts_repeat_move = require("nvim-treesitter.textobjects.repeatable_move") + + -- 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_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, +} diff --git a/lua/pika/plugins/lsp/rainbow-delimiters.lua b/lua/pika/plugins/lsp/rainbow-delimiters.lua new file mode 100644 index 0000000..ebb22e0 --- /dev/null +++ b/lua/pika/plugins/lsp/rainbow-delimiters.lua @@ -0,0 +1,30 @@ +return { + { + "hiphish/rainbow-delimiters.nvim", + config = function() + local rainbow_delimiters = require 'rainbow-delimiters' + + -- Setup configuration for rainbow-delimiters + vim.g.rainbow_delimiters = { + strategy = { + [''] = rainbow_delimiters.strategy['global'], + commonlisp = rainbow_delimiters.strategy['local'], + }, + query = { + [''] = 'rainbow-delimiters', + latex = 'rainbow-blocks', + }, + highlight = { + 'RainbowDelimiterRed', + 'RainbowDelimiterYellow', + 'RainbowDelimiterBlue', + 'RainbowDelimiterOrange', + 'RainbowDelimiterGreen', + 'RainbowDelimiterViolet', + 'RainbowDelimiterCyan', + }, + blacklist = {'c', 'cpp'}, + } + end + } +} \ No newline at end of file diff --git a/lua/pika/plugins/lsp/treesitter.lua b/lua/pika/plugins/lsp/treesitter.lua new file mode 100644 index 0000000..470acc7 --- /dev/null +++ b/lua/pika/plugins/lsp/treesitter.lua @@ -0,0 +1,37 @@ +return { + "nvim-treesitter/nvim-treesitter", + event = { "BufReadPre", "BufNewFile" }, + build = ":TSUpdate", + dependencies = { + "windwp/nvim-ts-autotag", + }, + config = function() + require("nvim-treesitter.configs").setup({ + highlight = { enable = true }, + indent = { enable = true }, + autotag = { enable = true }, + ensure_installed = { + "bash", + "gitignore", + "git_config", + "markdown", + "markdown_inline", + "yaml", + "lua", + "ini", + "passwd", + "vim", + "vimdoc", + }, + incremental_selection = { + enable = true, + keymaps = { + init_selection = "", + node_incremental = "", + scope_incremental = false, + node_decremental = "", + }, + }, + }) + end, +} diff --git a/lua/pika/plugins/markdown.lua b/lua/pika/plugins/markdown.lua new file mode 100644 index 0000000..bd9ae9a --- /dev/null +++ b/lua/pika/plugins/markdown.lua @@ -0,0 +1,9 @@ +return{ +{ + 'MeanderingProgrammer/render-markdown.nvim', + opts = {}, + -- 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 +}, +} diff --git a/lua/pika/plugins/mini.lua b/lua/pika/plugins/mini.lua new file mode 100644 index 0000000..e3bca6d --- /dev/null +++ b/lua/pika/plugins/mini.lua @@ -0,0 +1,32 @@ +return { + -- mini-ai for a and i selections or other --> vin" for visual in next "" + { + "echasnovski/mini.ai", + version = "false", + opts = {}, + }, + + -- ─< mini-surround for surrounding words or lines with "" or () or '' etc.. >────────── + { + "echasnovski/mini.surround", + version = "false", + opts = {}, + }, + + -- ─< miniIcons >─────────────────────────────────────────────────────────────────────── + { + "echasnovski/mini.icons", + version = "false", + opts = {}, + lazy = true, + specs = { + { "nvim-tree/nvim-web-devicons", enabled = false, optional = true }, + }, + init = function() + package.preload["nvim-web-devicons"] = function() + require("mini.icons").mock_nvim_web_devicons() + return package.loaded["nvim-web-devicons"] + end + end, + }, +} diff --git a/lua/pika/plugins/qol.lua b/lua/pika/plugins/qol.lua new file mode 100644 index 0000000..c012d60 --- /dev/null +++ b/lua/pika/plugins/qol.lua @@ -0,0 +1,263 @@ +return { + -- ╭───────────╮ + -- │ autopairs │ + -- ╰───────────╯ + { + "windwp/nvim-autopairs", + event = { "InsertEnter" }, + dependencies = { + "hrsh7th/nvim-cmp", + }, + config = function() + -- import nvim-autopairs + local autopairs = require("nvim-autopairs") + + -- configure autopairs + autopairs.setup({ + check_ts = true, -- enable treesitter + ts_config = { + lua = { "string" }, -- don't add pairs in lua string treesitter nodes + javascript = { "template_string" }, -- don't add pairs in javascript template_string treesitter nodes + java = false, -- don't check treesitter on java + }, + }) + + -- import nvim-autopairs completion functionality + local cmp_autopairs = require("nvim-autopairs.completion.cmp") + + -- import nvim-cmp plugin (completions plugin) + local cmp = require("cmp") + + -- make autopairs and completion work together + cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) + end, + }, + + -- ╭─────────────────────────────────────╮ + -- │ ╭───────────────╮ │ + -- │ │ comment boxes │<- yes, those ones │ + -- │ ╰───────────────╯ │ + -- ╰─────────────────────────────────────╯ + { + "LudoPinelli/comment-box.nvim", + lazy = false, + opts = { + comment_style = "line", + doc_width = 90, -- width of the document + box_width = 75, -- width of the boxes + line_width = 120, -- width of the lines + }, + -- ───────────────────────────────< keymaps - commentboxes >─────────────────────────────── + vim.keymap.set( + "n", + "cd", + "CBd", + { noremap = true, silent = true, desc = "[c]ommentbox [d]elete" } + ), + vim.keymap.set( + "v", + "cd", + "CBd", + { noremap = true, silent = true, desc = "[c]ommentbox [d]elete" } + ), + + vim.keymap.set( + "n", + "cy", + "CBy", + { noremap = true, silent = true, desc = "[y]ank content of Commentbox" } + ), + vim.keymap.set( + "v", + "cy", + "CBy", + { noremap = true, silent = true, desc = "[y]ank content of Commentbox" } + ), + + vim.keymap.set( + "n", + "cb", + "CBlabox1", + { noremap = true, silent = true, desc = "[c]reate comment [b]ox" } + ), + vim.keymap.set( + "v", + "cb", + "CBlabox1", + { noremap = true, silent = true, desc = "[c]reate comment [b]ox" } + ), + vim.keymap.set( + "n", + "cB", + "CBcabox1", + { noremap = true, silent = true, desc = "[c]reate comment [b]ox (centered)" } + ), + + vim.keymap.set( + "v", + "cB", + "CBcabox1", + { noremap = true, silent = true, desc = "[c]reate comment [b]ox (centered)" } + ), + vim.keymap.set( + "n", + "cc", + "CBllbox14", + { noremap = true, silent = true, desc = "[c]reate [c]omment" } + ), + vim.keymap.set( + "v", + "cc", + "CBllbox14", + { noremap = true, silent = true, desc = "[c]reate [c]omment" } + ), + vim.keymap.set( + "n", + "cC", + "CBclbox14", + { noremap = true, silent = true, desc = "[c]reate [c]omment (C)entered" } + ), + vim.keymap.set( + "v", + "cC", + "CBclbox14", + { noremap = true, silent = true, desc = "[c]reate [c]omment (C)entered" } + ), + + vim.keymap.set( + "n", + "cl", + "CBllline8", + { noremap = true, silent = true, desc = "[c]reate comment [l]ine" } + ), + vim.keymap.set( + "n", + "cL", + "CBlcline8", + { noremap = true, silent = true, desc = "[c]reate comment [L]ine" } + ), + }, + + -- ╭───────────╮ + -- │ colorizer │ + -- ╰───────────╯ + { + "brenoprata10/nvim-highlight-colors", + opts = { + ---Render style + ---@usage 'background'|'foreground'|'virtual' + render = "background", + + ---Set virtual symbol (requires render to be set to 'virtual') + virtual_symbol = "■", + + ---Set virtual symbol suffix (defaults to '') + virtual_symbol_prefix = "", + + ---Set virtual symbol suffix (defaults to ' ') + virtual_symbol_suffix = " ", + + ---Set virtual symbol position() + ---@usage 'inline'|'eol'|'eow' + ---inline mimics VS Code style + ---eol stands for `end of column` - Recommended to set `virtual_symbol_suffix = ''` when used. + ---eow stands for `end of word` - Recommended to set `virtual_symbol_prefix = ' ' and virtual_symbol_suffix = ''` when used. + virtual_symbol_position = "inline", + + ---Highlight hex colors, e.g. '#FFFFFF' + enable_hex = true, + + ---Highlight short hex colors e.g. '#fff' + enable_short_hex = true, + + ---Highlight rgb colors, e.g. 'rgb(0 0 0)' + enable_rgb = true, + + ---Highlight hsl colors, e.g. 'hsl(150deg 30% 40%)' + enable_hsl = true, + + ---Highlight CSS variables, e.g. 'var(--testing-color)' + enable_var_usage = true, + + ---Highlight named colors, e.g. 'green' + enable_named_colors = true, + + ---Highlight tailwind colors, e.g. 'bg-blue-500' + enable_tailwind = false, + + ---Set custom colors + ---Label must be properly escaped with '%' to adhere to `string.gmatch` + --- :help string.gmatch + custom_colors = { + { label = "%-%-theme%-primary%-color", color = "#0f1219" }, + { label = "%-%-theme%-secondary%-color", color = "#5a5d64" }, + }, + + -- Exclude filetypes or buftypes from highlighting e.g. 'exclude_buftypes = {'text'}' + exclude_filetypes = {}, + exclude_buftypes = {}, + }, + }, + + -- ╭──────────────────────────────────────╮ + -- │ flash - to navigate more efficiently │ + -- ╰──────────────────────────────────────╯ + { + "folke/flash.nvim", + event = "VeryLazy", + vscode = true, + -- @type Flash.Config + opts = {}, + -- stylua: ignore + keys = { + { "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" }, + { "S", mode = { "n", "o", "x" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" }, + { "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" }, + { "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" }, + { "", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" }, + }, + }, + + -- ╭──────────────────────────────╮ + -- │ renaming (also project wide) │ + -- ╰──────────────────────────────╯ + { + "MagicDuck/grug-far.nvim", + opts = { headerMaxWidth = 80 }, + cmd = "GrugFar", + -- ────────────────────────────────────< keybindings >───────────────────────────────── + keys = { + { + "sr", + function() + local grug = require("grug-far") + local ext = vim.bo.buftype == "" and vim.fn.expand("%:e") + grug.grug_far({ + transient = true, + prefills = { + filesFilter = ext and ext ~= "" and "*." .. ext or nil, + }, + }) + end, + mode = { "n", "v" }, + desc = "Search and Replace", + }, + }, + }, + -- ╭──────────╮ + -- │ snippets │ + -- ╰──────────╯ + { + { + "chrisgrieser/nvim-scissors", + lazy = false, + dependencies = { "nvim-telescope/telescope.nvim", "garymjr/nvim-snippets" }, + opts = { + snippetDir = "~/.config/nvim/snippets", -- <- i have this as a submodule in my neovim config to have a seperate repo https://git.k4li.de/dotfiles/nvim-snippets.git + }, + }, + -- ──────────────────────────< keybindings for snippets engine >─────────────────────── + vim.keymap.set("n", "sm", ":ScissorsEditSnippet"), + vim.keymap.set("v", "sa", ":ScissorsAddNewSnippet"), + }, +} diff --git a/lua/pika/plugins/telescope.lua b/lua/pika/plugins/telescope.lua new file mode 100644 index 0000000..0656a2b --- /dev/null +++ b/lua/pika/plugins/telescope.lua @@ -0,0 +1,62 @@ +return { + "nvim-telescope/telescope.nvim", + branch = "0.1.x", + dependencies = { + "nvim-lua/plenary.nvim", + { "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, + "echasnovski/mini.icons", + }, + config = function() + local telescope = require("telescope") + local actions = require("telescope.actions") + -- local transform_mod = require("telescope.actions.mt").transform_mod + + telescope.setup({ + defaults = { + path_display = { "smart" }, + mappings = { + i = { + [""] = actions.move_selection_previous, -- move to prev result + [""] = actions.move_selection_next, -- move to next result + }, + }, + }, + }) + + telescope.load_extension("fzf") + + -- set keymaps + local map = vim.keymap.set -- for conciseness + + -- 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", "", "Telescope buffers", { noremap = true, silent = true, desc = "Buffers" }) + local builtin = require("telescope.builtin") + + map("n", "sn", function() + builtin.find_files({ cwd = vim.fn.stdpath("config") }) + end, { desc = "[S]earch [N]eovim files" }) + map("n", "ff", builtin.find_files, { desc = "[S]earch [F]iles" }) + map("n", "sh", builtin.help_tags, { desc = "[S]earch [H]elp" }) + 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", "s.", builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) + map("n", "", builtin.buffers, { desc = "[ ] Find existing buffers" }) + map("n", "sR", function() + require("telescope.builtin").oldfiles() + end) + map("n", "T", "Telescope colorscheme") + map("n", "q", vim.cmd.q) + + -- Additional custom mappings + map("n", "/", function() + builtin.current_buffer_fuzzy_find(require("telescope.themes").get_dropdown()) + end, { desc = "[/] Fuzzily search in current buffer" }) + map("n", "s/", function() + builtin.live_grep({ grep_open_files = true, prompt_title = "Live Grep in Open Files" }) + end, { desc = "[S]earch [/] in Open Files" }) + end, +} diff --git a/lua/pika/plugins/ui.lua b/lua/pika/plugins/ui.lua new file mode 100644 index 0000000..0a02416 --- /dev/null +++ b/lua/pika/plugins/ui.lua @@ -0,0 +1,304 @@ +return { + -- ╭───────────────────────────────────────╮ + -- │ bufferline - for mistakes and stuff.. │ + -- ╰───────────────────────────────────────╯ + -- { + -- "akinsho/bufferline.nvim", + -- dependencies = { "echasnovski/mini.icons" }, + -- version = "*", + -- opts = { + -- options = { + -- diagnostics = "nvim_lsp", + -- diagnostics_update_on_event = true, -- use nvim's diagnostic handler + -- diagnostics_indicator = function(count, level) + -- local icon = level:match("error") and " " or " " + -- return " " .. icon .. count + -- end, + -- offsets = { { filetype = "neo-tree", text = "File Explorer", highlight = "Directory" } }, + -- -- ─< style >─────────────────────────────────────────────────────────────────────────── + -- indicator = { + -- icon = "▎", -- this should be omitted if indicator style is not 'icon' + -- style = "icon", + -- }, + -- move_wraps_at_ends = true, -- whether or not the move command "wraps" at the first or last position + -- separator_style = "slope", + -- -- ─< icons >─────────────────────────────────────────────────────────────────────────── + -- modified_icon = "󱞇", + -- left_trunc_marker = "󰬩", + -- right_trunc_marker = "󰬫", + -- themable = true, -- allows highlight groups to be overriden i.e. sets highlights as default + -- close_icon = "󱄊", + -- buffer_close_icon = "󱄊", + -- show_buffer_icons = true, -- disable filetype icons for buffers + -- show_buffer_close_icons = true, + -- show_close_icon = true, + -- show_tab_indicators = true, + -- hover = { + -- enabled = true, + -- delay = 80, + -- reveal = { "close" }, + -- hide = { "nvim_lsp" }, + -- }, + -- -- You can set buffer_mode to "list" or "tabbed" based on your preference. + -- buffer_mode = "list", + -- color_icons = true, -- whether or not to add the filetype icon highlights + -- }, + -- }, + -- config = function(_, opts) + -- require("bufferline").setup(opts) + -- -- Remap the tab key for buffer navigation (you can adjust the keys as needed) + -- vim.keymap.set("n", "", "BufferLineCycleNext") + -- vim.keymap.set("n", "", "BufferLineCyclePrev") + -- end, + -- }, + + -- ╭───────────────────────────────────╮ + -- │ cmdline - for nice command inputs │ + -- ╰───────────────────────────────────╯ + { + "VonHeikemen/fine-cmdline.nvim", + dependencies = { + { "MunifTanjim/nui.nvim" }, + }, + config = function() + require("fine-cmdline").setup({ + cmdline = { + enable_keymaps = true, + smart_history = true, + prompt = " ", + }, + popup = { + position = { + row = "10%", + col = "50%", + }, + size = { + width = "60%", + }, + border = { + style = "rounded", + }, + win_options = { + winhighlight = "Normal:Normal,FloatBorder:FloatBorder", + }, + }, + -- hooks = { + -- before_mount = function(input) + -- -- code + -- end, + -- after_mount = function(input) + -- -- code + -- end, + -- set_keymaps = function(imap, feedkeys) + -- -- code + -- end, + -- }, + }) + end, + vim.api.nvim_set_keymap("n", ":", "FineCmdline", { noremap = true }), + vim.keymap.set("n", "T", "FineCmdline"), + }, + + -- ╭───────────────────────────────────────╮ + -- │ barbecue - for a nice breadcrump menu │ + -- ╰───────────────────────────────────────╯ + -- { + -- "utilyre/barbecue.nvim", + -- name = "barbecue", + -- version = "*", + -- dependencies = { + -- "SmiteshP/nvim-navic", + -- "echasnovski/mini.icons", -- optional dependency + -- }, + -- opts = { + -- theme = { + -- -- this highlight is used to override other highlights + -- -- you can take advantage of its `bg` and set a background throughout your winbar + -- -- (e.g. basename will look like this: { fg = "#c0caf5", bold = true }) + -- normal = { fg = "#c0caf5" }, + -- + -- -- these highlights correspond to symbols table from config + -- ellipsis = { fg = "#737aa2" }, + -- separator = { fg = "#737aa2" }, + -- modified = { fg = "#737aa2" }, + -- + -- -- these highlights represent the _text_ of three main parts of barbecue + -- dirname = { fg = "#737aa2" }, + -- basename = { bold = true }, + -- context = {}, + -- + -- -- these highlights are used for context/navic icons + -- context_file = { fg = "#ac8fe4" }, + -- context_module = { fg = "#ac8fe4" }, + -- context_namespace = { fg = "#ac8fe4" }, + -- context_package = { fg = "#ac8fe4" }, + -- context_class = { fg = "#ac8fe4" }, + -- context_method = { fg = "#ac8fe4" }, + -- context_property = { fg = "#ac8fe4" }, + -- context_field = { fg = "#ac8fe4" }, + -- context_constructor = { fg = "#ac8fe4" }, + -- context_enum = { fg = "#ac8fe4" }, + -- context_interface = { fg = "#ac8fe4" }, + -- context_function = { fg = "#ac8fe4" }, + -- context_variable = { fg = "#ac8fe4" }, + -- context_constant = { fg = "#ac8fe4" }, + -- context_string = { fg = "#ac8fe4" }, + -- context_number = { fg = "#ac8fe4" }, + -- context_boolean = { fg = "#ac8fe4" }, + -- context_array = { fg = "#ac8fe4" }, + -- context_object = { fg = "#ac8fe4" }, + -- context_key = { fg = "#ac8fe4" }, + -- context_null = { fg = "#ac8fe4" }, + -- context_enum_member = { fg = "#ac8fe4" }, + -- context_struct = { fg = "#ac8fe4" }, + -- context_event = { fg = "#ac8fe4" }, + -- context_operator = { fg = "#ac8fe4" }, + -- context_type_parameter = { fg = "#ac8fe4" }, + -- }, + -- }, + -- }, + -- ╭─────────────────────────────────╮ + -- │ indentlines - nice indent lines │ + -- ╰─────────────────────────────────╯ + { + "lukas-reineke/indent-blankline.nvim", + event = { "BufReadPre", "BufNewFile" }, + main = "ibl", + opts = { + indent = { + char = "┊", + tab_char = "┊", + -- char = "│", + -- tab_char = "│", + }, + }, + }, + + -- ╭──────────────────╮ + -- │ markdown plugins │ + -- ╰──────────────────╯ + { + "MeanderingProgrammer/render-markdown.nvim", + opts = {}, + -- 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 + }, + + -- ╭────────────────────────────────────╮ + -- │ notify for excellent notifications │ + -- ╰────────────────────────────────────╯ + -- { + -- "rcarriga/nvim-notify", + -- config = function() + -- require("notify").setup({ + -- stages = "slide", + -- background_colour = "FloatShadow", + -- max_width = 120, + -- timeout = 2750, + -- render = "wrapped-compact", + -- -- Minimum/Maximum width for notification windows + -- minimum_width = 30, + -- maximum_width = 120, + -- + -- -- Function called when a new window is opened, use for changing win settings/config + -- on_open = nil, + -- + -- -- Function called when a window is closed + -- on_close = nil, + -- icons = { + -- ERROR = "", -- alternate symbol  + -- WARN = "", + -- INFO = "", + -- DEBUG = "", + -- TRACE = "", + -- }, + -- }) + -- vim.notify = require("notify") + -- end, + -- }, + -- ╭──────────────────────────────╮ + -- │ slimline - nice bar for nvim │ + -- ╰──────────────────────────────╯ + { + -- Calls `require('slimline').setup({})` + "sschleemilch/slimline.nvim", + opts = { + bold = true, -- makes primary parts and mode bold + verbose_mode = false, -- Mode as single letter or as a word + style = "bg", -- or "fg". Whether highlights should be applied to bg or fg of components + mode_follow_style = true, -- Whether the mode color components should follow the style option + components = { -- Choose components and their location + left = { + "mode", + -- "path", + -- "git", + }, + center = { + "path", + "git", + }, + right = { + "diagnostics", + "filetype_lsp", + "progress", + }, + }, + spaces = { + components = " ", -- string between components + left = " ", -- string at the start of the line + right = " ", -- string at the end of the line + }, + sep = { + hide = { + first = false, -- hides the first separator + last = false, -- hides the last separator + }, + left = "", -- left separator of components + right = "", -- right separator of components + }, + hl = { + modes = { + normal = "Type", -- highlight base of modes + insert = "Function", + pending = "Boolean", + visual = "Keyword", + command = "String", + }, + base = "Comment", -- highlight of everything in in between components + primary = "Normal", -- highlight of primary parts (e.g. filename) + secondary = "Comment", -- highlight of secondary parts (e.g. filepath) + }, + icons = { + diagnostics = { + ERROR = " ", + WARN = " ", + HINT = " ", + INFO = " ", + }, + git = { + branch = "", + }, + folder = " ", + lines = " ", + }, + }, + }, + + -- ╭────────────────────────────────────────╮ + -- │ which key - to know what to press next │ + -- ╰────────────────────────────────────────╯ + { + "folke/which-key.nvim", + event = "VeryLazy", + init = function() + vim.o.timeout = true + vim.o.timeoutlen = 350 + end, + opts = { + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below + }, + }, +}