From 4519c8bf8955b4e5a02bd2f3db19b2bed6f66713 Mon Sep 17 00:00:00 2001 From: Nami Lauckner Date: Tue, 17 Feb 2026 20:56:53 +0100 Subject: [PATCH] config --- .gitignore | 2 + after/plugin/alpha.lua | 75 +++++++++++++++ after/plugin/colors.lua | 8 ++ after/plugin/comment.lua | 17 ++++ after/plugin/flutter.lua | 103 ++++++++++++++++++++ after/plugin/fugitive.lua | 1 + after/plugin/harpoon.lua | 15 +++ after/plugin/llm.lua | 44 +++++++++ after/plugin/lsp.lua | 74 +++++++++++++++ after/plugin/minialign.lua | 1 + after/plugin/netrw.lua | 43 +++++++++ after/plugin/presense.lua | 22 +++++ after/plugin/telescope.lua | 8 ++ after/plugin/treesitter.lua | 37 ++++++++ after/plugin/undotree.lua | 1 + init.lua | 12 +++ lazy-lock.json | 25 +++++ logos.txt | 12 +++ lua/nami/init.lua | 3 + lua/nami/lazy.lua | 110 ++++++++++++++++++++++ lua/nami/remap.lua | 53 +++++++++++ lua/nami/set.lua | 48 ++++++++++ lua/nami/utils/headers.lua | 181 ++++++++++++++++++++++++++++++++++++ 23 files changed, 895 insertions(+) create mode 100644 .gitignore create mode 100644 after/plugin/alpha.lua create mode 100644 after/plugin/colors.lua create mode 100644 after/plugin/comment.lua create mode 100644 after/plugin/flutter.lua create mode 100644 after/plugin/fugitive.lua create mode 100644 after/plugin/harpoon.lua create mode 100644 after/plugin/llm.lua create mode 100644 after/plugin/lsp.lua create mode 100644 after/plugin/minialign.lua create mode 100644 after/plugin/netrw.lua create mode 100644 after/plugin/presense.lua create mode 100644 after/plugin/telescope.lua create mode 100644 after/plugin/treesitter.lua create mode 100644 after/plugin/undotree.lua create mode 100644 init.lua create mode 100644 lazy-lock.json create mode 100644 logos.txt create mode 100644 lua/nami/init.lua create mode 100755 lua/nami/lazy.lua create mode 100644 lua/nami/remap.lua create mode 100644 lua/nami/set.lua create mode 100644 lua/nami/utils/headers.lua diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fe8d138 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/plugin +plugin/packer_compiled.lua diff --git a/after/plugin/alpha.lua b/after/plugin/alpha.lua new file mode 100644 index 0000000..b05fdf8 --- /dev/null +++ b/after/plugin/alpha.lua @@ -0,0 +1,75 @@ +local alpha = require("alpha") +local dashboard = require("alpha.themes.dashboard") +-- local icons = require("user.utils").icons +-- local utils = require("user.utils") +local datetime = os.date(" %H:%M. ") +local num_plugins_loaded = require("lazy").stats().loaded + +dashboard.section.header.val = require("nami.utils.headers") + +dashboard.section.buttons.val = { + dashboard.button("i", " New file", "enewi"), + dashboard.button( + "o", + " Recent Files", + "Telescope oldfiles" + ), + dashboard.button( + "f", + " Find", + " pf" + ), + dashboard.button( + "e", + " Explorer", + "Explore" + ), + dashboard.button( + "c", + " Neovim config", + "e ~/.config/nvim | cd %:p:h" + ), + dashboard.button("l", " Lazy", "Lazy"), + dashboard.button("q", " Quit NVIM", ":qa"), +} + +local footer = { + type = "text", + val = { num_plugins_loaded .. " plugins loaded." }, + opts = { position = "center", hl = "Comment" }, +} + +-- local bottom_section = { +-- type = "text", +-- val = "Hi " +-- .. utils.get_user() +-- .. "," +-- .. " It's" +-- .. datetime +-- .. "How are you doing today?", +-- opts = { +-- position = "center", +-- }, +-- } + +local section = { + header = dashboard.section.header, + -- bottom_section = bottom_section, + buttons = dashboard.section.buttons, + footer = footer, +} + +local opts = { + layout = { + { type = "padding", val = 8 }, + section.header, + { type = "padding", val = 2 }, + section.buttons, + { type = "padding", val = 1 }, + -- section.bottom_section, + -- { type = "padding", val = 1 }, + section.footer, + }, +} + +alpha.setup(opts) diff --git a/after/plugin/colors.lua b/after/plugin/colors.lua new file mode 100644 index 0000000..b6b0f9a --- /dev/null +++ b/after/plugin/colors.lua @@ -0,0 +1,8 @@ +function ColorMyPencils(color) +color = color or "rose-pine" +vim.cmd.colorscheme(color) + +vim.api.nvim_set_hl(0,"Normal", { bg = "none" }) +vim.api.nvim_set_hl(0,"NormalFloat", { bg = "none" }) +end +ColorMyPencils(); diff --git a/after/plugin/comment.lua b/after/plugin/comment.lua new file mode 100644 index 0000000..f7dbdb2 --- /dev/null +++ b/after/plugin/comment.lua @@ -0,0 +1,17 @@ +require("Comment").setup() + +-- Normal Mode +-- +-- `gcc` - Toggles the current line using linewise comment +-- `gbc` - Toggles the current line using blockwise comment +-- `[count]gcc` - Toggles the number of line given as a prefix-count using linewise +-- `[count]gbc` - Toggles the number of line given as a prefix-count using blockwise +-- `gc[count]{motion}` - (Op-pending) Toggles the region using linewise comment +-- `gb[count]{motion}` - (Op-pending) Toggles the region using blockwise comment +-- `gco` - Insert comment to the next line and enters INSERT mode +-- `gcO` - Insert comment to the previous line and enters INSERT mode +-- `gcA` - Insert comment to end of the current line and enters INSERT mode +-- +-- Visual Mode +-- `gc` - Toggles the region using linewise comment +-- `gb` - Toggles the region using blockwise comment diff --git a/after/plugin/flutter.lua b/after/plugin/flutter.lua new file mode 100644 index 0000000..1b92abb --- /dev/null +++ b/after/plugin/flutter.lua @@ -0,0 +1,103 @@ +-- alternatively you can override the default configs +require("flutter-tools").setup { + ui = { + -- the border type to use for all floating windows, the same options/formats + -- used for ":h nvim_open_win" e.g. "single" | "shadow" | {} + border = "rounded", + -- This determines whether notifications are show with `vim.notify` or with the plugin's custom UI + -- please note that this option is eventually going to be deprecated and users will need to + -- depend on plugins like `nvim-notify` instead. + notification_style = 'native' -- | 'plugin' + }, + decorations = { + statusline = { + -- set to true to be able use the 'flutter_tools_decorations.app_version' in your statusline + -- this will show the current version of the flutter app from the pubspec.yaml file + app_version = false, + -- set to true to be able use the 'flutter_tools_decorations.device' in your statusline + -- this will show the currently running device if an application was started with a specific + -- device + device = false, + -- set to true to be able use the 'flutter_tools_decorations.project_config' in your statusline + -- this will show the currently selected project configuration + project_config = false, + } + }, + debugger = { -- integrate with nvim dap + install dart code debugger + enabled = false, + -- if empty dap will not stop on any exceptions, otherwise it will stop on those specified + -- see |:help dap.set_exception_breakpoints()| for more info + exception_breakpoints = {}, + -- Whether to call toString() on objects in debug views like hovers and the + -- variables list. + -- Invoking toString() has a performance cost and may introduce side-effects, + -- although users may expected this functionality. null is treated like false. + evaluate_to_string_in_debug_views = true, + -- You can use the `debugger.register_configurations` to register custom runner configuration (for example for different targets or flavor). Plugin automatically registers the default configuration, but you can override it or add new ones. + -- register_configurations = function(paths) + -- require("dap").configurations.dart = { + -- -- your custom configuration + -- } + -- end, + }, + -- flutter_path = "/opt/flutter", -- <-- this takes priority over the lookup + -- flutter_lookup_cmd = nil, -- example "dirname $(which flutter)" or "asdf where flutter" + root_patterns = { ".git", "pubspec.yaml" }, -- patterns to find the root of your flutter project + fvm = false, -- takes priority over path, uses /.fvm/flutter_sdk if enabled + default_run_args= nil, -- Default options for run command (i.e `{ flutter = "--no-version-check" }`). Configured separately for `dart run` and `flutter run`. + widget_guides = { + enabled = false, + }, + closing_tags = { + highlight = "ErrorMsg", -- highlight for the closing tag + prefix = ">", -- character to use for close tag e.g. > Widget + priority = 10, -- priority of virtual text in current line + -- consider to configure this when there is a possibility of multiple virtual text items in one line + -- see `priority` option in |:help nvim_buf_set_extmark| for more info + enabled = true -- set to false to disable + }, + dev_log = { + enabled = true, + filter = nil, -- optional callback to filter the log + -- takes a log_line as string argument; returns a boolean or nil; + -- the log_line is only added to the output if the function returns true + notify_errors = false, -- if there is an error whilst running then notify the user + open_cmd = "15split", -- command to use to open the log buffer + focus_on_open = true, -- focus on the newly opened log window + }, + dev_tools = { + autostart = false, -- autostart devtools server if not detected + auto_open_browser = false, -- Automatically opens devtools in the browser + }, + outline = { + open_cmd = "30vnew", -- command to use to open the outline buffer + auto_open = false -- if true this will open the outline automatically when it is first populated + }, + lsp = { + color = { -- show the derived colours for dart variables + enabled = false, -- whether or not to highlight color variables at all, only supported on flutter >= 2.10 + background = false, -- highlight the background + background_color = nil, -- required, when background is transparent (i.e. background_color = { r = 19, g = 17, b = 24},) + foreground = false, -- highlight the foreground + virtual_text = true, -- show the highlight using virtual text + virtual_text_str = "■", -- the virtual text character to highlight + }, + on_attach = my_custom_on_attach, + capabilities = my_custom_capabilities, -- e.g. lsp_status capabilities + --- OR you can specify a function to deactivate or change or control how the config is created + capabilities = function(config) + config.specificThingIDontWant = false + return config + end, + -- see the link below for details on each option: + -- https://github.com/dart-lang/sdk/blob/master/pkg/analysis_server/tool/lsp_spec/README.md#client-workspace-configuration + -- settings = { + -- showTodos = true, + -- completeFunctionCalls = true, + -- analysisExcludedFolders = {""}, + -- renameFilesWithClasses = "prompt", -- "always" + -- enableSnippets = true, + -- updateImportsOnRename = true, -- Whether to update imports and other directives when files are renamed. Required for `FlutterRename` command. + -- } + } +} diff --git a/after/plugin/fugitive.lua b/after/plugin/fugitive.lua new file mode 100644 index 0000000..80c9070 --- /dev/null +++ b/after/plugin/fugitive.lua @@ -0,0 +1 @@ +vim.keymap.set("n", "gs", vim.cmd.Git) diff --git a/after/plugin/harpoon.lua b/after/plugin/harpoon.lua new file mode 100644 index 0000000..8016bee --- /dev/null +++ b/after/plugin/harpoon.lua @@ -0,0 +1,15 @@ +local harpoon = require("harpoon") + +harpoon:setup() + +vim.keymap.set("n", "a", function() harpoon:list():add() end) +vim.keymap.set("n", "", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end) + +vim.keymap.set("n", "", function() harpoon:list():select(1) end) +vim.keymap.set("n", "", function() harpoon:list():select(2) end) +vim.keymap.set("n", "", function() harpoon:list():select(3) end) +vim.keymap.set("n", "", function() harpoon:list():select(4) end) + +-- Toggle previous & next buffers stored within Harpoon list +vim.keymap.set("n", "", function() harpoon:list():prev() end) +vim.keymap.set("n", "", function() harpoon:list():next() end) diff --git a/after/plugin/llm.lua b/after/plugin/llm.lua new file mode 100644 index 0000000..6d8f185 --- /dev/null +++ b/after/plugin/llm.lua @@ -0,0 +1,44 @@ +-- local llm = require('llm') +-- +-- llm.setup({ +-- api_token = nil, -- cf Install paragraph +-- model = "codellama:7b-code", -- the model ID, behavior depends on backend +-- backend = "ollama", -- backend ID, "huggingface" | "ollama" | "openai" | "tgi" +-- url = "", -- the http url of the backend +-- +-- tokens_to_clear = { "" }, -- tokens to remove from the model's output +-- -- 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 = 120, +-- temperature = 0.2, +-- top_p = 0.95, +-- rope_frequency_base = 1000000 +-- }, +-- }, +-- -- set this if the model supports fill in the middle +-- fim = { +-- enabled = true, +-- prefix = "
 ",
+--         middle = " ",
+--         suffix = " ",
+--
+--     },
+--     debounce_ms = 500,
+--     accept_keymap = "",
+--     dismiss_keymap = "",
+--     tls_skip_verify_insecure = false,
+--     -- llm-ls configuration, cf llm-ls section
+--     lsp = {
+--         bin_path = nil,
+--         host = nil,
+--         port = nil,
+--         cmd_env = nil, -- or { LLM_LOG_LEVEL = "DEBUG" } to set the log level of llm-ls
+--         version = "0.5.3",
+--     },
+--     tokenizer = nil,                   -- cf Tokenizer paragraph
+--     context_window = 4048,             -- max number of tokens for the context window
+--     enable_suggestions_on_startup = true,
+--     enable_suggestions_on_files = "*", -- pattern matching syntax to enable suggestions on specific files, either a string or a list of strings
+--     disable_url_path_completion = false, -- cf Backend
+-- })
diff --git a/after/plugin/lsp.lua b/after/plugin/lsp.lua
new file mode 100644
index 0000000..c8be042
--- /dev/null
+++ b/after/plugin/lsp.lua
@@ -0,0 +1,74 @@
+local lsp = require("lsp-zero")
+
+lsp.preset("recommended")
+
+require("mason").setup({})
+require("mason-lspconfig").setup({
+	ensure_installed = {
+        "ts_ls",
+		"eslint",
+		"lua_ls",
+		"rust_analyzer",
+        "ast_grep"
+	},
+	handlers = {
+		function(server_name)
+			require("lspconfig")[server_name].setup({})
+		end,
+	}
+})
+
+local cmp = require('cmp')
+
+cmp.setup({
+	window = {
+		completion = cmp.config.window.bordered(),
+		documentation = cmp.config.window.bordered(),
+	},
+	mapping = cmp.mapping.preset.insert({
+		[''] = cmp.mapping.select_prev_item(),
+		[''] = cmp.mapping.select_next_item(),
+		[''] = cmp.mapping.confirm({ select = true }),
+		[""] = cmp.mapping.complete(),
+	}),
+	snippet = {
+		expand = function(args)
+			require('luasnip').lsp_expand(args.body)
+		end,
+	},
+})
+
+lsp.extend_lspconfig()
+
+lsp.set_preferences({
+  sign_icons = { }
+})
+
+lsp.on_attach(function(client, bufnr)
+lsp.default_keymaps({buffer = bufnr})
+
+  local opts = {buffer = bufnr, remap = false}
+
+  vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts)
+  vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts)
+  vim.keymap.set("n", "vws", function() vim.lsp.buf.workspace_symbol() end, opts)
+  vim.keymap.set("n", "vd", function() vim.diagnostic.open_float() end, opts)
+  vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts)
+  vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts)
+  vim.keymap.set("n", "vca", function() vim.lsp.buf.code_action() end, opts)
+  vim.keymap.set("n", "vrn", function() vim.lsp.buf.rename() end, opts)
+  vim.keymap.set("i", "", function() vim.lsp.buf.signature_help() end, opts)
+end)
+
+lsp.setup()
+
+-- Function to restart all active LSP clients
+local function restart_lsp()
+  for _, client in pairs(vim.lsp.get_active_clients()) do
+    client.stop()
+  end
+  vim.cmd("edit") -- Reload the current buffer to reattach the LSP clients
+end
+
+-- Create a Neovim command to restart LSP
+vim.api.nvim_create_user_command('LspRestart', restart_lsp, {})
diff --git a/after/plugin/minialign.lua b/after/plugin/minialign.lua
new file mode 100644
index 0000000..b0e8640
--- /dev/null
+++ b/after/plugin/minialign.lua
@@ -0,0 +1 @@
+-- require("mini.align").setup()
diff --git a/after/plugin/netrw.lua b/after/plugin/netrw.lua
new file mode 100644
index 0000000..9cb317e
--- /dev/null
+++ b/after/plugin/netrw.lua
@@ -0,0 +1,43 @@
+-- local g = vim.g
+--
+-- local options_append = {
+-- 	netrw_keepdir = 0, --Keep the current directory and the browsing directory synced
+-- 	netrw_winsize = "17", -- 17% size
+-- 	netrw_localmkdir = "mkdir -p", -- change mkdir cmd
+-- 	netrw_localcopycmd = "cp -r", -- change copy command
+-- 	netrw_localrmdir = "rm -r", -- change delete command
+-- 	netrw_list_hide = [['\(^\|\s\s\)\zs\.\S\+']], -- don't show hidden
+-- 	--netrw_banner = 0, -- hide banner
+-- 	--netrw_liststyle = 3, -- how files are open
+-- 	--netrw_browse_split = 0, -- open new files in vertical split
+-- --	netrw_altv = 1,
+-- 	netrw_bufsettings = "noma nomod nu nobl nowrap ro", -- line number
+-- }
+--
+-- for k, v in pairs(options_append) do
+-- 	g[k] = v
+-- end
+--
+-- local bind = function(lhs, rhs)
+-- 	vim.keymap.set("n", lhs, rhs, { remap = true, buffer = true })
+-- end
+--
+-- -- Navigation
+-- bind("l", "") -- open file or dir
+-- bind(".", "gh") -- toggle dotfiles
+-- bind("H", "u") -- preview dir
+-- bind("h", "-^") -- go up
+-- bind("[f", ":Explore") -- close if open
+--
+-- -- Marks
+-- bind("", "mf") -- toggle mark
+-- bind("", "mF") -- unmark
+-- bind("", "mu") -- unmark all
+--
+-- -- Files
+-- bind("ff", ":!touch ") -- create file
+-- bind("fd", ":!mkdir -p ") -- create folder
+-- bind("fm", ":!mv ") -- move/rename
+-- bind("fc", ":!cp -r ") -- copy
+-- bind("D", ":!rm -r ") -- delete
+-- bind("f;", "mx") -- run command
diff --git a/after/plugin/presense.lua b/after/plugin/presense.lua
new file mode 100644
index 0000000..6659e2b
--- /dev/null
+++ b/after/plugin/presense.lua
@@ -0,0 +1,22 @@
+require("presence").setup({
+    auto_update         = true,                       -- Update activity based on autocmd events (if `false`, map or manually execute `:lua package.loaded.presence:update()`)
+    neovim_image_text   = "The One True Text Editor", -- Text displayed when hovered over the Neovim image
+    main_image          = "neovim",                   -- Main image display (either "neovim" or "file")
+   -- client_id           = "793271441293967371",       -- Use your own Discord application client id (not recommended)
+    log_level           =  nil,                        -- Log messages at or above this level (one of the following: "debug", "info", "warn", "error")
+    debounce_timeout    = 10,                         -- Number of seconds to debounce events (or calls to `:lua package.loaded.presence:update(, true)`)
+    enable_line_number  = true,                      -- Displays the current line number instead of the current project
+    blacklist           = {},                         -- A list of strings or Lua patterns that disable Rich Presence if the current file name, path, or workspace matches
+    buttons             = true,                       -- Configure Rich Presence button(s), either a boolean to enable/disable, a static table (`{{ label = "