summaryrefslogtreecommitdiff
path: root/.config/nvim
diff options
context:
space:
mode:
Diffstat (limited to '.config/nvim')
-rw-r--r--.config/nvim/lazy-lock.json69
-rw-r--r--.config/nvim/lua/config/plugins/blink-cmp.lua11
-rw-r--r--.config/nvim/lua/config/plugins/conform.lua1
-rw-r--r--.config/nvim/lua/config/plugins/fzflua.lua4
-rw-r--r--.config/nvim/lua/config/plugins/jupytext.lua6
-rw-r--r--.config/nvim/lua/config/plugins/learn.lua8
-rw-r--r--.config/nvim/lua/config/plugins/leetcode.lua22
-rw-r--r--.config/nvim/lua/config/plugins/lsp.lua16
-rw-r--r--.config/nvim/lua/config/plugins/notebook.lua14
-rw-r--r--.config/nvim/lua/config/plugins/rustacean.lua26
-rw-r--r--.config/nvim/lua/config/plugins/snacks.lua1
-rw-r--r--.config/nvim/lua/config/plugins/treesitter.lua70
-rw-r--r--.config/nvim/lua/mappings.lua8
13 files changed, 152 insertions, 104 deletions
diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json
index 74ad888..3d12f22 100644
--- a/.config/nvim/lazy-lock.json
+++ b/.config/nvim/lazy-lock.json
@@ -1,46 +1,43 @@
{
- "LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" },
+ "LuaSnip": { "branch": "master", "commit": "5a1e39223db9a0498024a77b8441169d260c8c25" },
"blink-emoji.nvim": { "branch": "master", "commit": "066013e4c98a9318408ee3f1ca2dbcb6fa3e4c06" },
- "blink.cmp": { "branch": "main", "commit": "327fff91fe6af358e990be7be1ec8b78037d2138" },
+ "blink.cmp": { "branch": "main", "commit": "4b18c32adef2898f95cdef6192cbd5796c1a332d" },
"blink.compat": { "branch": "main", "commit": "2ed6d9a28b07fa6f3bface818470605f8896408c" },
- "bullets.vim": { "branch": "master", "commit": "1c13e510e11d08b0259e8e627f128359c5521962" },
+ "bullets.vim": { "branch": "master", "commit": "89294b8930e660936374fb763ac48a1ac51dd29c" },
"cmp-sql": { "branch": "master", "commit": "54193ac99e3855c6ffaa36f83a7c50213df03157" },
- "conform.nvim": { "branch": "master", "commit": "9fd3d5e0b689ec1bf400c53cbbec72c6fdf24081" },
- "fidget.nvim": { "branch": "main", "commit": "3f5475949679953af6d78654db29b944fa826e6a" },
- "flash.nvim": { "branch": "main", "commit": "3be9bf7e85550045ec576379a0c45aac144d0438" },
- "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
- "fzf-lua": { "branch": "main", "commit": "9244bd48e0e6167ffe521209d0cfddc70bb70c21" },
- "gitsigns.nvim": { "branch": "main", "commit": "20ad4419564d6e22b189f6738116b38871082332" },
- "image.nvim": { "branch": "master", "commit": "c75654b37cd13df17475a53d9dc3e3d1b5e09fa1" },
- "jupytext.nvim": { "branch": "main", "commit": "c8baf3ad344c59b3abd461ecc17fc16ec44d0f7b" },
- "lazy.nvim": { "branch": "main", "commit": "16e52715b70b4d0fc6af3563ccc0ed9df82ae23e" },
- "lualine.nvim": { "branch": "master", "commit": "3946f0122255bc377d14a59b27b609fb3ab25768" },
+ "conform.nvim": { "branch": "master", "commit": "c2526f1cde528a66e086ab1668e996d162c75f4f" },
+ "fidget.nvim": { "branch": "main", "commit": "7fa433a83118a70fe24c1ce88d5f0bd3453c0970" },
+ "flash.nvim": { "branch": "main", "commit": "fcea7ff883235d9024dc41e638f164a450c14ca2" },
+ "friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" },
+ "fzf-lua": { "branch": "main", "commit": "9004cbb4c065a32b690e909c49903967b45301eb" },
+ "gitsigns.nvim": { "branch": "main", "commit": "9f3c6dd7868bcc116e9c1c1929ce063b978fa519" },
+ "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
+ "leetcode.nvim": { "branch": "master", "commit": "fdd3f91800b3983e27bc9fcfb99cfa7293d7f11a" },
+ "lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" },
"markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" },
- "mason-lspconfig.nvim": { "branch": "main", "commit": "2304ff65ecc8cb2afc2484de3e2ed9a407edf0b9" },
- "mason-tool-installer.nvim": { "branch": "main", "commit": "517ef5994ef9d6b738322664d5fdd948f0fdeb46" },
- "mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" },
- "mini.icons": { "branch": "main", "commit": "284798619aed9f4c1ac1b9417b9a5e3b4b85ef3a" },
- "mini.nvim": { "branch": "main", "commit": "cf32454e91b3d963a12fef0314811fb035b62d49" },
- "molten-nvim": { "branch": "main", "commit": "4fd7be6a12b5efda5179db642f13bad60893acca" },
- "neo-tree.nvim": { "branch": "v3.x", "commit": "8cdd6b1940f333c1dd085526a9c45b30fb2dbf50" },
+ "mason-lspconfig.nvim": { "branch": "main", "commit": "21c2a84ce368e99b18f52ab348c4c02c32c02fcf" },
+ "mason-tool-installer.nvim": { "branch": "main", "commit": "443f1ef8b5e6bf47045cb2217b6f748a223cf7dc" },
+ "mason.nvim": { "branch": "main", "commit": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65" },
+ "mini.icons": { "branch": "main", "commit": "68c178e0958d95b3977a771f3445429b1bded985" },
+ "mini.nvim": { "branch": "main", "commit": "dbb073bd2ed4a7bb35daafc7989567f0ff1426ee" },
+ "neo-tree.nvim": { "branch": "v3.x", "commit": "f3df514fff2bdd4318127c40470984137f87b62e" },
"nord.nvim": { "branch": "master", "commit": "80c1e5321505aeb22b7a9f23eb82f1e193c12470" },
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
- "nvim-colorizer.lua": { "branch": "master", "commit": "51cf7c995ed1eb6642aecf19067ee634fa1b6ba2" },
- "nvim-lspconfig": { "branch": "master", "commit": "52a893217b2c12e215c6851bd8813b43204416cd" },
+ "nvim-colorizer.lua": { "branch": "master", "commit": "338409dd8a6ed74767bad3eb5269f1b903ffb3cf" },
+ "nvim-lspconfig": { "branch": "master", "commit": "44acfe887d4056f704ccc4f17513ed41c9e2b2e6" },
"nvim-osc52": { "branch": "main", "commit": "04cfaba1865ae5c53b6f887c3ca7304973824fb2" },
- "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
- "nvim-web-devicons": { "branch": "master", "commit": "b8221e42cf7287c4dcde81f232f58d7b947c210d" },
- "oil.nvim": { "branch": "master", "commit": "7e1cd7703ff2924d7038476dcbc04b950203b902" },
- "outline.nvim": { "branch": "main", "commit": "6b62f73a6bf317531d15a7ae1b724e85485d8148" },
+ "nvim-treesitter": { "branch": "main", "commit": "dc42c209f3820bdfaae0956f15de29689aa6b451" },
+ "nvim-web-devicons": { "branch": "master", "commit": "746ffbb17975ebd6c40142362eee1b0249969c5c" },
+ "oil.nvim": { "branch": "master", "commit": "f55b25e493a7df76371cfadd0ded5004cb9cd48a" },
+ "outline.nvim": { "branch": "main", "commit": "ead1820d49c8e79ce89cab1c2c318981b695c9d2" },
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
- "pyworks.nvim": { "branch": "main", "commit": "5e7f0298849d4b1d3dd2f272d27b48a93bcdd424" },
- "rainbow-delimiters.nvim": { "branch": "master", "commit": "3277ad5f96eb03c9d618c88e24f683e4364e578c" },
- "render-markdown.nvim": { "branch": "main", "commit": "475d3ad8cae486b0df6fc6050cf5b5ea1de42db8" },
- "rustaceanvim": { "branch": "master", "commit": "12504405821c05874d2d1f6b5ec919f9808e2c99" },
- "snacks.nvim": { "branch": "main", "commit": "4e1070867a701b863d4bce4fd54a6c11314de506" },
- "typst-preview.nvim": { "branch": "master", "commit": "1603d37bb44ed2efa0b4378d1dfedc087b4f2141" },
- "undotree": { "branch": "master", "commit": "0f1c9816975b5d7f87d5003a19c53c6fd2ff6f7f" },
- "uv.nvim": { "branch": "main", "commit": "be4a7d47a976249282bb2f71fc773ac2f5325973" },
- "vim-tmux-navigator": { "branch": "master", "commit": "c45243dc1f32ac6bcf6068e5300f3b2b237e576a" },
- "which-key.nvim": { "branch": "main", "commit": "b4177e3eaf15fe5eb8357ebac2286d488be1ed00" }
+ "rainbow-delimiters.nvim": { "branch": "master", "commit": "e2858c43caafec291f915ef25fbed27bbe78abbd" },
+ "render-markdown.nvim": { "branch": "main", "commit": "48b4175dbca8439d30c1f52231cbe5a712c8f9d9" },
+ "rustaceanvim": { "branch": "master", "commit": "88575b98bb9937fb9983ddec5e532b67e75ce677" },
+ "snacks.nvim": { "branch": "main", "commit": "fe7cfe9800a182274d0f868a74b7263b8c0c020b" },
+ "typst-preview.nvim": { "branch": "master", "commit": "e123a7ab64e52d836e00dea9251e85b201f38966" },
+ "undotree": { "branch": "master", "commit": "d8f99084d98c32f651860eb0baaf89759f91debc" },
+ "uv.nvim": { "branch": "main", "commit": "b0bce1b61584fde99c316aa0587a4996c52df206" },
+ "vim-tmux-navigator": { "branch": "master", "commit": "e41c431a0c7b7388ae7ba341f01a0d217eb3a432" },
+ "which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }
}
diff --git a/.config/nvim/lua/config/plugins/blink-cmp.lua b/.config/nvim/lua/config/plugins/blink-cmp.lua
index 424d463..9f622c7 100644
--- a/.config/nvim/lua/config/plugins/blink-cmp.lua
+++ b/.config/nvim/lua/config/plugins/blink-cmp.lua
@@ -49,6 +49,12 @@ return {
-- (Default) Only show the documentation popup when manually triggered
completion = {
+ menu = { auto_show = true },
+ trigger = {
+ show_on_keyword = true,
+ show_on_trigger_character = true,
+ show_on_insert_on_trigger_character = true,
+ },
documentation = { auto_show = true, window = { border = "single" } },
},
signature = { enabled = true },
@@ -56,6 +62,11 @@ return {
sources = {
default = { "lsp", "path", "snippets", "buffer", "emoji", "sql" },
providers = {
+ lsp = {
+ name = "LSP",
+ module = "blink.cmp.sources.lsp",
+ min_keyword_length = 0,
+ },
snippets = {
name = "snippets",
module = "blink.cmp.sources.snippets",
diff --git a/.config/nvim/lua/config/plugins/conform.lua b/.config/nvim/lua/config/plugins/conform.lua
index afc2dd5..55660e9 100644
--- a/.config/nvim/lua/config/plugins/conform.lua
+++ b/.config/nvim/lua/config/plugins/conform.lua
@@ -22,7 +22,6 @@ return {
typescriptreact = { "prettierd", "prettier", stop_after_first = true },
css = { "prettierd", "prettier", stop_after_first = true },
html = { "prettierd", "prettier", stop_after_first = true },
- htmldjango = { "djlint" },
typst = { "prettypst" },
},
format_on_save = {
diff --git a/.config/nvim/lua/config/plugins/fzflua.lua b/.config/nvim/lua/config/plugins/fzflua.lua
index ea8a744..8dfdeb3 100644
--- a/.config/nvim/lua/config/plugins/fzflua.lua
+++ b/.config/nvim/lua/config/plugins/fzflua.lua
@@ -22,8 +22,8 @@ return {
},
files = {
-- Show hidden files but respect .gitignore
- rg_opts = [[--color=never --hidden --files -g "!.git" --ignore-file ~/.config/git/ignore]],
- fd_opts = [[--color=never --hidden --type f --type l --exclude .git --ignore-file ~/.config/git/ignore]],
+ -- rg_opts = [[--color=never --hidden --files -g "!.git" --ignore-file ~/.config/git/ignore]],
+ -- fd_opts = [[--color=never --hidden --type f --type l --exclude .git --ignore-file ~/.config/git/ignore]],
},
},
}
diff --git a/.config/nvim/lua/config/plugins/jupytext.lua b/.config/nvim/lua/config/plugins/jupytext.lua
deleted file mode 100644
index 2f57193..0000000
--- a/.config/nvim/lua/config/plugins/jupytext.lua
+++ /dev/null
@@ -1,6 +0,0 @@
-return {
- "GCBallesteros/jupytext.nvim",
- config = true,
- -- Depending on your nvim distro or config you may need to make the loading not lazy
- -- lazy=false,
-}
diff --git a/.config/nvim/lua/config/plugins/learn.lua b/.config/nvim/lua/config/plugins/learn.lua
deleted file mode 100644
index 2d82d9f..0000000
--- a/.config/nvim/lua/config/plugins/learn.lua
+++ /dev/null
@@ -1,8 +0,0 @@
-return {
- -- {
- -- "m4xshen/hardtime.nvim",
- -- lazy = false,
- -- dependencies = { "MunifTanjim/nui.nvim" },
- -- opts = {},
- -- },
-}
diff --git a/.config/nvim/lua/config/plugins/leetcode.lua b/.config/nvim/lua/config/plugins/leetcode.lua
new file mode 100644
index 0000000..920aba9
--- /dev/null
+++ b/.config/nvim/lua/config/plugins/leetcode.lua
@@ -0,0 +1,22 @@
+return {
+ "kawre/leetcode.nvim",
+ build = function()
+ if vim.fn.exists(":TSUpdate") == 2 then
+ vim.cmd("TSUpdate html")
+ end
+ end,
+ dependencies = {
+ -- include a picker of your choice, see picker section for more details
+ "nvim-lua/plenary.nvim",
+ "MunifTanjim/nui.nvim",
+ },
+ opts = {
+ -- configuration goes here
+ lang = "rust",
+ storage = {
+ home = vim.fn.expand("~/leetcode"),
+ cache = vim.fn.stdpath("cache") .. "/leetcode",
+ },
+ image_support = false,
+ },
+}
diff --git a/.config/nvim/lua/config/plugins/lsp.lua b/.config/nvim/lua/config/plugins/lsp.lua
index 4d4dcc0..eb812d2 100644
--- a/.config/nvim/lua/config/plugins/lsp.lua
+++ b/.config/nvim/lua/config/plugins/lsp.lua
@@ -138,7 +138,12 @@ return {
[vim.diagnostic.severity.HINT] = "󰌶 ",
},
},
- virtual_text = { current_line = true },
+ virtual_text = {
+ source = "if_many",
+ spacing = 2,
+ },
+ update_in_insert = true,
+ virtual_lines = false,
-- virtual_text = {
-- source = "if_many",
-- spacing = 2,
@@ -164,6 +169,7 @@ return {
-- - capabilities (table): Override fields in capabilities. Can be used to disable certain LSP features.
-- - settings (table): Override the default settings passed when initializing the server.
-- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/
+ local lspconfig_util = require("lspconfig.util")
local servers = {
bashls = {},
marksman = {},
@@ -184,6 +190,13 @@ return {
"--fallback-style={BasedOnStyle: LLVM, IndentWidth: 4, TabWidth: 4, UseTab: Never}",
},
},
+ rust_analyzer = {
+ single_file_support = true,
+ root_dir = function(fname)
+ return lspconfig_util.root_pattern("Cargo.toml", "rust-project.json", ".git")(fname)
+ or vim.fs.dirname(fname)
+ end,
+ },
lua_ls = {},
} -- Ensure the servers and tools above are installed
--
@@ -208,6 +221,7 @@ return {
require("mason-lspconfig").setup({
ensure_installed = {}, -- explicitly set to an empty table (Kickstart populates installs via mason-tool-installer)
automatic_installation = false,
+ automatic_enable = false,
handlers = {
function(server_name)
if server_name == "rust_analyzer" then
diff --git a/.config/nvim/lua/config/plugins/notebook.lua b/.config/nvim/lua/config/plugins/notebook.lua
deleted file mode 100644
index f3eff87..0000000
--- a/.config/nvim/lua/config/plugins/notebook.lua
+++ /dev/null
@@ -1,14 +0,0 @@
-return {
- {
- "jeryldev/pyworks.nvim",
- dependencies = {
- "benlubas/molten-nvim",
- "3rd/image.nvim",
- },
- config = function()
- require("pyworks").setup() -- See Configuration section for options
- end,
- lazy = false,
- priority = 100,
- },
-}
diff --git a/.config/nvim/lua/config/plugins/rustacean.lua b/.config/nvim/lua/config/plugins/rustacean.lua
index 849db6e..1187aad 100644
--- a/.config/nvim/lua/config/plugins/rustacean.lua
+++ b/.config/nvim/lua/config/plugins/rustacean.lua
@@ -1,5 +1,29 @@
return {
"mrcjkb/rustaceanvim",
- version = "^6", -- Recommended
+ version = "^8", -- Recommended
lazy = false, -- This plugin is already lazy
+ init = function()
+ local capabilities = vim.lsp.protocol.make_client_capabilities()
+ local ok, blink = pcall(require, "blink.cmp")
+ if ok then
+ capabilities = blink.get_lsp_capabilities(capabilities)
+ end
+
+ vim.g.rustaceanvim = {
+ tools = {
+ enable_clippy = false,
+ },
+ server = {
+ capabilities = capabilities,
+ standalone = true,
+ status_notify_level = false,
+ load_vscode_settings = false,
+ default_settings = {
+ ["rust-analyzer"] = {
+ checkOnSave = false,
+ },
+ },
+ },
+ }
+ end,
}
diff --git a/.config/nvim/lua/config/plugins/snacks.lua b/.config/nvim/lua/config/plugins/snacks.lua
index b83beb9..dd731dd 100644
--- a/.config/nvim/lua/config/plugins/snacks.lua
+++ b/.config/nvim/lua/config/plugins/snacks.lua
@@ -25,6 +25,7 @@ return {
{ icon = " ", key = "f", desc = "Find File", action = ":lua Snacks.dashboard.pick('files')" },
{ icon = " ", key = "g", desc = "Grep", action = ":lua Snacks.dashboard.pick('live_grep')", padding = 1 },
{ icon = " ", key = "n", desc = "New File", action = ":ene | startinsert" },
+ { icon = " ", key = "c", desc = "LeetCode", action = ":Leet" },
{ icon = "󰒲 ", key = "l", desc = "Lazy", action = ":Lazy", enabled = package.loaded.lazy ~= nil },
{ icon = " ", key = "q", desc = "Quit", action = ":qa" },
},
diff --git a/.config/nvim/lua/config/plugins/treesitter.lua b/.config/nvim/lua/config/plugins/treesitter.lua
index 3c95b41..3e866c5 100644
--- a/.config/nvim/lua/config/plugins/treesitter.lua
+++ b/.config/nvim/lua/config/plugins/treesitter.lua
@@ -2,40 +2,42 @@ return {
{
"nvim-treesitter/nvim-treesitter",
event = "VeryLazy",
- build = ":TSUpdate",
- config = function()
- require("nvim-treesitter.configs").setup({
- ensure_installed = {
- "c",
- "lua",
- "vim",
- "vimdoc",
- "query",
- "markdown",
- "markdown_inline",
- "rust",
+ opts = {
+ ensure_installed = {
+ "c",
+ "lua",
+ "vim",
+ "vimdoc",
+ "query",
+ "markdown",
+ "markdown_inline",
+ "rust",
+ "css",
+ "javascript",
+ "svelte",
+ "tsx",
+ "typst",
+ },
+ auto_install = true,
+ incremental_selection = {
+ enable = true,
+ keymaps = {
+ node_incremental = "<Enter>",
+ scope_incremental = false,
+ node_decremental = "<Backspace>",
},
- auto_install = true,
- incremental_selection = {
- enable = true,
- keymaps = {
- node_incremental = "<Enter>",
- scope_incremental = false,
- node_decremental = "<Backspace>",
- },
- },
- highlight = {
- enable = true,
- disable = function(lang, buf)
- local max_filesize = 100 * 1024 -- 100 KB
- local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
- if ok and stats and stats.size > max_filesize then
- return true
- end
- end,
- additional_vim_regex_highlighting = false,
- },
- })
- end,
+ },
+ highlight = {
+ enable = true,
+ disable = function(lang, buf)
+ local max_filesize = 100 * 1024 -- 100 KB
+ local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
+ if ok and stats and stats.size > max_filesize then
+ return true
+ end
+ end,
+ additional_vim_regex_highlighting = false,
+ },
+ },
},
}
diff --git a/.config/nvim/lua/mappings.lua b/.config/nvim/lua/mappings.lua
index 25b566a..9f17f28 100644
--- a/.config/nvim/lua/mappings.lua
+++ b/.config/nvim/lua/mappings.lua
@@ -13,6 +13,12 @@ local fzf = require("fzf-lua")
wk.add({
{
mode = { "n" },
+ { "<leader>qr", "<cmd>Leet run<CR>", desc = "Run code" },
+ { "<leader>qs", "<cmd>Leet submit<CR>", desc = "Submit code" },
+ { "<leader>qi", "<cmd>Leet info<CR>", desc = "Get info" },
+ { "<leader>qo", "<cmd>Leet open<CR>", desc = "Open in browser" },
+ { "<leader>qd", "<cmd>Leet desc<CR>", desc = "Toggle decription" },
+ { "<leader>qm", "<cmd>Leet menu<CR>", desc = "Open menu" },
{ "<C-d>", "<C-d>zz", desc = "Move down in buffer with cursor centered" },
{ "<C-u>", "<C-u>zz", desc = "Move up in buffer with cursor centered" },
{ "n", "nzzzv", desc = "Search next with cursor centered" },
@@ -48,7 +54,7 @@ wk.add({
desc = "Search by Grep",
},
{
- "<leader>d",
+ "<leader>h",
function()
require("fzf-lua").lsp_document_diagnostics()
end,