irongit

happy with formatting

huncholanehuncholaneauthored
parent 59fc9d7commit 7ef3842f79532546e567b33238e7fac0573fa06eBrowse files

12 files changed, +169 -15

+3-3alacritty/alacritty.toml
@@ -1,11 +1,11 @@
11 [window]
22 opacity = 0.9
33 blur = true
4-option_as_alt = "Both"
4+# option_as_alt = "Both"
55
66 [font]
77 size = 10
8-normal.family = "Iosevka Nerd Font"
8+# normal.family = "Iosevka Nerd Font"
99
1010 [keyboard]
11-option_as_alt = "Both"
11+# option_as_alt = "Both"
+6-4nvim/lazy-lock.json
@@ -1,14 +1,17 @@
11 {
2+ "LuaSnip": { "branch": "master", "commit": "21f74f7ba8c49f95f9d7c8293b147c2901dd2d3a" },
23 "alpha-nvim": { "branch": "main", "commit": "2b3cbcdd980cae1e022409289245053f62fb50f6" },
4+ "blink.cmp": { "branch": "main", "commit": "fa9e5fa324f8a721a562a7baeba35a0da44ec651" },
35 "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
46 "cmp-cmdline": { "branch": "main", "commit": "d126061b624e0af6c3a556428712dd4d4194ec6d" },
57 "cmp-nvim-lsp": { "branch": "main", "commit": "bd5a7d6db125d4654b50eeae9f5217f24bb22fd3" },
68 "cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" },
7- "cmp-vsnip": { "branch": "main", "commit": "989a8a73c44e926199bfd05fa7a516d51f2d2752" },
89 "conform.nvim": { "branch": "master", "commit": "b4aab989db276993ea5dcb78872be494ce546521" },
910 "crates.nvim": { "branch": "main", "commit": "afcd1cc3eeceb5783676fc8464389b9216a29d05" },
10- "gitsigns.nvim": { "branch": "main", "commit": "6e3c66548035e50db7bd8e360a29aec6620c3641" },
11+ "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
12+ "gitsigns.nvim": { "branch": "main", "commit": "f780609807eca1f783a36a8a31c30a48fbe150c5" },
1113 "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
14+ "lspkind.nvim": { "branch": "master", "commit": "d79a1c3299ad0ef94e255d045bed9fa26025dab6" },
1215 "mason.nvim": { "branch": "main", "commit": "7dc4facca9702f95353d5a1f87daf23d78e31c2a" },
1316 "mini.icons": { "branch": "main", "commit": "f9a177c11daa7829389b7b6eaaec8b8a5c47052d" },
1417 "neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" },
@@ -16,7 +19,7 @@
1619 "nvim-autopairs": { "branch": "master", "commit": "23320e75953ac82e559c610bec5a90d9c6dfa743" },
1720 "nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
1821 "nvim-compe": { "branch": "master", "commit": "d186d739c54823e0b010feb205c6f97792322c08" },
19- "nvim-lspconfig": { "branch": "master", "commit": "bc09aa236d7d2af66f56a5a35d0577588eca7800" },
22+ "nvim-lspconfig": { "branch": "master", "commit": "d89f4891f0720cd2598e4bdd60010d8784b2ac8a" },
2023 "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
2124 "nvim-web-devicons": { "branch": "master", "commit": "6e51ca170563330e063720449c21f43e27ca0bc1" },
2225 "oil-git-status.nvim": { "branch": "main", "commit": "4b5cf53842c17a09420919e655a6a559da3112d7" },
@@ -32,6 +35,5 @@
3235 "vim-airline-themes": { "branch": "master", "commit": "0e976956eb674db8a6f72fae4dda6d1277433660" },
3336 "vim-devicons": { "branch": "master", "commit": "71f239af28b7214eebb60d4ea5bd040291fb7e33" },
3437 "vim-fugitive": { "branch": "master", "commit": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4" },
35- "vim-vsnip": { "branch": "master", "commit": "0a4b8419e44f47c57eec4c90df17567ad4b1b36e" },
3638 "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }
3739 }
+3-0nvim/lua/autocmds.lua
@@ -8,6 +8,9 @@ vim.api.nvim_create_autocmd({ "FocusLost", "WinLeave" }, {
88 callback = autosave.save,
99 })
1010
11+local qfiletypes = {
12+ [""] = true,
13+}
1114 vim.api.nvim_create_autocmd("BufEnter", {
1215 callback = function(args)
1316 if vim.bo[args.buf].readonly then
+67-0nvim/lua/configs/cmp/vscode.lua
@@ -0,0 +1,67 @@
1+local M = {}
2+
3+M.set_colors = function()
4+ -- gray
5+ vim.api.nvim_set_hl(0, "CmpItemAbbrDeprecated", { bg = "NONE", strikethrough = true, fg = "#808080" })
6+ -- blue
7+ vim.api.nvim_set_hl(0, "CmpItemAbbrMatch", { bg = "NONE", fg = "#569CD6" })
8+ vim.api.nvim_set_hl(0, "CmpItemAbbrMatchFuzzy", { link = "CmpIntemAbbrMatch" })
9+ -- light blue
10+ vim.api.nvim_set_hl(0, "CmpItemKindVariable", { bg = "NONE", fg = "#9CDCFE" })
11+ vim.api.nvim_set_hl(0, "CmpItemKindInterface", { link = "CmpItemKindVariable" })
12+ vim.api.nvim_set_hl(0, "CmpItemKindText", { link = "CmpItemKindVariable" })
13+ -- pink
14+ vim.api.nvim_set_hl(0, "CmpItemKindFunction", { bg = "NONE", fg = "#C586C0" })
15+ vim.api.nvim_set_hl(0, "CmpItemKindMethod", { link = "CmpItemKindFunction" })
16+ -- front
17+ vim.api.nvim_set_hl(0, "CmpItemKindKeyword", { bg = "NONE", fg = "#D4D4D4" })
18+ vim.api.nvim_set_hl(0, "CmpItemKindProperty", { link = "CmpItemKindKeyword" })
19+ vim.api.nvim_set_hl(0, "CmpItemKindUnit", { link = "CmpItemKindKeyword" })
20+end
21+
22+M.icons = {
23+ Text = "",
24+ Method = "",
25+ Function = "",
26+ Constructor = "",
27+ Field = "",
28+ Variable = "",
29+ Class = "",
30+ Interface = "",
31+ Module = "",
32+ Property = "",
33+ Unit = "",
34+ Value = "",
35+ Enum = "",
36+ Keyword = "",
37+ Snippet = "",
38+ Color = "",
39+ File = "",
40+ Reference = "",
41+ Folder = "",
42+ EnumMember = "",
43+ Constant = "",
44+ Struct = "",
45+ Event = "",
46+ Operator = "",
47+ TypeParameter = "",
48+}
49+
50+---@type cmp.FormattingConfig
51+M.formatting = {
52+ format = function(entry, vim_item)
53+ local icon = M.icons[vim_item.kind] or ""
54+ local src = ({
55+ buffer = "",
56+ nvim_lsp = "󰙴",
57+ luasnip = "",
58+ nvim_lua = "",
59+ latex_symbols = "",
60+ })[entry.source.name] or ""
61+ local text = string.upper(vim_item.kind)
62+ vim_item.kind = string.format("%s %-8s %s", icon, text, src)
63+ return vim_item
64+ end,
65+}
66+
67+return M
+1-1nvim/lua/ftconfig/python.lua
@@ -1,5 +1,5 @@
11 vim.lsp.config("pyright", {})
2-vim.lsp.setup("pyright")
2+vim.lsp.enable("pyright")
33
44 ---@type FTSpec
55 return {
+1-1nvim/lua/ftconfig/rust.lua
@@ -4,7 +4,7 @@ vim.lsp.enable("rust_analyzer")
44 ---@type FTSpec
55 return {
66 conform = {
7- use = { "rust-analyzer" },
7+ use = { "rustfmt" },
88 -- formatters = {
99 -- cargo_fix = {
1010 -- command = "cargo",
+2-0nvim/lua/keymaps.lua
@@ -28,6 +28,7 @@ vim.keymap.set("n", "<leader>ba", ":Alpha | BufUtils focus<cr>", { desc = "Alpha
2828
2929 -- code bindings
3030 vim.keymap.set("n", "<leader>c", "", { desc = "Code" })
31+vim.keymap.set("n", "<leader>cc", ":FT<cr>", { desc = "Config" })
3132 vim.keymap.set("n", "<leader>cd", require("plugins.lspconfig").open_float, { desc = "Open Diagnostic" })
3233
3334 -- executable bindings
@@ -45,6 +46,7 @@ vim.keymap.set("n", "<leader>te", telescope.extensions.emoji.emoji, { desc = "Em
4546 vim.keymap.set("n", "<leader>ta", builtin.autocommands, { desc = "Autocommands" })
4647 vim.keymap.set("n", "<leader>to", ":Telescope oil<cr>", { desc = "Oil" })
4748 vim.keymap.set("n", "<leader>tn", ":Telescope nerdy<cr>", { desc = "Nerd Fonts" })
49+vim.keymap.set("n", "<leader>tc", ":Telescope ftconfig<cr>", { desc = "Filetype Config" })
4850
4951 -- control bindings
5052 vim.keymap.set({ "i", "n" }, "<C-h>", "<C-w>h", { desc = "Window Left" })
+56-0nvim/lua/plugins/blink.lua
@@ -0,0 +1,56 @@
1+return {
2+ {
3+ "saghen/blink.cmp",
4+ enabled = false,
5+ -- optional: provides snippets for the snippet source
6+ dependencies = { "rafamadriz/friendly-snippets" },
7+
8+ -- use a release tag to download pre-built binaries
9+ version = "1.*",
10+ -- AND/OR build from source, requires nightly: https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust
11+ build = "cargo build --release",
12+ -- If you use nix, you can build from source using latest nightly rust with:
13+ -- build = 'nix run .#build-plugin',
14+
15+ ---@module 'blink.cmp'
16+ ---@type blink.cmp.Config
17+ opts = {
18+ -- 'default' (recommended) for mappings similar to built-in completions (C-y to accept)
19+ -- 'super-tab' for mappings similar to vscode (tab to accept)
20+ -- 'enter' for enter to accept
21+ -- 'none' for no mappings
22+ --
23+ -- All presets have the following mappings:
24+ -- C-space: Open menu or open docs if already open
25+ -- C-n/C-p or Up/Down: Select next/previous item
26+ -- C-e: Hide menu
27+ -- C-k: Toggle signature help (if signature.enabled = true)
28+ --
29+ -- See :h blink-cmp-config-keymap for defining your own keymap
30+ keymap = { preset = "enter" },
31+
32+ appearance = {
33+ -- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
34+ -- Adjusts spacing to ensure icons are aligned
35+ nerd_font_variant = "mono",
36+ },
37+
38+ -- (Default) Only show the documentation popup when manually triggered
39+ completion = { documentation = { auto_show = false } },
40+
41+ -- Default list of enabled providers defined so that you can extend it
42+ -- elsewhere in your config, without redefining it, due to `opts_extend`
43+ sources = {
44+ default = { "lsp", "path", "snippets", "buffer" },
45+ },
46+
47+ -- (Default) Rust fuzzy matcher for typo resistance and significantly better performance
48+ -- You may use a lua implementation instead by using `implementation = "lua"` or fallback to the lua implementation,
49+ -- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"`
50+ --
51+ -- See the fuzzy documentation for more information
52+ -- fuzzy = { implementation = "prefer_rust_with_warning" },
53+ },
54+ opts_extend = { "sources.default" },
55+ },
56+}
+24-4nvim/lua/plugins/nvim-cmp.lua
@@ -1,6 +1,7 @@
11 ---@type LazySpec
22 return {
33 "hrsh7th/nvim-cmp",
4+ enabled = true,
45 dependencies = {
56 "neovim/nvim-lspconfig",
67 "hrsh7th/nvim-compe",
@@ -8,18 +9,37 @@ return {
89 "hrsh7th/cmp-buffer",
910 "hrsh7th/cmp-path",
1011 "hrsh7th/cmp-cmdline",
11- "hrsh7th/cmp-vsnip",
12- "hrsh7th/vim-vsnip",
12+ "L3MON4D3/LuaSnip",
13+ "rafamadriz/friendly-snippets",
14+ "onsails/lspkind.nvim",
15+ -- "hrsh7th/cmp-vsnip",
16+ -- "hrsh7th/vim-vsnip",
1317 },
1418 config = function()
1519 local cmp = require("cmp")
20+ local vscode = require("configs.cmp.vscode")
21+ vscode.set_colors()
1622
1723 cmp.setup.cmdline("/", {
1824 mapping = cmp.mapping.preset.cmdline(),
1925 sources = { { name = "buffer" } },
2026 })
27+ cmp.setup.cmdline(":", {
28+ mapping = cmp.mapping.preset.cmdline(),
29+ sources = cmp.config.sources({
30+ { name = "path" },
31+ }, {
32+ {
33+ name = "cmdline",
34+ option = {
35+ ignore_cmds = { "Man", "!" },
36+ },
37+ },
38+ }),
39+ })
2140
2241 cmp.setup({
42+ formatting = vscode.formatting,
2343 window = {
2444 -- completion = cmp.config.window.bordered(),
2545 -- documentation = cmp.config.window.bordered(),
@@ -34,8 +54,8 @@ return {
3454 sources = cmp.config.sources({
3555 { name = "path" },
3656 { name = "nvim_lsp" },
37- { name = "vsnip" }, -- For vsnip users.
38- -- { name = 'luasnip' }, -- For luasnip users.
57+ -- { name = "vsnip" }, -- For vsnip users.
58+ { name = "luasnip" }, -- For luasnip users.
3959 -- { name = 'ultisnips' }, -- For ultisnips users.
4060 -- { name = 'snippy' }, -- For snippy users.
4161 }, {
+1-0nvim/lua/setup.lua
@@ -31,6 +31,7 @@ require("lazy").setup({
3131 spec = plugins,
3232 })
3333
34+vim.opt.swapfile = false
3435 require("clipboard")
3536 require("autocmds")
3637 require("keymaps")
+1-1nvim/sample_files/rust_sample/target/.rustc_info.json
@@ -1 +1 @@
1-{"rustc_fingerprint":10790545351301117111,"outputs":{"17747080675513052775":{"success":true,"status":"","code":0,"stdout":"rustc 1.87.0 (17067e9ac 2025-05-09)\nbinary: rustc\ncommit-hash: 17067e9ac6d7ecb70e50f92c1944e545188d2359\ncommit-date: 2025-05-09\nhost: x86_64-unknown-linux-gnu\nrelease: 1.87.0\nLLVM version: 20.1.1\n","stderr":""},"7971740275564407648":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.so\nlib___.so\nlib___.a\nlib___.so\n/home/huncho/.rustup/toolchains/stable-x86_64-unknown-linux-gnu\noff\npacked\nunpacked\n___\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_abi=\"\"\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"gnu\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"unknown\"\nunix\n","stderr":""}},"successes":{}}
1+{"rustc_fingerprint":10790545351301117111,"outputs":{"7971740275564407648":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.so\nlib___.so\nlib___.a\nlib___.so\n/home/huncho/.rustup/toolchains/stable-x86_64-unknown-linux-gnu\noff\npacked\nunpacked\n___\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_abi=\"\"\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"gnu\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"unknown\"\nunix\n","stderr":""},"17747080675513052775":{"success":true,"status":"","code":0,"stdout":"rustc 1.87.0 (17067e9ac 2025-05-09)\nbinary: rustc\ncommit-hash: 17067e9ac6d7ecb70e50f92c1944e545188d2359\ncommit-date: 2025-05-09\nhost: x86_64-unknown-linux-gnu\nrelease: 1.87.0\nLLVM version: 20.1.1\n","stderr":""}},"successes":{}}
+4-1nvim/sample_files/sample.py
@@ -1,6 +1,9 @@
1+import os
2+
3+
14 def hello(name: str):
25 """says hello to the name"""
3- print(f"Hello {name}")
6+ print(f"Hello {name}", os.curdir)
47
58
69 hello("Huncho from")