feat(flutter-tools.lua): add configuration for flutter-tools statusline decorations

feat(lsp-config.lua): update key bindings for code actions and references, remove pycodestyle config
feat(lualine.lua): add functions to display Flutter Tools statusline and check if Flutter Tools is active
feat(mason.lua): add kotlin_language_server to the list of supported language servers
feat(molten.lua): improve configuration for Molten plugin based on file type
feat(none-ls.lua): improve configuration for null-ls sources, resolve virtual environment for mypy diagnostics

fix(telescope.lua): update trouble import path to sources instead of providers
feat(telescope.lua): add vimgrep_arguments to improve search functionality
feat(telescope.lua): add mappings for trouble.open in insert and normal mode
feat(telescope.lua): load extensions flutter and dap
feat(telescope.lua): define custom find_files function with specific find_command
feat(trouble.lua): update trouble import path to sources instead of providers
feat(trouble.lua): update mappings to use trouble_sources.open instead of trouble_telescope.open_with_trouble
feat(core/init.lua): add ignorecase and smartcase options for case-insensitive searching
feat(core/init.lua): add backspace option for more flexible backspacing behavior
feat(core/init.lua): set cursor color based on mode in InsertEnter and InsertLeave autocmds
feat(dap.lua): add nvim-nio dependency and load telescope-dap.nvim extension
feat(flutter-tools.lua): add flutter-tools.nvim plugin configuration
feat(molten.lua): add lazy loading and ft option for Python files
feat(none-ls.lua.disabled): add none-ls.nvim plugin configuration
feat(poet-v.lua): add lazy loading and ft option for Python files
feat(vim-tmux-navigator.lua): update cmd and keys for vim-tmux-navigator plugin

chore(remap.lua): reorganize keymap descriptions for better clarity and readability
feat(remap.lua): add key mappings for jumping up, down, to next, and to previous locations with center screen
feat(remap.lua): add key mappings for resizing windows right, left, up, and down by 10 lines
feat(safe-invoke.lua): add utility function SafeInvoke to safely invoke functions and handle errors
This commit is contained in:
David Ibia
2024-06-14 02:03:40 +01:00
parent a96a4f719e
commit 2b7ce8f520
19 changed files with 314 additions and 205 deletions

View File

@@ -1,68 +1,69 @@
{
"Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
"LuaSnip": { "branch": "master", "commit": "a7a4b4682c4b3e2ba82b82a4e6e5f5a0e79dec32" },
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
"LuaSnip": { "branch": "master", "commit": "50fcf17db7c75af80e6b6109acfbfb4504768780" },
"cheatsheet.nvim": { "branch": "master", "commit": "9716f9aaa94dd1fd6ce59b5aae0e5f25e2a463ef" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" },
"cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
"cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" },
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
"copilot.vim": { "branch": "release", "commit": "3b39e786d865df9ba77fe61624d6ee646528a809" },
"dashboard-nvim": { "branch": "master", "commit": "413442b12d85315fc626c44a0ce4929b213ef604" },
"dressing.nvim": { "branch": "master", "commit": "18e5beb3845f085b6a33c24112b37988f3f93c06" },
"friendly-snippets": { "branch": "main", "commit": "dcd4a586439a1c81357d5b9d26319ae218cc9479" },
"fzf": { "branch": "master", "commit": "8977c9257a8093a82a2cffa4f7e6974e43206ef4" },
"git-blame.nvim": { "branch": "master", "commit": "a0282d05adbee80aaf4e2ff35b81b52940b67bed" },
"gitignore.nvim": { "branch": "master", "commit": "6f541c1fab844c5ddf6971872bd3a9861abca20d" },
"gitsigns.nvim": { "branch": "main", "commit": "4e348641b8206c3b8d23080999e3ddbe4ca90efc" },
"copilot.vim": { "branch": "release", "commit": "1dcaf72099b436b5832d6117d9cd7a4a098a8d77" },
"dashboard-nvim": { "branch": "master", "commit": "b88c997f468a1bacb1e9b13ff3b567638caa06e6" },
"dressing.nvim": { "branch": "master", "commit": "e3714c8049b2243e792492c4149e4cc395c68eb9" },
"flutter-tools.nvim": { "branch": "main", "commit": "990a1349c29f7d474a0cd51355aba773ccc9deea" },
"friendly-snippets": { "branch": "main", "commit": "700c4a25caacbb4648c9a27972c2fe203948e0c2" },
"fzf": { "branch": "master", "commit": "9dc3ed638a1c5bc7a7d4918eb736cd82c8cb3fa0" },
"git-blame.nvim": { "branch": "master", "commit": "408d5487d908dfe5d48e5645d8b27ddcc16b11e0" },
"gitignore.nvim": { "branch": "master", "commit": "2455191ec94da8ed222806a4fe3aa358eac1e558" },
"gitsigns.nvim": { "branch": "main", "commit": "47c8e3e571376b24de62408fd0c9d12f0a9fc0a3" },
"harpoon": { "branch": "master", "commit": "ccae1b9bec717ae284906b0bf83d720e59d12b91" },
"image.nvim": { "branch": "master", "commit": "0dd8bdbb8855bc98c534a902c91dc9eddb8155b1" },
"incline.nvim": { "branch": "main", "commit": "a3df527789289016b561c4ad3c891490169d1d6b" },
"indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" },
"image.nvim": { "branch": "master", "commit": "a2a0849e0b3dbed90f9283603cedb683bda5d4d1" },
"incline.nvim": { "branch": "main", "commit": "16fc9c073e3ea4175b66ad94375df6d73fc114c0" },
"indent-blankline.nvim": { "branch": "master", "commit": "d98f537c3492e87b6dc6c2e3f66ac517528f406f" },
"jedi-vim": { "branch": "master", "commit": "9bd79ee41ac59a33f5890fa50b6d6a446fcc38c7" },
"jupytext.nvim": { "branch": "main", "commit": "68fddf28119dbaddfaea6b71f3d6aa1e081afb93" },
"jupytext.nvim": { "branch": "main", "commit": "c8baf3ad344c59b3abd461ecc17fc16ec44d0f7b" },
"keyseer.nvim": { "branch": "main", "commit": "6cb478f9b2be4af4680ceb0308a9b49cd6b6ea73" },
"lazy.nvim": { "branch": "main", "commit": "83493db50a434a4c5c648faf41e2ead80f96e478" },
"lazy.nvim": { "branch": "main", "commit": "eb4957442e3182f051b0ae11da32e06d22c190e3" },
"lspkind.nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" },
"lualine.nvim": { "branch": "master", "commit": "26dac2fcadb6e622790ab08e36d0dba3d3765398" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "55716a879568a498fa236593c8119789054a3b8e" },
"mason-nvim-dap.nvim": { "branch": "main", "commit": "67210c0e775adec55de9826b038e8b62de554afc" },
"mason.nvim": { "branch": "main", "commit": "3b5068f0fc565f337d67a2d315d935f574848ee7" },
"mini.nvim": { "branch": "main", "commit": "f24747266a047617d06605a2316aa6c071662fa2" },
"molten-nvim": { "branch": "main", "commit": "8346bba69e0de96278dad2038e9be74605908b7d" },
"nightfly": { "branch": "master", "commit": "e17c27c27372dd3db4aeb9a86d294c506de85ae6" },
"none-ls.nvim": { "branch": "main", "commit": "e25d2fcb24364b9cdb1e6b24a2399dfda5dbdf0c" },
"nvim-bqf": { "branch": "main", "commit": "b51a37fcd808edafd52511458467c8c9a701ea8d" },
"nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" },
"nvim-dap": { "branch": "master", "commit": "fc880e82059eb21c0fa896be60146e5f17680648" },
"nvim-dap-python": { "branch": "master", "commit": "66560f0ebddf96604f7037e1efad3ba6942761e6" },
"nvim-dap-ui": { "branch": "master", "commit": "9720eb5fa2f41988e8770f973cd11b76dd568a5d" },
"nvim-highlight-colors": { "branch": "main", "commit": "a9f191d5ba27a5943b8992bf618858fa7374758f" },
"lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "37a336b653f8594df75c827ed589f1c91d91ff6c" },
"mason-nvim-dap.nvim": { "branch": "main", "commit": "f5425eb1d0d794f0305d5eeebddabb74614683ff" },
"mason.nvim": { "branch": "main", "commit": "0950b15060067f752fde13a779a994f59516ce3d" },
"mini.nvim": { "branch": "main", "commit": "19e1584124cda35388d4fdb911eab7124014e541" },
"molten-nvim": { "branch": "main", "commit": "df5ccef3b6fda3582f7746e45327ee031f668826" },
"nightfly": { "branch": "master", "commit": "d7efbcbc4774700a4f81768d9bcd5a7a76b3274a" },
"nvim-bqf": { "branch": "main", "commit": "1b24dc6050c34e8cd377b6b4cd6abe40509e0187" },
"nvim-cmp": { "branch": "main", "commit": "a110e12d0b58eefcf5b771f533fc2cf3050680ac" },
"nvim-dap": { "branch": "master", "commit": "6f79b822997f2e8a789c6034e147d42bc6706770" },
"nvim-dap-python": { "branch": "master", "commit": "ae0225d0d4a46e18e6057ab3701ef87bbbd6aaad" },
"nvim-dap-ui": { "branch": "master", "commit": "b7267003ba4dd860350be86f75b9d9ea287cedca" },
"nvim-highlight-colors": { "branch": "main", "commit": "30f305d57d658615cd827146f5e56db8b6833475" },
"nvim-lsp-file-operations": { "branch": "master", "commit": "223aca86b737dc66e9c51ebcda8788a8d9cc6cf2" },
"nvim-lspconfig": { "branch": "master", "commit": "4bdd3800b4148f670c6cf55ef65f490148eeb550" },
"nvim-silicon": { "branch": "main", "commit": "ab664633e5090809da7470288404fe5b8735a8c8" },
"nvim-surround": { "branch": "main", "commit": "d47001f8ddf9646c24f16d2732d4d0255acd2121" },
"nvim-tree.lua": { "branch": "master", "commit": "164f11db4f18a3e0eb3d6719b53f63cabfac7d8b" },
"nvim-treesitter": { "branch": "master", "commit": "3ae78f376c2e721ce4feb23e9a5e8bc6062a2657" },
"nvim-treesitter-context": { "branch": "master", "commit": "b8b7e52c1517d401d7c519787d5dc4528c41291a" },
"nvim-web-devicons": { "branch": "master", "commit": "75df79feb02d5e0ec114e447453775d4d291ea03" },
"nvim_lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
"otter.nvim": { "branch": "main", "commit": "6dd878c49520f7e53c75fc14d20dcf2c4a5f326d" },
"pkl-neovim": { "branch": "main", "commit": "4c3bc2cd46085b36b2873c1ae9086aee404b3d90" },
"nvim-lspconfig": { "branch": "master", "commit": "4d38bece98300e3e5cd24a9aa0d0ebfea4951c16" },
"nvim-nio": { "branch": "master", "commit": "7969e0a8ffabdf210edd7978ec954a47a737bbcc" },
"nvim-silicon": { "branch": "main", "commit": "b305ad8a45210f0dc8bbba1494dea6af072c0ed2" },
"nvim-surround": { "branch": "main", "commit": "687ea2f33955df0042bf228853a82696265e7e2d" },
"nvim-tree.lua": { "branch": "master", "commit": "2086e564c4d23fea714e8a6d63b881e551af2f41" },
"nvim-treesitter": { "branch": "master", "commit": "cdc613c630598779dc9f975bae12a4dc7c001950" },
"nvim-treesitter-context": { "branch": "master", "commit": "5efba33af0f39942e426340da7bc15d7dec16474" },
"nvim-web-devicons": { "branch": "master", "commit": "c0cfc1738361b5da1cd0a962dd6f774cc444f856" },
"nvim_lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
"otter.nvim": { "branch": "main", "commit": "cbb1be0586eae18cbea38ada46af428d2bebf81a" },
"pkl-neovim": { "branch": "main", "commit": "a0ae099c7eb926150ee0a126b1dd78086edbe3fc" },
"playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" },
"plenary.nvim": { "branch": "master", "commit": "f7adfc4b3f4f91aab6caebf42b3682945fbc35be" },
"plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" },
"poet-v": { "branch": "master", "commit": "85a5dd44d89602cc3dccd2489924e9c7caab0044" },
"quarto-nvim": { "branch": "main", "commit": "67e09027b5d8bd948907734fc6fb15028ffdcd28" },
"rose-pine": { "branch": "main", "commit": "a29b09d15a9ef5cd575fbe5ae2a3cfb854876caf" },
"tailwind-sorter.nvim": { "branch": "main", "commit": "3bde5890457e6272550c8b853c13bfb57457f47f" },
"rose-pine": { "branch": "main", "commit": "8c4660cfe697621bcc61d37b3651ffed94fe7fed" },
"tailwind-sorter.nvim": { "branch": "main", "commit": "1b60096635a1a1bef6b36b6c88a61ff437df5a15" },
"telescope-dap.nvim": { "branch": "master", "commit": "8c88d9716c91eaef1cdea13cb9390d8ef447dbfe" },
"telescope.nvim": { "branch": "0.1.x", "commit": "6312868392331c9c0f22725041f1ec2bef57c751" },
"todo-comments.nvim": { "branch": "main", "commit": "833d8dd8b07eeda37a09e99460f72a02616935cb" },
"toggleterm.nvim": { "branch": "main", "commit": "193786e0371e3286d3bc9aa0079da1cd41beaa62" },
"tokyonight": { "branch": "main", "commit": "c025baf23b62f044eff1f4ef561c45de636f0e32" },
"treesj": { "branch": "main", "commit": "60e27280030f9cd8dfb6ceb335922c6ff76682cc" },
"trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" },
"undotree": { "branch": "master", "commit": "aa93a7e5890dbbebbc064cd22260721a6db1a196" },
"telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
"todo-comments.nvim": { "branch": "main", "commit": "51e10f838e84b4756c16311d0b1ef0972c6482d2" },
"toggleterm.nvim": { "branch": "main", "commit": "066cccf48a43553a80a210eb3be89a15d789d6e6" },
"tokyonight": { "branch": "main", "commit": "81c867c5f638597a82c82094dcb90ed42444dabc" },
"treesj": { "branch": "main", "commit": "f98deb33805485b56a8d44d1a27d16874af00d7f" },
"trouble.nvim": { "branch": "main", "commit": "e0b35a273df58b03612255783cf475a782ede7e0" },
"undotree": { "branch": "master", "commit": "56c684a805fe948936cda0d1b19505b84ad7e065" },
"vim-maximizer": { "branch": "master", "commit": "2e54952fe91e140a2e69f35f22131219fcd9c5f1" },
"vim-tmux-navigator": { "branch": "master", "commit": "38b1d0402c4600543281dc85b3f51884205674b6" }
"vim-tmux-navigator": { "branch": "master", "commit": "5b3c701686fb4e6629c100ed32e827edf8dad01e" }
}

View File

@@ -0,0 +1,12 @@
local flutter_tools = require('flutter-tools')
flutter_tools.setup({
decorations = {
statusline = {
app_version = true,
device = true,
project_config = true,
}
},
fvm = true,
})

View File

@@ -37,10 +37,10 @@ local on_attach = function(client, bufnr)
vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts)
opts.desc = "See available code actions"
vim.keymap.set({ "n", "v" }, "<leader>vca", vim.lsp.buf.code_action, opts)
vim.keymap.set({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, opts)
opts.desc = "Show LSP references"
vim.keymap.set("n", "<leader>vrr", "<cmd>Telescope lsp_references<CR>", opts)
vim.keymap.set("n", "<leader>cr", "<cmd>Telescope lsp_references<CR>", opts)
opts.desc = "Format File"
vim.keymap.set("n", "<leader>f", function()
@@ -123,10 +123,6 @@ lspconfig["pylsp"].setup({
jedi_completion = {
include_params = true,
},
pycodestyle = {
ignore = { "E231" },
maxLineLength = 150,
},
},
},
},

View File

@@ -2,6 +2,7 @@ local lualine = require("lualine")
local lazy_status = require("lazy.status") -- to configure lazy pending updates count
local molten_status = require("molten.status") -- to configure molten statusline
local colors = {
blue = "#65D1FF",
green = "#3EFFDC",
@@ -46,6 +47,21 @@ local my_lualine_theme = {
},
}
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
@@ -80,6 +96,11 @@ lualine.setup({
},
sections = {
lualine_x = {
{
GetFlutterToolsStatusLine,
cond = IsFlutterToolsActive,
color = { fg = "#ff9e64" },
},
{
molten_status.initialized,
},

View File

@@ -11,6 +11,7 @@ require("mason-lspconfig").setup({
"svelte",
"cssls",
"jedi_language_server",
"kotlin_language_server"
},
automatic_installation = true,
})

View File

@@ -1,84 +1,84 @@
-- change the configuration when editing a python file
vim.api.nvim_create_autocmd("BufEnter", {
pattern = "*.py",
callback = function(e)
if string.match(e.file, ".otter.") then
return
end
if require("molten.status").initialized() == "Molten" then -- this is kinda a hack...
vim.fn.MoltenUpdateOption("virt_lines_off_by_1", false)
vim.fn.MoltenUpdateOption("virt_text_output", false)
else
vim.g.molten_virt_lines_off_by_1 = false
vim.g.molten_virt_text_output = false
end
end,
pattern = "*.py",
callback = function(e)
if string.match(e.file, ".otter.") then
return
end
if require("molten.status").initialized() == "Molten" then -- this is kinda a hack...
vim.fn.MoltenUpdateOption("virt_lines_off_by_1", false)
vim.fn.MoltenUpdateOption("virt_text_output", false)
else
vim.g.molten_virt_lines_off_by_1 = false
vim.g.molten_virt_text_output = false
end
end,
})
-- Undo those config changes when we go back to a markdown or quarto file
vim.api.nvim_create_autocmd("BufEnter", {
pattern = { "*.qmd", "*.md", "*.ipynb" },
callback = function(e)
if string.match(e.file, ".otter.") then
return
end
if require("molten.status").initialized() == "Molten" then
vim.fn.MoltenUpdateOption("virt_lines_off_by_1", true)
vim.fn.MoltenUpdateOption("virt_text_output", true)
else
vim.g.molten_virt_lines_off_by_1 = true
vim.g.molten_virt_text_output = true
end
end,
pattern = { "*.qmd", "*.md", "*.ipynb" },
callback = function(e)
if string.match(e.file, ".otter.") then
return
end
if require("molten.status").initialized() == "Molten" then
vim.fn.MoltenUpdateOption("virt_lines_off_by_1", true)
vim.fn.MoltenUpdateOption("virt_text_output", true)
else
vim.g.molten_virt_lines_off_by_1 = true
vim.g.molten_virt_text_output = true
end
end,
})
-- automatically export output chunks to a jupyter notebook on write
vim.api.nvim_create_autocmd("BufWritePost", {
pattern = { "*.ipynb" },
callback = function()
if require("molten.status").initialized() == "Molten" then
vim.cmd("MoltenExportOutput!")
end
end,
pattern = { "*.ipynb" },
callback = function()
if require("molten.status").initialized() == "Molten" then
vim.cmd("MoltenExportOutput!")
end
end,
})
-- automatically import output chunks from a jupyter notebook
-- tries to find a kernel that matches the kernel in the jupyter notebook
-- falls back to a kernel that matches the name of the active venv (if any)
local imb = function(e) -- init molten buffer
vim.schedule(function()
local kernels = vim.fn.MoltenAvailableKernels()
local try_kernel_name = function()
local metadata = vim.json.decode(io.open(e.file, "r"):read("a"))["metadata"]
return metadata.kernelspec.name
end
local ok, kernel_name = pcall(try_kernel_name)
if not ok or not vim.tbl_contains(kernels, kernel_name) then
kernel_name = nil
local venv = os.getenv("VIRTUAL_ENV")
if venv ~= nil then
kernel_name = string.match(venv, "/.+/(.+)")
end
end
if kernel_name ~= nil and vim.tbl_contains(kernels, kernel_name) then
vim.cmd(("MoltenInit %s"):format(kernel_name))
end
vim.cmd("MoltenImportOutput")
end)
vim.schedule(function()
local kernels = vim.fn.MoltenAvailableKernels()
local try_kernel_name = function()
local metadata = vim.json.decode(io.open(e.file, "r"):read("a"))["metadata"]
return metadata.kernelspec.name
end
local ok, kernel_name = pcall(try_kernel_name)
if not ok or not vim.tbl_contains(kernels, kernel_name) then
kernel_name = nil
local venv = os.getenv("VIRTUAL_ENV")
if venv ~= nil then
kernel_name = string.match(venv, "/.+/(.+)")
end
end
if kernel_name ~= nil and vim.tbl_contains(kernels, kernel_name) then
vim.cmd(("MoltenInit %s"):format(kernel_name))
end
vim.cmd("MoltenImportOutput")
end)
end
-- automatically import output chunks from a jupyter notebook
vim.api.nvim_create_autocmd("BufAdd", {
pattern = { "*.ipynb" },
callback = imb,
pattern = { "*.ipynb" },
callback = imb,
})
-- we have to do this as well so that we catch files opened like nvim ./hi.ipynb
vim.api.nvim_create_autocmd("BufEnter", {
pattern = { "*.ipynb" },
callback = function(e)
if vim.api.nvim_get_vvar("vim_did_enter") ~= 1 then
imb(e)
end
end,
pattern = { "*.ipynb" },
callback = function(e)
if vim.api.nvim_get_vvar("vim_did_enter") ~= 1 then
imb(e)
end
end,
})

View File

@@ -1,16 +1,17 @@
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,
null_ls.builtins.formatting.black,
null_ls.builtins.diagnostics.mypy.with({
extra_args = function()
local virtual = os.getenv("VIRTUAL_ENV") or os.getenv("CONDA_PREFIX") or "/usr"
return { "--python-executable", virtual .. "/bin/python3" }
end,
}),
},
sources = {
null_ls.builtins.formatting.stylua,
null_ls.builtins.formatting.prettierd,
null_ls.builtins.formatting.shfmt,
null_ls.builtins.formatting.black,
null_ls.builtins.diagnostics.mypy.with({
extra_args = function()
-- Let's resolve the virtual environment or conda environment
local virtual = os.getenv("VIRTUAL_ENV") or os.getenv("CONDA_PREFIX") or "/usr"
return { "--python-executable", virtual .. "/bin/python3" }
end,
}),
},
})

View File

@@ -1,23 +1,43 @@
local telescope = require("telescope")
local builtin = require("telescope.builtin")
local trouble = require("trouble.providers.telescope")
local trouble = require("trouble.sources.telescope")
telescope.setup({
defaults = {
mappings = {
i = {
["<C-q>"] = trouble.open_with_trouble,
},
n = {
["<C-q>"] = trouble.open_with_trouble,
},
},
},
defaults = {
vimgrep_arguments = {
"rg",
"--color=never",
"--no-heading",
"--with-filename",
"--line-number",
"--column",
"--smart-case",
},
mappings = {
i = {
["<C-q>"] = trouble.open,
},
n = {
["<C-q>"] = trouble.open,
},
},
},
})
vim.keymap.set("n", "<leader>pf", builtin.find_files, { desc = "Fuzzy find files in cwd" })
telescope.load_extension("flutter")
telescope.load_extension("dap")
local find_files = function()
builtin.find_files({
find_command = { "rg", "--files", "--hidden", "--glob", "!.git" },
})
end
vim.keymap.set("n", "<leader>pf", find_files, { desc = "Fuzzy find files in cwd" })
vim.keymap.set("n", "<leader>pr", builtin.oldfiles, { desc = "Fuzzy find recent files" })
vim.keymap.set("n", "<C-p>", builtin.git_files, { desc = "Fuzzy find files in git in cwd" })
vim.keymap.set("n", "<leader>ps", function()
builtin.grep_string({ search = vim.fn.input("Grep > ") })
builtin.grep_string({ search = vim.fn.input("Grep > ") })
end, { desc = "Find string under cursor in cwd" })

View File

@@ -1,8 +1,8 @@
local tsj = require("treesj")
tsj.setup({
use_default_keymaps = false,
max_join_length = 400,
use_default_keymaps = false,
max_join_length = 1000,
})
local opts = { silent = true, noremap = true }

View File

@@ -1,20 +1,20 @@
local telescope = require("telescope")
local actions = require("telescope.actions")
local trouble_telescope = require("trouble.providers.telescope")
local trouble_sources = require("trouble.sources.telescope")
telescope.setup({
defaults = {
mappings = {
i = {
["<C-t>"] = trouble_telescope.open_with_trouble,
["<C-q>"] = actions.send_to_qflist,
},
n = {
["<C-t>"] = trouble_telescope.open_with_trouble,
["<C-q>"] = actions.send_to_qflist,
},
},
},
defaults = {
mappings = {
i = {
["<C-t>"] = trouble_sources.open,
["<C-q>"] = actions.send_to_qflist,
},
n = {
["<C-t>"] = trouble_sources.open,
["<C-q>"] = actions.send_to_qflist,
},
},
},
})
-- Keybindings

View File

@@ -18,6 +18,11 @@ vim.opt.backup = false
vim.opt.hlsearch = false
vim.opt.incsearch = true
vim.opt.ignorecase = true
vim.opt.smartcase = true
vim.opt.backspace = "indent,eol,start"
vim.opt.termguicolors = true
vim.opt.scrolloff = 8
@@ -32,27 +37,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

View File

@@ -3,11 +3,12 @@ return {
dependencies = {
-- "theHamsta/nvim-dap-virtual-text",
"rcarriga/nvim-dap-ui",
-- "nvim-telescope/telescope-dap.nvim",
"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
end,
}

View File

@@ -0,0 +1,11 @@
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,
}

View File

@@ -3,6 +3,8 @@ return {
version = "^1.0.0", -- use version <2.0.0 to avoid breaking changes
dependencies = { "3rd/image.nvim" },
build = ":UpdateRemotePlugins",
lazy = true,
ft = "py",
init = function()
vim.g.molten_auto_open_output = false
vim.g.molten_wrap_output = true

View File

@@ -1,5 +1,7 @@
return {
"petobens/poet-v",
lazy = true,
ft = "py",
config = function()
require("absolute.after.poet-v")
end,

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>" },
},
"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>" },
},
}

View File

@@ -62,18 +62,20 @@ vim.keymap.set("i", "<C-c>", "<Esc>", opts)
opts.desc = "Disable Q - Nothing Good Ever Happens"
vim.keymap.set("n", "Q", "<nop>", opts)
-- Format document with LSP Formatter
opts.desc = "Format document with LSP Formatter"
vim.keymap.set("n", "<leader>f", vim.lsp.buf.format, opts)
-- Navigation Quick Fixes
--
-- vim.keymap.set("n", "<C-k>", "<cmd>cnext<CR>zz", opts)
-- vim.keymap.set("n", "<C-j>", "<cmd>cprev<CR>zz", opts)
-- vim.keymap.set("n", "<leader>k", "<cmd>lnext<CR>zz", opts)
-- vim.keymap.set("n", "<leader>j", "<cmd>lprev<CR>zz", opts)
--
opts.desc = "Jump up and center screen"
vim.keymap.set("n", "<C-k>", "<cmd>cnext<CR>zz", opts)
opts.desc = "Jump down and center screen"
vim.keymap.set("n", "<C-j>", "<cmd>cprev<CR>zz", opts)
opts.desc = "Jump to next location and center screen"
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"
@@ -85,20 +87,39 @@ vim.keymap.set("v", "<leader>ss", [[:s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><
-- 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"]]
-- 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")
-- 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
print("Filetype not supported")
end
-- Check if the file extension is allowed
if string.find(allowed_extensions, file_extension) then
vim.cmd("so %")
else
print("Filetype not supported")
end
end, opts)
-- Manage VIM Maximizer
opts.desc = "Toggle TMUX Pane"
vim.keymap.set("n", "<leader>`", "<cmd>NvimTreeToggle<CR>", opts)
-- Optimize Window Resize
-- Resize Window Right
opts.desc = "Resize Window Right"
vim.keymap.set("n", "<leader>l", "<C-w>10>", opts)
-- Resize Window Left
opts.desc = "Resize Window Left"
vim.keymap.set("n", "<leader>h", "<C-w>10<", opts)
-- Resize Window Up
opts.desc = "Resize Window Up"
vim.keymap.set("n", "<leader>k", "<C-w>10-", opts)
-- Resize Window Down
opts.desc = "Resize Window Down"
vim.keymap.set("n", "<leader>j", "<C-w>10+", opts)

View File

@@ -0,0 +1,15 @@
function SafeInvoke(func)
-- safely invoke a functions
-- if the function returns an error, return an empty string
-- otherwise return the result of the function
local ok, result = pcall(func)
if ok then
return result
else
return ""
end
end
return SafeInvoke