├── .luarc.json ├── README.md ├── ftplugin ├── bash.lua ├── javascript.lua ├── typescript.lua ├── javascriptreact.lua ├── go.lua ├── typescriptreact.lua └── rust.lua ├── lua └── user │ ├── fidget.lua │ ├── lsp │ ├── languages │ │ ├── sh.lua │ │ ├── golang.lua │ │ ├── rust.lua │ │ └── js-ts.lua │ └── init.lua │ ├── whichkey.lua │ ├── copilot.lua │ ├── telescope.lua │ ├── keymaps.lua │ ├── inlay-hints.lua │ ├── functions.lua │ ├── treesitter.lua │ ├── neoai.lua │ ├── plugins.lua │ ├── dial.lua │ ├── chatgpt.lua │ ├── autocommands.lua │ ├── options.lua │ └── icons.lua ├── .stylua.toml ├── config.lua └── .gitignore /.luarc.json: -------------------------------------------------------------------------------- 1 | { 2 | "workspace.checkThirdParty": false 3 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Lunarvim config files 2 | 3 | https://www.lunarvim.org/ 4 | -------------------------------------------------------------------------------- /ftplugin/bash.lua: -------------------------------------------------------------------------------- 1 | vim.opt_local.shiftwidth = 4 2 | vim.opt_local.tabstop = 4 3 | vim.opt.cmdheight=1 -------------------------------------------------------------------------------- /lua/user/fidget.lua: -------------------------------------------------------------------------------- 1 | local status_ok, fidget = pcall(require, "fidget") 2 | if not status_ok then 3 | return 4 | end 5 | 6 | fidget.setup() 7 | -------------------------------------------------------------------------------- /.stylua.toml: -------------------------------------------------------------------------------- 1 | column_width = 120 2 | line_endings = "Unix" 3 | indent_type = "Spaces" 4 | indent_width = 2 5 | quote_style = "AutoPreferDouble" 6 | no_call_parentheses = true 7 | -------------------------------------------------------------------------------- /config.lua: -------------------------------------------------------------------------------- 1 | -- additional plugins 2 | reload "user.plugins" 3 | reload "user.options" 4 | reload "user.keymaps" 5 | reload "user.autocommands" 6 | reload "user.lsp" 7 | reload "user.treesitter" 8 | reload "user.copilot" 9 | reload "user.telescope" 10 | reload "user.fidget" 11 | reload "user.whichkey" 12 | reload "user.inlay-hints" 13 | reload "user.functions" 14 | reload "user.dial" 15 | 16 | -- reload "user.chatgpt" 17 | -- reload "user.neoai" 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Lua sources 2 | luac.out 3 | 4 | # luarocks build files 5 | *.src.rock 6 | *.zip 7 | *.tar.gz 8 | 9 | # Object files 10 | *.o 11 | *.os 12 | *.ko 13 | *.obj 14 | *.elf 15 | 16 | # Precompiled Headers 17 | *.gch 18 | *.pch 19 | 20 | # Libraries 21 | *.lib 22 | *.a 23 | *.la 24 | *.lo 25 | *.def 26 | *.exp 27 | 28 | # Shared objects (inc. Windows DLLs) 29 | *.dll 30 | *.so 31 | *.so.* 32 | *.dylib 33 | 34 | # Executables 35 | *.exe 36 | *.out 37 | *.app 38 | *.i*86 39 | *.x86_64 40 | *.hex 41 | 42 | 43 | java 44 | 45 | plugin/packer_compiled.lua 46 | lazy-lock.json 47 | 48 | .envrc -------------------------------------------------------------------------------- /lua/user/lsp/languages/sh.lua: -------------------------------------------------------------------------------- 1 | local formatters = require "lvim.lsp.null-ls.formatters" 2 | formatters.setup { 3 | { command = "shfmt", filetypes = { "sh", "zsh", "bash" } }, 4 | } 5 | 6 | vim.filetype.add { 7 | extension = { 8 | zsh = "zsh", 9 | }, 10 | } 11 | 12 | vim.list_extend(lvim.lsp.automatic_configuration.skipped_servers, { "bashls" }) 13 | 14 | local lsp_manager = require "lvim.lsp.manager" 15 | lsp_manager.setup("bashls", { 16 | filetypes = { "sh", "zsh" }, 17 | on_init = require("lvim.lsp").common_on_init, 18 | capabilities = require("lvim.lsp").common_capabilities(), 19 | }) 20 | -------------------------------------------------------------------------------- /lua/user/lsp/init.lua: -------------------------------------------------------------------------------- 1 | reload "user.lsp.languages.rust" 2 | reload "user.lsp.languages.golang" 3 | reload "user.lsp.languages.sh" 4 | reload "user.lsp.languages.js-ts" 5 | 6 | vim.list_extend(lvim.lsp.automatic_configuration.skipped_servers, { "rust_analyzer", "gopls", "bashls", "tsserver" }) 7 | 8 | local formatters = require "lvim.lsp.null-ls.formatters" 9 | formatters.setup { 10 | { command = "stylua", filetypes = { "lua" } }, 11 | { command = "goimports", filetypes = { "go" } }, 12 | { command = "gofumpt", filetypes = { "go" } }, 13 | { command = "stylua", filetypes = { "lua" } }, 14 | { command = "shfmt", filetypes = { "sh", "zsh" } }, 15 | } 16 | -------------------------------------------------------------------------------- /lua/user/whichkey.lua: -------------------------------------------------------------------------------- 1 | -- local existingWhichKeys = lvim.builtin.which_key.mappings["g"] 2 | 3 | -- -- append to existing which keys if they exist 4 | -- existingWhichKeys.G = { 5 | -- name = "Gist", 6 | -- a = { "Gist -b -a", "Create Anon" }, 7 | -- d = { "Gist -d", "Delete" }, 8 | -- f = { "Gist -f", "Fork" }, 9 | -- g = { "Gist -b", "Create" }, 10 | -- l = { "Gist -l", "List" }, 11 | -- p = { "Gist -b -p", "Create Private" }, 12 | -- } 13 | 14 | local existingLspWhichKeys = lvim.builtin.which_key.mappings["l"] 15 | table.insert(existingLspWhichKeys, { 16 | name = "Inlay Hints", 17 | h = { "lua require('lsp-inlayhints').toggle()", "Toggle Hints" }, 18 | }) 19 | -------------------------------------------------------------------------------- /ftplugin/javascript.lua: -------------------------------------------------------------------------------- 1 | local status_ok, which_key = pcall(require, "which-key") 2 | if not status_ok then 3 | return 4 | end 5 | 6 | local opts = { 7 | mode = "n", -- NORMAL mode 8 | prefix = "", 9 | buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings 10 | silent = true, -- use `silent` when creating keymaps 11 | noremap = true, -- use `noremap` when creating keymaps 12 | nowait = true, -- use `nowait` when creating keymaps 13 | } 14 | 15 | local mappings = { 16 | C = { 17 | name = "Javascript", 18 | i = { "TypescriptAddMissingImports", "AddMissingImports" }, 19 | o = { "TypescriptOrganizeImports", "OrganizeImports" }, 20 | u = { "TypescriptRemoveUnused", "RemoveUnused" }, 21 | r = { "TypescriptRenameFile", "RenameFile" }, 22 | f = { "TypescriptFixAll", "FixAll" }, 23 | g = { "TypescriptGoToSourceDefinition", "GoToSourceDefinition" }, 24 | }, 25 | } 26 | 27 | which_key.register(mappings, opts) 28 | -------------------------------------------------------------------------------- /ftplugin/typescript.lua: -------------------------------------------------------------------------------- 1 | local status_ok, which_key = pcall(require, "which-key") 2 | if not status_ok then 3 | return 4 | end 5 | 6 | local opts = { 7 | mode = "n", -- NORMAL mode 8 | prefix = "", 9 | buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings 10 | silent = true, -- use `silent` when creating keymaps 11 | noremap = true, -- use `noremap` when creating keymaps 12 | nowait = true, -- use `nowait` when creating keymaps 13 | } 14 | 15 | local mappings = { 16 | C = { 17 | name = "Typescript", 18 | i = { "TypescriptAddMissingImports", "AddMissingImports" }, 19 | o = { "TypescriptOrganizeImports", "OrganizeImports" }, 20 | u = { "TypescriptRemoveUnused", "RemoveUnused" }, 21 | r = { "TypescriptRenameFile", "RenameFile" }, 22 | f = { "TypescriptFixAll", "FixAll" }, 23 | g = { "TypescriptGoToSourceDefinition", "GoToSourceDefinition" }, 24 | }, 25 | } 26 | 27 | which_key.register(mappings, opts) 28 | 29 | 30 | -------------------------------------------------------------------------------- /ftplugin/javascriptreact.lua: -------------------------------------------------------------------------------- 1 | local status_ok, which_key = pcall(require, "which-key") 2 | if not status_ok then 3 | return 4 | end 5 | 6 | local opts = { 7 | mode = "n", -- NORMAL mode 8 | prefix = "", 9 | buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings 10 | silent = true, -- use `silent` when creating keymaps 11 | noremap = true, -- use `noremap` when creating keymaps 12 | nowait = true, -- use `nowait` when creating keymaps 13 | } 14 | 15 | local mappings = { 16 | C = { 17 | name = "Javascriptreact", 18 | i = { "TypescriptAddMissingImports", "AddMissingImports" }, 19 | o = { "TypescriptOrganizeImports", "OrganizeImports" }, 20 | u = { "TypescriptRemoveUnused", "RemoveUnused" }, 21 | r = { "TypescriptRenameFile", "RenameFile" }, 22 | f = { "TypescriptFixAll", "FixAll" }, 23 | g = { "TypescriptGoToSourceDefinition", "GoToSourceDefinition" }, 24 | }, 25 | } 26 | 27 | which_key.register(mappings, opts) 28 | 29 | -------------------------------------------------------------------------------- /ftplugin/go.lua: -------------------------------------------------------------------------------- 1 | local status_ok, which_key = pcall(require, "which-key") 2 | if not status_ok then 3 | return 4 | end 5 | 6 | local opts = { 7 | mode = "n", -- NORMAL mode 8 | prefix = "", 9 | buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings 10 | silent = true, -- use `silent` when creating keymaps 11 | noremap = true, -- use `noremap` when creating keymaps 12 | nowait = true, -- use `nowait` when creating keymaps 13 | } 14 | 15 | local mappings = { 16 | G = { 17 | name = "+Go", 18 | i = { "GoInstallDeps", "Install Go Dependencies" }, 19 | t = { "GoMod tidy", "Go Tidy" }, 20 | a = { "GoTestAdd", "Add Test" }, 21 | A = { "GoTestsAll", "Add All Tests" }, 22 | e = { "GoTestsExp", "Add Exported Tests" }, 23 | g = { "GoGenerate", "Go Generate" }, 24 | f = { "GoGenerate %", "Go Generate File" }, 25 | c = { "GoCmt", "Generate Comment" }, 26 | }, 27 | } 28 | 29 | which_key.register(mappings, opts) 30 | -------------------------------------------------------------------------------- /ftplugin/typescriptreact.lua: -------------------------------------------------------------------------------- 1 | local status_ok, which_key = pcall(require, "which-key") 2 | if not status_ok then 3 | return 4 | end 5 | 6 | local opts = { 7 | mode = "n", -- NORMAL mode 8 | prefix = "", 9 | buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings 10 | silent = true, -- use `silent` when creating keymaps 11 | noremap = true, -- use `noremap` when creating keymaps 12 | nowait = true, -- use `nowait` when creating keymaps 13 | } 14 | 15 | local mappings = { 16 | C = { 17 | name = "Typescriptreact", 18 | i = { "TypescriptAddMissingImports", "AddMissingImports" }, 19 | o = { "TypescriptOrganizeImports", "OrganizeImports" }, 20 | u = { "TypescriptRemoveUnused", "RemoveUnused" }, 21 | r = { "TypescriptRenameFile", "RenameFile" }, 22 | f = { "TypescriptFixAll", "FixAll" }, 23 | g = { "TypescriptGoToSourceDefinition", "GoToSourceDefinition" }, 24 | }, 25 | } 26 | 27 | which_key.register(mappings, opts) 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /lua/user/copilot.lua: -------------------------------------------------------------------------------- 1 | -- lvim.builtin.cmp.formatting.source_names["copilot"] = "(Copilot)" 2 | -- table.insert(lvim.builtin.cmp.sources, 1, { name = "copilot" }) 3 | 4 | 5 | local ok, copilot = pcall(require, "copilot") 6 | if not ok then 7 | return 8 | end 9 | 10 | copilot.setup { 11 | panel = { 12 | enabled = true, 13 | auto_refresh = true, 14 | keymap = { 15 | jump_next = "", 16 | jump_prev = "", 17 | accept = "", 18 | refresh = "r", 19 | open = "", 20 | }, 21 | layout = { 22 | position = "bottom", -- | top | left | right 23 | ratio = 0.4, 24 | }, 25 | }, 26 | suggestion = { 27 | enabled = true, 28 | auto_trigger = true, 29 | debounce = 75, 30 | keymap = { 31 | accept = "", 32 | accept_word = false, 33 | accept_line = false, 34 | next = "", 35 | prev = "", 36 | dismiss = "", 37 | }, 38 | }, 39 | } 40 | 41 | 42 | -- local opts = { noremap = true, silent = true } 43 | -- local keymap = vim.keymap.set 44 | -------------------------------------------------------------------------------- /lua/user/telescope.lua: -------------------------------------------------------------------------------- 1 | lvim.builtin.telescope.defaults.file_ignore_patterns = { 2 | ".git/", 3 | "target/", 4 | "docs/", 5 | "vendor/*", 6 | "%.lock", 7 | "__pycache__/*", 8 | "%.sqlite3", 9 | "%.ipynb", 10 | "node_modules/*", 11 | -- "%.jpg", 12 | -- "%.jpeg", 13 | -- "%.png", 14 | "%.svg", 15 | "%.otf", 16 | "%.ttf", 17 | "%.webp", 18 | ".dart_tool/", 19 | ".github/", 20 | ".gradle/", 21 | ".idea/", 22 | ".settings/", 23 | ".vscode/", 24 | "__pycache__/", 25 | "build/", 26 | "env/", 27 | "gradle/", 28 | "node_modules/", 29 | "%.pdb", 30 | "%.dll", 31 | "%.class", 32 | "%.exe", 33 | "%.cache", 34 | "%.ico", 35 | "%.pdf", 36 | "%.dylib", 37 | "%.jar", 38 | "%.docx", 39 | "%.met", 40 | "smalljre_*/*", 41 | ".vale/", 42 | "%.burp", 43 | "%.mp4", 44 | "%.mkv", 45 | "%.rar", 46 | "%.zip", 47 | "%.7z", 48 | "%.tar", 49 | "%.bz2", 50 | "%.epub", 51 | "%.flac", 52 | "%.tar.gz", 53 | } -------------------------------------------------------------------------------- /lua/user/keymaps.lua: -------------------------------------------------------------------------------- 1 | M = {} 2 | lvim.leader = "space" 3 | 4 | local opts = { noremap = true, silent = true } 5 | 6 | local keymap = vim.keymap.set 7 | keymap("n", "", "WhichKey \\", opts) 8 | 9 | lvim.keys.normal_mode[""] = ":w" 10 | lvim.keys.normal_mode[""] = ":BufferLineCycleNext" 11 | lvim.keys.normal_mode[""] = "zz" 12 | lvim.keys.normal_mode[""] = "zz" 13 | lvim.keys.visual_mode["J"] = ":m '>+1gv=gv" 14 | lvim.keys.visual_mode["K"] = ":m '<-2gv=gv" 15 | lvim.keys.normal_mode[""] = ":Telescope buffers" 16 | lvim.keys.normal_mode[""] = ":BufferLineCyclePrev" 17 | 18 | lvim.keys.normal_mode["t"] = "TroubleToggle" 19 | lvim.keys.normal_mode["o"] = "SymbolsOutline" 20 | 21 | -- Normal -- 22 | -- Better window navigation 23 | keymap("n", "", "h", opts) 24 | keymap("n", "", "j", opts) 25 | keymap("n", "", "k", opts) 26 | keymap("n", "", "l", opts) 27 | keymap("n", "", "", opts) 28 | 29 | -- Resize with arrows 30 | -- keymap("n", "", ":resize -2", opts) 31 | -- keymap("n", "", ":resize +2", opts) 32 | -- keymap("n", "", ":vertical resize -2", opts) 33 | -- keymap("n", "", ":vertical resize +2", opts) 34 | 35 | return M -------------------------------------------------------------------------------- /lua/user/inlay-hints.lua: -------------------------------------------------------------------------------- 1 | local status_ok, hints = pcall(require, "lsp-inlayhints") 2 | if not status_ok then 3 | return 4 | end 5 | 6 | local group = vim.api.nvim_create_augroup("LspAttach_inlayhints", {}) 7 | vim.api.nvim_create_autocmd("LspAttach", { 8 | group = "LspAttach_inlayhints", 9 | callback = function(args) 10 | if not (args.data and args.data.client_id) then 11 | return 12 | end 13 | 14 | local client = vim.lsp.get_client_by_id(args.data.client_id) 15 | require("lsp-inlayhints").on_attach(client, args.buf) 16 | end, 17 | }) 18 | 19 | hints.setup { 20 | inlay_hints = { 21 | parameter_hints = { 22 | show = false, 23 | -- prefix = "<- ", 24 | separator = ", ", 25 | }, 26 | type_hints = { 27 | -- type and other hints 28 | show = true, 29 | prefix = "", 30 | separator = ", ", 31 | remove_colon_end = false, 32 | remove_colon_start = false, 33 | }, 34 | -- separator between types and parameter hints. Note that type hints are 35 | -- shown before parameter 36 | labels_separator = " ", 37 | -- whether to align to the length of the longest line in the file 38 | max_len_align = false, 39 | -- padding from the left if max_len_align is true 40 | max_len_align_padding = 1, 41 | -- whether to align to the extreme right or not 42 | right_align = false, 43 | -- padding from the right if right_align is true 44 | right_align_padding = 7, 45 | -- highlight group 46 | highlight = "Comment", 47 | }, 48 | debug_mode = false, 49 | } 50 | 51 | -------------------------------------------------------------------------------- /lua/user/lsp/languages/golang.lua: -------------------------------------------------------------------------------- 1 | local formatters = require "lvim.lsp.null-ls.formatters" 2 | formatters.setup { 3 | { command = "goimports", filetypes = { "go" } }, 4 | { command = "gofumpt", filetypes = { "go" } }, 5 | } 6 | 7 | vim.list_extend(lvim.lsp.automatic_configuration.skipped_servers, { "gopls" }) 8 | 9 | local lsp_manager = require "lvim.lsp.manager" 10 | lsp_manager.setup("golangci_lint_ls", { 11 | on_init = require("lvim.lsp").common_on_init, 12 | capabilities = require("lvim.lsp").common_capabilities(), 13 | }) 14 | 15 | lsp_manager.setup("gopls", { 16 | on_attach = function(client, bufnr) 17 | require("lvim.lsp").common_on_attach(client, bufnr) 18 | local _, _ = pcall(vim.lsp.codelens.refresh) 19 | end, 20 | on_init = require("lvim.lsp").common_on_init, 21 | capabilities = require("lvim.lsp").common_capabilities(), 22 | settings = { 23 | gopls = { 24 | usePlaceholders = true, 25 | gofumpt = true, 26 | codelenses = { 27 | generate = false, 28 | gc_details = true, 29 | test = true, 30 | tidy = true, 31 | }, 32 | }, 33 | }, 34 | }) 35 | 36 | local status_ok, gopher = pcall(require, "gopher") 37 | if not status_ok then 38 | return 39 | end 40 | 41 | gopher.setup { 42 | commands = { 43 | go = "go", 44 | gomodifytags = "gomodifytags", 45 | gotests = "gotests", 46 | impl = "impl", 47 | iferr = "iferr", 48 | }, 49 | } 50 | 51 | lvim.format_on_save = { 52 | pattern = { "*.go" }, 53 | } 54 | -------------------------------------------------------------------------------- /lua/user/functions.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | function M.remove_augroup(name) 4 | if vim.fn.exists("#" .. name) == 1 then 5 | vim.cmd("au! " .. name) 6 | end 7 | end 8 | 9 | -- get length of current word 10 | function M.get_word_length() 11 | local word = vim.fn.expand "" 12 | return #word 13 | end 14 | 15 | function M.toggle_option(option) 16 | local value = not vim.api.nvim_get_option_value(option, {}) 17 | vim.opt[option] = value 18 | vim.notify(option .. " set to " .. tostring(value)) 19 | end 20 | 21 | function M.toggle_tabline() 22 | local value = vim.api.nvim_get_option_value("showtabline", {}) 23 | 24 | if value == 2 then 25 | value = 0 26 | else 27 | value = 2 28 | end 29 | 30 | vim.opt.showtabline = value 31 | 32 | vim.notify("showtabline" .. " set to " .. tostring(value)) 33 | end 34 | 35 | local diagnostics_active = true 36 | function M.toggle_diagnostics() 37 | diagnostics_active = not diagnostics_active 38 | if diagnostics_active then 39 | vim.diagnostic.show() 40 | else 41 | vim.diagnostic.hide() 42 | end 43 | end 44 | 45 | function M.isempty(s) 46 | return s == nil or s == "" 47 | end 48 | 49 | function M.get_buf_option(opt) 50 | local status_ok, buf_option = pcall(vim.api.nvim_buf_get_option, 0, opt) 51 | if not status_ok then 52 | return nil 53 | else 54 | return buf_option 55 | end 56 | end 57 | 58 | function M.smart_quit() 59 | local bufnr = vim.api.nvim_get_current_buf() 60 | local modified = vim.api.nvim_buf_get_option(bufnr, "modified") 61 | if modified then 62 | vim.ui.input({ 63 | prompt = "You have unsaved changes. Quit anyway? (y/n) ", 64 | }, function(input) 65 | if input == "y" then 66 | vim.cmd "q!" 67 | end 68 | end) 69 | else 70 | vim.cmd "q!" 71 | end 72 | end 73 | 74 | return M 75 | -------------------------------------------------------------------------------- /lua/user/treesitter.lua: -------------------------------------------------------------------------------- 1 | lvim.builtin.treesitter.ensure_installed = { 2 | "bash", 3 | "c", 4 | "javascript", 5 | "json", 6 | "lua", 7 | "python", 8 | "typescript", 9 | "tsx", 10 | "css", 11 | "rust", 12 | "yaml", 13 | "php", 14 | "go", 15 | "gomod", 16 | } 17 | 18 | lvim.builtin.treesitter.ignore_install = { "haskell", "markdown" } 19 | lvim.builtin.treesitter.highlight.enable = true 20 | lvim.builtin.treesitter.autotag.enable = true 21 | lvim.builtin.treesitter.auto_install = true 22 | 23 | lvim.builtin.treesitter.textobjects = { 24 | select = { 25 | enable = true, 26 | -- Automatically jump forward to textobj, similar to targets.vim 27 | lookahead = true, 28 | keymaps = { 29 | -- You can use the capture groups defined in textobjects.scm 30 | ["af"] = "@function.outer", -- select the outer function 31 | ["if"] = "@function.inner", -- select the inner function 32 | ["at"] = "@class.outer", -- select the outer class 33 | ["it"] = "@class.inner", -- select the inner class 34 | ["ac"] = "@call.outer", -- select the outer call 35 | ["ic"] = "@call.inner", -- select the inner call 36 | ["aa"] = "@parameter.outer", -- select the outer parameter 37 | ["ia"] = "@parameter.inner", -- select the inner parameter 38 | ["al"] = "@loop.outer", 39 | ["il"] = "@loop.inner", 40 | ["ai"] = "@conditional.outer", 41 | ["ii"] = "@conditional.inner", 42 | ["a/"] = "@comment.outer", 43 | ["i/"] = "@comment.inner", 44 | ["ab"] = "@block.outer", 45 | ["ib"] = "@block.inner", 46 | ["as"] = "@statement.outer", 47 | ["is"] = "@scopename.inner", 48 | ["aA"] = "@attribute.outer", 49 | ["iA"] = "@attribute.inner", 50 | ["aF"] = "@frame.outer", 51 | ["iF"] = "@frame.inner", 52 | }, 53 | }, 54 | } 55 | 56 | -------------------------------------------------------------------------------- /lua/user/neoai.lua: -------------------------------------------------------------------------------- 1 | require("neoai").setup { 2 | -- Below are the default options, feel free to override what you would like changed 3 | ui = { 4 | output_popup_text = "NeoAI", 5 | input_popup_text = "Prompt", 6 | width = 30, -- As percentage eg. 30% 7 | output_popup_height = 80, -- As percentage eg. 80% 8 | }, 9 | models = { 10 | { 11 | name = "openai", 12 | model = "gpt-3.5-turbo", 13 | }, 14 | }, 15 | register_output = { 16 | ["g"] = function(output) 17 | return output 18 | end, 19 | ["c"] = require("neoai.utils").extract_code_snippets, 20 | }, 21 | inject = { 22 | cutoff_width = 75, 23 | }, 24 | prompts = { 25 | context_prompt = function(context) 26 | return "Hey, I'd like to provide some context for future " 27 | .. "messages. Here is the code/text that I want to refer " 28 | .. "to in our upcoming conversations:\n\n" 29 | .. context 30 | end, 31 | }, 32 | open_api_key_env = "OPENAI_API_KEY", 33 | shortcuts = { 34 | { 35 | key = "as", 36 | use_context = true, 37 | prompt = [[ 38 | Please rewrite the text to make it more readable, clear, 39 | concise, and fix any grammatical, punctuation, or spelling 40 | errors 41 | ]], 42 | modes = { "v" }, 43 | strip_function = nil, 44 | }, 45 | { 46 | key = "ag", 47 | use_context = false, 48 | prompt = function() 49 | return [[ 50 | Using the following git diff generate a consise and 51 | clear git commit message, with a short title summary 52 | that is 75 characters or less: 53 | ]] .. vim.fn.system "git diff --cached" 54 | end, 55 | modes = { "n" }, 56 | strip_function = nil, 57 | }, 58 | }, 59 | } 60 | -------------------------------------------------------------------------------- /lua/user/plugins.lua: -------------------------------------------------------------------------------- 1 | -- Additional Plugins 2 | lvim.plugins = { 3 | "gpanders/editorconfig.nvim", 4 | "sainnhe/gruvbox-material", 5 | "folke/tokyonight.nvim", 6 | "fatih/vim-go", 7 | "olexsmir/gopher.nvim", 8 | "j-hui/fidget.nvim", 9 | { 10 | "norcalli/nvim-colorizer.lua", 11 | config = function() 12 | require("colorizer").setup() 13 | end, 14 | }, 15 | { 16 | "roobert/tailwindcss-colorizer-cmp.nvim", 17 | -- optionally, override the default options: 18 | config = function() 19 | require("tailwindcss-colorizer-cmp").setup { 20 | color_square_width = 2, 21 | } 22 | end, 23 | }, 24 | "lvimuser/lsp-inlayhints.nvim", 25 | { 26 | "nvim-treesitter/nvim-treesitter-textobjects", 27 | after = "nvim-treesitter", 28 | dependencies = "nvim-treesitter/nvim-treesitter", 29 | }, 30 | "jose-elias-alvarez/typescript.nvim", 31 | { 32 | "simrat39/symbols-outline.nvim", 33 | config = function() 34 | require("symbols-outline").setup() 35 | end, 36 | }, 37 | "mxsdev/nvim-dap-vscode-js", 38 | { 39 | "folke/trouble.nvim", 40 | dependencies = "nvim-tree/nvim-web-devicons", 41 | }, 42 | "simrat39/rust-tools.nvim", 43 | { 44 | "saecki/crates.nvim", 45 | version = "v0.3.0", 46 | dependencies = { "nvim-lua/plenary.nvim" }, 47 | config = function() 48 | require("crates").setup { 49 | null_ls = { 50 | enabled = true, 51 | name = "crates.nvim", 52 | }, 53 | popup = { 54 | border = "rounded", 55 | }, 56 | } 57 | end, 58 | }, 59 | { 60 | "zbirenbaum/copilot.lua", 61 | -- cmd = "Copilot", 62 | event = "InsertEnter", 63 | }, 64 | { 65 | "zbirenbaum/copilot-cmp", 66 | after = { "copilot.lua" }, 67 | config = function() 68 | require("copilot_cmp").setup() 69 | end, 70 | }, 71 | "monaqa/dial.nvim", 72 | -- "MunifTanjim/nui.nvim", 73 | -- "jackMort/ChatGPT.nvim", 74 | -- "Bryley/neoai.nvim" 75 | } 76 | -------------------------------------------------------------------------------- /lua/user/lsp/languages/rust.lua: -------------------------------------------------------------------------------- 1 | vim.list_extend(lvim.lsp.automatic_configuration.skipped_servers, { "rust_analyzer" }) 2 | 3 | pcall(function() 4 | require("rust-tools").setup { 5 | tools = { 6 | executor = require("rust-tools/executors").termopen, -- can be quickfix or termopen 7 | reload_workspace_from_cargo_toml = true, 8 | runnables = { 9 | use_telescope = true, 10 | }, 11 | inlay_hints = { 12 | auto = true, 13 | only_current_line = false, 14 | show_parameter_hints = false, 15 | parameter_hints_prefix = "<-", 16 | other_hints_prefix = "=>", 17 | max_len_align = false, 18 | max_len_align_padding = 1, 19 | right_align = false, 20 | right_align_padding = 7, 21 | highlight = "Comment", 22 | }, 23 | hover_actions = { 24 | border = "rounded", 25 | }, 26 | on_initialized = function() 27 | vim.api.nvim_create_autocmd({ "BufWritePost", "BufEnter", "CursorHold", "InsertLeave" }, { 28 | pattern = { "*.rs" }, 29 | callback = function() 30 | local _, _ = pcall(vim.lsp.codelens.refresh) 31 | end, 32 | }) 33 | end, 34 | }, 35 | server = { 36 | on_attach = function(client, bufnr) 37 | require("lvim.lsp").common_on_attach(client, bufnr) 38 | local rt = require "rust-tools" 39 | vim.keymap.set("n", "K", rt.hover_actions.hover_actions, { buffer = bufnr }) 40 | end, 41 | capabilities = require("lvim.lsp").common_capabilities(), 42 | settings = { 43 | ["rust-analyzer"] = { 44 | lens = { 45 | enable = true, 46 | }, 47 | check = { 48 | enable = true, 49 | command = "clippy", 50 | }, 51 | }, 52 | }, 53 | }, 54 | } 55 | end) 56 | -------------------------------------------------------------------------------- /lua/user/dial.lua: -------------------------------------------------------------------------------- 1 | local status_ok, dial_config = pcall(require, "dial.config") 2 | if not status_ok then 3 | return 4 | end 5 | 6 | local augend = require "dial.augend" 7 | dial_config.augends:register_group { 8 | default = { 9 | augend.integer.alias.decimal, 10 | augend.integer.alias.hex, 11 | augend.date.alias["%Y/%m/%d"], 12 | }, 13 | typescript = { 14 | augend.integer.alias.decimal, 15 | augend.integer.alias.hex, 16 | augend.constant.new { elements = { "let", "const" } }, 17 | }, 18 | visual = { 19 | augend.integer.alias.decimal, 20 | augend.integer.alias.hex, 21 | augend.date.alias["%Y/%m/%d"], 22 | augend.constant.alias.alpha, 23 | augend.constant.alias.Alpha, 24 | }, 25 | mygroup = { 26 | augend.constant.new { 27 | elements = { "and", "or" }, 28 | word = true, -- if false, "sand" is incremented into "sor", "doctor" into "doctand", etc. 29 | cyclic = true, -- "or" is incremented into "and". 30 | }, 31 | augend.constant.new { 32 | elements = { "True", "False" }, 33 | word = true, 34 | cyclic = true, 35 | }, 36 | augend.constant.new { 37 | elements = { "public", "private" }, 38 | word = true, 39 | cyclic = true, 40 | }, 41 | augend.constant.new { 42 | elements = { "sad", "sad" }, 43 | word = true, 44 | cyclic = true, 45 | }, 46 | augend.constant.new { 47 | elements = { "&&", "||" }, 48 | word = false, 49 | cyclic = true, 50 | }, 51 | augend.date.alias["%m/%d/%Y"], -- date (02/19/2022, etc.) 52 | augend.constant.alias.bool, -- boolean value (true <-> false) 53 | augend.integer.alias.decimal, 54 | augend.integer.alias.hex, 55 | augend.semver.alias.semver 56 | }, 57 | } 58 | 59 | local map = require "dial.map" 60 | 61 | -- change augends in VISUAL mode 62 | vim.api.nvim_set_keymap("n", "", map.inc_normal "mygroup", { noremap = true }) 63 | vim.api.nvim_set_keymap("n", "", map.dec_normal "mygroup", { noremap = true }) 64 | vim.api.nvim_set_keymap("v", "", map.inc_normal "visual", { noremap = true }) 65 | vim.api.nvim_set_keymap("v", "", map.dec_normal "visual", { noremap = true }) 66 | 67 | vim.cmd [[ 68 | " enable only for specific FileType 69 | autocmd FileType typescript,javascript lua vim.api.nvim_buf_set_keymap(0, "n", "", require("dial.map").inc_normal("typescript"), {noremap = true}) 70 | ]] 71 | -------------------------------------------------------------------------------- /ftplugin/rust.lua: -------------------------------------------------------------------------------- 1 | local status_ok, which_key = pcall(require, "which-key") 2 | if not status_ok then 3 | return 4 | end 5 | 6 | local opts = { 7 | mode = "n", -- NORMAL mode 8 | prefix = "", 9 | buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings 10 | silent = true, -- use `silent` when creating keymaps 11 | noremap = true, -- use `noremap` when creating keymaps 12 | nowait = true, -- use `nowait` when creating keymaps 13 | } 14 | 15 | local mappings = { 16 | r = { 17 | name = "+Rust", 18 | j = { "lua require('rust-tools').join_lines.join_lines()", "Join Lines" }, 19 | r = { "RustRunnables", "Runnables" }, 20 | t = { "lua _CARGO_TEST()", "Cargo Test" }, 21 | m = { "RustExpandMacro", "Expand Macro" }, 22 | c = { "RustOpenCargo", "Open Cargo" }, 23 | p = { "RustParentModule", "Parent Module" }, 24 | d = { "RustDebuggables", "Debuggables" }, 25 | v = { "RustViewCrateGraph", "View Crate Graph" }, 26 | R = { 27 | "lua require('rust-tools/workspace_refresh')._reload_workspace_from_cargo_toml()", 28 | "Reload Workspace", 29 | }, 30 | }, 31 | t = { 32 | name = "+Rust Crates", 33 | o = { "lua require('crates').show_popup()", "Show popup" }, 34 | r = { "lua require('crates').reload()", "Reload" }, 35 | v = { "lua require('crates').show_versions_popup()", "Show Versions" }, 36 | f = { "lua require('crates').show_features_popup()", "Show Features" }, 37 | d = { "lua require('crates').show_dependencies_popup()", "Show Dependencies Popup" }, 38 | u = { "lua require('crates').update_crate()", "Update Crate" }, 39 | a = { "lua require('crates').update_all_crates()", "Update All Crates" }, 40 | U = { "lua require('crates').upgrade_crate", "Upgrade Crate" }, 41 | A = { "lua require('crates').upgrade_all_crates(true)", "Upgrade All Crates" }, 42 | H = { "lua require('crates').open_homepage()", "Open Homepage" }, 43 | R = { "lua require('crates').open_repository()", "Open Repository" }, 44 | D = { "lua require('crates').open_documentation()", "Open Documentation" }, 45 | C = { "lua require('crates').open_crates_io()", "Open Crate.io" }, 46 | } 47 | } 48 | 49 | which_key.register(mappings, opts) 50 | -------------------------------------------------------------------------------- /lua/user/chatgpt.lua: -------------------------------------------------------------------------------- 1 | require("chatgpt").setup { 2 | -- welcome_message = WELCOME_MESSAGE, -- set to "" if you don't like the fancy godot robot 3 | -- loading_text = "loading", 4 | -- question_sign = "", -- you can use emoji if you want e.g. 🙂 5 | -- answer_sign = "ﮧ", -- 🤖 6 | -- max_line_length = 120, 7 | -- yank_register = "+", 8 | -- chat_layout = { 9 | -- relative = "editor", 10 | -- position = "50%", 11 | -- size = { 12 | -- height = "80%", 13 | -- width = "80%", 14 | -- }, 15 | -- }, 16 | -- settings_window = { 17 | -- border = { 18 | -- style = "rounded", 19 | -- text = { 20 | -- top = " Settings ", 21 | -- }, 22 | -- }, 23 | -- }, 24 | -- chat_window = { 25 | -- filetype = "chatgpt", 26 | -- border = { 27 | -- highlight = "FloatBorder", 28 | -- style = "rounded", 29 | -- text = { 30 | -- top = " ChatGPT ", 31 | -- }, 32 | -- }, 33 | -- }, 34 | -- chat_input = { 35 | -- prompt = "  ", 36 | -- border = { 37 | -- highlight = "FloatBorder", 38 | -- style = "rounded", 39 | -- text = { 40 | -- top_align = "center", 41 | -- top = " Prompt ", 42 | -- }, 43 | -- }, 44 | -- }, 45 | -- openai_params = { 46 | -- model = "text-davinci-003", 47 | -- frequency_penalty = 0, 48 | -- presence_penalty = 0, 49 | -- max_tokens = 300, 50 | -- temperature = 0, 51 | -- top_p = 1, 52 | -- n = 1, 53 | -- }, 54 | -- openai_edit_params = { 55 | -- model = "code-davinci-edit-001", 56 | -- temperature = 0, 57 | -- top_p = 1, 58 | -- n = 1, 59 | -- }, 60 | -- keymaps = { 61 | -- close = { "", "" }, 62 | -- yank_last = "", 63 | -- scroll_up = "", 64 | -- scroll_down = "", 65 | -- toggle_settings = "", 66 | -- new_session = "", 67 | -- cycle_windows = "", 68 | -- }, 69 | } 70 | 71 | local opts = { noremap = true, silent = true } 72 | 73 | local keymap = vim.keymap.set 74 | 75 | keymap("n", "", "ChatGPT", opts) 76 | 77 | -- to close chat window. 78 | -- scroll up chat window. 79 | -- scroll down chat window. 80 | -- to copy/yank last answer. 81 | -- Toggle settings window. 82 | -- Start new session. 83 | -- Cycle over windows. 84 | -- [Edit Window] use response as input. 85 | -------------------------------------------------------------------------------- /lua/user/lsp/languages/js-ts.lua: -------------------------------------------------------------------------------- 1 | -- Setup lsp. 2 | vim.list_extend(lvim.lsp.automatic_configuration.skipped_servers, { "tsserver" }) 3 | 4 | local capabilities = require("lvim.lsp").common_capabilities() 5 | 6 | require("typescript").setup { 7 | -- disable_commands = false, -- prevent the plugin from creating Vim commands 8 | debug = false, -- enable debug logging for commands 9 | go_to_source_definition = { 10 | fallback = true, -- fall back to standard LSP definition on failure 11 | }, 12 | server = { -- pass options to lspconfig's setup method 13 | on_attach = require("lvim.lsp").common_on_attach, 14 | on_init = require("lvim.lsp").common_on_init, 15 | capabilities = capabilities, 16 | settings = { 17 | typescript = { 18 | inlayHints = { 19 | includeInlayConstantValueHints = true, 20 | includeInlayEnumMemberValueHints = true, 21 | includeInlayFunctionLikeReturnTypeHints = true, 22 | includeInlayFunctionParameterTypeHints = false, 23 | includeInlayParameterNameHints = "all", -- 'none' | 'literals' | 'all'; 24 | includeInlayParameterNameHintsWhenArgumentMatchesName = true, 25 | includeInlayPropertyDeclarationTypeHints = true, 26 | includeInlayVariableTypeHints = true, 27 | }, 28 | }, 29 | }, 30 | }, 31 | } 32 | 33 | -- Set a formatter. 34 | local formatters = require "lvim.lsp.null-ls.formatters" 35 | formatters.setup { 36 | { command = "prettier", filetypes = { "javascript", "typescript", "javascriptreact", "typescriptreact", "css" } }, 37 | } 38 | 39 | local mason_path = vim.fn.glob(vim.fn.stdpath "data" .. "/mason/") 40 | require("dap-vscode-js").setup { 41 | -- node_path = "node", -- Path of node executable. Defaults to $NODE_PATH, and then "node" 42 | debugger_path = mason_path .. "packages/js-debug-adapter", -- Path to vscode-js-debug installation. 43 | -- debugger_cmd = { "js-debug-adapter" }, -- Command to use to launch the debug server. Takes precedence over `node_path` and `debugger_path`. 44 | adapters = { "pwa-node", "pwa-chrome", "pwa-msedge", "node-terminal", "pwa-extensionHost" }, -- which adapters to register in nvim-dap 45 | } 46 | 47 | for _, language in ipairs { "typescript", "javascript" } do 48 | require("dap").configurations[language] = { 49 | { 50 | type = "pwa-node", 51 | request = "launch", 52 | name = "Debug Jest Tests", 53 | -- trace = true, -- include debugger info 54 | runtimeExecutable = "node", 55 | runtimeArgs = { 56 | "./node_modules/jest/bin/jest.js", 57 | "--runInBand", 58 | }, 59 | rootPath = "${workspaceFolder}", 60 | cwd = "${workspaceFolder}", 61 | console = "integratedTerminal", 62 | internalConsoleOptions = "neverOpen", 63 | }, 64 | } 65 | end 66 | 67 | -- Set a linter. 68 | -- local linters = require("lvim.lsp.null-ls.linters") 69 | -- linters.setup({ 70 | -- { command = "eslint", filetypes = { "javascript", "typescript" } }, 71 | -- }) 72 | -------------------------------------------------------------------------------- /lua/user/autocommands.lua: -------------------------------------------------------------------------------- 1 | -- vim.api.nvim_create_autocmd({ "User" }, { 2 | -- pattern = { "AlphaReady" }, 3 | -- callback = function() 4 | -- vim.cmd [[ 5 | -- set showtabline=0 | autocmd BufUnload set showtabline=2 6 | -- ]] 7 | -- end, 8 | -- }) 9 | 10 | lvim.autocommands = { 11 | { 12 | "ColorScheme", 13 | { 14 | desc="Transparent NvimTree on unfocused", 15 | command = "hi link NvimTreeNormalNC NormalNC" 16 | } 17 | } 18 | } 19 | 20 | vim.api.nvim_create_autocmd({ "BufWinEnter" }, { 21 | callback = function() 22 | vim.cmd "set formatoptions-=cro" 23 | end, 24 | }) 25 | 26 | vim.api.nvim_create_autocmd({ "FileType" }, { 27 | pattern = { 28 | "Jaq", 29 | "qf", 30 | "help", 31 | "man", 32 | "lspinfo", 33 | "spectre_panel", 34 | "lir", 35 | "DressingSelect", 36 | "tsplayground", 37 | "Markdown", 38 | }, 39 | callback = function() 40 | vim.cmd [[ 41 | nnoremap q :close 42 | nnoremap :close 43 | set nobuflisted 44 | ]] 45 | end, 46 | }) 47 | 48 | vim.api.nvim_create_autocmd({ "FileType" }, { 49 | pattern = { "Jaq" }, 50 | callback = function() 51 | vim.cmd [[ 52 | nnoremap :close 53 | " nnoremap 54 | set nobuflisted 55 | ]] 56 | end, 57 | }) 58 | 59 | vim.api.nvim_create_autocmd({ "BufEnter" }, { 60 | pattern = { "" }, 61 | callback = function() 62 | local buf_ft = vim.bo.filetype 63 | if buf_ft == "" or buf_ft == nil then 64 | vim.cmd [[ 65 | nnoremap q :close 66 | " nnoremap j 67 | " nnoremap k 68 | set nobuflisted 69 | ]] 70 | end 71 | end, 72 | }) 73 | 74 | vim.api.nvim_create_autocmd({ "BufEnter" }, { 75 | pattern = { "" }, 76 | callback = function() 77 | local get_project_dir = function() 78 | local cwd = vim.fn.getcwd() 79 | local project_dir = vim.split(cwd, "/") 80 | local project_name = project_dir[#project_dir] 81 | return project_name 82 | end 83 | 84 | vim.opt.titlestring = get_project_dir() .. " - nvim" 85 | end, 86 | }) 87 | 88 | vim.api.nvim_create_autocmd({ "BufEnter" }, { 89 | pattern = { "term://*" }, 90 | callback = function() 91 | vim.cmd "startinsert!" 92 | vim.cmd "set cmdheight=1" 93 | end, 94 | }) 95 | 96 | vim.api.nvim_create_autocmd({ "FileType" }, { 97 | pattern = { "gitcommit", "markdown" }, 98 | callback = function() 99 | vim.opt_local.wrap = true 100 | vim.opt_local.spell = true 101 | end, 102 | }) 103 | 104 | vim.api.nvim_create_autocmd({ "FileType" }, { 105 | pattern = { "NeogitCommitMessage" }, 106 | callback = function() 107 | vim.opt_local.wrap = true 108 | vim.opt_local.spell = true 109 | vim.cmd "startinsert!" 110 | end, 111 | }) 112 | 113 | vim.api.nvim_create_autocmd({ "VimResized" }, { 114 | callback = function() 115 | vim.cmd "tabdo wincmd =" 116 | end, 117 | }) 118 | 119 | vim.api.nvim_create_autocmd({ "CmdWinEnter" }, { 120 | callback = function() 121 | vim.cmd "quit" 122 | end, 123 | }) 124 | 125 | vim.api.nvim_create_autocmd({ "BufWinEnter" }, { 126 | callback = function() 127 | vim.cmd "set formatoptions-=cro" 128 | end, 129 | }) 130 | 131 | vim.api.nvim_create_autocmd({ "TextYankPost" }, { 132 | callback = function() 133 | vim.highlight.on_yank { higroup = "Visual", timeout = 40 } 134 | end, 135 | }) 136 | 137 | vim.api.nvim_create_autocmd({ "VimEnter" }, { 138 | callback = function() 139 | vim.cmd "hi link illuminatedWord LspReferenceText" 140 | end, 141 | }) 142 | 143 | vim.api.nvim_create_autocmd({ "BufWinEnter" }, { 144 | pattern = { "*" }, 145 | callback = function() 146 | vim.cmd "checktime" 147 | end, 148 | }) 149 | 150 | vim.api.nvim_create_autocmd({ "CursorHold" }, { 151 | callback = function() 152 | local status_ok, luasnip = pcall(require, "luasnip") 153 | if not status_ok then 154 | return 155 | end 156 | if luasnip.expand_or_jumpable() then 157 | -- ask maintainer for option to make this silent 158 | -- luasnip.unlink_current() 159 | vim.cmd [[silent! lua require("luasnip").unlink_current()]] 160 | end 161 | end, 162 | }) 163 | 164 | -- add extension to go filetype (for gno files) 165 | vim.api.nvim_command [[autocmd BufNewFile,BufRead *.gno set filetype=go]] 166 | 167 | -------------------------------------------------------------------------------- /lua/user/options.lua: -------------------------------------------------------------------------------- 1 | -- lvim.colorscheme = "tokyonight-moon" 2 | lvim.colorscheme = "gruvbox-material" 3 | lvim.log.level = "warn" 4 | vim.o.background = "dark" 5 | vim.g.gruvbox_material_background = "hard" 6 | -- TODO simethg 7 | 8 | lvim.builtin.alpha.active = true 9 | lvim.reload_config_on_save = true 10 | lvim.builtin.illuminate.active = false 11 | -- lvim.builtin.bufferline.active = false 12 | -- lvim.builtin.alpha.mode = "dashboard" 13 | -- lvim.builtin.nvimtree.setup.view.side = "left" 14 | lvim.builtin.nvimtree.setup.renderer.icons.show.git = true 15 | lvim.builtin.breadcrumbs.active = true 16 | lvim.builtin.treesitter.highlight.enabled = true 17 | lvim.builtin.dap.active = true 18 | lvim.format_on_save.enabled = false 19 | lvim.builtin.lualine.sections.lualine_a = { "mode" } 20 | -- lvim.builtin.lualine.options.theme = "gruvbox-material" 21 | lvim.transparent_window = false 22 | lvim.builtin.terminal.active = true 23 | lvim.builtin.terminal.open_mapping = "" 24 | lvim.builtin.alpha.active = true 25 | 26 | lvim.builtin.breadcrumbs.active = true 27 | 28 | -- close nvimtree when opening a file 29 | lvim.builtin.nvimtree.setup.actions.open_file.quit_on_open = true 30 | 31 | lvim.builtin.cmp.formatting = { 32 | format = require("tailwindcss-colorizer-cmp").formatter 33 | } 34 | 35 | local options = { 36 | incsearch = true, -- make search act like search in modern browsers 37 | backup = false, -- creates a backup file 38 | clipboard = "unnamedplus", -- allows neovim to access the system clipboard 39 | cmdheight = 1, -- more space in the neovim command line for displaying messages 40 | completeopt = { "menuone", "noselect" }, -- mostly just for cmp 41 | conceallevel = 0, -- so that `` is visible in markdown files 42 | fileencoding = "utf-8", -- the encoding written to a file 43 | hlsearch = true, -- highlight all matches on previous search pattern 44 | ignorecase = true, -- ignore case in search patterns 45 | mouse = "a", -- allow the mouse to be used in neovim 46 | pumheight = 10, -- pop up menu height 47 | showmode = false, -- we don't need to see things like -- INSERT -- anymore 48 | showtabline = 0, -- always show tabs 49 | smartcase = true, -- smart case 50 | smartindent = true, -- make indenting smarter again 51 | splitbelow = true, -- force all horizontal splits to go below current window 52 | splitright = true, -- force all vertical splits to go to the right of current window 53 | swapfile = false, -- creates a swapfile 54 | termguicolors = true, -- set term gui colors (most terminals support this) 55 | timeoutlen = 1000, -- time to wait for a mapped sequence to complete (in milliseconds) 56 | undofile = true, -- enable persistent undo 57 | updatetime = 100, -- faster completion (4000ms default) 58 | writebackup = false, -- if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited 59 | expandtab = true, -- convert tabs to spaces 60 | shiftwidth = 2, -- the number of spaces inserted for each indentation 61 | tabstop = 2, -- insert 2 spaces for a tab 62 | cursorline = true, -- highlight the current line 63 | number = true, -- set numbered lines 64 | laststatus = 3, 65 | showcmd = false, 66 | ruler = false, 67 | relativenumber = true, -- set relative numbered lines 68 | numberwidth = 4, -- set number column width to 2 {default 4} 69 | signcolumn = "yes", -- always show the sign column, otherwise it would shift the text each time 70 | wrap = false, -- display lines as one long line 71 | scrolloff = 8, 72 | sidescrolloff = 8, 73 | guifont = "monospace:h17", -- the font used in graphical neovim applications 74 | title = true, 75 | } 76 | 77 | vim.opt.shortmess:append "c" 78 | 79 | for k, v in pairs(options) do 80 | vim.opt[k] = v 81 | end 82 | 83 | vim.cmd "set whichwrap+=<,>,[,],h,l" 84 | 85 | vim.filetype.add { 86 | extension = { 87 | conf = "dosini", 88 | }, 89 | } 90 | -------------------------------------------------------------------------------- /lua/user/icons.lua: -------------------------------------------------------------------------------- 1 | -- https://github.com/microsoft/vscode/blob/main/src/vs/base/common/codicons.ts 2 | -- go to the above and then enter u and the symbold should appear 3 | -- or go here and upload the font file: https://mathew-kurian.github.io/CharacterMap/ 4 | -- find more here: https://www.nerdfonts.com/cheat-sheet 5 | -- return { 6 | -- kind = { 7 | -- Text = " ", 8 | -- Method = " ", 9 | -- Function = " ", 10 | -- Constructor = " ", 11 | -- Field = " ", 12 | -- Variable = " ", 13 | -- Class = " ", 14 | -- Interface = " ", 15 | -- Module = " ", 16 | -- Property = " ", 17 | -- Unit = " ", 18 | -- Value = " ", 19 | -- Enum = " ", 20 | -- Keyword = " ", 21 | -- Snippet = " ", 22 | -- Color = " ", 23 | -- File = " ", 24 | -- Reference = " ", 25 | -- Folder = " ", 26 | -- EnumMember = " ", 27 | -- Constant = " ", 28 | -- Struct = " ", 29 | -- Event = " ", 30 | -- Operator = " ", 31 | -- TypeParameter = " ", 32 | -- Misc = " ", 33 | -- }, 34 | -- type = { 35 | -- Array = " ", 36 | -- Number = " ", 37 | -- String = " ", 38 | -- Boolean = " ", 39 | -- Object = " ", 40 | -- }, 41 | -- documents = { 42 | -- File = " ", 43 | -- Files = " ", 44 | -- Folder = " ", 45 | -- OpenFolder = " ", 46 | -- }, 47 | -- git = { 48 | -- Add = " ", 49 | -- Mod = " ", 50 | -- Remove = " ", 51 | -- Ignore = " ", 52 | -- Rename = " ", 53 | -- Diff = " ", 54 | -- Repo = " ", 55 | -- Octoface = " ", 56 | -- }, 57 | -- ui = { 58 | -- ArrowClosed = "", 59 | -- ArrowOpen = "", 60 | -- Lock = " ", 61 | -- Circle = " ", 62 | -- BigCircle = " ", 63 | -- BigUnfilledCircle = " ", 64 | -- Close = " ", 65 | -- NewFile = " ", 66 | -- Search = " ", 67 | -- Lightbulb = " ", 68 | -- Project = " ", 69 | -- Dashboard = " ", 70 | -- History = " ", 71 | -- Comment = " ", 72 | -- Bug = " ", 73 | -- Code = " ", 74 | -- Telescope = " ", 75 | -- Gear = " ", 76 | -- Package = " ", 77 | -- List = " ", 78 | -- SignIn = " ", 79 | -- SignOut = " ", 80 | -- NoteBook = " ", 81 | -- Check = " ", 82 | -- Fire = " ", 83 | -- Note = " ", 84 | -- BookMark = " ", 85 | -- Pencil = " ", 86 | -- ChevronRight = "", 87 | -- Table = " ", 88 | -- Calendar = " ", 89 | -- CloudDownload = " ", 90 | -- }, 91 | -- diagnostics = { 92 | -- Error = " ", 93 | -- Warning = " ", 94 | -- Information = " ", 95 | -- Question = " ", 96 | -- Hint = " ", 97 | -- }, 98 | -- misc = { 99 | -- Robot = " ", 100 | -- Squirrel = " ", 101 | -- Tag = " ", 102 | -- Watch = " ", 103 | -- Smiley = " ", 104 | -- Package = " ", 105 | -- CircuitBoard = " ", 106 | -- }, 107 | -- } 108 | -- end 109 | 110 | lvim.icons.kind = { 111 | Text = " ", 112 | Method = " ", 113 | Function = " ", 114 | Constructor = " ", 115 | Field = " ", 116 | Variable = " ", 117 | Class = " ", 118 | Interface = " ", 119 | Module = " ", 120 | Property = " ", 121 | Unit = " ", 122 | Value = " ", 123 | Enum = " ", 124 | Keyword = " ", 125 | Snippet = " ", 126 | Color = " ", 127 | File = " ", 128 | Reference = " ", 129 | Folder = " ", 130 | EnumMember = " ", 131 | Constant = " ", 132 | Struct = " ", 133 | Event = " ", 134 | Operator = " ", 135 | TypeParameter = " ", 136 | Misc = " ", 137 | Array = "", 138 | Boolean = "蘒", 139 | Key = "", 140 | Namespace = "", 141 | Null = "ﳠ", 142 | Number = "", 143 | Object = "", 144 | Package = "", 145 | String = "", 146 | } 147 | 148 | -- git = { 149 | -- LineAdded = "", 150 | -- LineModified = "", 151 | -- LineRemoved = "", 152 | -- FileDeleted = "", 153 | -- FileIgnored = "◌", 154 | -- FileRenamed = "➜", 155 | -- FileStaged = "S", 156 | -- FileUnmerged = "", 157 | -- FileUnstaged = "", 158 | -- FileUntracked = "U", 159 | -- Diff = "", 160 | -- Repo = "", 161 | -- Octoface = "", 162 | -- Branch = "", 163 | -- }, 164 | -- ui = { 165 | -- ArrowCircleDown = "", 166 | -- ArrowCircleLeft = "", 167 | -- ArrowCircleRight = "", 168 | -- ArrowCircleUp = "", 169 | -- BoldArrowDown = "", 170 | -- BoldArrowLeft = "", 171 | -- BoldArrowRight = "", 172 | -- BoldArrowUp = "", 173 | -- BoldClose = "", 174 | -- BoldDividerLeft = "", 175 | -- BoldDividerRight = "", 176 | -- BoldLineLeft = "▎", 177 | -- BookMark = "", 178 | -- BoxChecked = "", 179 | -- Bug = "", 180 | -- Stacks = " ", 181 | -- Scopes = "", 182 | -- Watches = "", 183 | -- DebugConsole = " ", 184 | -- Calendar = "", 185 | -- Check = "", 186 | -- ChevronRight = ">", 187 | -- ChevronShortDown = "", 188 | -- ChevronShortLeft = "", 189 | -- ChevronShortRight = "", 190 | -- ChevronShortUp = "", 191 | -- Circle = "", 192 | -- Close = "", 193 | -- CloudDownload = "", 194 | -- Code = "", 195 | -- Comment = "", 196 | -- Dashboard = "", 197 | -- DividerLeft = "", 198 | -- DividerRight = "", 199 | -- DoubleChevronRight = "»", 200 | -- Ellipsis = "…", 201 | -- EmptyFolder = "", 202 | -- EmptyFolderOpen = "", 203 | -- File = "", 204 | -- FileSymlink = "", 205 | -- Files = "", 206 | -- FindFile = "", 207 | -- FindText = "", 208 | -- Fire = "", 209 | -- Folder = "", 210 | -- FolderOpen = "", 211 | -- FolderSymlink = "", 212 | -- Forward = "", 213 | -- Gear = "", 214 | -- History = "", 215 | -- Lightbulb = "", 216 | -- LineLeft = "▏", 217 | -- LineMiddle = "│", 218 | -- List = "", 219 | -- Lock = "", 220 | -- NewFile = "", 221 | -- Note = "", 222 | -- Package = "", 223 | -- Pencil = "", 224 | -- Plus = "", 225 | -- Project = "", 226 | -- Search = "", 227 | -- SignIn = "", 228 | -- SignOut = "", 229 | -- Tab = "", 230 | -- Table = "", 231 | -- Target = "", 232 | -- Telescope = "", 233 | -- Text = "", 234 | -- Tree = "", 235 | -- Triangle = "契", 236 | -- TriangleShortArrowDown = "", 237 | -- TriangleShortArrowLeft = "", 238 | -- TriangleShortArrowRight = "", 239 | -- TriangleShortArrowUp = "", 240 | -- }, 241 | -- diagnostics = { 242 | -- BoldError = "", 243 | -- Error = "", 244 | -- BoldWarning = "", 245 | -- Warning = "", 246 | -- BoldInformation = "", 247 | -- Information = "", 248 | -- BoldQuestion = "", 249 | -- Question = "", 250 | -- BoldHint = "", 251 | -- Hint = "", 252 | -- Debug = "", 253 | -- Trace = "✎", 254 | -- }, 255 | -- misc = { 256 | -- Robot = "ﮧ", 257 | -- Squirrel = "", 258 | -- Tag = "", 259 | -- Watch = "", 260 | -- Smiley = "ﲃ", 261 | -- Package = "", 262 | -- CircuitBoard = "", 263 | -- }, 264 | -- } 265 | 266 | -- -- lvim.icons.diagnostics = { 267 | -- -- BoldError = " ", 268 | -- -- BoldWarning = " ", 269 | -- -- BoldInformation = " ", 270 | -- -- BoldHint = " ", 271 | -- -- Error = " ", 272 | -- -- Warning = " ", 273 | -- -- Information = " ", 274 | -- -- Hint = " ", 275 | -- -- Question = " ", 276 | -- -- } 277 | 278 | -- -- vim.g.use_nerd_icons = false 279 | -- -- if vim.fn.has("mac") == 1 or vim.g.use_nerd_icons then 280 | -- -- -- elseif vim.fn.has "mac" == 1 then 281 | -- -- return { 282 | -- -- kind = { 283 | -- -- Text = "", 284 | -- -- -- Method = "m", 285 | -- -- -- Function = "", 286 | -- -- -- Constructor = "", 287 | -- -- Method = "", 288 | -- -- Function = "", 289 | -- -- Constructor = "", 290 | -- -- Field = "", 291 | -- -- -- Variable = "", 292 | -- -- Variable = "", 293 | -- -- Class = "", 294 | -- -- Interface = "", 295 | -- -- -- Module = "", 296 | -- -- Module = "", 297 | -- -- Property = "", 298 | -- -- Unit = "", 299 | -- -- Value = "", 300 | -- -- Enum = "", 301 | -- -- -- Keyword = "", 302 | -- -- Keyword = "", 303 | -- -- -- Snippet = "", 304 | -- -- Snippet = "", 305 | -- -- Color = "", 306 | -- -- File = "", 307 | -- -- Reference = "", 308 | -- -- Folder = "", 309 | -- -- EnumMember = "", 310 | -- -- Constant = "", 311 | -- -- Struct = "", 312 | -- -- Event = "", 313 | -- -- Operator = "", 314 | -- -- TypeParameter = "", 315 | -- -- }, 316 | -- -- type = { 317 | -- -- Array = "", 318 | -- -- Number = "", 319 | -- -- String = "", 320 | -- -- Boolean = "蘒", 321 | -- -- Object = "", 322 | -- -- }, 323 | -- -- documents = { 324 | -- -- File = "", 325 | -- -- Files = "", 326 | -- -- Folder = "", 327 | -- -- OpenFolder = "", 328 | -- -- }, 329 | -- -- git = { 330 | -- -- Add = "", 331 | -- -- Mod = "", 332 | -- -- Remove = "", 333 | -- -- Ignore = "", 334 | -- -- Rename = "", 335 | -- -- Diff = "", 336 | -- -- Repo = "", 337 | -- -- Octoface = "", 338 | -- -- }, 339 | -- -- ui = { 340 | -- -- ArrowClosed = "", 341 | -- -- ArrowOpen = "", 342 | -- -- Lock = "", 343 | -- -- Circle = "", 344 | -- -- BigCircle = "", 345 | -- -- BigUnfilledCircle = "", 346 | -- -- Close = "", 347 | -- -- NewFile = "", 348 | -- -- Search = "", 349 | -- -- Lightbulb = "", 350 | -- -- Project = "", 351 | -- -- Dashboard = "", 352 | -- -- History = "", 353 | -- -- Comment = "", 354 | -- -- Bug = "", 355 | -- -- Code = "", 356 | -- -- Telescope = "", 357 | -- -- Gear = "", 358 | -- -- Package = "", 359 | -- -- List = "", 360 | -- -- SignIn = "", 361 | -- -- SignOut = "", 362 | -- -- Check = "", 363 | -- -- Fire = "", 364 | -- -- Note = "", 365 | -- -- BookMark = "", 366 | -- -- Pencil = "", 367 | -- -- -- ChevronRight = "", 368 | -- -- ChevronRight = ">", 369 | -- -- Table = "", 370 | -- -- Calendar = "", 371 | -- -- CloudDownload = "", 372 | -- -- }, 373 | -- -- diagnostics = { 374 | -- -- Error = "", 375 | -- -- Warning = "", 376 | -- -- Information = "", 377 | -- -- Question = "", 378 | -- -- Hint = "", 379 | -- -- }, 380 | -- -- misc = { 381 | -- -- Robot = "ﮧ", 382 | -- -- Squirrel = "", 383 | -- -- Tag = "", 384 | -- -- Watch = "", 385 | -- -- Smiley = "ﲃ", 386 | -- -- Package = "", 387 | -- -- CircuitBoard = "", 388 | -- -- }, 389 | -- -- } 390 | -- -- else 391 | -- -- --   פּ ﯟ   蘒練 some other good icons 392 | -- -- return { 393 | -- -- kind = { 394 | -- -- Text = " ", 395 | -- -- Method = " ", 396 | -- -- Function = " ", 397 | -- -- Constructor = " ", 398 | -- -- Field = " ", 399 | -- -- Variable = " ", 400 | -- -- Class = " ", 401 | -- -- Interface = " ", 402 | -- -- Module = " ", 403 | -- -- Property = " ", 404 | -- -- Unit = " ", 405 | -- -- Value = " ", 406 | -- -- Enum = " ", 407 | -- -- Keyword = " ", 408 | -- -- Snippet = " ", 409 | -- -- Color = " ", 410 | -- -- File = " ", 411 | -- -- Reference = " ", 412 | -- -- Folder = " ", 413 | -- -- EnumMember = " ", 414 | -- -- Constant = " ", 415 | -- -- Struct = " ", 416 | -- -- Event = " ", 417 | -- -- Operator = " ", 418 | -- -- TypeParameter = " ", 419 | -- -- Misc = " ", 420 | -- -- }, 421 | -- -- type = { 422 | -- -- Array = " ", 423 | -- -- Number = " ", 424 | -- -- String = " ", 425 | -- -- Boolean = " ", 426 | -- -- Object = " ", 427 | -- -- }, 428 | -- -- documents = { 429 | -- -- File = " ", 430 | -- -- Files = " ", 431 | -- -- Folder = " ", 432 | -- -- OpenFolder = " ", 433 | -- -- }, 434 | -- -- git = { 435 | -- -- Add = " ", 436 | -- -- Mod = " ", 437 | -- -- Remove = " ", 438 | -- -- Ignore = " ", 439 | -- -- Rename = " ", 440 | -- -- Diff = " ", 441 | -- -- Repo = " ", 442 | -- -- Octoface = " ", 443 | -- -- }, 444 | -- -- ui = { 445 | -- -- ArrowClosed = "", 446 | -- -- ArrowOpen = "", 447 | -- -- Lock = " ", 448 | -- -- Circle = " ", 449 | -- -- BigCircle = " ", 450 | -- -- BigUnfilledCircle = " ", 451 | -- -- Close = " ", 452 | -- -- NewFile = " ", 453 | -- -- Search = " ", 454 | -- -- Lightbulb = " ", 455 | -- -- Project = " ", 456 | -- -- Dashboard = " ", 457 | -- -- History = " ", 458 | -- -- Comment = " ", 459 | -- -- Bug = " ", 460 | -- -- Code = " ", 461 | -- -- Telescope = " ", 462 | -- -- Gear = " ", 463 | -- -- Package = " ", 464 | -- -- List = " ", 465 | -- -- SignIn = " ", 466 | -- -- SignOut = " ", 467 | -- -- NoteBook = " ", 468 | -- -- Check = " ", 469 | -- -- Fire = " ", 470 | -- -- Note = " ", 471 | -- -- BookMark = " ", 472 | -- -- Pencil = " ", 473 | -- -- ChevronRight = "", 474 | -- -- Table = " ", 475 | -- -- Calendar = " ", 476 | -- -- CloudDownload = " ", 477 | -- -- }, 478 | -- -- diagnostics = { 479 | -- -- Error = " ", 480 | -- -- Warning = " ", 481 | -- -- Information = " ", 482 | -- -- Question = " ", 483 | -- -- Hint = " ", 484 | -- -- }, 485 | -- -- misc = { 486 | -- -- Robot = " ", 487 | -- -- Squirrel = " ", 488 | -- -- Tag = " ", 489 | -- -- Watch = " ", 490 | -- -- Smiley = " ", 491 | -- -- Package = " ", 492 | -- -- CircuitBoard = " ", 493 | -- -- }, 494 | -- -- } 495 | -- -- end 496 | --------------------------------------------------------------------------------