diff --git a/README.md b/README.md index 7a6cd22..5c54e16 100644 --- a/README.md +++ b/README.md @@ -4,56 +4,66 @@  [
 Installation 
](#installation)   [
 Usage 
](#usage)   [
 Troubleshooting 
](#troubleshooting)  + ## About this repository -It contains all my configuration files (managed by [Chezmoi](https://www.chezmoi.io/)) and the script permitting to install my configuration on any Arch-based Linux distribution or any Linux distribution (as long as you can install [that](#prerequisites)). + +It contains all my configuration files (managed by [Chezmoi](https://www.chezmoi.io/)) and the script permitting to install my configuration on any Arch-based Linux distribution or any Linux distribution (as long as you can install [that](#prerequisites)). **Overview :** + - [💻 OS](): - - [Arch Linux 💥](https://archlinux.org/) + - [Arch Linux 💥](https://archlinux.org/) - [🪟 Windows Manager](): - - [HyprLand 🍚](https://hyprland.org/) + - [HyprLand 🍚](https://hyprland.org/) - [📟 Widgets](): - - [ Eww 🤢](https://github.com/elkowar/eww) + - [ Eww 🤢](https://github.com/elkowar/eww) - [👽 Terminal](): - - [☄ Emulator](): - - [Kitty 😽](https://sw.kovidgoyal.net/kitty/) - - [🐚 Shell](): - - [fish 🐟](https://fishshell.com/) with [Fisher 🎣](https://github.com/jorgebucaran/fisher) - - [Zsh 📡]() with [Zinit 🌻](https://github.com/zdharma-continuum/zinit) - - [Bash 📻]() - - **🤖 Prompt**: [Oh-My-Posh 🔋](https://ohmyposh.dev/) - - [📝 Editor](): - - [Vim 👾](https://www.vim.org/) - - [NeoVim 👓](https://neovim.io/) with [NvChad 🗿](https://nvchad.com/) + - [☄ Emulator](): + - [Kitty 😽](https://sw.kovidgoyal.net/kitty/) + - [🐚 Shell](): + - [fish 🐟](https://fishshell.com/) with [Fisher 🎣](https://github.com/jorgebucaran/fisher) + - [Zsh 📡]() with [Zinit 🌻](https://github.com/zdharma-continuum/zinit) + - [Bash 📻]() + - **🤖 Prompt**: [Oh-My-Posh 🔋](https://ohmyposh.dev/) + - [📝 Editor](): + - [Vim 👾](https://www.vim.org/) + - [NeoVim 👓](https://neovim.io/) with [NvChad 🗿](https://nvchad.com/) - [🔎 Browser](): - - [Firefox 🌐](https://www.mozilla.org/fr/firefox/) + - [Firefox 🌐](https://www.mozilla.org/fr/firefox/) Check the `utils/packages` file to see all the packages installed by the script.
## Installation + ### Prerequisites + `Chezmoi`, `pacman` and `sudo` are necessary, be sure to have them install and configure! `Git` and `age` might be useful to have install. -You may want to install the appropriate [driver](https://wiki.archlinux.org/title/NVIDIA) if you have an NVIDIA GPU. +You may want to install the appropriate [driver](https://wiki.archlinux.org/title/NVIDIA) if you have an NVIDIA GPU. ### Installation guide -Initialize the `chezmoi` repository with the following command : + +Initialize the `chezmoi` repository with the following command : + ```bash chezmoi init https://gitea.hexasec.io/tombdf/.dotfiles.git ``` -Start the installation script with the following command : + +Start the installation script with the following command : + ```bash chezmoi cd && ./install.sh ``` ### Finishing the configuration + The script will end by itself. I recommend you to restart your computer. After restarting and opening the terminal, Fisher will install all the plugins. -If you have access to Github Copilot, I recommend you to log in neovim with the `Copilot auth` command. +If you have access to Github Copilot, I recommend you to log in neovim with the `Copilot auth` command. I also recommend you to launch Firefox and create a Betterfox profile (using the `~/.config/betterfox/` folder). You can follow [this tutorial](https://github.com/yokoffing/Betterfox?tab=readme-ov-file). You may want to add an DNS in `user.js` (search line `user_pref("network.trr.uri", "");`). You may also setup the DNS in `/etc/systemd/resolved.conf` (I use [NextDNS](https://nextdns.io/) for that). Once you've done that, it's all good, enjoy your new config! @@ -62,162 +72,181 @@ PS: Don't forget to check the log file
## Usage -The following sections will resume what usage you can have of different commands, text editors or terminal emulator. + +The following sections will resume what usage you can have of different commands, text editors or terminal emulator. ### Commands -With Zsh and Zinit, a lot of commands will be installed. They're very useful and powerful so it might be a good idea to learn what they are. + +With Zsh and Zinit, a lot of commands will be installed. They're very useful and powerful so it might be a good idea to learn what they are. #### Zoxide + **Commands** : `z` | `zi` **Replaced by** : `cd` | `cdi` -[Github page](https://github.com/ajeetdsouza/zoxide) +[Github page](https://github.com/ajeetdsouza/zoxide) Zoxide is a **cd** replacement. It will work fine as cd does, but every time you use the command, it will remember the path to the directory. After a little bit of time using the command, you could use it to "jump" to a repository i.e. you could only write a part of the path to the directory. You could also not write the entire name of the directory. -If you want to see all the repository remembered by Zoxide, you can use the `cdi` command. -**Note** : Zoxide integrate a system to replace the original `z` command by another (alternative to alias). That mean that only the "new" command work, not the original work. You can find the command in the Shell configuration file. +If you want to see all the repository remembered by Zoxide, you can use the `cdi` command. +**Note** : Zoxide integrate a system to replace the original `z` command by another (alternative to alias). That mean that only the "new" command work, not the original work. You can find the command in the Shell configuration file. -Usage of the command : `tldr zoxide` +Usage of the command : `tldr zoxide`
#### Lsd + **Command** : `lsd` **Aliased by** : `ls` | `ll` -[Github page](https://github.com/lsd-rs/lsd-rs) +[Github page](https://github.com/lsd-rs/lsd-rs) Lsd is a **ls** replacement. It will add colors, icons and even git status to the display. -The `ll` alias will print all the informations on all the files (including hidden files) in a directory. Check the aliases in the Shell configuration file. +The `ll` alias will print all the informations on all the files (including hidden files) in a directory. Check the aliases in the Shell configuration file. -Usage of the command : `tldr lsd` +Usage of the command : `tldr lsd`
#### Rip + **Command** : `rip` **Aliased by** : `rm` -[Github page](https://github.com/nivekuil/rip) +[Github page](https://github.com/nivekuil/rip) Rip is a **rm** replacement. It will send all the deleted files to the graveyard (`/tmp/graveyard-$USER` or `$XDG_DATA_HOME/graveyard`), which means that the files can be restored. -The files can only be deleted permanently by deleting the entire graveyard with the appropriate flag. Note that the graveyard can be put where you want with the right option. +The files can only be deleted permanently by deleting the entire graveyard with the appropriate flag. Note that the graveyard can be put where you want with the right option. -Usage of the command : `tldr rip` +Usage of the command : `tldr rip`
#### Bat + **Command** : `bat` **Aliased by** : `cat` -[Github page](https://github.com/sharkdp/bat) +[Github page](https://github.com/sharkdp/bat) Bat is a **cat** replacement. It supports syntax-highlighting and git integration. -It can be use as a pager. +It can be use as a pager. -Usage of the command : `tldr bat` +Usage of the command : `tldr bat`
#### Ripgrep + **Command** : `rg` **Aliased by** : `grep` -[Github page](https://github.com/BurntSushi/ripgrep) +[Github page](https://github.com/BurntSushi/ripgrep) -Ripgrep is a **grep** replacement. It's a faster and recursive alternative to the original command. +Ripgrep is a **grep** replacement. It's a faster and recursive alternative to the original command. -Usage of the command : `tldr rg` +Usage of the command : `tldr rg`
#### Fd + **Command** : `fd` **Aliased by** : `find` -[Github page](https://github.com/sharkdp/fd) +[Github page](https://github.com/sharkdp/fd) Fd is a **find** replacement. It's a faster and more user-friendly alternative to the original command. -The alias is set to show the hidden directory as well. Check the alias in the Shell configuration file. +The alias is set to show the hidden directory as well. Check the alias in the Shell configuration file. -Usage of the command : `tldr fd` +Usage of the command : `tldr fd`
#### Sd + **Command** : `sd` **Aliased by** : `sed` -[Github page](https://github.com/chmln/sd) +[Github page](https://github.com/chmln/sd) -Sd is a **sed** replacement. It's a faster and more intuitive alternative to the original command. +Sd is a **sed** replacement. It's a faster and more intuitive alternative to the original command. -Usage of the command : `tldr sd` +Usage of the command : `tldr sd`
#### Topgrade + **Command** : `topgrade` -[Github page](https://github.com/topgrade-rs/topgrade) +[Github page](https://github.com/topgrade-rs/topgrade) -Topgrade permit to update, not only the system, but also all the packages and the git repository. It update **ALL** the things. +Topgrade permit to update, not only the system, but also all the packages and the git repository. It update **ALL** the things. -Usage of the command : `tldr topgrade` +Usage of the command : `tldr topgrade`
#### Tealdeer + **Command** : `tldr` -[Github page](https://github.com/dbrgn/tealdeer) +[Github page](https://github.com/dbrgn/tealdeer) Tealdeer is a faster TLDR. It shows you pages written by community on different commands and programs. -The pages shows different common and useful uses of commands. +The pages shows different common and useful uses of commands. ### Text editors -Differents text editors are available with my config. They're very powerful if you know how to use them and if you know the right keyboard shortcuts. + +Differents text editors are available with my config. They're very powerful if you know how to use them and if you know the right keyboard shortcuts. #### Vim + **Command** : `vim` **Replaced by** : `vi` -**Leader** : `,` +**Leader** : `,` Vim is installed with vim-plug plugin manager and the Gruvbox theme. In Vim, you can use the `PlugInstall` command to install the plugin, and `Minimap` to toggle the minimap. In Insert mode, you can use the `jj` mapping to go in Normal mode, and type Space to enter Command mode. Also in Insert mode, you can use the `'` mapping to open a block instruction. -In Normal mode, use the `j`|`k`|`l`|`m` keys to move. Use the `` mapping to open NerdTree. +In Normal mode, use the `j`|`k`|`l`|`m` keys to move. Use the `` mapping to open NerdTree. -To see all the mappings, check the `.vimrc` config file. +To see all the mappings, check the `.vimrc` config file.
#### Neovim with NvChad + **Command** : `nvim` **Aliased by** : `vim` **Leader** : `,` -[NvChad Github page](https://github.com/NvChad/NvChad) +[NvChad Github page](https://github.com/NvChad/NvChad) Neovim is installed with the NvChad config. The basics mappings in Neovim are the same as the ones describes [here](#Vim). To see (almost) all the mappings, use the `ch` mapping. Use the `Lazy` command in Neovim to manage the plugins, and the `Mason` command to manage LSP. -Type the `Copilot` command and type `tab` to see all the command available to use Copilot and CopilotChat. +Type the `Copilot` command and type `tab` to see all the command available to use Copilot and CopilotChat. -To see all the mappings, check the `mappings.lua` file in `.config/nvim/lua/`. To see all the plugins, check the `plugins.lua` file in `.config/nvim/lua/plugins`. +To see all the mappings, check the `mappings.lua` file in `.config/nvim/lua/`. To see all the plugins, check the `plugins.lua` file in `.config/nvim/lua/plugins`. ### Terminal emulator -Kitty is the terminal emulator use in this config. -The leader key is Ctrl+Shift, here is a list of useful mappings : -* `t` : Create a new tab. -* `q` : Close a tab. -* `` : Split a tab. -* `` : Move between the different tab. -Check the `kitty.conf` file in `.config/kitty/` to see all the possibility offered by Kitty. +Kitty is the terminal emulator use in this config. +The leader key is Ctrl+Shift, here is a list of useful mappings : + +- `t` : Create a new tab. +- `q` : Close a tab. +- `` : Split a tab. +- `` : Move between the different tab. + +Check the `kitty.conf` file in `.config/kitty/` to see all the possibility offered by Kitty.
## Troubleshooting -Before doing anything, verify that all the packages listed [here](#necessary-packages) are installed with the latest stable version. + +Before doing anything, verify that all the packages listed [here](#necessary-packages) are installed with the latest stable version. ### Fish + If something went wrong when sourcing the config file, it might be that fish_inclusion was not delete preventing, when sourcing the file again, the downloading or the call of certains plugins. To fix that, you just have to run manually the command to reset the variable : set -e fish_inclusion ### Neovim + If NvChad seems not to be installed, be sure to have the latest version of Neovim installed. For any problem with a plugin, use the `checkhealth` command and see if anything wrong with the plugin is mentioned. -If you get an error message like this : **"Client 1 quit with code 1"**, it might mean that a package is missing for Mason to work correctly. +If you get an error message like this : **"Client 1 quit with code 1"**, it might mean that a package is missing for Mason to work correctly. diff --git a/private_dot_config/kitty/kitty.conf b/private_dot_config/kitty/kitty.conf index 3657d69..3639e06 100644 --- a/private_dot_config/kitty/kitty.conf +++ b/private_dot_config/kitty/kitty.conf @@ -1,3 +1,4 @@ +# vim:fileencoding=utf-8:foldmethod=marker ######################################################################################################## # # ██╗ ██╗██╗████████╗████████╗██╗ ██╗ ██████╗ ██████╗ ███╗ ██╗███████╗ @@ -9,6 +10,7 @@ # ######################################################################################################## + #: Fonts {{{ #: kitty has very powerful font management. You can configure @@ -316,7 +318,7 @@ cursor_stop_blinking_after 15.0 #: Stop blinking cursor after the specified number of seconds of #: keyboard inactivity. Set to zero to never stop blinking. -# cursor_trail 0 +cursor_trail 0 #: Set this to a value larger than zero to enable a "cursor trail" #: animation. This is an animation that shows a "trail" following the @@ -332,7 +334,7 @@ cursor_stop_blinking_after 15.0 #: cursor_trail_start_threshold to control when a cursor trail is #: started. -# cursor_trail_decay 0.1 0.4 +cursor_trail_decay 0.1 0.4 #: Controls the decay times for the cursor trail effect when the #: cursor_trail is enabled. This option accepts two positive float @@ -344,7 +346,7 @@ cursor_stop_blinking_after 15.0 #: trail. Adjust these values to control how quickly the cursor trail #: fades away. -# cursor_trail_start_threshold 2 +cursor_trail_start_threshold 2 #: Set the distance threshold for starting the cursor trail. This #: option accepts a positive integer value that represents the minimum @@ -1070,7 +1072,7 @@ tab_bar_margin_height 0.0 0.0 #: The second number is the margin between the tab bar and the #: contents of the current tab. -tab_bar_style fade +tab_bar_style custom #: The tab bar style, can be one of: @@ -2463,6 +2465,8 @@ map kitty_mod+e open_url_with_hints #: Miscellaneous {{{ +map kitty_mod+g kitten gattino/gattino.py + #: Show documentation map kitty_mod+f1 show_kitty_doc overview diff --git a/private_dot_config/nvim/dot_neoconf.json b/private_dot_config/nvim/dot_neoconf.json new file mode 100644 index 0000000..7c48087 --- /dev/null +++ b/private_dot_config/nvim/dot_neoconf.json @@ -0,0 +1,15 @@ +{ + "neodev": { + "library": { + "enabled": true, + "plugins": true + } + }, + "neoconf": { + "plugins": { + "lua_ls": { + "enabled": true + } + } + } +} diff --git a/private_dot_config/nvim/init.lua b/private_dot_config/nvim/init.lua index 00571a9..a3eef8a 100644 --- a/private_dot_config/nvim/init.lua +++ b/private_dot_config/nvim/init.lua @@ -1,37 +1,10 @@ -vim.g.base46_cache = vim.fn.stdpath "data" .. "/nvchad/base46/" -vim.g.mapleader = "," +vim.g.base46_cache = vim.fn.stdpath("data") .. "/base46_cache/" --- bootstrap lazy and all plugins -local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim" +-- bootstrap lazy.nvim, LazyVim and your plugins +require("config.lazy") -if not vim.loop.fs_stat(lazypath) then - local repo = "https://github.com/folke/lazy.nvim.git" - vim.fn.system { "git", "clone", "--filter=blob:none", repo, "--branch=stable", lazypath } -end +-- dofile(vim.g.base46_cache .. "defaults") -vim.opt.rtp:prepend(lazypath) - -local lazy_config = require "configs.lazy" - --- load plugins -require("lazy").setup({ - { - "NvChad/NvChad", - lazy = false, - branch = "v2.5", - import = "nvchad.plugins", - }, - - { import = "plugins" }, -}, lazy_config) - --- load theme -dofile(vim.g.base46_cache .. "defaults") -dofile(vim.g.base46_cache .. "statusline") - -require "options" -require "nvchad.autocmds" - -vim.schedule(function() - require "mappings" -end) +-- for _, v in ipairs(vim.fn.readdir(vim.g.base46_cache)) do +-- dofile(vim.g.base46_cache .. v) +-- end diff --git a/private_dot_config/nvim/lazyvim.json b/private_dot_config/nvim/lazyvim.json new file mode 100644 index 0000000..ad3f491 --- /dev/null +++ b/private_dot_config/nvim/lazyvim.json @@ -0,0 +1,40 @@ +{ + "extras": [ + "lazyvim.plugins.extras.ai.copilot", + "lazyvim.plugins.extras.ai.copilot-chat", + "lazyvim.plugins.extras.coding.luasnip", + "lazyvim.plugins.extras.coding.mini-comment", + "lazyvim.plugins.extras.coding.mini-surround", + "lazyvim.plugins.extras.coding.neogen", + "lazyvim.plugins.extras.coding.yanky", + "lazyvim.plugins.extras.dap.core", + "lazyvim.plugins.extras.dap.nlua", + "lazyvim.plugins.extras.editor.dial", + "lazyvim.plugins.extras.editor.fzf", + "lazyvim.plugins.extras.editor.inc-rename", + "lazyvim.plugins.extras.formatting.black", + "lazyvim.plugins.extras.lang.clangd", + "lazyvim.plugins.extras.lang.docker", + "lazyvim.plugins.extras.lang.git", + "lazyvim.plugins.extras.lang.haskell", + "lazyvim.plugins.extras.lang.json", + "lazyvim.plugins.extras.lang.markdown", + "lazyvim.plugins.extras.lang.nix", + "lazyvim.plugins.extras.lang.python", + "lazyvim.plugins.extras.lang.sql", + "lazyvim.plugins.extras.lang.toml", + "lazyvim.plugins.extras.ui.edgy", + "lazyvim.plugins.extras.ui.smear-cursor", + "lazyvim.plugins.extras.ui.treesitter-context", + "lazyvim.plugins.extras.util.chezmoi", + "lazyvim.plugins.extras.util.dot", + "lazyvim.plugins.extras.util.gitui", + "lazyvim.plugins.extras.util.mini-hipatterns", + "lazyvim.plugins.extras.util.octo", + "lazyvim.plugins.extras.util.project" + ], + "news": { + "NEWS.md": "10960" + }, + "version": 7 +} \ No newline at end of file diff --git a/private_dot_config/nvim/lua/autocmds.lua b/private_dot_config/nvim/lua/autocmds.lua deleted file mode 100644 index e797d97..0000000 --- a/private_dot_config/nvim/lua/autocmds.lua +++ /dev/null @@ -1,79 +0,0 @@ -local autocmd = vim.api.nvim_create_autocmd - --- dont list quickfix buffers -autocmd("FileType", { - pattern = "qf", - callback = function() - vim.opt_local.buflisted = false - end, -}) - --- reload some chadrc options on-save -autocmd("BufWritePost", { - pattern = vim.tbl_map(function(path) - return vim.fs.normalize(vim.loop.fs_realpath(path)) - end, vim.fn.glob(vim.fn.stdpath "config" .. "/lua/**/*.lua", true, true, true)), - group = vim.api.nvim_create_augroup("ReloadNvChad", {}), - - callback = function(opts) - local fp = vim.fn.fnamemodify(vim.fs.normalize(vim.api.nvim_buf_get_name(opts.buf)), ":r") --[[@as string]] - local app_name = vim.env.NVIM_APPNAME and vim.env.NVIM_APPNAME or "nvim" - local module = string.gsub(fp, "^.*/" .. app_name .. "/lua/", ""):gsub("/", ".") - - require("plenary.reload").reload_module "nvconfig" - require("plenary.reload").reload_module "chadrc" - require("plenary.reload").reload_module "base46" - require("plenary.reload").reload_module(module) - - local config = require "nvconfig" - - -- statusline - require("plenary.reload").reload_module "nvchad.stl.utils" - require("plenary.reload").reload_module("nvchad.stl." .. config.ui.statusline.theme) - vim.opt.statusline = "%!v:lua.require('nvchad.stl." .. config.ui.statusline.theme .. "')()" - - -- tabufline - if config.ui.tabufline.enabled then - require("plenary.reload").reload_module "nvchad.tabufline.modules" - vim.opt.tabline = "%!v:lua.require('nvchad.tabufline.modules')()" - end - - require("base46").load_all_highlights() - -- vim.cmd("redraw!") - end, -}) - --- user event that loads after UIEnter + only if file buf is there -vim.api.nvim_create_autocmd({ "UIEnter", "BufReadPost", "BufNewFile" }, { - group = vim.api.nvim_create_augroup("NvFilePost", { clear = true }), - callback = function(args) - local file = vim.api.nvim_buf_get_name(args.buf) - local buftype = vim.api.nvim_buf_get_option(args.buf, "buftype") - - if not vim.g.ui_entered and args.event == "UIEnter" then - vim.g.ui_entered = true - end - - if file ~= "" and buftype ~= "nofile" and vim.g.ui_entered then - vim.api.nvim_exec_autocmds("User", { pattern = "FilePost", modeline = false }) - vim.api.nvim_del_augroup_by_name "NvFilePost" - - vim.schedule(function() - vim.api.nvim_exec_autocmds("FileType", {}) - - if vim.g.editorconfig then - require("editorconfig").config(args.buf) - end - end, 0) - end - end, -}) - --- fix lspsaga codeaction causing buffer issues -vim.api.nvim_create_autocmd("BufAdd", { - callback = function(args) - if vim.bo[args.buf].buflisted then - print(args.buf) - end - end, -}) diff --git a/private_dot_config/nvim/lua/chadrc.lua b/private_dot_config/nvim/lua/chadrc.lua index 43bfd50..d90faa9 100644 --- a/private_dot_config/nvim/lua/chadrc.lua +++ b/private_dot_config/nvim/lua/chadrc.lua @@ -1,149 +1,120 @@ --------------------------------------------------------------------------- --- --- ██████╗██╗ ██╗ █████╗ ██████╗ ██████╗ ██████╗ --- ██╔════╝██║ ██║██╔══██╗██╔══██╗██╔══██╗██╔════╝ --- ██║ ███████║███████║██║ ██║██████╔╝██║ --- ██║ ██╔══██║██╔══██║██║ ██║██╔══██╗██║ --- ╚██████╗██║ ██║██║ ██║██████╔╝██║ ██║╚██████╗ --- ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═════╝ ╚═╝ ╚═╝ ╚═════╝ --- --------------------------------------------------------------------------- - ----@type ChadrcConfig local options = { - ui = { - ------------------------------- nvchad_ui modules ----------------------------- - statusline = { - enabled = true, - theme = "default", -- default/vscode/vscode_colored/minimal - -- default/round/block/arrow separators work only for default statusline theme - -- round and block will work for minimal theme only - separator_style = "arrow", - order = nil, - modules = nil, - }, + base46 = { + theme = "gruvbox", -- default theme + hl_add = {}, + hl_override = { + Comment = { fg = "#928374" }, + ["@comment"] = { fg = "#928374" }, + LineNr = { fg = "#928374" }, + Directory = { fg = "#b8bb26" }, + -- Special = { fg = "#fe8019" }, + }, + integrations = { "cmp", "dap", "edgy", "leap", "lsp", "telescope", "treesitter", "trouble", "whichkey" }, + changed_themes = {}, + transparency = true, + theme_toggle = { "gruvbox" }, + }, - -- lazyload it when there are 1+ buffers - tabufline = { - enabled = true, - lazyload = true, - order = { "treeOffset", "buffers", "tabs", "btns" }, - modules = nil, - }, - - telescope = { style = "bordered" }, -- borderless / bordered - - cmp = { - icons = true, - icons_left = false, -- only for non-atom styles! - lspkind_text = true, - style = "default", -- default/flat_light/flat_dark/atom/atom_colored - format_colors = { - tailwind = false, -- will work for css lsp too - icon = "󱓻", - }, - }, + ui = { + cmp = { + style = "default", -- default/flat_light/flat_dark/atom/atom_colored + format_colors = { + tailwind = false, -- will work for css lsp too + icon = "󱓻", + }, }, - nvdash = { - load_on_startup = true, - header = { - " I use ", - " ██████ █████ █████ █████ ███ ", - " ░░██████ ░░███ ░░███ ░░███ ░░░ ", - " ░███░███ ░███ ██████ ██████ ░███ ░███ ████ █████████████ ", - " ░███░░███░███ ███░░███ ███░░███ ░███ ░███ ░░███ ░░███░░███░░███ ", - " ░███ ░░██████ ░███████ ░███ ░███ ░░███ ███ ░███ ░███ ░███ ░███ ", - " ░███ ░░█████ ░███░░░ ░███ ░███ ░░░█████░ ░███ ░███ ░███ ░███ ", - " █████ ░░█████░░██████ ░░██████ ░░███ █████ █████░███ █████ ", - " ░░░░░ ░░░░░ ░░░░░░ ░░░░░░ ░░░ ░░░░░ ░░░░░ ░░░ ░░░░░ ", - " btw ", - }, - buttons = { - { txt = " Find file", keys = ", f f", cmd = "Telescope find_files" }, - { txt = "󰈚 Recent Files", keys = ", f o", cmd = "Telescope oldfiles" }, - { txt = "󰈭 Find Word", keys = ", f w", cmd = "Telescope live_grep" }, - { txt = " Bookmarks", keys = ", m a", cmd = "Telescope marks" }, - { txt = " Themes", keys = ", t h", cmd = "Telescope themes" }, - { txt = " Mappings", keys = ", c h", cmd = "NvCheatsheet" }, - { txt = "─", hl = "NvDashFooter", no_gap = true, rep = true }, + telescope = { style = "bordered" }, -- borderless / bordered - { - txt = function() - local stats = require("lazy").stats() - local ms = math.floor(stats.startuptime) .. " ms" - return " Loaded " .. stats.loaded .. "/" .. stats.count .. " plugins in " .. ms - end, - hl = "NvDashFooter", - no_gap = true, - }, - - { txt = "─", hl = "NvDashFooter", no_gap = true, rep = true }, - }, + statusline = { + enabled = true, + theme = "default", -- default/vscode/vscode_colored/minimal + -- default/round/block/arrow separators work only for default statusline theme + -- round and block will work for minimal theme only + separator_style = "arrow", + order = nil, + modules = nil, }, - term = { - winopts = { number = false, relativenumber = false }, - sizes = { sp = 0.3, vsp = 0.2, ["bo sp"] = 0.3, ["bo vsp"] = 0.2 }, - float = { - relative = "editor", - row = 0.3, - col = 0.25, - width = 0.5, - height = 0.4, - border = "single", - }, + -- lazyload it when there are 1+ buffers + tabufline = { + enabled = false, + lazyload = true, + order = { "treeOffset", "buffers", "tabs", "btns" }, + modules = nil, + bufwidth = 21, + }, + }, + + nvdash = { + load_on_startup = false, + header = { + " ", + " ▄▄ ▄ ▄▄▄▄▄▄▄ ", + " ▄▀███▄ ▄██ █████▀ ", + " ██▄▀███▄ ███ ", + " ███ ▀███▄ ███ ", + " ███ ▀██ ███ ", + " ███ ▀ ███ ", + " ▀██ █████▄▀█▀▄██████▄ ", + " ▀ ▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀ ", + " ", + "  Powered By  eovim ", + " ", }, - lsp = { - signature = true, - semantic_tokens = false, + buttons = { + { txt = " Find File", keys = "ff", cmd = "Telescope find_files" }, + { txt = " Recent Files", keys = "fo", cmd = "Telescope oldfiles" }, + { txt = "󰈭 Find Word", keys = "fw", cmd = "Telescope live_grep" }, + { txt = "󱥚 Themes", keys = "th", cmd = ":lua require('nvchad.themes').open()" }, + { txt = " Mappings", keys = "ch", cmd = "NvCheatsheet" }, + + { txt = "─", hl = "NvDashFooter", no_gap = true, rep = true }, + + { + txt = function() + local stats = require("lazy").stats() + local ms = math.floor(stats.startuptime) .. " ms" + return " Loaded " .. stats.loaded .. "/" .. stats.count .. " plugins in " .. ms + end, + hl = "NvDashFooter", + no_gap = true, + }, + + { txt = "─", hl = "NvDashFooter", no_gap = true, rep = true }, }, + }, - cheatsheet = { theme = "grid" }, -- simple/grid - - base46 = { - integrations = { - "codeactionmenu", - "cmp", - "dap", - "defaults", - "devicons", - "git", - "lsp", - "lspsaga", - "markview", - "mason", - "notify", - "nvcheatsheet", - "nvimtree", - "statusline", - "syntax", - "treesitter", - "trouble", - "tbline", - "telescope", - "whichkey", - }, - - theme = "gruvbox", -- default theme - - hl_override = { - Comment = { fg = "#928374" }, - ["@comment"] = { fg = "#928374" }, - LineNr = { fg = "#928374" }, - }, - transparency = true, + term = { + winopts = { number = false, relativenumber = false }, + sizes = { sp = 0.3, vsp = 0.2, ["bo sp"] = 0.3, ["bo vsp"] = 0.2 }, + float = { + relative = "editor", + row = 0.3, + col = 0.25, + width = 0.5, + height = 0.4, + border = "single", }, + }, - colorify = { - enabled = true, - mode = "virtual", -- fg, bg, virtual - virt_text = "󱓻 ", - highlight = { hex = true, lspvars = true }, - }, + lsp = { signature = false }, + cheatsheet = { + theme = "grid", -- simple/grid + excluded_groups = { "terminal (t)", "autopairs", "Nvim", "Opens" }, -- can add group name or with mode + }, + + mason = { pkgs = {}, skip = {} }, + + colorify = { + enabled = true, + mode = "virtual", -- fg, bg, virtual + virt_text = "󱓻 ", + highlight = { hex = true, lspvars = true }, + }, } local status, chadrc = pcall(require, "chadrc") diff --git a/private_dot_config/nvim/lua/config/autocmds.lua b/private_dot_config/nvim/lua/config/autocmds.lua new file mode 100644 index 0000000..1b674ce --- /dev/null +++ b/private_dot_config/nvim/lua/config/autocmds.lua @@ -0,0 +1,19 @@ +-- Autocmds are automatically loaded on the VeryLazy event +-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua +-- +-- Add any additional autocmds here +-- with `vim.api.nvim_create_autocmd` +-- +-- Or remove existing autocmds by their group name (which is prefixed with `lazyvim_` for the defaults) +-- e.g. vim.api.nvim_del_augroup_by_name("lazyvim_wrap_spell") + +-- Window navigation for dadbod-ui +vim.api.nvim_create_autocmd("FileType", { + pattern = "dbui", -- for dadbod-ui buffers + callback = function() + vim.keymap.set("n", "", "h", { buffer = true, desc = "Go to left window" }) + vim.keymap.set("n", "", "j", { buffer = true, desc = "Go to lower window" }) + vim.keymap.set("n", "", "k", { buffer = true, desc = "Go to upper window" }) + vim.keymap.set("n", "", "l", { buffer = true, desc = "Go to right window" }) + end, +}) diff --git a/private_dot_config/nvim/lua/config/keymaps.lua b/private_dot_config/nvim/lua/config/keymaps.lua new file mode 100644 index 0000000..2ff7ac3 --- /dev/null +++ b/private_dot_config/nvim/lua/config/keymaps.lua @@ -0,0 +1,80 @@ +-- Keymaps are automatically loaded on the VeryLazy event +-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua +-- Add any additional keymaps here + +local map = vim.keymap.set + +-- Custom movement keys (JKLM instead of HJKL) +map({ "n", "v", "o" }, "j", "h", { desc = "Move left" }) +map({ "n", "v", "o" }, "k", "v:count == 0 ? 'gj' : 'j'", { desc = "Move down", expr = true, silent = true }) +map({ "n", "v" }, "", "v:count == 0 ? 'gj' : 'j'", { desc = "Move down", expr = true, silent = true }) +map({ "n", "v", "o" }, "l", "v:count == 0 ? 'gk' : 'k'", { desc = "Move up", expr = true, silent = true }) +map({ "n", "v" }, "", "v:count == 0 ? 'gk' : 'k'", { desc = "Move up", expr = true, silent = true }) +map({ "n", "v", "o" }, "m", "l", { desc = "Move right" }) + +map("n", "§", "m", { desc = "Set a mark" }) + +-- Window navigation +map("n", "", "h", { desc = "Go to left window" }) +map("n", "", "j", { desc = "Go to lower window" }) +map("n", "", "k", { desc = "Go to upper window" }) +map("n", "", "l", { desc = "Go to right window" }) +-- for dadbod-ui buffers, see autocmds.lua + +-- Move Lines +map("n", "", "execute 'move .+' . v:count1==", { desc = "Move Down" }) +map("n", "", "execute 'move .-' . (v:count1 + 1)==", { desc = "Move Up" }) +map("i", "", "m .+1==gi", { desc = "Move Down" }) +map("i", "", "m .-2==gi", { desc = "Move Up" }) +map("v", "", ":execute \"'<,'>move '>+\" . v:count1gv=gv", { desc = "Move Down" }) +map("v", "", ":execute \"'<,'>move '<-\" . (v:count1 + 1)gv=gv", { desc = "Move Up" }) + +-- Better line creation +-- map("n", "o", "o", { desc = "Create line below and stay in normal mode" }) +-- map("n", "O", "O", { desc = "Create line above and stay in normal mode" }) + +map("n", "n", "nzz") +map("n", "N", "Nzz") + +-- Insert mode mappings +map("i", "jj", "", { desc = "Exit insert mode" }) +map("i", "", "ddi", { desc = "Delete line" }) +map("i", "", "^i", { desc = "Beginning of line" }) +map("i", "", "", { desc = "End of line" }) + +-- Space as command key +-- map("n", "", ":", { desc = "Enter command mode" }) + +-- Move between buffers +map("n", "", "bprevious", { desc = "Prev Buffer" }) +map("n", "", "bnext", { desc = "Next Buffer" }) + +-- map("n", "h", function() +-- require("nvchad.term").new({ pos = "sp", size = 0.4 }) +-- end, { desc = "Terminal New horizontal term" }) + +map("t", "", "", { desc = "Terminal Escape terminal mode" }) + +-- Keyboard users +vim.keymap.set("n", "", function() + require("menu").open("default") +end, {}) + +-- mouse users + nvimtree users! +vim.keymap.set({ "n", "v" }, "", function() + require("menu.utils").delete_old_menus() + + vim.cmd.exec('"normal! \\"') + + -- clicked buf + local buf = vim.api.nvim_win_get_buf(vim.fn.getmousepos().winid) + local options = vim.bo[buf].ft == "NvimTree" and "nvimtree" or "default" + + require("menu").open(options, { mouse = true }) +end, {}) + +local nomap = vim.keymap.del + +nomap({ "n", "i", "v" }, "") +nomap("n", "") +nomap("n", "") diff --git a/private_dot_config/nvim/lua/config/lazy.lua b/private_dot_config/nvim/lua/config/lazy.lua new file mode 100644 index 0000000..29a7e26 --- /dev/null +++ b/private_dot_config/nvim/lua/config/lazy.lua @@ -0,0 +1,53 @@ +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) + +require("lazy").setup({ + spec = { + -- add LazyVim and import its plugins + { "LazyVim/LazyVim", import = "lazyvim.plugins" }, + -- import/override with your plugins + { import = "plugins" }, + }, + defaults = { + -- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup. + -- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default. + lazy = false, + -- It's recommended to leave version=false for now, since a lot the plugin that support versioning, + -- have outdated releases, which may break your Neovim install. + version = false, -- always use the latest git commit + -- version = "*", -- try installing the latest stable version for plugins that support semver + }, + install = { colorscheme = { "tokyonight", "habamax", "gruvbox" } }, + checker = { + enabled = true, -- check for plugin updates periodically + notify = false, -- notify on update + }, -- automatically check for plugin updates + performance = { + rtp = { + -- disable some rtp plugins + disabled_plugins = { + "gzip", + -- "matchit", + -- "matchparen", + -- "netrwPlugin", + "tarPlugin", + "tohtml", + "tutor", + "zipPlugin", + }, + }, + }, +}) diff --git a/private_dot_config/nvim/lua/config/options.lua b/private_dot_config/nvim/lua/config/options.lua new file mode 100644 index 0000000..640a03d --- /dev/null +++ b/private_dot_config/nvim/lua/config/options.lua @@ -0,0 +1,17 @@ +-- Options are automatically loaded before lazy.nvim startup +-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua +-- Add any additional options here + +-- vim.g.mapleader = "," + +vim.g.lazyvim_python_lsp = "basedpyright" + +vim.g.lazyvim_blink_main = true + +local opt = vim.opt + +opt.tabstop = 4 + +-- opt.relativenumber = false + +-- opt.foldmethod = "marker" diff --git a/private_dot_config/nvim/lua/configs/conform.lua b/private_dot_config/nvim/lua/configs/conform.lua deleted file mode 100644 index f15e11f..0000000 --- a/private_dot_config/nvim/lua/configs/conform.lua +++ /dev/null @@ -1,26 +0,0 @@ -local options = { - lsp_fallback = true, - - formatters_by_ft = { - lua = { "stylua" }, - python = { "ruff", "black" }, - c = { "clang-format" }, - cpp = { "clang-format" }, - html = { "prettier" }, - css = { "prettier" }, - javascript = { "prettier" }, - markdown = { "prettier" }, - md = { "prettier" }, - text = { "prettier" }, - json = { "prettier" }, - yaml = { "prettier" }, - toml = { "prettier" }, - }, - - format_on_save = { - timeout_ms = 500, - lsp_fallback = true, - }, -} - -return options diff --git a/private_dot_config/nvim/lua/configs/lazy.lua b/private_dot_config/nvim/lua/configs/lazy.lua deleted file mode 100644 index cd170bd..0000000 --- a/private_dot_config/nvim/lua/configs/lazy.lua +++ /dev/null @@ -1,47 +0,0 @@ -return { - defaults = { lazy = true }, - install = { colorscheme = { "nvchad" } }, - - ui = { - icons = { - ft = "", - lazy = "󰂠 ", - loaded = "", - not_loaded = "", - }, - }, - - performance = { - rtp = { - disabled_plugins = { - "2html_plugin", - "tohtml", - "getscript", - "getscriptPlugin", - "gzip", - "logipat", - "netrw", - "netrwPlugin", - "netrwSettings", - "netrwFileHandlers", - "matchit", - "tar", - "tarPlugin", - "rrhelper", - "spellfile_plugin", - "vimball", - "vimballPlugin", - "zip", - "zipPlugin", - "tutor", - "rplugin", - "syntax", - "synmenu", - "optwin", - "compiler", - "bugreport", - "ftplugin", - }, - }, - }, -} diff --git a/private_dot_config/nvim/lua/configs/lspconfig.lua b/private_dot_config/nvim/lua/configs/lspconfig.lua deleted file mode 100644 index e988482..0000000 --- a/private_dot_config/nvim/lua/configs/lspconfig.lua +++ /dev/null @@ -1,26 +0,0 @@ -require("nvchad.configs.lspconfig").defaults() - -local lspconfig = require("lspconfig") - -local nvlsp = require("nvchad.configs.lspconfig") -local servers = { "jdtls", "html", "cssls", "clangd", "pylsp", "basedpyright", "ruff" } - -local nomap = vim.keymap.del - -for _, lsp in ipairs(servers) do - lspconfig[lsp].setup({ - on_init = nvlsp.on_init, - on_attach = function(client, bufnr) - nvlsp.on_attach(client, bufnr) - nomap("n", "gD", { buffer = bufnr }) - nomap("n", "gd", { buffer = bufnr }) - nomap("n", "gi", { buffer = bufnr }) - nomap("n", "sh", { buffer = bufnr }) - nomap("n", "D", { buffer = bufnr }) - nomap("n", "ra", { buffer = bufnr }) - nomap("n", "ca", { buffer = bufnr }) - nomap("n", "gr", { buffer = bufnr }) - end, - capabilities = nvlsp.capabilities, - }) -end diff --git a/private_dot_config/nvim/lua/configs/overrides.lua b/private_dot_config/nvim/lua/configs/overrides.lua deleted file mode 100644 index b904b41..0000000 --- a/private_dot_config/nvim/lua/configs/overrides.lua +++ /dev/null @@ -1,84 +0,0 @@ -local M = {} - -M.treesitter = { - ensure_installed = { - "vim", - "lua", - "html", - "css", - "javascript", - "typescript", - "tsx", - "php", - "c", - "cpp", - "java", - "python", - "ninja", - "rst", - "markdown", - "markdown_inline", - "bash", - "fish", - "regex", - "git_config", - "gitcommit", - "git_rebase", - "gitignore", - "gitattributes", - "dockerfile", - }, - indent = { - enable = true, - }, -} - -M.mason = { - cmd = true, - pkgs = { - -- lua stuff - "lua-language-server", - "stylua", - - -- web dev stuff - "css-lsp", - "html-lsp", - "prettier", - - -- c/cpp stuff - "clangd", - "clang-format", - - -- java stuff - "jdtls", - "java-test", - "java-debug-adapter", - "spring-boot-tools", - "lombok", - - -- python stuff - "pylsp", - "basedpyright", - "ruff", - "black", - - "hadolint", - }, -} - --- git support in nvimtree -M.nvimtree = { - git = { - enable = true, - }, - renderer = { - highlight_git = true, - icons = { - show = { - git = true, - }, - }, - }, -} - -return M diff --git a/private_dot_config/nvim/lua/mappings.lua b/private_dot_config/nvim/lua/mappings.lua deleted file mode 100644 index 4bd977f..0000000 --- a/private_dot_config/nvim/lua/mappings.lua +++ /dev/null @@ -1,212 +0,0 @@ -local map = vim.keymap.set - -map("n", "", "noh", { desc = "General Clear highlights" }) - -map("n", "", "w", { desc = "File Save" }) -map("n", "", "%y+", { desc = "File Copy whole" }) - -map("n", "n", "set nu!", { desc = "Toggle Line number" }) -map("n", "rn", "set rnu!", { desc = "Toggle Relative number" }) -map("n", "ch", "NvCheatsheet", { desc = "Toggle NvCheatsheet" }) - -map("n", "fm", function() - require("conform").format { lsp_fallback = true } -end, { desc = "Format Files" }) - --- lsp mappings -map({ "n", "v" }, "", "Lspsaga code_action", { desc = "LSP code action" }) -map({ "n", "v" }, "", "Lspsaga peek_definition", { desc = "LSP peek definition" }) -map({ "n", "v" }, "", "Lspsaga peek_type_definition", { desc = "LSP peek type definition" }) -map({ "n", "v" }, "", "Lspsaga goto_definition", { desc = "LSP goto definition" }) -map({ "n", "v" }, "", "Lspsaga goto_type_definition", { desc = "LSP goto type definition" }) -map({ "n", "v" }, "", "Lspsaga rename ++project", { desc = "LSP rename" }) -map({ "n", "v" }, "", "Lspsaga diagnostic_jump_next", { desc = "LSP diagnostic next" }) -map({ "n", "v" }, "", "Lspsaga diagnostic_jump_prev", { desc = "LSP diagnostic previous" }) - --- tabufline -map("n", "b", "enew", { desc = "Buffer New" }) - -map("n", "", function() - require("nvchad.tabufline").next() -end, { desc = "Buffer Goto next" }) - -map("n", "", function() - require("nvchad.tabufline").prev() -end, { desc = "Buffer Goto prev" }) - -map("n", "x", function() - require("nvchad.tabufline").close_buffer() -end, { desc = "Buffer Close" }) - -map("n", "t", "tabnew", { desc = "Tab New" }) - --- Comment -map("n", "/", "gcc", { desc = "Comment toggle", remap = true }) -map("v", "/", "gc", { desc = "Comment toggle", remap = true }) - --- Spider nvim movement -map({ "n", "v" }, "w", "lua require('spider').motion('w')", {desc = "Spider Move to next word"}) -map({ "n", "v" }, "b", "lua require('spider').motion('b')", {desc = "Spider Move to previous word"}) -map({ "n", "v" }, "e", "lua require('spider').motion('e')", {desc = "Spider Move to end of word"}) - --- nvimtree -map("n", "", "NvimTreeToggle", { desc = "Nvimtree Toggle window" }) -map("n", "e", "NvimTreeFocus", { desc = "Nvimtree Focus window" }) - --- telescope -map("n", "fw", "Telescope live_grep", { desc = "Telescope Live grep" }) -map("n", "fb", "Telescope buffers", { desc = "Telescope Find buffers" }) -map("n", "fh", "Telescope help_tags", { desc = "Telescope Help page" }) - -map("n", "fo", "Telescope oldfiles", { desc = "Telescope Find oldfiles" }) -map("n", "fz", "Telescope current_buffer_fuzzy_find", { desc = "Telescope Find in current buffer" }) -map("n", "cm", "Telescope git_commits", { desc = "Telescope Git commits" }) -map("n", "gt", "Telescope git_status", { desc = "Telescope Git status" }) -map("n", "pt", "Telescope terms", { desc = "Telescope Pick hidden term" }) -map("n", "th", "Telescope themes", { desc = "Telescope Nvchad themes" }) -map("n", "ff", "Telescope find_files", { desc = "Telescope Find files" }) -map( - "n", - "fa", - "Telescope find_files follow=true no_ignore=true hidden=true", - { desc = "Telescope Find all files" } -) - --- terminal -map("t", "", "", { desc = "Terminal Escape terminal mode" }) - -map("t", "", function() - local win = vim.api.nvim_get_current_win() - vim.api.nvim_win_close(win, true) -end, { desc = "Terminal Close term in terminal mode" }) - --- new terminals -map("n", "h", function() - require("nvchad.term").new { pos = "sp", size = 0.4 } -end, { desc = "Terminal New horizontal term" }) - -map("n", "v", function() - require("nvchad.term").new { pos = "vsp", size = 0.5 } -end, { desc = "Terminal New vertical window" }) - --- toggleable --- map({ "n", "t" }, "", function() --- require("nvchad.term").toggle { pos = "vsp", id = "vtoggleTerm", size = 0.3 } --- end, { desc = "Terminal Toggleable vertical term" }) --- --- map({ "n", "t" }, "", function() --- require("nvchad.term").toggle { pos = "sp", id = "htoggleTerm", size = 0.3 } --- end, { desc = "Terminal New horizontal term" }) --- --- map({ "n", "t" }, "", function() --- require("nvchad.term").toggle { pos = "float", id = "floatTerm" } --- end, { desc = "Terminal Toggle Floating term" }) - --- whichkey -map("n", "wK", "WhichKey ", { desc = "Whichkey all keymaps" }) - -map("n", "wk", function() - vim.cmd("WhichKey " .. vim.fn.input "WhichKey: ") -end, { desc = "Whichkey query lookup" }) - --- blankline -map("n", "cc", function() - local config = { scope = {} } - config.scope.exclude = { language = {}, node_type = {} } - config.scope.include = { node_type = {} } - local node = require("ibl.scope").get(vim.api.nvim_get_current_buf(), config) - - if node then - local start_row, _, end_row, _ = node:range() - if start_row ~= end_row then - vim.api.nvim_win_set_cursor(vim.api.nvim_get_current_win(), { start_row + 1, 0 }) - vim.api.nvim_feedkeys("_", "n", true) - end - end -end, { desc = "Blankline Jump to current context" }) - --- copilotchat -map({ "n", "v" }, "ccp", function() - local actions = require("CopilotChat.actions") - require("CopilotChat.integrations.telescope").pick(actions.prompt_actions()) -end, { desc = "CopilotChat - Prompt actions" }) - -map({ "n", "v" }, "ccq", function() - local input = vim.fn.input("Quick Chat: ") - if input ~= "" then - require("CopilotChat").ask(input, { selection = require("CopilotChat.select").buffer }) - end -end, { desc = "CopilotChat - Quick chat" }) - -map({ "n", "v" }, "ccf", function() - require("CopilotChat").ask("Fix this, using the lsp diagnostics if needed", { selection = require("CopilotChat.select").visual }) -end, { desc = "CopilotChat - Fix this" }) - --- menu --- vim.keymap.set("n", "", function() --- require("menu").open("default") --- end, {}) --- --- vim.keymap.set("n", "", function() --- vim.cmd.exec '"normal! \\"' --- --- local options = vim.bo.ft == "NvimTree" and "nvimtree" or "default" --- require("menu").open(options, { mouse = true }) --- end, {}) - - --- Custom mappings -map("n", "", ":", { desc = "Enter command mode" }) -map({ "n", "v" }, "j", "h", { desc = "Move left" }) -map({ "n", "v" }, "k", "j", { desc = "Move down" }) -map({ "n", "v" }, "l", "k", { desc = "Move up" }) -map({ "n", "v" }, "m", "l", { desc = "Move right" }) -map("n", "", "h", { desc = "Move the cursor to the left window" }) -map("n", "", "j", { desc = "Move the cursor to the bottom window" }) -map("n", "", "k", { desc = "Move the cursor to the upper window" }) -map("n", "", "l", { desc = "Move the cursor to the right window" }) -map("n", "", "+", { desc = "Enlarge window upwards" }) -map("n", "", "-", { desc = "Enlarge window downwards" }) -map("n", "", ">", { desc = "Enlarge window to the left" }) -map("n", "", "<", { desc = "Enlarge window to the rigth" }) -map("n", "o", "o") -map("n", "O", "O") -map("n", "n", "nzz") -map("n", "N", "Nzz") -map({ "n", "v" }, "y", "\"+y") -map("n", "yy", "\"+yy") -map({ "n", "v" }, "Y", "\"+yg_") -map({ "n", "v" }, "p", "\"+p") -map({ "n", "v" }, "P", "\"+P") -map("n", "a", function() - require("treesj").toggle() -end, { desc = "Extends or retracts an instruction block" }) -map({ "n", "v" }, "gb", "Gitsigns blame", { desc = "Git blame" }) -map("i", "jj", "", { desc = "Enter normal mode" }) -map("i", "", "ddi", { desc = "Delete a line" }) -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" }) - --- Disable mappings --- local nomap = vim.keymap.del - --- LSP unmappings are set in configs/lspconfig.lua - --- nomap("n", "h") --- nomap("n", "j") --- nomap("n", "k") --- nomap("n", "l") --- nomap("n", "") --- nomap("n", "") --- nomap("n", "") --- nomap("n", "") --- nomap("n", "") - --- nomap("v", "h") --- nomap("v", "j") --- nomap("v", "k") --- nomap("v", "l") diff --git a/private_dot_config/nvim/lua/options.lua b/private_dot_config/nvim/lua/options.lua deleted file mode 100644 index cdd9673..0000000 --- a/private_dot_config/nvim/lua/options.lua +++ /dev/null @@ -1,15 +0,0 @@ -require("nvchad.options") - -vim.opt.termguicolors = true - --- Modification de la taille des tabulations -vim.opt.shiftwidth = 4 -vim.opt.tabstop = 4 -vim.opt.softtabstop = 4 - -vim.opt.shell = "/usr/local/bin/fish" - -vim.opt.foldmethod = "marker" - --- local o = vim.o --- o.cursorlineopt ='both' -- to enable cursorline! diff --git a/private_dot_config/nvim/lua/plugins/ai.lua b/private_dot_config/nvim/lua/plugins/ai.lua new file mode 100644 index 0000000..8a26b36 --- /dev/null +++ b/private_dot_config/nvim/lua/plugins/ai.lua @@ -0,0 +1,30 @@ +return { + -- Add chat for Copilot + { + "CopilotC-Nvim/CopilotChat.nvim", + opts = { + model = "claude-3.5-sonnet", + debug = true, + auto_insert_mode = false, + }, + build = function() + vim.notify("Please run 'make tiktoken' to use CopilotChat") + end, + dependencies = { + { "zbirenbaum/copilot.lua" }, + { "nvim-lua/plenary.nvim" }, + { + "MeanderingProgrammer/render-markdown.nvim", + dependencies = { "nvim-treesitter/nvim-treesitter", "nvim-tree/nvim-web-devicons" }, + ---@module 'render-markdown' + ---@type render.md.UserConfig + opts = {}, + config = function() + require("render-markdown").setup({ + file_types = { "markdown", "copilot-chat" }, + }) + end, + }, + }, + }, +} diff --git a/private_dot_config/nvim/lua/plugins/coding.lua b/private_dot_config/nvim/lua/plugins/coding.lua new file mode 100644 index 0000000..4e9da2a --- /dev/null +++ b/private_dot_config/nvim/lua/plugins/coding.lua @@ -0,0 +1,98 @@ +return { + -- Treesitter configuration + { + "nvim-treesitter/nvim-treesitter", + opts = { + ensure_installed = { + "vim", + "lua", + "html", + "css", + "javascript", + "typescript", + "tsx", + "php", + "c", + "make", + "cmake", + "cpp", + "java", + "python", + "ninja", + "rst", + "markdown", + "markdown_inline", + "bash", + "fish", + "regex", + "git_config", + "gitcommit", + "git_rebase", + "gitignore", + "gitattributes", + "dockerfile", + }, + }, + }, + + { + "neovim/nvim-lspconfig", + opts = { + setup = { + clangd = function(_, opts) + opts.capabilities.offsetEncoding = { "utf-16" } + end, + }, + }, + }, + + -- LSP lens + { + "VidocqH/lsp-lens.nvim", + event = "VeryLazy", + opts = {}, + }, + + { + "zeioth/garbage-day.nvim", + dependencies = "neovim/nvim-lspconfig", + event = "VeryLazy", + opts = {}, + }, + + -- DAP and JTDLS (lsp) configuration for Java + { + "nvim-java/nvim-java", + lazy = false, + dependencies = { + "nvim-java/lua-async-await", + "nvim-java/nvim-java-core", + "nvim-java/nvim-java-test", + "nvim-java/nvim-java-dap", + "nvim-java/nvim-java-refactor", + "MunifTanjim/nui.nvim", + "neovim/nvim-lspconfig", + "mfussenegger/nvim-dap", + { + "williamboman/mason.nvim", + opts = { + registries = { + "github:nvim-java/mason-registry", + "github:mason-org/mason-registry", + }, + }, + }, + { + "williamboman/mason-lspconfig.nvim", + opts = { + handlers = { + ["jdtls"] = function() + require("java").setup() + require("lspconfig").jdtls.setup({}) + end, + }, + }, + }, + }, + }, +} diff --git a/private_dot_config/nvim/lua/plugins/colorscheme.lua b/private_dot_config/nvim/lua/plugins/colorscheme.lua new file mode 100644 index 0000000..d1cbf1d --- /dev/null +++ b/private_dot_config/nvim/lua/plugins/colorscheme.lua @@ -0,0 +1,83 @@ +local neutral_aqua = "#689d6a" +local bright_yellow = "#fadb2f" +local dark4 = "#7c6f64" +local neutral_yellow = "#d79921" +local bright_orange = "#fe8019" + +return { + { + "nvchad/base46", + lazy = true, + build = function() + require("base46").load_all_highlights() + end, + }, + + -- { + -- "nvchad/ui", + -- branch = "v3.0", + -- lazy = false, + -- config = function() + -- require("nvchad") + -- end, + -- }, + + -- { + -- "nvim-tree/nvim-web-devicons", + -- lazy = true, + -- opts = function() + -- return { override = require("nvchad.icons.devicons") } + -- end, + -- config = function(_, opts) + -- dofile(vim.g.base46_cache .. "devicons") + -- require("nvim-web-devicons").setup(opts) + -- end, + -- }, + + -- Taken from gruvbox.lua in EdenVim + { + "ellisonleao/gruvbox.nvim", + priority = 1000, + config = true, + opts = { + -- hard, soft, "" (the default contrast) + contrast = "soft", + background = "dark", + transparent_mode = true, + inverse = false, + overrides = { + StatusLine = { bg = "#32302F", fg = "#ebdbb2" }, + + BufferlineBufferSelected = { fg = neutral_aqua, bold = true, italic = true }, + BufferlineSeparator = { fg = neutral_aqua }, + BufferlineSeparatorSelected = { fg = bright_yellow }, + + BufferlineTab = { fg = dark4 }, + BufferlineTabSelected = { fg = neutral_aqua, bold = true, italic = true }, + BufferlineTabSeparator = { fg = dark4 }, + BufferlineTabSeparatorSelected = { fg = dark4 }, + + NoiceCmdlinePopupBorder = { fg = "#b8bb26" }, + + -- Uncomment to make window separator green (for some people it's too much color in UI) + -- WinSeparator = { fg = neutral_aqua }, + + FlashLabel = { fg = bright_orange, bold = true }, + WhichKeySeparator = { fg = neutral_yellow }, + WhichKey = { fg = bright_yellow }, + WhichKeyDesc = { fg = neutral_aqua }, + WhichKeyGroup = { fg = bright_orange }, + WhichKeyBorder = { fg = neutral_aqua }, + + NvimTreeRootFolder = { fg = neutral_aqua }, + }, + }, + }, + + { + "LazyVim/LazyVim", + opts = { + colorscheme = "gruvbox", + }, + }, +} diff --git a/private_dot_config/nvim/lua/plugins/editor.lua b/private_dot_config/nvim/lua/plugins/editor.lua new file mode 100644 index 0000000..b63fea6 --- /dev/null +++ b/private_dot_config/nvim/lua/plugins/editor.lua @@ -0,0 +1,236 @@ +return { + { "nvzone/volt", lazy = true }, + { "nvzone/menu", lazy = true }, + { "nvzone/minty", cmd = { "Shades", "Huefy" } }, + + { + "snacks.nvim", + opts = { + dashboard = { + preset = { + header = [[ + I use + ██████ █████ █████ █████ ███ +░░██████ ░░███ ░░███ ░░███ ░░░ + ░███░███ ░███ ██████ ██████ ░███ ░███ ████ █████████████ + ░███░░███░███ ███░░███ ███░░███ ░███ ░███ ░░███ ░░███░░███░░███ + ░███ ░░██████ ░███████ ░███ ░███ ░░███ ███ ░███ ░███ ░███ ░███ + ░███ ░░█████ ░███░░░ ░███ ░███ ░░░█████░ ░███ ░███ ░███ ░███ + █████ ░░█████░░██████ ░░██████ ░░███ █████ █████░███ █████ +░░░░░ ░░░░░ ░░░░░░ ░░░░░░ ░░░ ░░░░░ ░░░░░ ░░░ ░░░░░ + btw + ]], + }, + }, + terminal = { + win = { + keys = { + -- nav_h = { "", [[h]], desc = "Go to Left Window", mode = "t" }, + nav_k = { "", [[k]], desc = "Go to Upper Window", mode = "t" }, + nav_j = { "", [[j]], desc = "Go to Lower Window", mode = "t" }, + -- nav_l = { "", [[l]], desc = "Go to Right Window", mode = "t" }, + -- Using C-m cause the enter key to not work in terminal + }, + }, + }, + }, + }, + + { + "nvim-neo-tree/neo-tree.nvim", + branch = "v3.x", + cmd = "Neotree", + keys = { + { "e", false }, + { "E", false }, + { + "", + function() + require("neo-tree.command").execute({ toggle = true, dir = vim.fn.getcwd() }) + end, + desc = "Explorer NeoTree (cwd)", + }, + }, + opts = { + close_if_last_window = true, + window = { + width = 30, + mappings = { + [""] = "none", + ["j"] = "none", + ["k"] = "none", + ["l"] = "none", + ["m"] = "none", + }, + }, + }, + }, + + { + "Bekaboo/dropbar.nvim", + dependencies = { + "nvim-telescope/telescope-fzf-native.nvim", + build = "make", + }, + config = function() + local dropbar_api = require("dropbar.api") + vim.keymap.set("n", ";", dropbar_api.pick, { desc = "Pick symbols in winbar" }) + vim.keymap.set("n", "[;", dropbar_api.goto_context_start, { desc = "Go to start of current context" }) + vim.keymap.set("n", "];", dropbar_api.select_next_context, { desc = "Select next context" }) + end, + init = function() + require("which-key").add({ + { ";", name = "Pick symbols in winbar", prefix = ";", icon = { icon = "", color = "blue" } }, + }) + end, + }, + + -- Hex editor + { + "RaafatTurki/hex.nvim", + config = true, + lazy = false, + }, + + -- Auto-save + { + "okuuva/auto-save.nvim", + event = { "InsertLeave", "TextChanged" }, + opts = { + noautocmd = true, + }, + }, + + -- Remember last position + { + "ethanholz/nvim-lastplace", + event = "BufRead", + config = true, + }, + + -- Better word movement + { + "chrisgrieser/nvim-spider", + lazy = true, + }, + + -- Underline current word + -- { + -- "itchyny/vim-cursorword", + -- event = { "BufEnter", "BufNewFile" }, + -- }, + + -- Full visual line + { + "0xAdk/full_visual_line.nvim", + keys = "V", + opts = {}, + }, + + -- { + -- "csessh/stopinsert.nvim", + -- opts = { + -- idle_time_ms = 15000, + -- }, + -- }, + + -- Minimap + { + "gorbit99/codewindow.nvim", + lazy = false, + keys = { + { + "m", + function() + require("codewindow").toggle_minimap() + end, + desc = "Toggle Minimap", + }, + }, + opts = { + z_index = 50, + auto_enable = true, + minimap_width = 10, + screen_bounds = "background", + window_border = "none", + }, + }, + + -- Split or join code blocks + { + "Wansmer/treesj", + dependencies = { "nvim-treesitter/nvim-treesitter" }, + opts = { use_default_keymaps = false }, + keys = { + { + "n", + "A", + function() + require("treesj").toggle() + end, + { desc = "Extends or retracts an instruction block" }, + }, + }, + init = function() + require("which-key").add({ + { + "A", + name = "Extends or retracts an instruction block", + prefix = "A", + icon = { icon = "", color = "green" }, + }, + }) + end, + }, + + { + "brenton-leighton/multiple-cursors.nvim", + version = "*", + opts = {}, + keys = { + { "", "MultipleCursorsAddUp", mode = { "i", "x" }, desc = "Add cursor and move up" }, + { "", "MultipleCursorsAddDown", mode = { "i", "x" }, desc = "Add cursor and move down" }, + { + "", + "MultipleCursorsMouseAddDelete", + mode = { "n", "v", "i" }, + desc = "Add or remove cursor", + }, + { "Ca", "MultipleCursorsAddMatches", mode = { "n", "v", "x" }, desc = "Add cursors to cword" }, + { + "CA", + "MultipleCursorsAddMatchesV", + mode = { "n", "v", "x" }, + desc = "Add cursors to cword in previous area", + }, + { + "Cd", + "MultipleCursorsAddJumpNextMatch", + mode = { "n", "v", "x" }, + desc = "Add cursor and jump to next cword", + }, + { "CD", "MultipleCursorsJumpNextMatch", mode = { "n", "v", "x" }, desc = "Jump to next cword" }, + { "Cl", "MultipleCursorsLock", mode = { "n", "v", "x" }, desc = "Lock virtual cursors" }, + }, + init = function() + require("which-key").add({ + { "C", name = "cursor", prefix = "C", icon = { icon = "󰗧", color = "cyan" } }, + }) + end, + }, + + { + "m4xshen/hardtime.nvim", + dependencies = { "MunifTanjim/nui.nvim" }, + opts = {}, + }, + + { + "2kabhishek/nerdy.nvim", + cmd = "Nerdy", + }, + + { + "ThePrimeagen/vim-be-good", + }, +} diff --git a/private_dot_config/nvim/lua/plugins/example.lua b/private_dot_config/nvim/lua/plugins/example.lua new file mode 100644 index 0000000..17f53d6 --- /dev/null +++ b/private_dot_config/nvim/lua/plugins/example.lua @@ -0,0 +1,197 @@ +-- since this is just an example spec, don't actually load anything here and return an empty spec +-- stylua: ignore +if true then return {} end + +-- every spec file under the "plugins" directory will be loaded automatically by lazy.nvim +-- +-- In your plugin files, you can: +-- * add extra plugins +-- * disable/enabled LazyVim plugins +-- * override the configuration of LazyVim plugins +return { + -- add gruvbox + { "ellisonleao/gruvbox.nvim" }, + + -- Configure LazyVim to load gruvbox + { + "LazyVim/LazyVim", + opts = { + colorscheme = "gruvbox", + }, + }, + + -- change trouble config + { + "folke/trouble.nvim", + -- opts will be merged with the parent spec + opts = { use_diagnostic_signs = true }, + }, + + -- disable trouble + { "folke/trouble.nvim", enabled = false }, + + -- override nvim-cmp and add cmp-emoji + { + "hrsh7th/nvim-cmp", + dependencies = { "hrsh7th/cmp-emoji" }, + ---@param opts cmp.ConfigSchema + opts = function(_, opts) + table.insert(opts.sources, { name = "emoji" }) + end, + }, + + -- change some telescope options and a keymap to browse plugin files + { + "nvim-telescope/telescope.nvim", + keys = { + -- add a keymap to browse plugin files + -- stylua: ignore + { + "fp", + function() require("telescope.builtin").find_files({ cwd = require("lazy.core.config").options.root }) end, + desc = "Find Plugin File", + }, + }, + -- change some options + opts = { + defaults = { + layout_strategy = "horizontal", + layout_config = { prompt_position = "top" }, + sorting_strategy = "ascending", + winblend = 0, + }, + }, + }, + + -- add pyright to lspconfig + { + "neovim/nvim-lspconfig", + ---@class PluginLspOpts + opts = { + ---@type lspconfig.options + servers = { + -- pyright will be automatically installed with mason and loaded with lspconfig + pyright = {}, + }, + }, + }, + + -- add tsserver and setup with typescript.nvim instead of lspconfig + { + "neovim/nvim-lspconfig", + dependencies = { + "jose-elias-alvarez/typescript.nvim", + init = function() + require("lazyvim.util").lsp.on_attach(function(_, buffer) + -- stylua: ignore + vim.keymap.set( "n", "co", "TypescriptOrganizeImports", { buffer = buffer, desc = "Organize Imports" }) + vim.keymap.set("n", "cR", "TypescriptRenameFile", { desc = "Rename File", buffer = buffer }) + end) + end, + }, + ---@class PluginLspOpts + opts = { + ---@type lspconfig.options + servers = { + -- tsserver will be automatically installed with mason and loaded with lspconfig + tsserver = {}, + }, + -- you can do any additional lsp server setup here + -- return true if you don't want this server to be setup with lspconfig + ---@type table + setup = { + -- example to setup with typescript.nvim + tsserver = function(_, opts) + require("typescript").setup({ server = opts }) + return true + end, + -- Specify * to use this function as a fallback for any server + -- ["*"] = function(server, opts) end, + }, + }, + }, + + -- for typescript, LazyVim also includes extra specs to properly setup lspconfig, + -- treesitter, mason and typescript.nvim. So instead of the above, you can use: + { import = "lazyvim.plugins.extras.lang.typescript" }, + + -- add more treesitter parsers + { + "nvim-treesitter/nvim-treesitter", + opts = { + ensure_installed = { + "bash", + "html", + "javascript", + "json", + "lua", + "markdown", + "markdown_inline", + "python", + "query", + "regex", + "tsx", + "typescript", + "vim", + "yaml", + }, + }, + }, + + -- since `vim.tbl_deep_extend`, can only merge tables and not lists, the code above + -- would overwrite `ensure_installed` with the new value. + -- If you'd rather extend the default config, use the code below instead: + { + "nvim-treesitter/nvim-treesitter", + opts = function(_, opts) + -- add tsx and treesitter + vim.list_extend(opts.ensure_installed, { + "tsx", + "typescript", + }) + end, + }, + + -- the opts function can also be used to change the default opts: + { + "nvim-lualine/lualine.nvim", + event = "VeryLazy", + opts = function(_, opts) + table.insert(opts.sections.lualine_x, { + function() + return "😄" + end, + }) + end, + }, + + -- or you can return new options to override all the defaults + { + "nvim-lualine/lualine.nvim", + event = "VeryLazy", + opts = function() + return { + --[[add your custom lualine config here]] + } + end, + }, + + -- use mini.starter instead of alpha + { import = "lazyvim.plugins.extras.ui.mini-starter" }, + + -- add jsonls and schemastore packages, and setup treesitter for json, json5 and jsonc + { import = "lazyvim.plugins.extras.lang.json" }, + + -- add any tools you want to have installed below + { + "williamboman/mason.nvim", + opts = { + ensure_installed = { + "stylua", + "shellcheck", + "shfmt", + "flake8", + }, + }, + }, +} diff --git a/private_dot_config/nvim/lua/plugins/init.lua b/private_dot_config/nvim/lua/plugins/init.lua deleted file mode 100644 index d1f4d3e..0000000 --- a/private_dot_config/nvim/lua/plugins/init.lua +++ /dev/null @@ -1,65 +0,0 @@ -local overrides = require("configs.overrides") - -return { - -- Format the file on save - { - "stevearc/conform.nvim", - event = 'BufWritePre', - config = function() - require "configs.conform" - end, - }, - -- Install the parser (overrides) - { - "nvim-treesitter/nvim-treesitter", - opts = overrides.treesitter, - }, - -- File explorer (overrides) - { - "nvim-tree/nvim-tree.lua", - opts = overrides.nvimtree, - }, - -- Install and manage LSP servers (overrides) - { - "williamboman/mason.nvim", - opts = overrides.mason, - }, - -- LSP configuration (overrides) - { - "neovim/nvim-lspconfig", - config = function() - require("nvchad.configs.lspconfig").defaults() - require "configs.lspconfig" - end, - dependencies = { - { - "nvimdev/lspsaga.nvim", - config = function() - require('lspsaga').setup({ - lightbulb = { - enabled = false, - virtual_text = false, - sign = false, - }, - code_action = { - extend_gitsigns = true, - }, - rename = { - auto_save = true, - } - }) - end, - dependencies = { - "nvim-treesitter/nvim-treesitter", - "nvim-tree/nvim-web-devicons", - } - } - }, - }, - { - "mfussenegger/nvim-dap", - dependencies = { - "mfussenegger/nvim-dap-python", - }, - } -} diff --git a/private_dot_config/nvim/lua/plugins/plugins.lua b/private_dot_config/nvim/lua/plugins/plugins.lua deleted file mode 100644 index 734db32..0000000 --- a/private_dot_config/nvim/lua/plugins/plugins.lua +++ /dev/null @@ -1,327 +0,0 @@ -local plugins = { - -- Open binary files in hex mode and edit them - { - "RaafatTurki/hex.nvim", - config = true, - lazy = false, - }, - -- Auto-save files when in normal mode - { - "Pocco81/auto-save.nvim", - lazy = false, - config = function() - require("auto-save").setup({}) - end, - }, - -- Open every file where you left off - { - "ethanholz/nvim-lastplace", - event = "BufRead", - config = function() - require("nvim-lastplace").setup({ - lastplace_ignore_buftype = { "quickfix", "nofile", "help" }, - lastplace_ignore_filetype = { "gitcommit", "gitrebase", "svn", "hgcommit", }, - lastplace_open_folds = true, - }) - end, - }, - -- Map keys for better word movement - { - "chrisgrieser/nvim-spider", - lazy = true, - }, - -- Map keys for smooth scrolling - { - "karb94/neoscroll.nvim", - event = "WinScrolled", - config = function() - require('neoscroll').setup({ - -- All these keys will be mapped to their corresponding default scrolling animation - mappings = { '', '', '', '', '', '', 'zt', 'zz', 'zb' }, - hide_cursor = true, -- Hide cursor while scrolling - stop_eof = true, -- Stop at when scrolling downwards - use_local_scrolloff = false, -- Use the local scope of scrolloff instead of the global scope - respect_scrolloff = false, -- Stop scrolling when the cursor reaches the scrolloff margin of the file - cursor_scrolls_alone = true, -- The cursor will keep on scrolling even if the window cannot scroll further - easing_function = nil, -- Default easing function - pre_hook = nil, -- Function to run before the scrolling animation starts - post_hook = nil, -- Function to run after the scrolling animation ends - }) - end, - }, - -- Underline current and matching word - { - "itchyny/vim-cursorword", - event = {"BufEnter", "BufNewFile"}, - config = function() - vim.api.nvim_command("augroup user_plugin_cursorword") - vim.api.nvim_command("autocmd!") - vim.api.nvim_command("autocmd FileType NvimTree,lspsagafinder,dashboard,vista let b:cursorword = 0") - vim.api.nvim_command("autocmd WinEnter * if &diff || &pvw | let b:cursorword = 0 | endif") - vim.api.nvim_command("autocmd InsertEnter * let b:cursorword = 0") - vim.api.nvim_command("autocmd InsertLeave * let b:cursorword = 1") - vim.api.nvim_command("augroup END") - end, - }, - -- Highlight the entire line in visual line mode - { - "0xAdk/full_visual_line.nvim", - keys = 'V', - opts = {}, - }, - -- Display number of uses of a Function - { - 'VidocqH/lsp-lens.nvim', - event = "VeryLazy", - opts = { - setup = function() - require('lsp-lens').setup() - end, - }, - }, - -- Split or join block of code - { - "Wansmer/treesj", - dependencies = { 'nvim-treesitter/nvim-treesitter' }, - config = function() - require('treesj').setup({ - use_default_keymaps = false, - }) - end, - }, - -- Replace the UI for messages, cmdline, and the popupmenu - { - "folke/noice.nvim", - event = "VeryLazy", - config = function() - require("noice").setup({ - lsp = { - override = { - ["vim.lsp.util.convert_input_to_markdown_lines"] = true, - ["vim.lsp.util.stylize_markdown"] = true, - ["cmp.entry.get_documentation"] = true, - }, - signature = { enable = false }, - hover = { enable = false }, - }, - presets = { - bottom_search = true, - command_palette = true, - long_message_to_split = true, - inc_rename = false, - lsp_doc_border = false, - }, - }) - end, - dependencies = { - "MunifTanjim/nui.nvim", - { - "rcarriga/nvim-notify", - opts = { - background_colour = "#000000", - } - }, - }, - opts = { - }, - }, - -- Display the lsp diagnostics in a window - { - "folke/trouble.nvim", - opts = {}, -- for default options, refer to the configuration section for custom setup. - cmd = "Trouble", - keys = { - { - "xx", - "Trouble diagnostics toggle", - desc = "Diagnostics (Trouble)", - }, - { - "cs", - "Trouble symbols toggle focus=false", - desc = "Symbols (Trouble)", - }, - }, - }, - -- Minimap plugin - { - "gorbit99/codewindow.nvim", - lazy = false, - config = function() - local codewindow = require("codewindow") - -- vim.api.nvim_set_hl(0, "CodewindowBorder", {fg = "#928374"}) - codewindow.setup({ - auto_enable = true, - minimap_width = 10, - screen_bounds = "background", - window_border = "none", - }) - codewindow.apply_default_keybinds({}) - end, - }, - -- Highlight the indent line and the current chunk - { - "shellRaining/hlchunk.nvim", - event = { "UIEnter" }, - config = function() - require("hlchunk").setup({ - chunk = { - enable = true, - chars = { - horizontal_line = "─", - vertical_line = "│", - left_top = "╭", - left_bottom = "╰", - right_arrow = ">", - }, - style = { - { fg = "#FABD2F" }, - { fg = "#c21f30" }, -- this fg is used to highlight wrong chunk - }, - }, - indent = { - enable = false, - }, - line_num = { - enable = true, - style = "#FABD2F", - }, - blank = { - enable = false, - }, - }) - end - }, - -- Integrate Github Copilot in NeoVim - { - "zbirenbaum/copilot.lua", - lazy = false, - cmd = "Copilot", - event = "InsertEnter", - config = function() - require("copilot").setup({ - panel = { - enabled = true, - auto_refresh = true, - keymap = { - jump_prev = "[[", - jump_next = "]]", - accept = "", - refresh = "gr", - open = "" - }, - layout = { - position = "bottom", -- | top | left | right - ratio = 0.4 - }, - }, - suggestion = { - enabled = true, - auto_trigger = true, - debounce = 75, - keymap = { - accept = "", - accept_word = false, - accept_line = false, - next = "", - prev = "", - dismiss = "", - }, - }, - filetypes = { - yaml = false, - markdown = true, - help = false, - gitcommit = false, - gitrebase = false, - hgcommit = false, - svn = false, - cvs = false, - ["."] = false, - }, - copilot_node_command = 'node', -- Node.js version must be > 18.x - server_opts_overrides = {}, - }) - end, - }, - -- Chat for copilot - { - "CopilotC-Nvim/CopilotChat.nvim", - event = "VeryLazy", - branch = "main", - dependencies = { - { "zbirenbaum/copilot.lua" }, -- or github/copilot.vim - { "nvim-lua/plenary.nvim" }, -- for curl, log wrapper - { - 'MeanderingProgrammer/render-markdown.nvim', - dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, - ---@module 'render-markdown' - ---@type render.md.UserConfig - opts = {}, - config = function () - require('render-markdown').setup({ - file_types = { 'markdown', 'copilot-chat' }, - }) - end - }, - }, - build = "make tiktoken", - opts = { - debug = true, -- Enable debugging - model = "claude-3.5-sonnet", - }, - keys = { - }, - config = function () - require('CopilotChat').setup({ - model = "claude-3.5-sonnet", - highlight_headers = false, - separator = '---', - error_header = '> [!ERROR] Error', - }) - end - }, - -- Suspend unused lsp - { - "zeioth/garbage-day.nvim", - dependencies = "neovim/nvim-lspconfig", - event = "VeryLazy", - }, - -- DAP and JTDLS (lsp) configuration for Java - { - "nvim-java/nvim-java", - lazy = false, - dependencies = { - "nvim-java/lua-async-await", - "nvim-java/nvim-java-core", - "nvim-java/nvim-java-test", - "nvim-java/nvim-java-dap", - "nvim-java/nvim-java-refactor", - "MunifTanjim/nui.nvim", - "neovim/nvim-lspconfig", - "mfussenegger/nvim-dap", - { - "williamboman/mason.nvim", - opts = { - registries = { - "github:nvim-java/mason-registry", - "github:mason-org/mason-registry", - }, - }, - }, - { - "williamboman/mason-lspconfig.nvim", - opts = { - handlers = { - ["jdtls"] = function() - require("java").setup() - require("lspconfig").jdtls.setup({}) - end, - }, - }, - }, - }, - } -} - -return plugins