Compare commits

..

14 Commits

Author SHA1 Message Date
David Ibia 13ddbe2f56 feat: added llm tools 2025-07-21 17:03:25 +01:00
David Ibia f0093997bf docs(README.md): add initial content for Absolute VIM Configuration README file 2025-07-21 17:01:49 +01:00
David Ibia 32d652a93f feat(lua): add configuration files for catppuccino theme, cheatsheet, comment, conform, dap, flutter-tools, gitignore, gitsigns, highlight-colors, image, incline, and indent-blank-line plugins.
feat(lsp-config.lua): Add configurations for various language servers and setup custom key mappings and settings for improved development experience.

feat(lualine.lua, mason.lua, mini-diff.lua, mini.lua, notify.lua, nvim-bqf.lua, nvim-cmp.lua, nvim-silicon.lua, nvim-surround.lua): Add new Lua files and configurations for lualine theme, mason setup, mini-diff, mini map integrations, notify setup, nvim-bqf, nvim-cmp autocompletion, nvim-silicon screenshot, and nvim-surround setup.

feat(nvim-tree.lua): add custom configurations for Nvim Tree plugin
feat(nvim-treesitter-context.lua): implement Treesitter Context plugin setup
feat(nvim-treesitter.lua): configure Nvim Treesitter with specific parsers and features
feat(poet-v.lua): set up Poet-V plugin with custom settings
feat(smear-cursor.lua): integrate Smear Cursor plugin with defined options
feat(tailwind-sorter.lua): initialize Tailwind Sorter plugin with save patterns and settings

feat(telescope.lua): add custom settings and extensions to improve Telescope functionality

feat(venv-selector.lua): add venv-selector setup and key mappings for VenvSelector and VenvSelectCached to enhance venv management.
2025-07-21 17:01:26 +01:00
David Ibia e9d9d2ac3b feat(init.lua): add new file init.lua with require statement for absolute module 2025-07-21 17:00:24 +01:00
David Ibia ddb1a63b2a chore: add initial configuration files for gitignore, rgignore, and tool-versions 2025-07-21 17:00:15 +01:00
David Ibia e641c42858 feat(theme): add new Lua script to set the color scheme to catppuccin-macchiato 2025-07-21 16:59:49 +01:00
David Ibia a55fa95d04 feat(colorscheme.lua): add functions to set window preferences and sync themes for WezTerm and Ghostty terminals. 2025-07-21 16:59:38 +01:00
David Ibia a12b3bb04e feat(lua): add helper functions to open project folder based on OS for better navigation 2025-07-21 16:59:25 +01:00
David Ibia 71e165541c feat(lua): add absolute Lua module with core, lazy, helpers, and remap submodules 2025-07-21 16:59:14 +01:00
David Ibia 95e0c9d74c feat(remap.lua): add key mappings for various actions to improve productivity and navigation in Vim 2025-07-21 16:59:07 +01:00
David Ibia f42b8759c5 feat(lazy.lua): add lazy loading functionality for lazy.nvim plugin to improve startup time and performance 2025-07-21 16:58:58 +01:00
David Ibia bdc798ba64 feat(lsp): add pbkit.lua file for Protocol Buffers Language Server Protocol integration 2025-07-21 16:58:50 +01:00
David Ibia 41c18ff80c feat(plugins): add multiple new Lua plugins for various functionalities
feat(plugins): add various new Lua plugins for Neovim configuration.

feat(plugins): add venv-selector, vim-maximizer, and vim-tmux-navigator plugins to enhance functionality
2025-07-21 16:58:32 +01:00
David Ibia 107d3c5db2 feat(lua): add utility functions to detect Lua, OS, Python environment, TypeScript environment, Git root, and safe function invocation. 2025-07-21 16:53:44 +01:00
69 changed files with 1656 additions and 1015 deletions
+3
View File
@@ -0,0 +1,3 @@
.git
!.env
!.opencommit
+2
View File
@@ -0,0 +1,2 @@
python 3.11.0
nodejs 20.0.0
+3 -46
View File
@@ -2,9 +2,8 @@
## Introduction
Here's the VIM configuration I'm going to be using for most of my professional work this year.
There may be changes as I discover new plugins. I intent to personalize this to my taste and
coding conventions. Feel free to try it out if you fancy 😄.
VIM Configurations for the modern developer. This configuration is designed to be efficient for my personal workflow. It is designed to be minimalistic and easy to use.
## Installation
@@ -35,47 +34,5 @@ git clone https://github.com/boxpositron/absolute-vim ~/.config/nvim --depth 1 &
- [Noto Emoji](https://fonts.google.com/noto/specimen/Noto+Emoji)
- [JetBrains Mono](https://fonts.google.com/specimen/JetBrains+Mono)
### Themes
- [Tokyonight](https://github.com/folke/tokyonight.nvim)
### Plugins
- [CheatSheet](https://github.com/sudormrfbin/cheatsheet.nvim)
- [Comment](https://github.com/numToStr/Comment.nvim)
- DAP
- Dashboard
- GitIgnore
- GitSigns
- Harpoon
- Incline
- IndentBlankline
- Jedi
- KeySeer
- LuaLine
- Mason
- Mini
- NoneLS
- NvimBQF
- NvimCMP
- NvimSilicon
- NvimSurround
- NvimTree
- NvimTreesitter
- PoetV
- SuperTab
- TailwindSorter
- Telescope
- TodoComments
- ToggleTerm
- TreeSJ
- Trouble
- UndoTree
## Keybindings
### General
| Keybinding | Description |
|------------|-------------|
Work in progress...
+71 -62
View File
@@ -1,69 +1,78 @@
{
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
"LuaSnip": { "branch": "master", "commit": "e808bee352d1a6fcf902ca1a71cee76e60e24071" },
"catppuccin": { "branch": "main", "commit": "63685e1562ef53873c9764b483d7ac5c7a608922" },
"LuaSnip": { "branch": "master", "commit": "831a130291eb6dae0dabd2748d0a99401a2eebc4" },
"catppuccin": { "branch": "main", "commit": "fa42eb5e26819ef58884257d5ae95dd0552b9a66" },
"cheatsheet.nvim": { "branch": "master", "commit": "9716f9aaa94dd1fd6ce59b5aae0e5f25e2a463ef" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
"conform.nvim": { "branch": "master", "commit": "1a99fdc1d3aa9ccdf3021e67982a679a8c5c740c" },
"copilot.vim": { "branch": "release", "commit": "782461159655b259cff10ecff05efa761e3d4764" },
"dashboard-nvim": { "branch": "master", "commit": "fabf5feec96185817c732d47d363f34034212685" },
"dressing.nvim": { "branch": "master", "commit": "1b7921eecc65af1baf8ac1dc06f0794934cbcfb2" },
"flutter-tools.nvim": { "branch": "main", "commit": "ea1d398f543a54ba95357c3b8bb9d6f68eaec36c" },
"friendly-snippets": { "branch": "main", "commit": "00ebcaa159e817150bd83bfe2d51fa3b3377d5c4" },
"fzf": { "branch": "master", "commit": "855f90727af7827d9934b7fa00ea5ed51f5e4e81" },
"git-blame.nvim": { "branch": "master", "commit": "8c56e864d448e84e0162872c381dd2715824dce2" },
"gitignore.nvim": { "branch": "master", "commit": "2455191ec94da8ed222806a4fe3aa358eac1e558" },
"gitsigns.nvim": { "branch": "main", "commit": "1ef74b546732f185d0f806860fa5404df7614f28" },
"harpoon": { "branch": "master", "commit": "1bc17e3e42ea3c46b33c0bbad6a880792692a1b3" },
"incline.nvim": { "branch": "main", "commit": "16fc9c073e3ea4175b66ad94375df6d73fc114c0" },
"indent-blankline.nvim": { "branch": "master", "commit": "18603eb949eba08300799f64027af11ef922283f" },
"keyseer.nvim": { "branch": "main", "commit": "6cb478f9b2be4af4680ceb0308a9b49cd6b6ea73" },
"lazy.nvim": { "branch": "main", "commit": "460e1cd8f24e364d54543a4b0e83f6f4ec1f65fb" },
"lspkind.nvim": { "branch": "master", "commit": "cff4ae321a91ee3473a92ea1a8c637e3a9510aec" },
"lualine.nvim": { "branch": "master", "commit": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "25c11854aa25558ee6c03432edfa0df0217324be" },
"mason-nvim-dap.nvim": { "branch": "main", "commit": "8b9363d83b5d779813cdd2819b8308651cec2a09" },
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
"mini.nvim": { "branch": "main", "commit": "19e1584124cda35388d4fdb911eab7124014e541" },
"nightfly": { "branch": "master", "commit": "19efaf31cbe15a429cb3ca6ac9c9fce13275045b" },
"noice.nvim": { "branch": "main", "commit": "c1ba80ccf6b3bd8c7fc88fe2e61085131d44ad65" },
"nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" },
"nvim-bqf": { "branch": "main", "commit": "1b24dc6050c34e8cd377b6b4cd6abe40509e0187" },
"nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" },
"nvim-dap": { "branch": "master", "commit": "90616ae6ae40053103dc66872886fc26b94c70c8" },
"nvim-dap-python": { "branch": "master", "commit": "db72bf6ab9f75fe841e8e11e772ee7fef6f484f1" },
"nvim-dap-ui": { "branch": "master", "commit": "1c351e4e417d4691da12948b6ecf966936a56d28" },
"nvim-dap-virtual-text": { "branch": "master", "commit": "3497eb39bf413a57ab5b7e7e2e192683e462148c" },
"nvim-highlight-colors": { "branch": "main", "commit": "a411550ef85cae467b889ba7d1a96bd78332d90e" },
"nvim-lsp-file-operations": { "branch": "master", "commit": "92a673de7ecaa157dd230d0128def10beb56d103" },
"nvim-lspconfig": { "branch": "master", "commit": "aaec5d049af99e7b975bdf68aca582f1aa91b338" },
"nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" },
"nvim-notify": { "branch": "master", "commit": "d333b6f167900f6d9d42a59005d82919830626bf" },
"nvim-silicon": { "branch": "main", "commit": "9fe6001dc8cad4d9c53bcfc8649e3dc76ffa169c" },
"nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" },
"nvim-treesitter": { "branch": "master", "commit": "2b2ac302324f4cd2194c5dcaa59332b65e1c6403" },
"nvim-treesitter-context": { "branch": "master", "commit": "7f7eeaa99e5a9beab518f502292871ae5f20de6f" },
"nvim-web-devicons": { "branch": "master", "commit": "9154484705968658e9aab2b894d1b2a64bf9f83d" },
"nvim_lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
"pkl-neovim": { "branch": "main", "commit": "a0ae099c7eb926150ee0a126b1dd78086edbe3fc" },
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
"cmp-cmdline": { "branch": "main", "commit": "d126061b624e0af6c3a556428712dd4d4194ec6d" },
"cmp-path": { "branch": "main", "commit": "e52e640b7befd8113b3350f46e8cfcfe98fcf730" },
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
"codecompanion.nvim": { "branch": "main", "commit": "99448f47c3e23a06009ac176ba4c785e162d9c10" },
"conform.nvim": { "branch": "master", "commit": "973f3cb73887d510321653044791d7937c7ec0fa" },
"copilot.vim": { "branch": "release", "commit": "12995dffe10282b29b8335650bf3e7457f4870e7" },
"dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" },
"flutter-tools.nvim": { "branch": "main", "commit": "70430c32d176f4a15c6e2c80586cd2791e3a664e" },
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
"fzf": { "branch": "master", "commit": "ead302981cc9d9219e58c1517921e9f2d68a6b6e" },
"gen.nvim": { "branch": "main", "commit": "e09a8dbffa139ad60d5b47998fcc8669ead1ebf4" },
"git-blame.nvim": { "branch": "master", "commit": "8503b199edf9a666fe7b1a989cf14e3c26b2eb03" },
"gitignore.nvim": { "branch": "master", "commit": "0344f643768c4d64af4add8c1bdddf6f7d4c9010" },
"gitsigns.nvim": { "branch": "main", "commit": "0cb5a7753d3c4b8e9cfdc9d88d9110cb8d4b1544" },
"image.nvim": { "branch": "master", "commit": "4c51d6202628b3b51e368152c053c3fb5c5f76f2" },
"incline.nvim": { "branch": "main", "commit": "0fd2d5a27504dba7fdc507a53275f22c081fe640" },
"indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" },
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
"llm.nvim": { "branch": "main", "commit": "9832a149bdcf0709433ca9c2c3a1c87460e98d13" },
"lspkind.nvim": { "branch": "master", "commit": "d79a1c3299ad0ef94e255d045bed9fa26025dab6" },
"lualine.nvim": { "branch": "master", "commit": "a94fc68960665e54408fe37dcf573193c4ce82c9" },
"markview.nvim": { "branch": "main", "commit": "ec33f2aa333ca1d76f51847922578434d7aeadf7" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "bb3a17efc797c34c054463174e5522442576ebd8" },
"mason-registry": { "branch": "main", "commit": "467ac84d138997773be67e2e5bd4020cb96a3697" },
"mason.nvim": { "branch": "main", "commit": "8024d64e1330b86044fed4c8494ef3dcd483a67c" },
"mcphub.nvim": { "branch": "main", "commit": "0d53a53f327b61c45691d6a60a16c20baf4590ea" },
"mini.diff": { "branch": "main", "commit": "63a7ce537ced356b8180892d9586826b0afb519c" },
"mini.nvim": { "branch": "main", "commit": "0420076298c4457f200c2de468f65d080597a347" },
"nightfly": { "branch": "master", "commit": "8c55003e89f321a48a8cd4bb426dd3e7c58f0646" },
"nvim-bqf": { "branch": "main", "commit": "dd17c73912487dccb372deff85d4262d2b89bc2b" },
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
"nvim-dap": { "branch": "master", "commit": "5dd4d50f2e6a2eaf9e57fad023d294ef371bda35" },
"nvim-dap-python": { "branch": "master", "commit": "261ce649d05bc455a29f9636dc03f8cdaa7e0e2c" },
"nvim-dap-ui": { "branch": "master", "commit": "cf91d5e2d07c72903d052f5207511bf7ecdb7122" },
"nvim-dap-virtual-text": { "branch": "master", "commit": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6" },
"nvim-highlight-colors": { "branch": "main", "commit": "b42a5ccec7457b44e89f7ed3b3afb1b375bb2093" },
"nvim-lsp-file-operations": { "branch": "master", "commit": "9744b738183a5adca0f916527922078a965515ed" },
"nvim-lspconfig": { "branch": "master", "commit": "f47cd681d7cb6048876a2e908b6d8ba1e530d152" },
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
"nvim-notify": { "branch": "master", "commit": "a22f5d7ac511c2df2fd3290a9f04c48d5a822e2e" },
"nvim-silicon": { "branch": "main", "commit": "7f66bda8f60c97a5bf4b37e5b8acb0e829ae3c32" },
"nvim-surround": { "branch": "main", "commit": "ae298105122c87bbe0a36b1ad20b06d417c0433e" },
"nvim-tmux-navigation": { "branch": "main", "commit": "4898c98702954439233fdaf764c39636681e2861" },
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
"nvim-treesitter-context": { "branch": "master", "commit": "59f318a65d42a5c4037796886a8874fd57f774fc" },
"nvim-web-devicons": { "branch": "master", "commit": "0422a19d9aa3aad2c7e5cca167e5407b13407a9d" },
"nvim_lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" },
"pkl-neovim": { "branch": "main", "commit": "da9d189b4fad7e67e6b2a5456a3cbc4c9d32a17f" },
"playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" },
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
"poet-v": { "branch": "master", "commit": "85a5dd44d89602cc3dccd2489924e9c7caab0044" },
"rose-pine": { "branch": "main", "commit": "8b1fd252255a7f2c41b4192a787ab62660b29f72" },
"tailwind-sorter.nvim": { "branch": "main", "commit": "e03eea3909c28509375993fb77a42454ac8ecbb2" },
"telescope-dap.nvim": { "branch": "master", "commit": "8c88d9716c91eaef1cdea13cb9390d8ef447dbfe" },
"telescope-file-browser.nvim": { "branch": "master", "commit": "dd9de68c08b6d678198a99f5ea13e0384a1f04cf" },
"telescope-themes": { "branch": "main", "commit": "f005622f066cc0cdbaf9bb44c48edbec67985501" },
"popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" },
"render-markdown.nvim": { "branch": "main", "commit": "7620d4e96eb5cf8d12e76c6fcaf1267628564ba9" },
"rose-pine": { "branch": "main", "commit": "72befaffeac38db7bdd49e0549eaa2c4806dd878" },
"smear-cursor.nvim": { "branch": "main", "commit": "4a0f7ac265b4ed1ce4d0af2afc13072763bfa691" },
"tailwind-sorter.nvim": { "branch": "main", "commit": "717e5c9761ed8334dadbb9357df7d826aae97b92" },
"telescope-dap.nvim": { "branch": "master", "commit": "783366bd6c1e7fa0a5c59c07db37f49c805a28df" },
"telescope-file-browser.nvim": { "branch": "master", "commit": "7bf55ed0ff5be182ad3301cff266581fc1c56cce" },
"telescope-live-grep-args.nvim": { "branch": "master", "commit": "8ad632f793fd437865f99af5684f78300dac93fb" },
"telescope-media-files.nvim": { "branch": "master", "commit": "0826c7a730bc4d36068f7c85cf4c5b3fd9fb570a" },
"telescope-themes": { "branch": "main", "commit": "65721365bd7a04a6c9679e76b6387b60320fd5f3" },
"telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
"todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" },
"toggleterm.nvim": { "branch": "main", "commit": "48be57eaba817f038d61bbf64d2c597f578c0827" },
"tokyonight": { "branch": "main", "commit": "817bb6ffff1b9ce72cdd45d9fcfa8c9cd1ad3839" },
"treesj": { "branch": "main", "commit": "0d81326b5afd36babe7dd480aabbb0b05f33e688" },
"trouble.nvim": { "branch": "main", "commit": "6efc446226679fda0547c0fd6a7892fd5f5b15d8" },
"undotree": { "branch": "master", "commit": "78b5241191852ffa9bb5da5ff2ee033160798c3b" },
"vim-maximizer": { "branch": "master", "commit": "2e54952fe91e140a2e69f35f22131219fcd9c5f1" },
"vim-tmux-navigator": { "branch": "master", "commit": "a9b52e7d36114d40350099f254b5f299a35df978" }
"todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" },
"toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" },
"tokyonight": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" },
"tree-sitter-ghostty": { "branch": "main", "commit": "1d5238fc0da5fd5a59130b95c3e1c4948a3f96c1" },
"treesj": { "branch": "main", "commit": "3b4a2bc42738a63de17e7485d4cc5e49970ddbcc" },
"trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" },
"undotree": { "branch": "master", "commit": "28f2f54a34baff90ea6f4a735ef1813ad875c743" },
"venv-selector.nvim": { "branch": "regexp", "commit": "c677caa1030808a9f90092e522de7cc20c1390dd" },
"vim-maximizer": { "branch": "master", "commit": "2e54952fe91e140a2e69f35f22131219fcd9c5f1" }
}
+6
View File
@@ -1,3 +1,9 @@
local cheatsheet = require("cheatsheet")
cheatsheet.setup({})
local opts = { noremap = true, silent = true }
opts.desc = "Show Cheatsheet"
vim.keymap.set("n", "<leader>\\", "<cmd>Cheatsheet<CR>", opts) -- toggle file explorer
+40
View File
@@ -0,0 +1,40 @@
local codecompanion = require("codecompanion")
codecompanion.setup({
strategies = {
chat = {
adapter = "openai",
},
},
extensions = {
mcphub = {
callback = "mcphub.extensions.codecompanion",
opts = {
make_vars = true,
make_slash_commands = true,
show_result_in_chat = true,
},
},
},
})
local opts = {
noremap = true,
silent = true,
}
vim.keymap.set("n", "<leader>ac", function()
vim.cmd("CodeCompanionChat")
end, opts)
vim.keymap.set({ "n", "v" }, "<leader>ai", function()
local input = vim.fn.input("[Code Companion Inline]: ")
local trimmed_input = vim.fn.trim(input)
if trimmed_input == "" then
vim.notify("No input provided for inline code companion", vim.log.levels.WARN)
return
end
vim.cmd("CodeCompanion" .. " " .. vim.fn.shellescape(trimmed_input))
end, opts)
+28 -9
View File
@@ -1,14 +1,33 @@
local conform = require("conform")
conform.setup({
formatters_by_ft = {
lua = { "stylua" },
-- Conform will run multiple formatters sequentially
python = { "isort", "black" },
-- Use a sub-list to run only the first available formatter
javascript = { "biome" },
astro = { { "prettierd", "prettier" } },
},
format_on_save = function(bufnr)
local disable_filetypes = {}
return {
timeout_ms = 500,
lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype],
}
end,
formatters_by_ft = {
sh = { "shfmt" },
lua = { "stylua" },
-- Conform will run multiple formatters sequentially
python = {
-- To fix auto-fixable lint errors.
"ruff_fix",
-- To run the Ruff formatter.
"ruff_format",
-- To organize the imports.
"ruff_organize_imports",
},
-- Use a sub-list to run only the first available formatter
javascript = { "biome" },
astro = { "prettierd", "prettier", "biome" },
vue = { "prettierd", "prettier" },
proto = { "buf" },
yaml = { "prettierd", "prettier" },
},
})
vim.o.formatexpr = "v:lua.require'conform'.formatexpr()"
-- vim.o.formatexpr = "v:lua.require'conform'.formatexpr()"
+7 -18
View File
@@ -1,33 +1,27 @@
local dap = require("dap")
local dapui = require("dapui")
local dap_python = require("dap-python")
local virtual_text = require("nvim-dap-virtual-text")
-- Setup Virtual Text
virtual_text.setup({
prefix = "",
hl = "Comment",
lines = 3,
enabled = true,
prefix = "",
hl = "Comment",
lines = 3,
enabled = true,
})
local mason_path = vim.fn.glob(vim.fn.stdpath("data") .. "/mason")
local debugpy_path = mason_path .. "/packages/debugpy/venv/bin/python"
dapui.setup()
dap_python.setup(debugpy_path)
dap.listeners.after.event_initialized["dapui_config"] = function()
dapui.open()
dapui.open()
end
dap.listeners.before.event_terminated["dapui_config"] = function()
dapui.close()
dapui.close()
end
dap.listeners.before.event_exited["dapui_config"] = function()
dapui.close()
dapui.close()
end
-- Setup Mappings
@@ -35,8 +29,3 @@ local opts = { noremap = true, silent = true }
opts.desc = "Toggle breakpoint"
vim.keymap.set("n", "<leader>db", "<cmd> DapToggleBreakpoint<CR>", opts)
opts.desc = "Debug Python Run"
vim.keymap.set("n", "<leader>dpr", function()
dap_python.test_method()
end, opts)
-25
View File
@@ -1,25 +0,0 @@
local dashboard = require("dashboard")
local header = {
[[' ⣇⣿⠘⣿⣿⣿⡿⡿⣟⣟⢟⢟⢝⠵⡝⣿⡿⢂⣼⣿⣷⣌⠩⡫⡻⣝⠹⢿⣿⣷ ']],
[[' ⡆⣿⣆⠱⣝⡵⣝⢅⠙⣿⢕⢕⢕⢕⢝⣥⢒⠅⣿⣿⣿⡿⣳⣌⠪⡪⣡⢑⢝⣇ ']],
[[' ⡆⣿⣿⣦⠹⣳⣳⣕⢅⠈⢗⢕⢕⢕⢕⢕⢈⢆⠟⠋⠉⠁⠉⠉⠁⠈⠼⢐⢕⢽ ']],
[[' ⡗⢰⣶⣶⣦⣝⢝⢕⢕⠅⡆⢕⢕⢕⢕⢕⣴⠏⣠⡶⠛⡉⡉⡛⢶⣦⡀⠐⣕⢕ ']],
[[' ⡝⡄⢻⢟⣿⣿⣷⣕⣕⣅⣿⣔⣕⣵⣵⣿⣿⢠⣿⢠⣮⡈⣌⠨⠅⠹⣷⡀⢱⢕ ']],
[[' ⡝⡵⠟⠈⢀⣀⣀⡀⠉⢿⣿⣿⣿⣿⣿⣿⣿⣼⣿⢈⡋⠴⢿⡟⣡⡇⣿⡇⡀⢕ ']],
[[' ⡝⠁⣠⣾⠟⡉⡉⡉⠻⣦⣻⣿⣿⣿⣿⣿⣿⣿⣿⣧⠸⣿⣦⣥⣿⡇⡿⣰⢗⢄ ']],
[[' ⠁⢰⣿⡏⣴⣌⠈⣌⠡⠈⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣬⣉⣉⣁⣄⢖⢕⢕⢕ ']],
[[' ⡀⢻⣿⡇⢙⠁⠴⢿⡟⣡⡆⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣵⣵⣿ ']],
[[' ⡻⣄⣻⣿⣌⠘⢿⣷⣥⣿⠇⣿⣿⣿⣿⣿⣿⠛⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ']],
[[' ⣷⢄⠻⣿⣟⠿⠦⠍⠉⣡⣾⣿⣿⣿⣿⣿⣿⢸⣿⣦⠙⣿⣿⣿⣿⣿⣿⣿⣿⠟ ']],
[[' ⡕⡑⣑⣈⣻⢗⢟⢞⢝⣻⣿⣿⣿⣿⣿⣿⣿⠸⣿⠿⠃⣿⣿⣿⣿⣿⣿⡿⠁⣠ ']],
[[' ⡝⡵⡈⢟⢕⢕⢕⢕⣵⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣶⣿⣿⣿⣿⣿⠿⠋⣀⣈⠙ ']],
[[' ⡝⡵⡕⡀⠑⠳⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠛⢉⡠⡲⡫⡪⡪⡣ ']],
}
dashboard.setup({
theme = "hyper",
config = {
header = header,
},
})
+36
View File
@@ -0,0 +1,36 @@
local gen = require("gen")
gen.setup({
-- Custom Parameters (with defaults)
model = "deepseek-r1:7b", -- The default model to use.
quit_map = "q", -- set keymap to close the response window
retry_map = "<c-r>", -- set keymap to re-send the current prompt
accept_map = "<c-cr>", -- set keymap to replace the previous selection with the last result
host = "localhost", -- The host running the Ollama service.
port = "11434", -- The port on which the Ollama service is listening.
display_mode = "split", -- The display mode. Can be "float" or "split" or "horizontal-split".
show_prompt = false, -- Shows the prompt submitted to Ollama. Can be true (3 lines) or "full".
show_model = false, -- Displays which model you are using at the beginning of your chat session.
no_auto_close = false, -- Never closes the window automatically.
file = false, -- Write the payload to a temporary file to keep the command short.
hidden = false, -- Hide the generation window (if true, will implicitly set `prompt.replace = true`), requires Neovim >= 0.10
init = function(options)
pcall(io.popen, "ollama serve > /dev/null 2>&1 &")
end,
-- Function to initialize Ollama
command = function(options)
local body = { model = options.model, stream = true }
return "curl --silent --no-buffer -X POST http://"
.. options.host
.. ":"
.. options.port
.. "/api/chat -d $body"
end,
-- The command for the Ollama service. You can use placeholders $prompt, $model and $body (shellescaped).
-- This can also be a command string.
-- The executed command must return a JSON object with { response, context }
-- (context property is optional).
-- list_models = '<omitted lua function>', -- Retrieves a list of model names
result_filetype = "markdown", -- Configure filetype of the result buffer
debug = false, -- Prints errors and the command which is run.
})
-10
View File
@@ -1,10 +0,0 @@
local mark = require("harpoon.mark")
local ui = require("harpoon.ui")
vim.keymap.set("n", "<leader>a", mark.add_file)
vim.keymap.set("n", "<C-e>", ui.toggle_quick_menu)
vim.keymap.set("n", "<C-1>", function() ui.nav_file(1) end)
vim.keymap.set("n", "<C-2>", function() ui.nav_file(2) end)
vim.keymap.set("n", "<C-3>", function() ui.nav_file(3) end)
vim.keymap.set("n", "<C-4>", function() ui.nav_file(4) end)
+37
View File
@@ -0,0 +1,37 @@
require("image").setup({
backend = "kitty",
processor = "magick_rock", -- or "magick_cli"
integrations = {
markdown = {
enabled = true,
clear_in_insert_mode = false,
download_remote_images = true,
only_render_image_at_cursor = false,
floating_windows = true, -- if true, images will be rendered in floating markdown windows
filetypes = { "markdown", "vimwiki" }, -- markdown extensions (ie. quarto) can go here
},
neorg = {
enabled = true,
filetypes = { "norg" },
},
typst = {
enabled = true,
filetypes = { "typst" },
},
html = {
enabled = false,
},
css = {
enabled = false,
},
},
max_width = nil,
max_height = nil,
max_width_window_percentage = nil,
max_height_window_percentage = 50,
window_overlap_clear_enabled = true, -- toggles images when windows are overlapped
window_overlap_clear_ft_ignore = { "cmp_menu", "cmp_docs", "snacks_notif", "scrollview", "scrollview_sign" },
editor_only_render_when_focused = true, -- auto show/hide images when the editor gains/looses focus
tmux_show_only_in_active_window = true, -- auto show/hide images in the correct Tmux window (needs visual-activity off)
hijack_file_patterns = { "*.png", "*.jpg", "*.jpeg", "*.gif", "*.webp", "*.avif", "*.svg" }, -- render image files as images when opened
})
-3
View File
@@ -1,3 +0,0 @@
local keyseer = require("keyseer")
keyseer.setup({})
+105
View File
@@ -0,0 +1,105 @@
local llm = require("llm")
local llmCompletion = require("llm.completion")
llm.setup({
api_token = nil, -- cf Install paragraph
model = "codellama:13b", -- the model ID, behavior depends on backend
backend = "ollama", -- backend ID, "huggingface" | "ollama" | "openai" | "tgi"
url = "http://localhost:11434", -- the http url of the backend
-- tokens_to_clear = { "<|endoftext|>" }, -- tokens to remove from the model's output
tokens_to_clear = { "<EOT>" },
-- parameters that are added to the request body, values are arbitrary, you can set any field:value pair here it will be passed as is to the backend
request_body = {
parameters = {
-- max_new_tokens = 60,
temperature = 0.2,
top_p = 0.95,
},
},
-- set this if the model supports fill in the middle
-- fim = {
-- enabled = false,
-- prefix = "<fim_prefix>",
-- middle = "<fim_middle>",
-- suffix = "<fim_suffix>",
-- },
fim = {
enabled = true,
prefix = "<PRE> ",
middle = " <MID>",
suffix = " <SUF>",
},
debounce_ms = 150,
accept_keymap = nil,
dismiss_keymap = nil,
tls_skip_verify_insecure = false,
-- llm-ls configuration, cf llm-ls section
lsp = {
bin_path = vim.api.nvim_call_function("stdpath", { "data" }) .. "/mason/bin/llm-ls",
cmd_env = { LLM_LOG_LEVEL = "DEBUG" },
},
-- tokenizer = nil, -- cf Tokenizer paragraph
tokenizer = {
repository = "codellama/CodeLlama-13b-hf",
},
context_window = 4096,
enable_suggestions_on_startup = false,
enable_suggestions_on_files = { "*.py", "*.js", "*.ts", "*.astro", "*.vue", "*.lua" },
disable_url_path_completion = false, -- cf Backend
})
vim.keymap.set("i", "<Tab>", function()
if llmCompletion.shown_suggestion ~= nil then
llmCompletion.complete()
else
local keys = vim.api.nvim_replace_termcodes("<Tab>", true, false, true)
vim.api.nvim_feedkeys(keys, "n", false)
end
end, { noremap = true, silent = true })
vim.keymap.set("n", "<Tab>", function()
if llmCompletion.shown_suggestion ~= nil then
llmCompletion.complete()
else
local keys = vim.api.nvim_replace_termcodes("<Tab>", true, false, true)
vim.api.nvim_feedkeys(keys, "n", false)
end
end, { noremap = true, silent = true })
-- Debounce helper
local debounce = function(func, timeout)
if type(func) ~= "function" then
error("Expected a function")
end
if type(timeout) ~= "number" or timeout <= 0 then
error("Expected a positive number for timeout")
end
local timer = vim.uv.new_timer()
return function(...)
local args = { ... }
timer:stop() -- Reset the timer
timer:start(
timeout,
0,
vim.schedule_wrap(function()
func(unpack(args))
end)
)
end
end
-- Define the function to be executed
local function on_text_change()
llmCompletion.lsp_suggest()
end
-- Debounce the function
local debounced_on_text_change = debounce(on_text_change, 3000)
-- Set up the autocommand
vim.api.nvim_create_autocmd({ "InsertCharPre" }, {
pattern = "*",
callback = debounced_on_text_change,
desc = "Run method after typing stops with debounce",
})
+223 -174
View File
@@ -1,287 +1,336 @@
-- Setup language servers.
local conform = require("conform")
local lspconfig = require("lspconfig")
local cmp_nvim_lsp = require("cmp_nvim_lsp")
local DPE = require("absolute.utils.detect-python-env")
local opts = { noremap = true, silent = true }
local global_node_modules = vim.fn.system("npm root -g")
-- client, buffer
local on_attach = function(client, bufnr)
opts.buffer = bufnr
opts.buffer = bufnr
-- Enable completion triggered by <c-x><c-o>
vim.bo[opts.buffer].omnifunc = "v:lua.vim.lsp.omnifunc"
-- Enable completion triggered by <c-x><c-o>
vim.bo[opts.buffer].omnifunc = "v:lua.vim.lsp.omnifunc"
opts.desc = "Go to declaration"
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts)
opts.desc = "Go to declaration"
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts)
opts.desc = "Go to definitions"
vim.keymap.set("n", "gd", "<cmd>Telescope lsp_definitions<CR>", opts)
opts.desc = "Go to definitions"
vim.keymap.set("n", "gd", "<cmd>Telescope lsp_definitions<CR>", opts)
opts.desc = "Show documentation for what is under cursor"
vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
opts.desc = "Show documentation for what is under cursor"
vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
opts.desc = "Show LSP Implementation"
vim.keymap.set("n", "gi", "<cmd>Telescope lsp_implementations<CR>", opts)
opts.desc = "Show LSP Implementation"
vim.keymap.set("n", "gi", "<cmd>Telescope lsp_implementations<CR>", opts)
opts.desc = "Get Help"
vim.keymap.set("n", "<leader>gh", vim.lsp.buf.signature_help, opts)
opts.desc = "Get Help"
vim.keymap.set("n", "<leader>gh", vim.lsp.buf.signature_help, opts)
-- vim.keymap.set('n', '<leader>wa', vim.lsp.buf.add_workspace_folder, opts)
-- vim.keymap.set('n', '<leader>wr', vim.lsp.buf.remove_workspace_folder, opts)
-- vim.keymap.set('n', '<leader>wl', function()
-- print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
-- end, opts)
-- vim.keymap.set('n', '<leader>wa', vim.lsp.buf.add_workspace_folder, opts)
-- vim.keymap.set('n', '<leader>wr', vim.lsp.buf.remove_workspace_folder, opts)
-- vim.keymap.set('n', '<leader>wl', function()
-- print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
-- end, opts)
opts.desc = "Show LSP type definitions"
vim.keymap.set("n", "gt", "<cmd>Telescope lsp_type_definitions<CR>", opts)
opts.desc = "Show LSP type definitions"
vim.keymap.set("n", "gt", "<cmd>Telescope lsp_type_definitions<CR>", opts)
opts.desc = "Smart rename"
vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts)
opts.desc = "Smart rename"
vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts)
opts.desc = "See available code actions"
vim.keymap.set({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, opts)
opts.desc = "See available code actions"
vim.keymap.set({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, opts)
opts.desc = "Show LSP references"
vim.keymap.set("n", "<leader>cr", "<cmd>Telescope lsp_references<CR>", opts)
opts.desc = "Show LSP references"
vim.keymap.set("n", "<leader>cr", "<cmd>Telescope lsp_references<CR>", opts)
opts.desc = "Format File"
vim.keymap.set("n", "<leader>f", function()
vim.lsp.buf.format({ async = true })
end, opts)
opts.desc = "Format File"
vim.keymap.set({ "n", "v" }, "<leader>f", function()
-- vim.lsp.buf.format({ async = true })
conform.format({
bufnr = opts.buffer,
async = true,
lsp_fallback = true,
})
end, opts)
opts.desc = "Restart LSP"
vim.keymap.set("n", "<leader>rs", "<cmd>LspRestart<CR>", opts)
opts.desc = "Restart LSP"
vim.keymap.set("n", "<leader>rs", "<cmd>LspRestart<CR>", opts)
-- LSP Only Settings
-- Ruff & Pyright behaviour
if client.name == "ruff" then
-- Disable hover in favor of Pyright
client.server_capabilities.hoverProvider = false
end
end
local capabilities = cmp_nvim_lsp.default_capabilities()
-- Change the Diagnostic symbols in the sign column (gutter)
local signs = {
Error = "",
Warn = "",
Hint = "󰠠 ",
Info = "",
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 = "" })
local hl = "DiagnosticSign" .. type
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
end
-- configure html server
lspconfig["html"].setup({
capabilities = capabilities,
on_attach = on_attach,
capabilities = capabilities,
on_attach = on_attach,
})
-- configure typescript server with plugin
lspconfig["ts_ls"].setup({
capabilities = capabilities,
on_attach = on_attach,
capabilities = capabilities,
on_attach = on_attach,
init_options = {
plugins = {
{
name = "@vue/typescript-plugin",
location = global_node_modules .. "@vue/typescript-plugin",
languages = { "vue" },
},
},
},
filetypes = { "typescript", "javascript", "javascriptreact", "typescriptreact", "vue" },
})
-- configure css server
lspconfig["cssls"].setup({
capabilities = capabilities,
on_attach = on_attach,
capabilities = capabilities,
on_attach = on_attach,
})
-- configure tailwindcss server
lspconfig["tailwindcss"].setup({
capabilities = capabilities,
on_attach = on_attach,
capabilities = capabilities,
on_attach = on_attach,
filetypes = { "html", "svelte", "vue", "astro" },
})
-- configure svelte server
lspconfig["svelte"].setup({
capabilities = capabilities,
on_attach = function(client, bufnr)
on_attach(client, bufnr)
capabilities = capabilities,
on_attach = function(client, bufnr)
on_attach(client, bufnr)
vim.api.nvim_create_autocmd("BufWritePost", {
pattern = { "*.js", "*.ts" },
callback = function(ctx)
if client.name == "svelte" then
client.notify("$/onDidChangeTsOrJsFile", { uri = ctx.file })
end
end,
})
end,
vim.api.nvim_create_autocmd("BufWritePost", {
pattern = { "*.js", "*.ts" },
callback = function(ctx)
if client.name == "svelte" then
client.notify("$/onDidChangeTsOrJsFile", { uri = ctx.file })
end
end,
})
end,
})
-- configure emmet language server
lspconfig["emmet_ls"].setup({
capabilities = capabilities,
on_attach = on_attach,
filetypes = {
"html",
"typescriptreact",
"javascriptreact",
"css",
"sass",
"scss",
"less",
"svelte",
"vue",
},
capabilities = capabilities,
on_attach = on_attach,
filetypes = {
"html",
"typescriptreact",
"javascriptreact",
"astro",
"css",
"sass",
"scss",
"less",
"svelte",
"vue",
},
})
-- configure python lsp
lspconfig["pylsp"].setup({
filetypes = { "python" },
capabilities = capabilities,
on_attach = on_attach,
pylsp = {
pylsp = {
plugins = {
rope_autoimport = {
enabled = true,
completions = { enabled = true },
rename = { enabled = false },
},
black = { enabled = true },
autopep8 = { enabled = false },
yapf = { enabled = false },
flake8 = { enabled = true },
jedi_completion = {
enabled = true,
include_params = true,
fuzzy = true,
},
pylsp_mypy = {
enabled = true,
overrides = DPE.ResolvePythonEnvironment(),
report_progress = true,
live_mode = true,
},
-- import sorting
pyls_isort = { enabled = true },
},
},
},
-- configure ruff server
lspconfig["ruff"].setup({
capabilities = capabilities,
on_attach = on_attach,
})
-- configure pyright server
lspconfig["pyright"].setup({
capabilities = capabilities,
on_attach = on_attach,
filetypes = { "python" },
settings = {
python = {
analysis = {
autoSearchPaths = true,
useLibraryCodeForTypes = true,
diagnosticMode = "workspace",
},
},
},
})
-- configure docker server
lspconfig["dockerls"].setup({
capabilities = capabilities,
on_attach = on_attach,
capabilities = capabilities,
on_attach = on_attach,
})
-- configure json server
lspconfig["jsonls"].setup({
capabilities = capabilities,
on_attach = on_attach,
capabilities = capabilities,
on_attach = on_attach,
})
-- configure vue server
lspconfig["volar"].setup({
capabilities = capabilities,
on_attach = on_attach,
filetypes = { "vue" },
capabilities = capabilities,
on_attach = on_attach,
filetypes = { "vue" },
init_options = {
vue = {
hybridMode = false,
},
},
settings = {
typescript = {
inlayHints = {
enumMemberValues = {
enabled = true,
},
functionLikeReturnTypes = {
enabled = true,
},
propertyDeclarationTypes = {
enabled = true,
},
parameterTypes = {
enabled = true,
suppressWhenArgumentMatchesName = true,
},
variableTypes = {
enabled = true,
},
},
},
},
})
-- configure rust server
lspconfig.rust_analyzer.setup({
-- Server-specific settings. See `:help lspconfig-setup`
on_attach = on_attach,
capabilities = capabilities,
settings = {
["rust-analyzer"] = {},
},
-- Server-specific settings. See `:help lspconfig-setup`
on_attach = on_attach,
capabilities = capabilities,
settings = {
["rust-analyzer"] = {},
},
})
-- configure lua server (with special settings)
lspconfig["lua_ls"].setup({
capabilities = capabilities,
on_attach = on_attach,
settings = { -- custom settings for lua
Lua = {
-- make the language server recognize "vim" global
diagnostics = {
globals = { "vim" },
},
workspace = {
-- make language server aware of runtime files
library = {
[vim.fn.expand("$VIMRUNTIME/lua")] = true,
[vim.fn.stdpath("config") .. "/lua"] = true,
},
},
},
},
capabilities = capabilities,
on_attach = on_attach,
settings = { -- custom settings for lua
Lua = {
-- make the language server recognize "vim" global
diagnostics = {
globals = { "vim" },
},
workspace = {
-- make language server aware of runtime files
library = {
[vim.fn.expand("$VIMRUNTIME/lua")] = true,
[vim.fn.stdpath("config") .. "/lua"] = true,
},
},
},
},
})
-- configure css server
lspconfig["cssls"].setup({
capabilities = capabilities,
on_attach = on_attach,
})
-- configure htmx server
lspconfig["htmx"].setup({
capabilities = capabilities,
on_attach = on_attach,
capabilities = capabilities,
on_attach = on_attach,
})
--configure docker file server
lspconfig["dockerls"].setup({
capabilities = capabilities,
on_attach = on_attach,
capabilities = capabilities,
on_attach = on_attach,
})
-- configure docker compose server
lspconfig["docker_compose_language_service"].setup({
capabilities = capabilities,
on_attach = on_attach,
capabilities = capabilities,
on_attach = on_attach,
})
-- configure eslint server
lspconfig["eslint"].setup({
capabilities = capabilities,
on_attach = on_attach,
capabilities = capabilities,
on_attach = on_attach,
})
-- configure astro server
lspconfig["astro"].setup({
capabilities = capabilities,
on_attach = on_attach,
capabilities = capabilities,
on_attach = on_attach,
-- init_options = {
-- typescript = {
-- tsdk = ResolveTypescriptServer(),
-- },
-- },
})
-- configure kotlin server
lspconfig["kotlin_language_server"].setup({
capabilities = capabilities,
on_attach = on_attach,
capabilities = capabilities,
on_attach = on_attach,
})
-- configure clang server
lspconfig["clangd"].setup({
capabilities = capabilities,
on_attach = on_attach,
cmd = { "clangd", "--compile-commands-dir=./", "--background-index=false" },
capabilities = capabilities,
on_attach = on_attach,
filetypes = { "c", "cpp", "objc", "objcpp" },
})
-- configure bufls server
lspconfig["buf_ls"].setup({
capabilities = capabilities,
on_attach = on_attach,
filetypes = { "proto" },
})
-- configure arduino language server
lspconfig["arduino_language_server"].setup({
capabilities = capabilities,
on_attach = on_attach,
capabilities = capabilities,
on_attach = on_attach,
})
-- configure biome server
lspconfig["biome"].setup({
capabilities = capabilities,
on_attach = on_attach,
filetypes = {
"javascript",
"javascriptreact",
"json",
"jsonc",
"typescript",
"typescript.tsx",
"typescriptreact",
"astro",
"svelte",
"vue",
},
capabilities = capabilities,
on_attach = on_attach,
filetypes = {
"javascript",
"javascriptreact",
"json",
"jsonc",
"typescript",
"typescript.tsx",
"typescriptreact",
"astro",
"svelte",
"vue",
},
})
+75 -101
View File
@@ -1,123 +1,97 @@
local lualine = require("lualine")
local lazy_status = require("lazy.status") -- to configure lazy pending updates count
local noice = require("noice")
local colors = {
blue = "#65D1FF",
green = "#3EFFDC",
violet = "#FF61EF",
yellow = "#FFDA7B",
red = "#FF4A4A",
fg = "#c3ccdc",
bg = "#112638",
inactive_bg = "#2c3043",
blue = "#65D1FF",
green = "#3EFFDC",
violet = "#FF61EF",
yellow = "#FFDA7B",
red = "#FF4A4A",
fg = "#c3ccdc",
bg = "#112638",
inactive_bg = "#2c3043",
}
local my_lualine_theme = {
normal = {
a = { bg = colors.blue, fg = colors.bg, gui = "bold" },
b = { bg = colors.bg, fg = colors.fg },
c = { bg = colors.bg, fg = colors.fg },
},
insert = {
a = { bg = colors.green, fg = colors.bg, gui = "bold" },
b = { bg = colors.bg, fg = colors.fg },
c = { bg = colors.bg, fg = colors.fg },
},
visual = {
a = { bg = colors.violet, fg = colors.bg, gui = "bold" },
b = { bg = colors.bg, fg = colors.fg },
c = { bg = colors.bg, fg = colors.fg },
},
command = {
a = { bg = colors.yellow, fg = colors.bg, gui = "bold" },
b = { bg = colors.bg, fg = colors.fg },
c = { bg = colors.bg, fg = colors.fg },
},
replace = {
a = { bg = colors.red, fg = colors.bg, gui = "bold" },
b = { bg = colors.bg, fg = colors.fg },
c = { bg = colors.bg, fg = colors.fg },
},
inactive = {
a = { bg = colors.inactive_bg, fg = colors.semilightgray, gui = "bold" },
b = { bg = colors.inactive_bg, fg = colors.semilightgray },
c = { bg = colors.inactive_bg, fg = colors.semilightgray },
},
normal = {
a = { bg = colors.blue, fg = colors.bg, gui = "bold" },
b = { bg = colors.bg, fg = colors.fg },
c = { bg = colors.bg, fg = colors.fg },
},
insert = {
a = { bg = colors.green, fg = colors.bg, gui = "bold" },
b = { bg = colors.bg, fg = colors.fg },
c = { bg = colors.bg, fg = colors.fg },
},
visual = {
a = { bg = colors.violet, fg = colors.bg, gui = "bold" },
b = { bg = colors.bg, fg = colors.fg },
c = { bg = colors.bg, fg = colors.fg },
},
command = {
a = { bg = colors.yellow, fg = colors.bg, gui = "bold" },
b = { bg = colors.bg, fg = colors.fg },
c = { bg = colors.bg, fg = colors.fg },
},
replace = {
a = { bg = colors.red, fg = colors.bg, gui = "bold" },
b = { bg = colors.bg, fg = colors.fg },
c = { bg = colors.bg, fg = colors.fg },
},
inactive = {
a = { bg = colors.inactive_bg, fg = colors.semilightgray, gui = "bold" },
b = { bg = colors.inactive_bg, fg = colors.semilightgray },
c = { bg = colors.inactive_bg, fg = colors.semilightgray },
},
}
function GetFlutterToolsStatusLine()
local application_version = vim.g.flutter_tools_decorations.app_version
local device = vim.g.flutter_tools_decorations.device
local result = "Flutter: " .. application_version .. " " .. device
end
function IsFlutterToolsActive()
if vim.g.flutter_tools_decorations ~= nil then
return true
else
return false
end
end
function GetPoetvStatusLine()
-- Get the poetv statusline
-- If poetv is not active, return empty string
-- Get the poetv statusline
-- If poetv is not active, return empty string
if IsPoetvActive() then
local poetv_name = vim.g.poetv_name
local poetv_statusline_symbol = vim.g.poetv_statusline_symbol
if IsPoetvActive() then
local poetv_name = vim.g.poetv_name
local poetv_statusline_symbol = vim.g.poetv_statusline_symbol
local result = string.sub(poetv_name, 1, 20) .. " " .. poetv_statusline_symbol
local result = string.sub(poetv_name, 1, 20) .. " " .. poetv_statusline_symbol
return result
else
return ""
end
return result
else
return ""
end
end
function IsPoetvActive()
-- Check if vim.g.poetv_name exists
-- If it does, then poetv is active
-- Check if vim.g.poetv_name exists
-- If it does, then poetv is active
if vim.g.poetv_name ~= nil then
return true
else
return false
end
if vim.g.poetv_name ~= nil then
return true
else
return false
end
end
-- configure lualine with modified theme
lualine.setup({
options = {
theme = my_lualine_theme,
},
sections = {
lualine_x = {
{
noice.api.statusline.mode.get,
cond = noice.api.statusline.mode.has,
color = { fg = "#ff9e64" },
},
{
GetFlutterToolsStatusLine,
cond = IsFlutterToolsActive,
color = { fg = "#ff9e64" },
},
{
GetPoetvStatusLine,
cond = IsPoetvActive,
color = { fg = "#ff9e64" },
},
{
lazy_status.updates,
cond = lazy_status.has_updates,
color = { fg = "#ff9e64" },
},
{ "encoding" },
{ "fileformat" },
{ "filetype" },
},
},
options = {
theme = my_lualine_theme,
},
sections = {
lualine_x = {
{
GetPoetvStatusLine,
cond = IsPoetvActive,
color = { fg = "#ff9e64" },
},
{
lazy_status.updates,
cond = lazy_status.has_updates,
color = { fg = "#ff9e64" },
},
{ "encoding" },
{ "fileformat" },
{ "filetype" },
},
},
})
+17 -23
View File
@@ -1,26 +1,20 @@
require("mason").setup()
require("mason-lspconfig").setup({
ensure_installed = {
"ts_ls",
"astro",
"biome",
"rust_analyzer",
"html",
"emmet_ls",
"lua_ls",
'arduino_language_server',
'clangd',
"tailwindcss",
"svelte",
"cssls",
"jedi_language_server",
"kotlin_language_server"
},
automatic_installation = true,
})
require("mason-nvim-dap").setup({
ensure_installed = {
"debugpy", -- python
},
automatic_installation = true,
ensure_installed = {
"ts_ls",
"astro",
"biome",
"rust_analyzer",
"html",
"emmet_ls",
"lua_ls",
"arduino_language_server",
"clangd",
"tailwindcss",
"svelte",
"cssls",
"jedi_language_server",
"kotlin_language_server",
},
automatic_enable = false,
})
+6
View File
@@ -0,0 +1,6 @@
local diff = require("mini.diff")
diff.setup({
-- Disabled by default
source = diff.gen_source.none(),
})
-92
View File
@@ -1,92 +0,0 @@
local noice = require("noice")
local notify = require("notify")
notify.setup({
top_down = false,
animate = false,
stages = "static",
})
noice.setup({
routes = {
{
filter = {
event = "msg_show",
min_height = 20,
},
view = "cmdline_output",
},
{
filter = {
event = "lsp",
kind = "progress",
cond = function(message)
local client = vim.tbl_get(message.opts, "progress", "client")
return client == "lua_ls"
end
},
opts = { skip = true },
}
},
lsp = {
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
override = {
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
["vim.lsp.util.stylize_markdown"] = true,
["cmp.entry.get_documentation"] = true, -- requires hrsh7th/nvim-cmp
},
},
cmdline = {
format = {
search_down = {
view = "cmdline",
},
search_up = {
view = "cmdline",
},
},
},
views = {
cmdline_popup = {
relative = "editor",
position = {
row = 5,
col = "50%",
},
size = {
width = 60,
height = "auto",
},
border = {
style = { "╭", "─", "╮", "│", "╯", "─", "╰", "│" },
padding = { 0, 1 },
},
filter_options = {},
win_options = {
winhighlight = {
Normal = "Normal",
}
},
},
popupmenu = {
relative = "editor",
position = {
row = 8,
col = "50%",
},
size = {
width = 60,
height = 10,
},
border = {
style = "rounded",
padding = { 0, 1 },
},
win_options = {
winhighlight = { Normal = "Normal", FloatBorder = "DiagnosticInfo" },
},
},
},
})
-9
View File
@@ -1,9 +0,0 @@
local null_ls = require("null-ls")
null_ls.setup({
sources = {
null_ls.builtins.formatting.stylua,
null_ls.builtins.formatting.prettierd,
null_ls.builtins.formatting.shfmt,
},
})
+25
View File
@@ -0,0 +1,25 @@
local notify = require("notify")
notify.setup({
background_colour = "#000000",
fps = 15,
icons = {
DEBUG = "",
ERROR = "",
INFO = "",
TRACE = "✎",
WARN = "",
},
level = 2,
minimum_width = 50,
render = "default",
stages = "static",
time_formats = {
notification = "%T",
notification_history = "%FT%T",
},
timeout = 3000,
top_down = true,
})
vim.notify = notify
+63 -42
View File
@@ -1,5 +1,5 @@
local cmp = require("cmp")
local types = require('cmp.types')
local types = require("cmp.types")
local luasnip = require("luasnip")
local lspkind = require("lspkind")
@@ -7,45 +7,66 @@ local lspkind = require("lspkind")
require("luasnip.loaders.from_vscode").lazy_load()
cmp.setup({
completion = {
completeopt = "menu,menuone,preview,noinsert",
autocomplete = { types.cmp.TriggerEvent.TextChanged },
},
window = {
documentation = {
border = { '┌', '─', '┐', '│', '┘', '─', '└', '│' },
winhighlight = 'Normal:CmpPmenu,FloatBorder:CmpPmenuBorder,CursorLine:PmenuSel,Search:None',
},
completion = {
side_padding = 1,
border = { '┌', '─', '┐', '│', '┘', '─', '└', '│' },
winhighlight = 'Normal:CmpPmenu,FloatBorder:CmpPmenuBorder,CursorLine:PmenuSel,Search:None',
scrollbar = false,
},
},
snippet = { -- configure how nvim-cmp interacts with snippet engine
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert({
["<C-o>"] = cmp.mapping.complete(), -- show completion suggestions
["<C-e>"] = cmp.mapping.abort(), -- close completion menu
["<CR>"] = cmp.mapping.confirm({ select = true }), -- accept current selection
}),
-- 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 = 'nvim_lsp_signature_help' },
}),
-- configure lspkind for vs-code like pictograms in completion menu
formatting = {
format = lspkind.cmp_format({
maxwidth = 50,
ellipsis_char = "...",
}),
},
completion = {
completeopt = "menu,menuone,preview,noinsert,noselect",
autocomplete = { types.cmp.TriggerEvent.TextChanged },
},
window = {
documentation = {
border = { "┌", "─", "┐", "│", "┘", "─", "└", "│" },
winhighlight = "Normal:CmpPmenu,FloatBorder:CmpPmenuBorder,CursorLine:PmenuSel,Search:None",
},
completion = {
side_padding = 1,
border = { "┌", "─", "┐", "│", "┘", "─", "└", "│" },
winhighlight = "Normal:CmpPmenu,FloatBorder:CmpPmenuBorder,CursorLine:PmenuSel,Search:None",
scrollbar = false,
},
},
snippet = { -- configure how nvim-cmp interacts with snippet engine
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert({
["<C-.>"] = cmp.mapping.complete(), -- show completion suggestions
["C-<BS>"] = cmp.mapping.abort(), -- close completion menu
["<CR>"] = cmp.mapping.confirm({ select = true }), -- accept current selection
}),
-- sources for autocompletion
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "codecompanion" }, -- code companion for AI-assisted coding
{ name = "luasnip" }, -- snippets
{ name = "buffer" }, -- text within current buffer
{ name = "path" }, -- file system paths,
{ name = "nvim_lsp_signature_help" },
}),
-- configure lspkind for vs-code like pictograms in completion menu
formatting = {
format = lspkind.cmp_format({
maxwidth = 50,
ellipsis_char = "...",
}),
},
})
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline({ "/", "?" }, {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = "buffer" },
},
})
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(":", {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = "path" },
}, {
{ name = "cmdline" },
}),
matching = { disallow_symbol_nonprefix_matching = false },
})
@@ -2,7 +2,7 @@ local treesittercontext = require("treesitter-context")
treesittercontext.setup({
enable = true, -- Enable this plugin (Can be enabled/disabled later via commands)
max_lines = 0, -- How many lines the window should span. Values <= 0 mean no limit.
max_lines = 5, -- How many lines the window should span. Values <= 0 mean no limit.
min_window_height = 0, -- Minimum editor window height to enable context. Values <= 0 mean no limit.
line_numbers = true,
multiline_threshold = 20, -- Maximum number of lines to show for a single context
+65 -63
View File
@@ -1,69 +1,71 @@
require("nvim-treesitter.configs").setup({
-- A list of parser names, or "all" (the five listed parsers should always be installed)
ensure_installed = {
"rust",
"javascript",
"typescript",
"python",
"c",
"lua",
"vim",
"vimdoc",
"query",
"markdown_inline",
"markdown",
},
-- A list of parser names, or "all" (the five listed parsers should always be installed)
ensure_installed = {
"rust",
"javascript",
"typescript",
"python",
"proto",
"c",
"lua",
"vim",
"vimdoc",
"query",
"markdown_inline",
"markdown",
},
-- Install parsers synchronously (only applied to `ensure_installed`)
sync_install = false,
-- Install parsers synchronously (only applied to `ensure_installed`)
sync_install = false,
-- Automatically install missing parsers when entering buffer
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
auto_install = true,
-- Automatically install missing parsers when entering buffer
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
auto_install = true,
---- If you need to change the installation directory of the parsers (see -> Advanced Setup)
-- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")!
---- If you need to change the installation directory of the parsers (see -> Advanced Setup)
-- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")!
highlight = {
enable = true,
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = false,
},
textobjects = {
move = {
enable = true,
set_jumps = false, -- you can change this if you want.
goto_next_start = {
--- ... other keymaps
["]b"] = { query = "@code_cell.inner", desc = "next code block" },
},
goto_previous_start = {
--- ... other keymaps
["[b"] = { query = "@code_cell.inner", desc = "previous code block" },
},
},
select = {
enable = true,
lookahead = true, -- you can change this if you want
keymaps = {
--- ... other keymaps
["ib"] = { query = "@code_cell.inner", desc = "in block" },
["ab"] = { query = "@code_cell.outer", desc = "around block" },
},
},
swap = { -- Swap only works with code blocks that are under the same
-- markdown header
enable = true,
swap_next = {
--- ... other keymap
["<leader>sbl"] = "@code_cell.outer",
},
swap_previous = {
--- ... other keymap
["<leader>sbh"] = "@code_cell.outer",
},
},
},
highlight = {
enable = true,
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = false,
disable = { "php" },
},
textobjects = {
move = {
enable = true,
set_jumps = false, -- you can change this if you want.
goto_next_start = {
--- ... other keymaps
["]b"] = { query = "@code_cell.inner", desc = "next code block" },
},
goto_previous_start = {
--- ... other keymaps
["[b"] = { query = "@code_cell.inner", desc = "previous code block" },
},
},
select = {
enable = true,
lookahead = true, -- you can change this if you want
keymaps = {
--- ... other keymaps
["ib"] = { query = "@code_cell.inner", desc = "in block" },
["ab"] = { query = "@code_cell.outer", desc = "around block" },
},
},
swap = { -- Swap only works with code blocks that are under the same
-- markdown header
enable = true,
swap_next = {
--- ... other keymap
["<leader>sbl"] = "@code_cell.outer",
},
swap_previous = {
--- ... other keymap
["<leader>sbh"] = "@code_cell.outer",
},
},
},
})
+15 -17
View File
@@ -1,22 +1,20 @@
vim.g.poetv_executables = { "poetry", "pipenv" }
vim.g.poetv_auto_activate = 1
vim.g.poetv_executables = { "poetry" }
vim.g.poetv_auto_activate = 0
vim.g.poetv_set_environment = 1
vim.g.poetv_statusline_symbol = "🐍"
-- Keybindings
local opts = { noremap = true, silent = true }
-- Poetv: Activate Virtualenv
opts.desc = "Poetv: Activate virtualenv"
vim.keymap.set("n", "<leader>pva", "<cmd>PoetvActivate<CR>", opts)
-- Poetv: Deactivate Virtualenv
opts.desc = "Poetv: Deactivate virtualenv"
vim.keymap.set("n", "<leader>pvd", "<cmd>PoetvDeactivate<CR>", opts)
-- Setup Autocommands
vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" },
{ pattern = { "*/.venv/*", "*.py" }, callback = function() vim.cmd([[ PoetvActivate]]) end })
vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, {
pattern = { "*/.venv/*", "*.py" },
callback = function()
-- check if poetv is activated
if vim.g.poetv_name ~= nil then
return
else
vim.cmd([[ PoetvActivate ]])
vim.cmd([[ LspRestart ]])
end
end,
})
+10
View File
@@ -0,0 +1,10 @@
local smear_cursor = require("smear_cursor")
smear_cursor.setup({
stiffness = 0.5,
trailing_stiffness = 0.49,
never_draw_over_target = false,
smear_insert_mode = false,
smear_between_buffers = true,
cursor_color = "#7DF9FF",
})
+153 -47
View File
@@ -2,75 +2,181 @@ local telescope = require("telescope")
local builtin = require("telescope.builtin")
local actions = require("telescope.actions")
local trouble = require("trouble.sources.telescope")
local file_browser_actions = require("telescope._extensions.file_browser.actions")
local live_grep_shortcuts = require("telescope-live-grep-args.shortcuts")
local live_grep_actions = require("telescope-live-grep-args.actions")
local image_preview = require("absolute.utils.telescope_image_preview")
-- local function chafa_previewer_mime_hook(filepath, bufnr, opts)
-- local is_image = function(current_filepath)
-- local image_extensions = { "png", "jpg", "jpeg", "gif" } -- Supported image formats
-- local split_path = vim.split(current_filepath:lower(), ".", { plain = true })
-- local extension = split_path[#split_path]
-- return vim.tbl_contains(image_extensions, extension)
-- end
-- if is_image(filepath) then
-- local term = vim.api.nvim_open_term(bufnr, {})
-- local function send_output(_, data, _)
-- for _, d in ipairs(data) do
-- vim.api.nvim_chan_send(term, d .. "\r\n")
-- end
-- end
-- vim.fn.jobstart("chafa --passthrough tmux --exact-size off --format=symbols " .. filepath, {
-- on_stdout = send_output,
-- stdout_buffered = true,
-- })
-- else
-- require("telescope.previewers.utils").set_preview_message(bufnr, opts.winid, "Binary cannot be previewed")
-- end
-- end
telescope.setup({
defaults = {
vimgrep_arguments = {
"rg",
"--color=never",
"--no-heading",
"--with-filename",
"--line-number",
"--column",
"--smart-case",
},
mappings = {
i = {
["<C-t>"] = trouble.open,
["<C-q>"] = actions.send_to_qflist,
},
n = {
["<C-t>"] = trouble.open,
["<C-q>"] = actions.send_to_qflist,
},
},
},
extensions = {
file_browser = {
hijack_netrw = true,
hide_parent_dir = true,
depth = 1,
respect_gitignore = false,
auto_depth = true,
display_stat = {
date = true,
size = true,
mode = false,
},
},
},
defaults = {
file_previewer = image_preview.file_previewer,
buffer_previewer_maker = image_preview.buffer_previewer_maker,
vimgrep_arguments = {
"rg",
"--color=never",
"--no-heading",
"--with-filename",
"--line-number",
"--column",
"--smart-case",
"--follow",
"--hidden",
"--glob=!.git/",
},
mappings = {
i = {
["<C-t>"] = trouble.open,
["<C-q>"] = actions.send_to_qflist,
},
n = {
["<C-t>"] = trouble.open,
["<C-q>"] = actions.send_to_qflist,
},
},
},
extensions = {
media_files = {
filetypes = { "png", "webp", "jpg", "jpeg", "svg" },
find_cmd = "rg",
},
live_grep_args = {
auto_quoting = false,
mappings = {
i = {
["C-space"] = live_grep_actions.to_fuzzy_refine,
},
},
},
file_browser = {
hijack_netrw = true,
hide_parent_dir = true,
depth = 1,
respect_gitignore = vim.fn.executable("fd") == 1,
hidden = { file_browser = true, folder_browser = false },
auto_depth = false,
browse_files = require("telescope._extensions.file_browser.finders").browse_files,
display_stat = {
date = true,
size = true,
mode = false,
},
use_fd = true,
git_status = true,
mappings = {
["i"] = {
["<A-c>"] = file_browser_actions.create,
["<S-CR>"] = file_browser_actions.create_from_prompt,
["<A-r>"] = file_browser_actions.rename,
["<A-m>"] = file_browser_actions.move,
["<A-y>"] = file_browser_actions.copy,
["<A-d>"] = file_browser_actions.remove,
["<C-o>"] = file_browser_actions.open,
["<C-g>"] = file_browser_actions.goto_parent_dir,
["<C-e>"] = file_browser_actions.goto_home_dir,
["<C-w>"] = file_browser_actions.goto_cwd,
["<C-t>"] = file_browser_actions.change_cwd,
["<C-f>"] = file_browser_actions.toggle_browser,
["<C-h>"] = file_browser_actions.toggle_hidden,
["<C-s>"] = file_browser_actions.toggle_all,
["<bs>"] = file_browser_actions.backspace,
},
["n"] = {
["c"] = file_browser_actions.create,
["r"] = file_browser_actions.rename,
["m"] = file_browser_actions.move,
["y"] = file_browser_actions.copy,
["d"] = file_browser_actions.remove,
["o"] = file_browser_actions.open,
["g"] = file_browser_actions.goto_parent_dir,
["e"] = file_browser_actions.goto_home_dir,
["w"] = file_browser_actions.goto_cwd,
["t"] = file_browser_actions.change_cwd,
["f"] = file_browser_actions.toggle_browser,
["h"] = file_browser_actions.toggle_hidden,
["s"] = file_browser_actions.toggle_all,
},
},
},
},
})
telescope.load_extension("live_grep_args")
telescope.load_extension("file_browser")
telescope.load_extension("flutter")
telescope.load_extension("dap")
telescope.load_extension("media_files")
telescope.load_extension("themes")
telescope.load_extension("dap")
local find_files = function()
builtin.find_files({
find_command = { "rg", "--files", "--hidden", "--glob", "!.git" },
})
builtin.find_files({
find_command = { "rg", "--files", "--hidden", "--glob", "!.git" },
})
end
local default_grep_files = function()
local input = vim.fn.input("[Global Search]: ")
local trimmed_input = vim.fn.trim(input)
-- Check the length of the input
local live_grep_args = telescope.extensions.live_grep_args
-- If the input is empty open the search prompt
if trimmed_input == "" then
live_grep_args.live_grep_args()
return
end
builtin.grep_string({ search = trimmed_input })
end
-- Function to get the visually selected text
-- Pipe the visual selection into Telescope find_files
local opts = { noremap = true, silent = true }
opts.desc = "Open file browser (cwd)"
vim.keymap.set("n", "<leader>af", "<cmd>Telescope file_browser<CR>", opts)
vim.keymap.set("n", "<leader>pf", "<cmd>Telescope file_browser<CR>", opts)
opts.desc = "Open file browser (current file)"
vim.keymap.set("n", "<leader>cf", "<cmd>Telescope file_browser path=%:p:h select_buffer=true<CR>", opts)
opts.desc = "Fuzzy find files (cwd)"
vim.keymap.set("n", "<leader>pf", find_files, opts)
vim.keymap.set("n", "<C-p>", find_files, opts)
opts.desc = "Fuzzy find recent files"
vim.keymap.set("n", "<leader>pr", builtin.oldfiles, opts)
opts.desc = "Fuzzy find files in git in cwd"
vim.keymap.set("n", "<C-p>", builtin.git_files, opts)
vim.keymap.set("n", "<leader>gf", builtin.git_files, opts)
opts.desc = "Fuzzy find string under cursor in cwd"
vim.keymap.set("n", "<leader>ps", function()
builtin.grep_string({ search = vim.fn.input("Grep > ") })
end, opts)
opts.desc = "Fuzzy find files in cwd"
vim.keymap.set("n", "<leader>ps", default_grep_files, opts)
opts.desc = "Fuzzy find word under cursor in cwd"
vim.keymap.set("n", "<leader>sb", live_grep_shortcuts.grep_word_under_cursor, opts)
+26
View File
@@ -29,8 +29,34 @@ function _LAZYGIT_TOGGLE()
lazygit:toggle()
end
-- Todo prompt model to run
local ollama = Terminal:new({
cmd = "ollama run llama3",
dir = "git_dir",
direction = "float",
float_opts = {
border = "double",
},
-- function to run on opening the terminal
on_open = function(term)
vim.cmd("startinsert!")
vim.api.nvim_buf_set_keymap(term.bufnr, "n", "q", "<cmd>close<CR>", opts)
end,
-- function to run on closing the terminal
on_close = function(term)
vim.cmd("startinsert!")
end,
})
function _OLLAMA_TOGGLE()
ollama:toggle()
end
opts.desc = "Open lazygit"
vim.api.nvim_set_keymap("n", "<leader>gs", "<cmd>lua _LAZYGIT_TOGGLE()<CR>", opts)
opts.desc = "Open ollama"
vim.api.nvim_set_keymap("n", "<leader>ol", "<cmd>lua _OLLAMA_TOGGLE()<CR>", opts)
-- opts.desc = "Open a terminal"
-- vim.api.nvim_set_keymap("n", "<C-`>", "<cmd>ToggleTerm<CR>", opts)
+14
View File
@@ -0,0 +1,14 @@
local venvSelector = require("venv-selector")
venvSelector.setup({
-- name = "venv",
auto_refresh = false,
})
local opts = { noremap = true, silent = true }
opts.desc = "Open VenvSelector to pick a venv."
vim.api.nvim_set_keymap("n", "<leader>vs", "<cmd>VenvSelect<cr>", opts)
opts.desc = "Retrieve the venv from a cache."
vim.api.nvim_set_keymap("n", "<leader>vc", "<cmd>VenvSelectCached<cr>", opts)
+139 -47
View File
@@ -1,61 +1,153 @@
local function SetupWindowPreferences()
-- Utility function to get the blend value or set a default
local function get_blend_value(group_name, default_blend)
-- Retrieve highlight settings for the group using the new API
local current_highlight = vim.api.nvim_get_hl(0, { name = group_name })
return current_highlight.blend or default_blend
end
-- Utility function to get the blend value or set a default
local function get_blend_value(group_name, default_blend)
-- Retrieve highlight settings for the group using the new API
local current_highlight = vim.api.nvim_get_hl(0, { name = group_name })
return current_highlight.blend or default_blend
end
-- Set the Normal group with dynamic blend
local normal_blend = get_blend_value("Normal", 50)
vim.api.nvim_set_hl(0, "Normal", { bg = "none", blend = normal_blend })
-- Set the Normal group with dynamic blend
local normal_blend = get_blend_value("Normal", 0)
vim.api.nvim_set_hl(0, "Normal", { bg = "none", blend = normal_blend })
-- Set the NormalFloat group with dynamic blend
local normal_float_blend = get_blend_value("NormalFloat", 50)
vim.api.nvim_set_hl(1, "NormalFloat", { bg = "none", blend = normal_float_blend })
-- Set the NormalFloat group with dynamic blend
local normal_float_blend = get_blend_value("NormalFloat", 0)
vim.api.nvim_set_hl(1, "NormalFloat", { bg = "none", blend = normal_float_blend })
-- Set the NormalNC group with dynamic blend
local normal_nc_blend = get_blend_value("NormalNC", 50)
vim.api.nvim_set_hl(0, "NormalNC", { bg = "none", blend = normal_nc_blend })
-- Set the NormalNC group with dynamic blend
local normal_nc_blend = get_blend_value("NormalNC", 0)
vim.api.nvim_set_hl(0, "NormalNC", { bg = "none", blend = normal_nc_blend })
end
local colorschemes = {
["tokyonight-day"] = "Tokyo Night Day",
["tokyonight-night"] = "Tokyo Night Night",
["tokyonight-storm"] = "Tokyo Night Storm",
["tokynight-moon"] = "Tokyo Night Moon",
["catppuccin-frappe"] = "Catppuccin Frappe",
["catppuccin-latte"] = "Catppuccin Latte",
["catppuccin-macchiato"] = "Catppuccin Macchiato",
["catppuccin-mocha"] = "Catppuccin Mocha",
}
local function SyncWezTerm()
vim.api.nvim_create_autocmd("ColorScheme", {
group = vim.api.nvim_create_augroup("wezterm_colorscheme", { clear = true }),
callback = function(args)
SetupWindowPreferences()
local colorschemes = {
["tokyonight-day"] = "Tokyo Night Day",
["tokyonight-night"] = "Tokyo Night Night",
["tokyonight-storm"] = "Tokyo Night Storm",
["tokynight-moon"] = "Tokyo Night Moon",
["catppuccin-frappe"] = "Catppuccin Frappe",
["catppuccin-latte"] = "Catppuccin Latte",
["catppuccin-macchiato"] = "Catppuccin Macchiato",
["catppuccin-mocha"] = "Catppuccin Mocha",
}
local colorscheme = colorschemes[args.match]
if not colorscheme then
return
end
vim.api.nvim_create_autocmd("ColorScheme", {
group = vim.api.nvim_create_augroup("wezterm_colorscheme", { clear = true }),
callback = function(args)
SetupWindowPreferences()
-- Write the colorscheme to a file
local filename = vim.fn.expand("$XDG_CONFIG_HOME/wezterm/colorscheme")
assert(type(filename) == "string")
local file = io.open(filename, "w")
assert(file)
file:write(colorscheme)
file:close()
-- vim.notify("Setting WezTerm color scheme to " .. colorscheme, vim.log.levels.INFO)
end,
})
local colorscheme = colorschemes[args.match]
if not colorscheme then
return
end
-- if the file does not exists, exit early
local filename = vim.fn.expand("$XDG_CONFIG_HOME/wezterm/colorscheme")
if not vim.fn.filereadable(filename) then
return
end
-- Write the colorscheme to a file
assert(type(filename) == "string")
local file = io.open(filename, "w")
assert(file)
file:write(colorscheme)
file:close()
-- vim.notify("Setting WezTerm color scheme to " .. colorscheme, vim.log.levels.INFO)
end,
})
end
-- Setup Autocommand if wezterm is available in the system
if vim.fn.executable("wezterm") == 1 then
SyncWezTerm()
local function SyncGhostyTerm()
vim.api.nvim_create_user_command("SendCmdShiftComma", function()
os.execute(
'osascript -e \'tell application "System Events" to keystroke "," using {command down, shift down}\''
)
end, {})
vim.api.nvim_create_autocmd("ColorScheme", {
group = vim.api.nvim_create_augroup("ghostty_colorscheme", { clear = true }),
callback = function(args)
SetupWindowPreferences()
local notifyOpts = { title = "Set Ghostty Theme" }
-- if the file does not exists, exit early
local filename = vim.fn.expand("$XDG_CONFIG_HOME/ghostty/colorscheme")
if not vim.fn.filereadable(filename) then
vim.notify("Ghostty colorscheme file not found", vim.log.levels.ERROR, notifyOpts)
return
end
-- lets check if ghostty supports the theme
-- ghostty +list-themes | xargs -I {} echo {} | grep <theme>
local cmd = "ghostty +list-themes | sed 's/ (resources)//g' | grep '^" .. args.match .. "$'"
local status = vim.fn.system(cmd)
local trimmed_output = vim.fn.substitute(status, "^s+|s+$", "", "g")
-- check if status is empty
if trimmed_output == "" then
vim.notify(args.match .. " is not supported by Ghostty", vim.log.levels.ERROR, notifyOpts)
return
end
assert(type(filename) == "string")
local file = io.open(filename, "w")
assert(file)
local theme_string = 'theme = "' .. args.match .. '"'
file:write(theme_string)
file:close()
vim.cmd([[SendCmdShiftComma]])
-- send a key combination to reload the theme
-- cmd + shift + ,
-- vim.api.nvim_feedkeys("<Cmd-Shift-,>", "n", true)
end,
})
end
local function is_wezterm()
return os.getenv("TERM_PROGRAM") == "WezTerm"
or os.getenv("WEZTERM_EXECUTABLE") ~= nil
or vim.fn.executable("wezterm") == 1
end
local function is_ghostty()
return os.getenv("TERM_PROGRAM") == "Ghostty"
or os.getenv("GHOSTTY_EXECUTABLE") ~= nil
or vim.fn.executable("ghostty") == 1
end
local function SetupAutocommands()
-- Setup Autocommand if wezterm is available in the system
if is_wezterm() then
SyncWezTerm()
end
-- Setup Autommand if the terminal is Ghostty
if is_ghostty() then
SyncGhostyTerm()
end
end
SetupWindowPreferences()
SetupAutocommands()
local opts = { noremap = true, silent = true }
opts.desc = "Fuzzy find colorschemes"
vim.api.nvim_set_keymap("n", "<leader>cs", "<cmd>Telescope colorscheme<CR>", opts)
opts.desc = "Fuzzy find themes"
vim.api.nvim_set_keymap("n", "<leader>th", "<cmd>Telescope themes<CR>", opts)
+15 -12
View File
@@ -2,11 +2,14 @@ local lua_utils = require("absolute.utils.detect-lua")
package.path = package.path .. lua_utils.GetLatestLuaVersion()
local current_home = os.getenv("HOME")
vim.g.python3_host_prog = current_home .. "/.pyenv/versions/py3nvim/bin/python"
-- disable nvim intro
vim.opt.shortmess:append "sI"
vim.opt.shortmess:append("sI")
vim.opt.shell = "zsh"
vim.opt.nu = true
vim.opt.relativenumber = true
@@ -48,27 +51,27 @@ vim.g.mapleader = " "
vim.g.maplocalleader = ";"
vim.opt.guicursor = "n-v-c:block,i-ci-ve:block,r-cr:hor20,o:hor50,"
.. "a:blinkwait700-blinkoff400-blinkon250-Cursor/lCursor,"
.. "sm:block-blinkwait175-blinkoff150-blinkon175"
.. "a:blinkwait700-blinkoff400-blinkon250-Cursor/lCursor,"
.. "sm:block-blinkwait175-blinkoff150-blinkon175"
-- Function to change cursor color
local function set_cursor_color(color)
vim.api.nvim_set_hl(0, "Cursor", { fg = color, bg = color })
vim.api.nvim_set_hl(0, "Cursor", { fg = color, bg = color })
end
-- Autocommands to change cursor color based on mode
vim.api.nvim_create_autocmd("InsertEnter", {
pattern = "*",
callback = function()
set_cursor_color("#ffffff") -- Red in insert mode
end,
pattern = "*",
callback = function()
set_cursor_color("#ffffff") -- Red in insert mode
end,
})
vim.api.nvim_create_autocmd("InsertLeave", {
pattern = "*",
callback = function()
set_cursor_color("#7DF9FF") -- Blue in visual mode
end,
pattern = "*",
callback = function()
set_cursor_color("#7DF9FF") -- Blue in visual mode
end,
})
-- Add similar autocommands for other modes as needed
+4 -2
View File
@@ -1,6 +1,8 @@
local lua_utils = require("absolute.utils.detect-lua")
package.path = package.path .. lua_utils.GetLatestLuaVersion()
require("absolute.core")
require("absolute.lazy")
require("absolute.helpers")
require("absolute.remap")
+8
View File
@@ -0,0 +1,8 @@
return {
default_config = {
cmd = { "pb", "lsp" },
filetypes = { "proto" },
single_file_support = true,
root_dir = require("lspconfig.util").root_pattern(".git"),
},
}
+10 -9
View File
@@ -1,11 +1,12 @@
return {
"https://github.com/apple/pkl-neovim",
lazy = true,
event = "BufReadPre *.pkl",
dependencies = {
"nvim-treesitter/nvim-treesitter",
},
build = function()
vim.cmd("TSInstall! pkl")
end,
"https://github.com/apple/pkl-neovim",
enabled = false,
lazy = true,
event = "BufReadPre *.pkl",
dependencies = {
"nvim-treesitter/nvim-treesitter",
},
build = function()
vim.cmd("TSInstall! pkl")
end,
}
+11
View File
@@ -0,0 +1,11 @@
return {
"olimorris/codecompanion.nvim",
dependencies = {
"ravitemer/mcphub.nvim",
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
},
config = function()
require("absolute.after.codecompanion")
end,
}
+1 -1
View File
@@ -1,3 +1,3 @@
return {
"github/copilot.vim"
"github/copilot.vim",
}
+10 -16
View File
@@ -1,18 +1,12 @@
return {
"mfussenegger/nvim-dap",
dependencies = {
"theHamsta/nvim-dap-virtual-text",
"rcarriga/nvim-dap-ui",
"nvim-neotest/nvim-nio",
"nvim-telescope/telescope-dap.nvim",
{
"mfussenegger/nvim-dap-python",
ft = "python",
dependencies = { "mfussenegger/nvim-dap" },
},
-- "Pocco81/DAPInstall.nvim"
},
config = function()
require("absolute.after.dap")
end,
"mfussenegger/nvim-dap",
dependencies = {
"theHamsta/nvim-dap-virtual-text",
"rcarriga/nvim-dap-ui",
"nvim-neotest/nvim-nio",
"nvim-telescope/telescope-dap.nvim",
},
config = function()
require("absolute.after.dap")
end,
}
-11
View File
@@ -1,11 +0,0 @@
return {
"nvimdev/dashboard-nvim",
dependencies = {
"nvim-tree/nvim-web-devicons"
},
event = "VimEnter",
config = function()
require("absolute.after.dashboard")
end
}
+10 -9
View File
@@ -1,11 +1,12 @@
return {
'akinsho/flutter-tools.nvim',
lazy = false,
dependencies = {
'nvim-lua/plenary.nvim',
'stevearc/dressing.nvim', -- optional for vim.ui.select
},
config = function()
require("absolute.after.flutter-tools")
end,
"akinsho/flutter-tools.nvim",
enabled = false,
lazy = false,
dependencies = {
"nvim-lua/plenary.nvim",
"stevearc/dressing.nvim", -- optional for vim.ui.select
},
config = function()
require("absolute.after.flutter-tools")
end,
}
+7
View File
@@ -0,0 +1,7 @@
return {
"David-Kunz/gen.nvim",
enabled = false,
config = function()
require("absolute.after.gen")
end,
}
-7
View File
@@ -1,7 +0,0 @@
return {
"theprimeagen/harpoon",
dependencies = { 'nvim-lua/plenary.nvim' },
config = function()
require("absolute.after.harpoon")
end
}
+6
View File
@@ -0,0 +1,6 @@
return {
"3rd/image.nvim",
config = function()
require("absolute.after.image")
end,
}
-7
View File
@@ -1,7 +0,0 @@
return {
"jokajak/keyseer.nvim",
version = "*",
config = function()
require("absolute.after.keyseer")
end,
}
+7
View File
@@ -0,0 +1,7 @@
return {
"huggingface/llm.nvim",
enabled = false,
config = function()
require("absolute.after.llm")
end,
}
+11
View File
@@ -0,0 +1,11 @@
return {
"OXY2DEV/markview.nvim",
lazy = false,
opts = {
preview = {
filetypes = { "markdown", "codecompanion" },
ignore_buftypes = {},
},
experimental = { check_rtp_message = false },
},
}
+9 -15
View File
@@ -1,17 +1,11 @@
return {
'williamboman/mason.nvim',
dependencies = {
'williamboman/mason-lspconfig.nvim',
{
"jay-babu/mason-nvim-dap.nvim",
dependencies = {
"mfussenegger/nvim-dap",
}
}
},
config = function()
require("absolute.after.mason")
end
"mason-org/mason.nvim",
dependencies = {
"mason-org/mason-registry",
"mason-org/mason-lspconfig.nvim",
"neovim/nvim-lspconfig",
},
config = function()
require("absolute.after.mason")
end,
}
+6
View File
@@ -0,0 +1,6 @@
return {
"echasnovski/mini.diff",
config = function()
require("absolute.after.mini-diff")
end,
}
+6 -5
View File
@@ -1,7 +1,8 @@
return {
"echasnovski/mini.nvim",
version = "*", -- Stable Version
config = function()
require("absolute.after.mini")
end
"echasnovski/mini.nvim",
enabled = false,
version = "*", -- Stable Version
config = function()
require("absolute.after.mini")
end,
}
-15
View File
@@ -1,15 +0,0 @@
return {
"folke/noice.nvim",
event = "VeryLazy",
dependencies = {
-- if you lazy-load any plugin below, make sure to add proper `module="..."` entries
"MunifTanjim/nui.nvim",
-- OPTIONAL:
-- `nvim-notify` is only needed, if you want to use the notification view.
-- If not available, we use `mini` as the fallback
"rcarriga/nvim-notify",
},
config = function()
require("absolute.after.noice")
end,
}
@@ -1,7 +0,0 @@
return {
"nvimtools/none-ls.nvim",
config = function()
require("absolute.after.none-ls")
end
}
+8
View File
@@ -0,0 +1,8 @@
return {
"rcarriga/nvim-notify",
lazy = false,
priority = 1000,
config = function()
require("absolute.after.notify")
end,
}
+7 -6
View File
@@ -1,8 +1,9 @@
return {
"kylechui/nvim-surround",
version = "*", -- Use for stability; omit to use `main` branch for the latest features
event = "VeryLazy",
config = function()
require("absolute.after.nvim-surround")
end,
"kylechui/nvim-surround",
enabled = false,
version = "*", -- Use for stability; omit to use `main` branch for the latest features
event = "VeryLazy",
config = function()
require("absolute.after.nvim-surround")
end,
}
@@ -1,4 +1,5 @@
return {
enabled = true,
"nvim-treesitter/nvim-treesitter-context",
config = function()
require("absolute.after.nvim-treesitter-context")
+8 -5
View File
@@ -1,7 +1,10 @@
return {
"nvim-treesitter/nvim-treesitter",
config = function()
vim.cmd([[:silent !TSUpdate]])
require("absolute.after.nvim-treesitter")
end
"nvim-treesitter/nvim-treesitter",
dependencies = {
"OXY2DEV/markview.nvim",
},
config = function()
vim.cmd([[:silent !TSUpdate]])
require("absolute.after.nvim-treesitter")
end,
}
+5 -7
View File
@@ -1,9 +1,7 @@
return {
"petobens/poet-v",
lazy = true,
ft = "py",
config = function()
require("absolute.after.poet-v")
end,
enabled = false,
"petobens/poet-v",
config = function()
require("absolute.after.poet-v")
end,
}
+4
View File
@@ -0,0 +1,4 @@
return {
"MeanderingProgrammer/render-markdown.nvim",
ft = { "markdown", "codecompanion" }
}
+7
View File
@@ -0,0 +1,7 @@
return {
enabled = false,
"sphamba/smear-cursor.nvim",
config = function()
require("absolute.after.smear-cursor")
end,
}
+1
View File
@@ -1,4 +1,5 @@
return {
enabled = false,
"laytan/tailwind-sorter.nvim",
dependencies = { "nvim-treesitter/nvim-treesitter", "nvim-lua/plenary.nvim" },
build = "cd formatter && npm i && npm run build",
@@ -1,7 +0,0 @@
return {
"nvim-telescope/telescope-file-browser.nvim",
dependencies = {
"nvim-telescope/telescope.nvim",
"nvim-lua/plenary.nvim"
},
}
+19 -10
View File
@@ -1,12 +1,21 @@
return {
'nvim-telescope/telescope.nvim',
branch = '0.1.x',
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope-dap.nvim",
"andrew-george/telescope-themes",
},
config = function()
require("absolute.after.telescope")
end
"nvim-telescope/telescope.nvim",
branch = "0.1.x",
dependencies = {
"nvim-lua/popup.nvim",
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope-dap.nvim",
"andrew-george/telescope-themes",
"nvim-telescope/telescope-media-files.nvim",
"nvim-telescope/telescope-file-browser.nvim",
{
"nvim-telescope/telescope-live-grep-args.nvim",
-- This will not install any breaking changes.
-- For major updates, this must be adjusted manually.
version = "^1.0.0",
},
},
config = function()
require("absolute.after.telescope")
end,
}
@@ -0,0 +1,4 @@
return {
"bezhermoso/tree-sitter-ghostty",
build = "make nvim_install",
}
+14
View File
@@ -0,0 +1,14 @@
return {
"linux-cultist/venv-selector.nvim",
lazy = false,
branch = "regexp", -- This is the regexp branch, use this for the new version
dependencies = {
"neovim/nvim-lspconfig",
"nvim-telescope/telescope.nvim",
"mfussenegger/nvim-dap-python",
},
config = function()
require("absolute.after.venv-selector")
end,
event = "VeryLazy", -- Optional: needed only if you want to type `:VenvSelect` without a keymapping
}
+15 -15
View File
@@ -1,17 +1,17 @@
return {
"christoomey/vim-tmux-navigator",
cmd = {
"TmuxNavigateLeft",
"TmuxNavigateDown",
"TmuxNavigateUp",
"TmuxNavigateRight",
"TmuxNavigatePrevious",
},
keys = {
{ "<C-h>", "<cmd><C-U>TmuxNavigateLeft<CR>" },
{ "<C-j>", "<cmd><C-U>TmuxNavigateDown<CR>" },
{ "<C-k>", "<cmd><C-U>TmuxNavigateUp<CR>" },
{ "<C-l>", "<cmd><C-U>TmuxNavigateRight<CR>" },
{ "<C-\\>", "<cmd><C-U>TmuxNavigatePrevious<CR>" },
},
"alexghergh/nvim-tmux-navigation",
config = function()
local nvim_tmux_nav = require("nvim-tmux-navigation")
nvim_tmux_nav.setup({
disable_when_zoomed = true, -- defaults to false
})
vim.keymap.set("n", "<C-h>", nvim_tmux_nav.NvimTmuxNavigateLeft)
vim.keymap.set("n", "<C-j>", nvim_tmux_nav.NvimTmuxNavigateDown)
vim.keymap.set("n", "<C-k>", nvim_tmux_nav.NvimTmuxNavigateUp)
vim.keymap.set("n", "<C-l>", nvim_tmux_nav.NvimTmuxNavigateRight)
vim.keymap.set("n", "<C-\\>", nvim_tmux_nav.NvimTmuxNavigateLastActive)
vim.keymap.set("n", "<C-Space>", nvim_tmux_nav.NvimTmuxNavigateNext)
end,
}
+29 -25
View File
@@ -1,7 +1,7 @@
local opts = { noremap = true, silent = true }
opts.desc = "Show Cheatsheet"
vim.keymap.set("n", "<leader>\\", "<cmd>Cheatsheet<CR>", opts) -- toggle file explorer
local opts = {
noremap = true,
silent = true,
}
opts.desc = "Show Keymap"
vim.keymap.set("n", "<leader>?", "<cmd>Telescope keymaps<CR>", opts) -- toggle file explorer
@@ -53,10 +53,6 @@ vim.keymap.set("n", "<leader>Y", [["+Y]], opts)
opts.desc = "Delete current line (blackhole)"
vim.keymap.set({ "n", "v" }, "<leader>d", [["_d]], opts)
-- Alternate Escape (Easy to Reach)
opts.desc = "Alternate Escape (Easy to Reach)"
vim.keymap.set("i", "<C-c>", "<Esc>", opts)
-- Disable Q - Nothing Good Ever Happens
-- Q is normally used to enable Ex mode. We dont want that
opts.desc = "Disable Q - Nothing Good Ever Happens"
@@ -76,7 +72,6 @@ vim.keymap.set("n", "<leader>k", "<cmd>lnext<CR>zz", opts)
opts.desc = "Jump to previous location and center screen"
vim.keymap.set("n", "<leader>j", "<cmd>lprev<CR>zz", opts)
-- Search Regex Keymap
opts.desc = "Regex Replace"
vim.keymap.set("n", "<leader>sr", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]], opts)
@@ -84,22 +79,31 @@ vim.keymap.set("n", "<leader>sr", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left>
opts.desc = "Replace selected text"
vim.keymap.set("v", "<leader>ss", [[:s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]], opts)
-- Source File Keymap
opts.desc = "Source File"
vim.keymap.set("n", "<leader><leader>", function()
-- Only source these file extensions
local allowed_extensions = [[".vim", ".lua", ".vimrc", ".gvimrc", ".nvim", ".nvimrc", ".sh"]]
-- Get the file extension
local file_extension = vim.fn.expand("%:e")
-- Check if the file extension is allowed
if string.find(allowed_extensions, file_extension) then
vim.cmd("so %")
else
vim.notify("Filetype not supported", vim.log.levels.ERROR)
end
end, opts)
-- -- Source File Keymap
-- opts.desc = "Source File"
-- vim.keymap.set("n", "<leader><leader>", function()
-- -- Only source these file extensions
-- local allowed_extensions = [[
-- ".vim",
-- ".lua",
-- ".vimrc",
-- ".gvimrc",
-- ".nvim",
-- ".nvimrc",
-- ".sh"
-- ]]
--
-- -- Get the file extension
-- local file_extension = vim.fn.expand("%:e")
--
-- -- Check if the file extension is allowed
-- if string.find(allowed_extensions, file_extension) then
-- vim.cmd("so %")
-- vim.notify("Sourced file", vim.log.levels.INFO)
-- else
-- vim.notify("Filetype not supported", vim.log.levels.ERROR)
-- end
-- end, opts)
-- Optimize Window Resize
+16 -16
View File
@@ -1,33 +1,33 @@
function GetLuaPath(version)
local path = vim.fn.expand("$HOME") .. "/.luarocks/share/lua/" .. version .. "/?.lua;"
path = path .. vim.fn.expand("$HOME") .. "/.luarocks/share/lua/" .. version .. "/?/init.lua;"
return path
local path = vim.fn.expand("$HOME") .. "/.luarocks/share/lua/" .. version .. "/?.lua;"
path = path .. vim.fn.expand("$HOME") .. "/.luarocks/share/lua/" .. version .. "/?/init.lua;"
return path
end
function GetInstalledLuaVersion()
-- List the directory contents of the lua rocks directory
local rocks = vim.fn.glob(vim.fn.expand("$HOME") .. "/.luarocks/share/lua/")
-- List the directory contents of the lua rocks directory
local rocks = vim.fn.glob(vim.fn.expand("$HOME") .. "/.luarocks/share/lua/")
-- Split the string into a table
-- Split the string into a table
rocks = vim.split(rocks, "\n")
rocks = vim.split(rocks, "\n")
-- Sort the table highest to lowest
-- Sort the table highest to lowest
table.sort(rocks, function(a, b)
return tonumber(a) > tonumber(b)
end)
table.sort(rocks, function(a, b)
return tonumber(a) > tonumber(b)
end)
return rocks
return rocks
end
function GetLatestLuaVersion()
local rocks = GetInstalledLuaVersion()
local preferredVersion = rocks[1]
local rocks = GetInstalledLuaVersion()
local preferredVersion = rocks[1]
local path = GetLuaPath(preferredVersion)
local path = GetLuaPath(preferredVersion)
return path
return path
end
M = {}
+32 -18
View File
@@ -1,32 +1,46 @@
function CheckPoetryVirtualEnv()
local poetry = vim.fn.system("poetry env info -p 2>/dev/null")
if poetry == "" then
return nil
end
return poetry
local poetry = vim.fn.system("poetry env info -p 2>/dev/null")
if poetry == "" then
return nil
end
return poetry
end
function ResolvePythonEnvironment()
-- Get system global python env
local python = vim.fn.system("which python3")
-- Check of virtual environments exists
local virtual = os.getenv("VIRTUAL_ENV") or os.getenv("CONDA_PREFIX") or CheckPoetryVirtualEnv()
-- Check if asdf is installed
if virtual == nil then
-- Check if poetry environment exists
-- Get system global python env
local python = vim.fn.system("which python3")
-- Check of virtual environments exists
local virtual = os.getenv("VIRTUAL_ENV") or CheckPoetryVirtualEnv()
return {
"--python-executable", python
}
end
if virtual == nil then
return {
"--python-executable",
python,
}
end
return {
"--python-executable", virtual .. "/bin/python"
}
return {
"--python-executable",
virtual .. "/bin/python",
}
end
function ResolvePythonEnvironmentAsString()
local env = ResolvePythonEnvironment()
if env == nil then
return ""
end
local path = table.concat(env, " ")
return path
end
M = {}
M.ResolvePythonEnvironmentAsString = ResolvePythonEnvironmentAsString
M.ResolvePythonEnvironment = ResolvePythonEnvironment
M.CheckPoetryVirtualEnv = CheckPoetryVirtualEnv
@@ -0,0 +1,67 @@
M = {}
local function trim(s)
return s:gsub("^%s*(.-)%s*$", "%1")
end
local ResolveTypescriptServer = function()
-- Find the package.json file
local viable = vim.fn.system("find . -name 'package.json' -maxdepth 3 | xargs dirname")
viable = trim(viable)
if viable == "" then
return nil
end
-- Check for lock files
local find_npm_result = trim(vim.fn.system("find . -name 'package-lock.json' -maxdepth 3 | wc -l"))
local find_pnpm_result = trim(vim.fn.system("find . -name 'pnpm-lock.yaml' -maxdepth 3 | wc -l"))
local find_yarn_result = trim(vim.fn.system("find . -name 'yarn.lock' -maxdepth 3 | wc -l"))
local is_npm = find_npm_result == "1"
local is_pnpm = find_pnpm_result == "1"
local is_yarn = find_yarn_result == "1"
-- if no package lock files are found, end early
if not is_npm and not is_pnpm and not is_yarn then
return nil
end
-- Determine the preferred package manager
local ppm = "pnpm" -- Default to pnpm
if is_npm then
ppm = "npm"
end
if is_yarn then
ppm = "yarn"
end
-- Resolve TypeScript server path
local base_command = ppm .. " list typescript --dir " .. viable .. " --json"
local base_result = trim(vim.fn.system(base_command))
if base_result == "" then
vim.notify("Failed to run " .. base_command, vim.log.levels.ERROR)
return nil
end
local typescript_path = nil
if ppm == "pnpm" or ppm == "npm" or ppm == "yarn" then
local ok, parsed = pcall(vim.fn.json_decode, base_result)
if ok and parsed and #parsed > 0 and parsed[1].path then
typescript_path = parsed[1].path .. "/node_modules/typescript/lib"
end
end
if not typescript_path or typescript_path == "" then
vim.notify("TypeScript not found. Please install TypeScript globally or in the project.", vim.log.levels.ERROR)
return nil
end
return typescript_path
end
M.ResolveTypescriptServer = ResolveTypescriptServer
M.trim = trim
return M
@@ -0,0 +1,127 @@
-- Sourced from github
-- https://github.com/3rd/image.nvim/issues/183#issuecomment-2572606511
M = {}
local supported_images = { "svg", "png", "jpg", "jpeg", "gif", "webp", "avif" }
local from_entry = require("telescope.from_entry")
local Path = require("plenary.path")
local conf = require("telescope.config").values
local Previewers = require("telescope.previewers")
local previewers = require("telescope.previewers")
local image_api = require("image")
local is_image_preview = false
local image = nil
local last_file_path = ""
local is_supported_image = function(filepath)
local split_path = vim.split(filepath:lower(), ".", { plain = true })
local extension = split_path[#split_path]
return vim.tbl_contains(supported_images, extension)
end
local delete_image = function()
if not image then
return
end
image:clear()
is_image_preview = false
end
local create_image = function(filepath, winid, bufnr)
image = image_api.hijack_buffer(filepath, winid, bufnr)
if not image then
return
end
vim.schedule(function()
image:render()
end)
is_image_preview = true
end
local function defaulter(f, default_opts)
default_opts = default_opts or {}
return {
new = function(opts)
if conf.preview == false and not opts.preview then
return false
end
opts.preview = type(opts.preview) ~= "table" and {} or opts.preview
if type(conf.preview) == "table" then
for k, v in pairs(conf.preview) do
opts.preview[k] = vim.F.if_nil(opts.preview[k], v)
end
end
return f(opts)
end,
__call = function()
local ok, err = pcall(f(default_opts))
if not ok then
error(debug.traceback(err))
end
end,
}
end
-- NOTE: Add teardown to cat previewer to clear image when close Telescope
local file_previewer = defaulter(function(opts)
opts = opts or {}
local cwd = opts.cwd or vim.fn.getcwd()
return Previewers.new_buffer_previewer({
title = "File Preview",
dyn_title = function(_, entry)
return Path:new(from_entry.path(entry, true)):normalize(cwd)
end,
get_buffer_by_name = function(_, entry)
return from_entry.path(entry, true)
end,
define_preview = function(self, entry, _)
local p = from_entry.path(entry, true)
if p == nil or p == "" then
return
end
conf.buffer_previewer_maker(p, self.state.bufnr, {
bufname = self.state.bufname,
winid = self.state.winid,
preview = opts.preview,
})
end,
teardown = function(_)
if is_image_preview then
delete_image()
end
end,
})
end, {})
local buffer_previewer_maker = function(filepath, bufnr, opts)
-- NOTE: Clear image when preview other file
if is_image_preview and last_file_path ~= filepath then
delete_image()
end
last_file_path = filepath
if is_supported_image(filepath) then
filepath = string.gsub(filepath, " ", "%%20"):gsub("\\", "")
create_image(filepath, opts.winid, bufnr)
else
previewers.buffer_previewer_maker(filepath, bufnr, opts)
end
end
M.buffer_previewer_maker = buffer_previewer_maker
M.file_previewer = file_previewer.new
return M
+1 -1
View File
@@ -1 +1 @@
vim.cmd("colorscheme catppuccin")
vim.cmd("colorscheme catppuccin-macchiato")