├── stylua.toml ├── dashboard.png ├── init.lua ├── .gitignore ├── lazyvim.json ├── lua ├── plugins │ ├── 0-disabled.lua │ ├── 3-formatter.lua │ ├── extras │ │ ├── gen-nvim.lua │ │ └── copilot-chat.lua │ ├── 5-cpell.lua │ ├── 2-folding.lua │ ├── 1-coding.lua │ └── 4-lsp.lua └── config │ ├── autocmds.lua │ ├── options.lua │ ├── lazy.lua │ └── keymaps.lua ├── renovate.json ├── .neoconf.json ├── cspell.json ├── Neovim_Switcher.md ├── cspell-tool.txt ├── README.md ├── lazy-lock.json └── LICENSE /stylua.toml: -------------------------------------------------------------------------------- 1 | indent_type = "Spaces" 2 | indent_width = 2 3 | column_width = 120 -------------------------------------------------------------------------------- /dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jellydn/nvim-for-webdev/HEAD/dashboard.png -------------------------------------------------------------------------------- /init.lua: -------------------------------------------------------------------------------- 1 | -- bootstrap lazy.nvim, LazyVim and your plugins 2 | require("config.lazy") 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | tt.* 2 | .tests 3 | doc/tags 4 | debug 5 | .repro 6 | foo.* 7 | *.log 8 | data 9 | -------------------------------------------------------------------------------- /lazyvim.json: -------------------------------------------------------------------------------- 1 | { 2 | "extras": [ 3 | 4 | ], 5 | "news": { 6 | "NEWS.md": "2123" 7 | }, 8 | "version": 2 9 | } -------------------------------------------------------------------------------- /lua/plugins/0-disabled.lua: -------------------------------------------------------------------------------- 1 | return { 2 | -- disable nvim-notify 3 | { "rcarriga/nvim-notify", enabled = false }, 4 | } 5 | -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": [ 4 | "config:base" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /lua/config/autocmds.lua: -------------------------------------------------------------------------------- 1 | -- Autocmds are automatically loaded on the VeryLazy event 2 | -- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua 3 | -- Add any additional autocmds here 4 | -------------------------------------------------------------------------------- /.neoconf.json: -------------------------------------------------------------------------------- 1 | { 2 | "neodev": { 3 | "library": { 4 | "enabled": true, 5 | "plugins": true 6 | } 7 | }, 8 | "neoconf": { 9 | "plugins": { 10 | "lua_ls": { 11 | "enabled": true 12 | } 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /cspell.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json", 3 | "version": "0.2", 4 | "language": "en", 5 | "globRoot": ".", 6 | "dictionaryDefinitions": [ 7 | { 8 | "name": "cspell-tool", 9 | "path": "./cspell-tool.txt", 10 | "addWords": true 11 | } 12 | ], 13 | "dictionaries": [ 14 | "cspell-tool" 15 | ], 16 | "ignorePaths": [ 17 | "node_modules", 18 | "dist", 19 | "build", 20 | "/cspell-tool.txt" 21 | ] 22 | } -------------------------------------------------------------------------------- /lua/config/options.lua: -------------------------------------------------------------------------------- 1 | -- Options are automatically loaded before lazy.nvim startup 2 | -- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua 3 | -- Add any additional options here 4 | -- 5 | -- UFO folding 6 | vim.o.foldcolumn = "1" -- '0' is not bad 7 | vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value 8 | vim.o.foldlevelstart = 99 9 | vim.o.foldenable = true 10 | vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]] 11 | -------------------------------------------------------------------------------- /lua/plugins/3-formatter.lua: -------------------------------------------------------------------------------- 1 | return { 2 | -- Custom formatters 3 | { 4 | "nvimtools/none-ls.nvim", 5 | opts = function() 6 | local null_ls_status_ok, null_ls = pcall(require, "null-ls") 7 | if not null_ls_status_ok then 8 | return 9 | end 10 | 11 | local b = null_ls.builtins 12 | 13 | local sources = { 14 | -- for tailwindcss 15 | b.formatting.rustywind.with({ 16 | filetypes = { "html", "css", "javascriptreact", "typescriptreact", "svelte" }, 17 | }), 18 | -- Lua 19 | b.formatting.stylua, 20 | } 21 | return { 22 | sources = sources, 23 | } 24 | end, 25 | }, 26 | } 27 | -------------------------------------------------------------------------------- /Neovim_Switcher.md: -------------------------------------------------------------------------------- 1 | # Guide for Using NVIM_APPNAME for Neovim 2 | 3 | ## Prerequisites 4 | 5 | - Ensure you have Neovim installed or use [MordechaiHadad/bob: A version manager for neovim](https://github.com/MordechaiHadad/bob) 6 | 7 | ## Steps 8 | 9 | ### 1. Clone the Configuration 10 | 11 | Clone the Neovim configuration for web development (or any other purpose). 12 | 13 | ```bash 14 | git clone https://github.com/jellydn/nvim-for-webdev.git ~/.config/nvim_webdev 15 | ``` 16 | 17 | ### 2. Set NVIM_APPNAME Environment Variable 18 | 19 | Change the `NVIM_APPNAME` environment variable to the name of the Neovim application. 20 | 21 | ```bash 22 | NVIM_APPNAME=nvim_webdev nvim 23 | ``` 24 | 25 | Otherwise, use alias: 26 | 27 | ```bash 28 | alias web_nvim="NVIM_APPNAME=nvim_webdev nvim" 29 | ``` 30 | 31 | This will start Neovim with the configuration stored in `~/.config/nvim_webdev`. 32 | 33 | ## Resources 34 | 35 | - [Neovim Configuration - Practicalli Neovim](https://practical.li/neovim/configuration/#multiple-configurations) 36 | - [mehalter/zsh-nvim-appname: A simple ZSH plugin for maintaining multiple Neovim configurations with NVIM_APPNAME](https://github.com/mehalter/zsh-nvim-appname) 37 | -------------------------------------------------------------------------------- /lua/plugins/extras/gen-nvim.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "jellydn/gen.nvim", 3 | opts = { 4 | model = "mistral", -- The default model to use. If you don't have, run `ollama pull mistral` on your terminal. 5 | display_mode = "split", -- The display mode. Can be "float" or "split". 6 | show_prompt = true, -- Shows the Prompt submitted to Ollama. 7 | show_model = true, -- Displays which model you are using at the beginning of your chat session. 8 | debug = false, -- Prints errors and the command which is run. 9 | }, 10 | event = "VeryLazy", 11 | keys = { 12 | { 13 | "mm", 14 | function() 15 | require("gen").select_model() 16 | end, 17 | desc = "Gen - Select AI Model", 18 | }, 19 | }, 20 | config = function(_, opts) 21 | local gen = require("gen") 22 | gen.setup(opts) 23 | gen.prompts["Elaborate_Text"] = { 24 | prompt = "Elaborate the following text:\n$text", 25 | } 26 | gen.prompts["Fix_Code"] = { 27 | prompt = 28 | "Fix the following code. Only output the result in format ```$filetype\n...\n```:\n```$filetype\n$text\n```", 29 | extract = "```$filetype\n(.-)```", 30 | } 31 | end, 32 | } 33 | -------------------------------------------------------------------------------- /cspell-tool.txt: -------------------------------------------------------------------------------- 1 | nvim 2 | bufferline 3 | catppuccin 4 | tabnine 5 | luasnip 6 | codeium 7 | gitsigns 8 | keymap 9 | lspsaga 10 | lualine 11 | lspconfig 12 | bufremove 13 | hipatterns 14 | indentscope 15 | neoconf 16 | neodev 17 | noice 18 | textobjects 19 | autotag 20 | commentstring 21 | devicons 22 | previm 23 | statuscol 24 | tokyonight 25 | startuptime 26 | Autocmds 27 | autocmds 28 | Keymaps 29 | keymaps 30 | lazyvim 31 | bufs 32 | getbufinfo 33 | buflisted 34 | bufnr 35 | buftype 36 | Lspsaga 37 | Gitsigns 38 | lazypath 39 | stdpath 40 | Neovim 41 | habamax 42 | matchit 43 | matchparen 44 | netrw 45 | tohtml 46 | foldcolumn 47 | foldlevel 48 | foldlevelstart 49 | foldenable 50 | fillchars 51 | foldopen 52 | foldsep 53 | foldclose 54 | rcarriga 55 | Jsdoc 56 | heavenshell 57 | jsdoc 58 | williamboman 59 | rustywind 60 | tailwindcss 61 | lukas 62 | reineke 63 | norg 64 | Previm 65 | kevinhwang 66 | luukvbaal 67 | relculright 68 | foldfunc 69 | lnumfunc 70 | anuvyklack 71 | nvimtools 72 | builtins 73 | inlayhints 74 | lvimuser 75 | augroup 76 | autocmd 77 | noremap 78 | glepnir 79 | JB's 80 | Vidocq 81 | narutoxy 82 | neovim 83 | codespell 84 | davidmh 85 | postprocess 86 | jellydn 87 | ollama 88 | Ollama 89 | NVIM 90 | APPNAME 91 | Mordechai 92 | Hadad 93 | webdev 94 | Practicalli 95 | mehalter 96 | appname 97 | Codeium 98 | Tabnine 99 | Rustywind 100 | Huynh 101 | kofi 102 | buymeacoffee -------------------------------------------------------------------------------- /lua/plugins/5-cpell.lua: -------------------------------------------------------------------------------- 1 | -- Define the tools to be installed and the key mapping 2 | local installed_tools = { "codespell", "misspell", "cspell" } 3 | local key_mapping = "cn" 4 | 5 | -- Example config with lazyvim 6 | return { 7 | -- Auto install those tools with mason 8 | { 9 | "williamboman/mason.nvim", 10 | opts = { 11 | ensure_installed = installed_tools, 12 | }, 13 | }, 14 | -- Set up null-ls to check spelling 15 | { 16 | "nvimtools/none-ls.nvim", 17 | keys = { 18 | { key_mapping, "NullLsInfo", desc = "NullLs Info" }, 19 | }, 20 | dependencies = { "mason.nvim", "davidmh/cspell.nvim" }, 21 | event = { "BufReadPre", "BufNewFile" }, 22 | opts = function() 23 | local cspell = require("cspell") 24 | local ok, none_ls = pcall(require, "null-ls") 25 | if not ok then 26 | return 27 | end 28 | 29 | local b = none_ls.builtins 30 | 31 | local sources = { 32 | -- spell check 33 | b.diagnostics.codespell, 34 | b.diagnostics.misspell, 35 | -- cspell 36 | cspell.diagnostics.with({ 37 | -- Set the severity to HINT for unknown words 38 | diagnostics_postprocess = function(diagnostic) 39 | diagnostic.severity = vim.diagnostic.severity["HINT"] 40 | end, 41 | }), 42 | cspell.code_actions, 43 | } 44 | -- Define the debounce value 45 | local debounce_value = 200 46 | return { 47 | sources = sources, 48 | debounce = debounce_value, 49 | debug = true, 50 | } 51 | end, 52 | }, 53 | } 54 | -------------------------------------------------------------------------------- /lua/plugins/2-folding.lua: -------------------------------------------------------------------------------- 1 | return { 2 | -- UFO folding 3 | { 4 | "kevinhwang91/nvim-ufo", 5 | dependencies = { 6 | "kevinhwang91/promise-async", 7 | { 8 | "luukvbaal/statuscol.nvim", 9 | config = function() 10 | local builtin = require("statuscol.builtin") 11 | require("statuscol").setup({ 12 | relculright = true, 13 | segments = { 14 | { text = { builtin.foldfunc }, click = "v:lua.ScFa" }, 15 | { text = { "%s" }, click = "v:lua.ScSa" }, 16 | { text = { builtin.lnumfunc, " " }, click = "v:lua.ScLa" }, 17 | }, 18 | }) 19 | end, 20 | }, 21 | }, 22 | event = "BufReadPost", 23 | opts = { 24 | provider_selector = function() 25 | return { "treesitter", "indent" } 26 | end, 27 | }, 28 | 29 | init = function() 30 | vim.keymap.set("n", "zR", function() 31 | require("ufo").openAllFolds() 32 | end) 33 | vim.keymap.set("n", "zM", function() 34 | require("ufo").closeAllFolds() 35 | end) 36 | end, 37 | }, 38 | -- Folding preview, by default h and l keys are used. 39 | -- On first press of h key, when cursor is on a closed fold, the preview will be shown. 40 | -- On second press the preview will be closed and fold will be opened. 41 | -- When preview is opened, the l key will close it and open fold. In all other cases these keys will work as usual. 42 | { 43 | "anuvyklack/fold-preview.nvim", 44 | event = "BufReadPost", 45 | dependencies = "anuvyklack/keymap-amend.nvim", 46 | config = true, 47 | }, 48 | } 49 | -------------------------------------------------------------------------------- /lua/plugins/1-coding.lua: -------------------------------------------------------------------------------- 1 | return { 2 | -- Jsdoc 3 | { 4 | "heavenshell/vim-jsdoc", 5 | ft = "javascript,typescript,typescriptreact,svelte", 6 | cmd = "JsDoc", 7 | keys = { 8 | { "jd", "JsDoc", desc = "JsDoc" }, 9 | }, 10 | build = "make install", 11 | }, 12 | -- Add Tailwind CSS LSP 13 | { 14 | "williamboman/mason.nvim", 15 | opts = { 16 | ensure_installed = { 17 | "stylua", 18 | -- rustywind for tailwindcss 19 | "tailwindcss-language-server", 20 | "rustywind", 21 | }, 22 | }, 23 | }, 24 | -- Markdown 25 | { 26 | "lukas-reineke/headlines.nvim", 27 | opts = function() 28 | local opts = {} 29 | for _, ft in ipairs({ "markdown", "norg", "rmd", "org" }) do 30 | opts[ft] = { headline_highlights = {} } 31 | for i = 1, 6 do 32 | table.insert(opts[ft].headline_highlights, "Headline" .. i) 33 | end 34 | end 35 | return opts 36 | end, 37 | ft = { "markdown", "norg", "rmd", "org" }, 38 | config = function(_, opts) 39 | -- PERF: schedule to prevent headlines slowing down opening a file 40 | vim.schedule(function() 41 | require("headlines").setup(opts) 42 | require("headlines").refresh() 43 | end) 44 | end, 45 | }, 46 | -- Markdown preview 47 | { 48 | "previm/previm", 49 | config = function() 50 | -- define global for open markdown preview, let g:previm_open_cmd = 'open -a Safari' 51 | vim.g.previm_open_cmd = "open -a Arc" 52 | end, 53 | ft = { "markdown" }, 54 | keys = { 55 | -- add mp to open markdown preview 56 | { 57 | "mp", 58 | "PrevimOpen", 59 | desc = "Markdown preview", 60 | }, 61 | }, 62 | }, 63 | } 64 | -------------------------------------------------------------------------------- /lua/config/lazy.lua: -------------------------------------------------------------------------------- 1 | local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" 2 | if not vim.loop.fs_stat(lazypath) then 3 | -- bootstrap lazy.nvim 4 | -- stylua: ignore 5 | vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath }) 6 | end 7 | vim.opt.rtp:prepend(vim.env.LAZY or lazypath) 8 | 9 | require("lazy").setup({ 10 | spec = { 11 | -- add LazyVim and import its plugins 12 | { "LazyVim/LazyVim", import = "lazyvim.plugins" }, 13 | -- import any extras modules here 14 | { import = "lazyvim.plugins.extras.lang.typescript" }, 15 | { import = "lazyvim.plugins.extras.lang.json" }, 16 | { import = "lazyvim.plugins.extras.lang.tailwind" }, 17 | { import = "lazyvim.plugins.extras.util.mini-hipatterns" }, 18 | { import = "lazyvim.plugins.extras.linting.eslint" }, 19 | { import = "lazyvim.plugins.extras.formatting.prettier" }, 20 | { import = "lazyvim.plugins.extras.coding.codeium" }, 21 | { import = "lazyvim.plugins.extras.coding.tabnine" }, 22 | { import = "lazyvim.plugins.extras.ui.alpha" }, 23 | { import = "lazyvim.plugins.extras.lsp.none-ls" }, 24 | -- { import = "lazyvim.plugins.extras.ui.mini-animate" }, 25 | -- import/override with your plugins 26 | { import = "plugins" }, 27 | }, 28 | defaults = { 29 | -- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup. 30 | -- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default. 31 | lazy = false, 32 | -- It's recommended to leave version=false for now, since a lot the plugin that support versioning, 33 | -- have outdated releases, which may break your Neovim install. 34 | version = false, -- always use the latest git commit 35 | -- version = "*", -- try installing the latest stable version for plugins that support semver 36 | }, 37 | install = { colorscheme = { "tokyonight", "habamax" } }, 38 | checker = { enabled = true }, -- automatically check for plugin updates 39 | performance = { 40 | rtp = { 41 | -- disable some rtp plugins 42 | disabled_plugins = { 43 | "gzip", 44 | -- "matchit", 45 | -- "matchparen", 46 | -- "netrwPlugin", 47 | "tarPlugin", 48 | "tohtml", 49 | "tutor", 50 | "zipPlugin", 51 | }, 52 | }, 53 | }, 54 | }) 55 | -------------------------------------------------------------------------------- /lua/plugins/4-lsp.lua: -------------------------------------------------------------------------------- 1 | -- disable lsp-inlayhints if that is nightly version, will remove when 0.10.0 is stable 2 | local enabled_inlay_hints = true 3 | if vim.fn.has("nvim-0.10.0") == 1 then 4 | enabled_inlay_hints = false 5 | end 6 | 7 | return { 8 | { 9 | "lvimuser/lsp-inlayhints.nvim", 10 | ft = { "javascript", "javascriptreact", "json", "jsonc", "typescript", "typescriptreact", "svelte" }, 11 | enabled = enabled_inlay_hints, 12 | opts = { 13 | debug_mode = true, 14 | }, 15 | config = function(_, options) 16 | vim.api.nvim_create_augroup("LspAttach_inlayhints", {}) 17 | vim.api.nvim_create_autocmd("LspAttach", { 18 | group = "LspAttach_inlayhints", 19 | callback = function(args) 20 | if not (args.data and args.data.client_id) then 21 | return 22 | end 23 | 24 | local bufnr = args.buf 25 | local client = vim.lsp.get_client_by_id(args.data.client_id) 26 | require("lsp-inlayhints").on_attach(client, bufnr) 27 | end, 28 | }) 29 | require("lsp-inlayhints").setup(options) 30 | -- define key map for toggle inlay hints: require('lsp-inlayhints').toggle() 31 | vim.api.nvim_set_keymap( 32 | "n", 33 | "uI", 34 | "lua require('lsp-inlayhints').toggle()", 35 | { noremap = true, silent = true } 36 | ) 37 | end, 38 | }, 39 | { 40 | "glepnir/lspsaga.nvim", 41 | event = "LspAttach", 42 | config = true, 43 | dependencies = { 44 | { "nvim-tree/nvim-web-devicons" }, 45 | -- Please make sure you install markdown and markdown_inline parser 46 | { "nvim-treesitter/nvim-treesitter" }, 47 | }, 48 | }, 49 | { 50 | -- Displaying references and definition infos upon functions like JB's IDEA. 51 | "VidocqH/lsp-lens.nvim", 52 | event = "BufRead", 53 | opts = { 54 | include_declaration = true, -- Reference include declaration 55 | sections = { -- Enable / Disable specific request 56 | definition = false, 57 | references = true, 58 | implementation = false, 59 | }, 60 | }, 61 | keys = { 62 | { 63 | -- LspLensToggle 64 | "uL", 65 | "LspLensToggle", 66 | desc = "LSP Len Toggle", 67 | }, 68 | }, 69 | }, 70 | { 71 | -- Dim the unused variables and functions using lsp and treesitter. 72 | "narutoxy/dim.lua", 73 | event = "BufRead", 74 | dependencies = { "nvim-treesitter/nvim-treesitter", "neovim/nvim-lspconfig" }, 75 | config = true, 76 | }, 77 | } 78 | -------------------------------------------------------------------------------- /lua/plugins/extras/copilot-chat.lua: -------------------------------------------------------------------------------- 1 | local prompts = { 2 | -- Code related prompts 3 | Explain = "Please explain how the following code works.", 4 | Review = "Please review the following code and provide suggestions for improvement.", 5 | Tests = "Please explain how the selected code works, then generate unit tests for it.", 6 | Refactor = "Please refactor the following code to improve its clarity and readability.", 7 | FixCode = "Please fix the following code to make it work as intended.", 8 | Documentation = "Please provide documentation for the following code.", 9 | -- Text related prompts 10 | Summarize = "Please summarize the following text.", 11 | Spelling = "Please correct any grammar and spelling errors in the following text.", 12 | Wording = "Please improve the grammar and wording of the following text.", 13 | Concise = "Please rewrite the following text to make it more concise.", 14 | } 15 | 16 | return { 17 | -- Import the copilot plugin 18 | { import = "lazyvim.plugins.extras.coding.copilot" }, 19 | { 20 | "jellydn/CopilotChat.nvim", 21 | opts = { 22 | show_help = "yes", 23 | prompts = prompts, 24 | debug = false, -- Set to true to see response from Github Copilot API. The log file will be in ~/.local/state/nvim/CopilotChat.nvim.log. 25 | }, 26 | build = function() 27 | vim.notify("Please update the remote plugins by running ':UpdateRemotePlugins', then restart Neovim.") 28 | end, 29 | event = "VeryLazy", 30 | keys = { 31 | -- Code related commands 32 | { "cce", "CopilotChatExplain", desc = "CopilotChat - Explain code" }, 33 | { "cct", "CopilotChatTests", desc = "CopilotChat - Generate tests" }, 34 | { "ccr", "CopilotChatReview", desc = "CopilotChat - Review code" }, 35 | { "ccR", "CopilotChatRefactor", desc = "CopilotChat - Refactor code" }, 36 | { "ccf", "CopilotChatFixCode", desc = "CopilotChat - Fix code" }, 37 | { "ccd", "CopilotChatDocumentation", desc = "CopilotChat - Add documentation for code" }, 38 | -- Text related commands 39 | { "ccs", "CopilotChatSummarize", desc = "CopilotChat - Summarize text" }, 40 | { "ccS", "CopilotChatSpelling", desc = "CopilotChat - Correct spelling" }, 41 | { "ccw", "CopilotChatWording", desc = "CopilotChat - Improve wording" }, 42 | { "ccc", "CopilotChatConcise", desc = "CopilotChat - Make text concise" }, 43 | -- Chat with Copilot in visual mode 44 | { 45 | "ccv", 46 | ":CopilotChatVisual", 47 | mode = "x", 48 | desc = "CopilotChat - Open in vertical split", 49 | }, 50 | { 51 | "ccx", 52 | ":CopilotChatInPlace", 53 | mode = "x", 54 | desc = "CopilotChat - Run in-place code", 55 | }, 56 | -- Custom input for CopilotChat 57 | { 58 | "cci", 59 | function() 60 | local input = vim.fn.input("Ask Copilot: ") 61 | if input ~= "" then 62 | vim.cmd("CopilotChat " .. input) 63 | end 64 | end, 65 | desc = "CopilotChat - Ask input", 66 | }, 67 | }, 68 | }, 69 | } 70 | -------------------------------------------------------------------------------- /lua/config/keymaps.lua: -------------------------------------------------------------------------------- 1 | -- Keymaps are automatically loaded on the VeryLazy event 2 | -- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua 3 | -- Add any additional keymaps here 4 | local Util = require("lazyvim.util") 5 | local keymap = vim.keymap.set 6 | -- Silent keymap option 7 | local opts = { silent = true } 8 | 9 | -- Press jj,jk fast to enter 10 | keymap("i", "jj", "", opts) 11 | keymap("i", "jk", "", opts) 12 | 13 | -- Close buffers 14 | if Util.has("mini.bufremove") then 15 | keymap("n", "", function() 16 | require("mini.bufremove").delete(0, false) 17 | local bufs = vim.fn.getbufinfo({ buflisted = true }) 18 | -- open alpha if no buffers are left 19 | if not bufs[2] and Util.has("alpha-nvim") then 20 | require("alpha").start(true) 21 | end 22 | end, opts) 23 | else 24 | keymap("n", "", "bd", opts) 25 | end 26 | 27 | -- Dashboard 28 | -- Add keymap to open alpha dashboard 29 | keymap("n", ";", function() 30 | -- close all open buffers before open dashboard 31 | for _, bufnr in ipairs(vim.api.nvim_list_bufs()) do 32 | local buftype = vim.api.nvim_buf_get_option(bufnr, "buftype") 33 | if buftype ~= "terminal" then 34 | vim.api.nvim_buf_delete(bufnr, { force = true }) 35 | end 36 | end 37 | 38 | if Util.has("alpha-nvim") then 39 | require("alpha").start(true) 40 | end 41 | end, opts) 42 | 43 | -- NullLs Info keymap 44 | if Util.has("none-ls.nvim") then 45 | keymap("n", "cn", "NullLsInfo", opts) 46 | end 47 | 48 | -- Better paste 49 | -- remap "p" in visual mode to delete the highlighted text without overwriting your yanked/copied text, and then paste the content from the unnamed register. 50 | keymap("v", "p", '"_dP', opts) 51 | 52 | -- Copy whole file content to clipboard with C-c 53 | keymap("n", "", ":%y+", opts) 54 | 55 | -- Visual -- 56 | -- Stay in indent mode 57 | keymap("v", "<", "", ">gv", opts) 59 | 60 | -- Move live up or down 61 | -- moving 62 | keymap("n", "", ":m .+1", opts) 63 | keymap("n", "", ":m .-2", opts) 64 | keymap("i", "", ":m .+1==gi", opts) 65 | keymap("i", "", ":m .-2==gi", opts) 66 | keymap("v", "", ":m '>+1gv=gv", opts) 67 | keymap("v", "", ":m '<-2gv=gv", opts) 68 | 69 | -- Show Lsp info 70 | keymap("n", "cl", "LspInfo", opts) 71 | 72 | -- Show references on telescope 73 | if Util.has("telescope.nvim") then 74 | keymap("n", "gr", "Telescope lsp_references") 75 | end 76 | 77 | -- LspSaga 78 | if Util.has("lspsaga.nvim") then 79 | -- LSP finder - Find the symbol's definition 80 | keymap("n", "gh", "Lspsaga lsp_finder") 81 | 82 | -- Code action 83 | keymap({ "n", "v" }, "ca", "Lspsaga code_action") 84 | 85 | -- Rename all occurrences of the hovered word for the entire file 86 | keymap("n", "cr", "Lspsaga rename") 87 | 88 | -- Rename all occurrences of the hovered word for the selected files 89 | keymap("n", "cR", "Lspsaga rename ++project") 90 | 91 | -- Peek definition 92 | keymap("n", "gp", "Lspsaga peek_definition") 93 | 94 | -- Go to definition 95 | keymap("n", "gD", "Lspsaga goto_definition") 96 | 97 | -- Go to type definition 98 | keymap("n", "gt", "Lspsaga goto_type_definition") 99 | 100 | -- Diagnostic jump can use `` to jump back 101 | keymap("n", "[e", "Lspsaga diagnostic_jump_prev") 102 | keymap("n", "]e", "Lspsaga diagnostic_jump_next") 103 | 104 | -- Diagnostic jump with filters such as only jumping to an error 105 | keymap("n", "[E", function() 106 | require("lspsaga.diagnostic"):goto_prev({ severity = vim.diagnostic.severity.ERROR }) 107 | end) 108 | keymap("n", "]E", function() 109 | require("lspsaga.diagnostic"):goto_next({ severity = vim.diagnostic.severity.ERROR }) 110 | end) 111 | 112 | -- Toggle Outline 113 | keymap("n", "o", "Lspsaga outline") 114 | 115 | -- Pressing the key twice will enter the hover window 116 | keymap("n", "K", "Lspsaga hover_doc") 117 | end 118 | 119 | -- Trouble 120 | -- Add keymap only show FIXME 121 | if Util.has("todo-comments.nvim") then 122 | -- show fixme on telescope 123 | keymap("n", "xf", "TodoTelescope keywords=FIX,FIXME") 124 | end 125 | 126 | -- Gitsigns 127 | -- Add toggle gitsigns blame line 128 | if Util.has("gitsigns.nvim") then 129 | keymap("n", "ub", "lua require('gitsigns').toggle_current_line_blame()", { 130 | desc = "Toggle current line blame", 131 | }) 132 | end 133 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

Welcome to nvim-for-webdev 👋

2 |

3 | Are you a web developer working with JS, Typescript, React, and Tailwind CSS? Check out the Neovim and LazyVim plugin starter template! 4 |

5 | 6 | [![IT Man - Talk #33 NeoVim as IDE [Vietnamese]](https://i.ytimg.com/vi/dFi8CzvqkNE/hqdefault.jpg)](https://www.youtube.com/watch?v=dFi8CzvqkNE) 7 | 8 | [![IT Man - Talk #35 - #Neovim IDE for Web Developer](https://i.ytimg.com/vi/3EbgMJ-RcWY/hqdefault.jpg)](https://www.youtube.com/watch?v=3EbgMJ-RcWY) 9 | 10 | [![IT Man - Step-by-Step Guide: Integrating Copilot Chat with Neovim [Vietnamese]](https://i.ytimg.com/vi/By_CCai62JE/hqdefault.jpg)](https://www.youtube.com/watch?v=By_CCai62JE) 11 | 12 | [![IT Man - Power up your Neovim with Gen.nvim](https://i.ytimg.com/vi/2nt_qcchW_8/hqdefault.jpg)](https://www.youtube.com/watch?v=2nt_qcchW_8) 13 | 14 | [![IT Man - Boost Your Neovim Productivity with GitHub Copilot Chat](https://i.ytimg.com/vi/6oOPGaKCd_Q/hqdefault.jpg)](https://www.youtube.com/watch?v=6oOPGaKCd_Q) 15 | 16 | ## Starter Template for Web Developers 17 | 18 | This is a starter template for [LazyVim](https://github.com/LazyVim/LazyVim). 19 | Refer to the [documentation](https://lazyvim.github.io/installation) to get started. 20 | 21 | Find detailed resources for each plugin in the accompanying readme. Start your web development journey with Neovim and LazyVim today! 22 | 23 | ## Install Neovim 24 | 25 | The easy way is using [MordechaiHadad/bob: A version manager for neovim](https://github.com/MordechaiHadad/bob). 26 | 27 | ```sh 28 | bob install stable 29 | bob use stable 30 | ``` 31 | 32 | ## Install the config 33 | 34 | Make sure to remove or move your current `nvim` directory 35 | 36 | ```sh 37 | git clone https://github.com/jellydn/nvim-for-webdev.git ~/.config/nvim 38 | rm -rf ~/.config/nvim/.git 39 | ``` 40 | 41 | ### Usage with NVIM_APPNAME 42 | 43 | ```sh 44 | git clone https://github.com/jellydn/nvim-for-webdev.git ~/.config/nvim_webdev 45 | alias web_nvim="NVIM_APPNAME=nvim_webdev nvim" 46 | web_nvim 47 | ``` 48 | 49 | You should restart Neovim to apply the changes after installing the starter template. 50 | 51 | ## Extra plugins from LazyVim 52 | 53 | Add below plugins to [lazy.lua](./lua/config/lazy.lua), more detail on https://www.lazyvim.org/plugins 54 | 55 | ```lua 56 | { import = "lazyvim.plugins.extras.test.core" }, 57 | { import = "lazyvim.plugins.extras.lang.json" }, 58 | { import = "lazyvim.plugins.extras.lang.tailwind" }, 59 | { import = "lazyvim.plugins.extras.util.mini-hipatterns" }, 60 | { import = "lazyvim.plugins.extras.ui.edgy" }, 61 | { import = "lazyvim.plugins.extras.linting.eslint" }, 62 | { import = "lazyvim.plugins.extras.lang.yaml" }, 63 | { import = "lazyvim.plugins.extras.lang.typescript" }, 64 | { import = "lazyvim.plugins.extras.coding.codeium" }, 65 | { import = "lazyvim.plugins.extras.coding.copilot" }, 66 | { import = "lazyvim.plugins.extras.coding.tabnine" }, 67 | { import = "lazyvim.plugins.extras.ui.alpha" }, 68 | { import = "lazyvim.plugins.extras.lsp.none-ls" }, 69 | ``` 70 | 71 | ## [Keymaps](./lua/config/keymaps.lua) 72 | 73 | - Add custom mappings for quickly exiting insert mode, closing buffers, opening the Alpha dashboard, displaying NullLs info, and toggling certain features of the Gitsigns and Todo Comments plugins. 74 | 75 | ## UI 76 | 77 | ### Dashboard 78 | 79 | ![dashboards](dashboard.png) 80 | 81 | ### Folding 82 | 83 | - Add [UFO folding and hover to preview](./lua/plugins/2-folding.lua) 84 | 85 | ## Setup [IDE](./lua/plugins/1-coding.lua) 86 | 87 | This IDE setup includes several plugins for Neovim that provide features such as autocompletion, documentation generation, and formatting. The setup includes the Codeium plugin, which is a competitor to GitHub Copilot, as well as the Tabnine autocompletion plugin. Additionally, the setup includes the vim-jsdoc plugin for generating documentation, and plugins for sorting Tailwind CSS classes using Rustywind and null-ls.nvim. 88 | 89 | ### Resources 90 | 91 | - https://codeium.com/compare/comparison-copilot-codeium 92 | - https://github.com/Exafunction/codeium.vim 93 | - https://www.tabnine.com/blog/tabnine-vs-github-copilot/ 94 | - https://github.com/tzachar/tabnine-vim 95 | - https://github.com/codota/tabnine-nvim 96 | - https://github.com/heavenshell/vim-jsdoc 97 | - https://github.com/avencera/rustywind 98 | 99 | ### Tutorial 100 | 101 | - [LazyVim: Linting and Formatting](https://www.youtube.com/watch?v=a_ZpTPaSn38) 102 | - [LazyVim: Tailwind CSS Support](https://www.youtube.com/watch?v=_NiWhZeR-MY) 103 | - [How to use NVIM_APPNAME for Neovim Switcher](./Neovim_Switcher.md) 104 | 105 | [![IT Man - Tip #38 - Learning Vim with VSCode - A Comprehensive Guide [Vietnamese]](https://i.ytimg.com/vi/yTTPRm0ACl0/hqdefault.jpg)](https://www.youtube.com/watch?v=yTTPRm0ACl0) 106 | [![IT Man - Eliminate Typos in Your Code with Neovim [Vietnamese]](https://i.ytimg.com/vi/3IwMd77_P8E/hqdefault.jpg)](https://www.youtube.com/watch?v=3IwMd77_P8E) 107 | 108 | ## Author 109 | 110 | 👤 **Huynh Duc Dung** 111 | 112 | - Website: https://productsway.com/ 113 | - Twitter: [@jellydn](https://twitter.com/jellydn) 114 | - Github: [@jellydn](https://github.com/jellydn) 115 | 116 | ## Show your support 117 | 118 | Give a ⭐️ if this project helped you! 119 | 120 | [![kofi](https://img.shields.io/badge/Ko--fi-F16061?style=for-the-badge&logo=ko-fi&logoColor=white)](https://ko-fi.com/dunghd) 121 | [![paypal](https://img.shields.io/badge/PayPal-00457C?style=for-the-badge&logo=paypal&logoColor=white)](https://paypal.me/dunghd) 122 | [![buymeacoffee](https://img.shields.io/badge/Buy_Me_A_Coffee-FFDD00?style=for-the-badge&logo=buy-me-a-coffee&logoColor=black)](https://www.buymeacoffee.com/dunghd) 123 | -------------------------------------------------------------------------------- /lazy-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "LazyVim": { "branch": "main", "commit": "c433ea7aa842c446edc2b1570998bf5440c68188" }, 3 | "LuaSnip": { "branch": "master", "commit": "2dbef19461198630b3d7c39f414d09fb07d1fdd2" }, 4 | "SchemaStore.nvim": { "branch": "main", "commit": "be4d1084397c9b9d3d5a41bda871e6b20415bf48" }, 5 | "alpha-nvim": { "branch": "main", "commit": "1356b9ef31b985d541d94314f2cf73c61124bf1d" }, 6 | "bufferline.nvim": { "branch": "main", "commit": "b15c6daf5a64426c69732b31a951f4e438cb6590" }, 7 | "catppuccin": { "branch": "main", "commit": "c2034f7b549152e5cc757820426341ea5000bc7a" }, 8 | "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, 9 | "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, 10 | "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, 11 | "cmp-tabnine": { "branch": "main", "commit": "a8d76fe729ee2ca6ffc497ebdc2d0f5ddff41b79" }, 12 | "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, 13 | "codeium.nvim": { "branch": "main", "commit": "f871000e91faa9ed334da2bfa4eadbf54d0e1047" }, 14 | "conform.nvim": { "branch": "master", "commit": "0d700ba9242abc44972109cb58085061d35c44d6" }, 15 | "cspell.nvim": { "branch": "main", "commit": "2e65904243f41b9002618d1fe0d79def6c795eeb" }, 16 | "dim.lua": { "branch": "main", "commit": "e7d7428d2d0bde97c6441ca9f04a1e9ac7c6d6bb" }, 17 | "dressing.nvim": { "branch": "master", "commit": "6f212262061a2120e42da0d1e87326e8a41c0478" }, 18 | "flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" }, 19 | "fold-preview.nvim": { "branch": "main", "commit": "b7920cb0aba2b48a6b679bff45f98c3ebc0f0b89" }, 20 | "friendly-snippets": { "branch": "main", "commit": "b8fae73a479ae0a1c54f5c98fa687ae8a0addc53" }, 21 | "gitsigns.nvim": { "branch": "main", "commit": "2c2463dbd82eddd7dbab881c3a62cfbfbe3c67ae" }, 22 | "headlines.nvim": { "branch": "master", "commit": "e3d7bfdf40e41a020d966d35f8b48d75b90367d2" }, 23 | "indent-blankline.nvim": { "branch": "master", "commit": "12e92044d313c54c438bd786d11684c88f6f78cd" }, 24 | "keymap-amend.nvim": { "branch": "master", "commit": "b8bf9d820878d5497fdd11d6de55dea82872d98e" }, 25 | "lazy.nvim": { "branch": "main", "commit": "28126922c9b54e35a192ac415788f202c3944c9f" }, 26 | "lsp-inlayhints.nvim": { "branch": "main", "commit": "d981f65c9ae0b6062176f0accb9c151daeda6f16" }, 27 | "lsp-lens.nvim": { "branch": "main", "commit": "48bb1a7e271424c15f3d588d54adc9b7c319d977" }, 28 | "lspsaga.nvim": { "branch": "main", "commit": "2198c07124bef27ef81335be511c8abfd75db933" }, 29 | "lualine.nvim": { "branch": "master", "commit": "7d131a8d3ba5016229e8a1d08bf8782acea98852" }, 30 | "mason-lspconfig.nvim": { "branch": "main", "commit": "2b3d247fce06f53934174f5dfe0362c42d65c00c" }, 31 | "mason.nvim": { "branch": "main", "commit": "c43eeb5614a09dc17c03a7fb49de2e05de203924" }, 32 | "mini.ai": { "branch": "main", "commit": "3ad9d455a91b8bf3c24d4e50518d9a6b9dddb42c" }, 33 | "mini.bufremove": { "branch": "main", "commit": "020243bfed8c8b941f2c20626faf3ea39c0c0e1b" }, 34 | "mini.comment": { "branch": "main", "commit": "b0b359ada4293cdcea7ab4072dfd5b031aac3f8e" }, 35 | "mini.hipatterns": { "branch": "main", "commit": "82d348b05328705a7048f852f15f66a482562f03" }, 36 | "mini.indentscope": { "branch": "main", "commit": "ca129b71edb672d30b8d7ec3138106db1b1f6a8b" }, 37 | "mini.pairs": { "branch": "main", "commit": "552062017ff207e1f35f7028bfb3f27c7421d22d" }, 38 | "mini.surround": { "branch": "main", "commit": "5ceb6a12d3761bc719fbdad5432c89333deb1498" }, 39 | "neo-tree.nvim": { "branch": "v3.x", "commit": "e578fe7a5832421b0d2c5b3c0a7a1e40e0f6a47a" }, 40 | "neoconf.nvim": { "branch": "main", "commit": "a0e63d84433ab03947cb3da82744220e39e05338" }, 41 | "neodev.nvim": { "branch": "main", "commit": "2793ba3127c2c93ee486b9072a3ef129eeb950cc" }, 42 | "noice.nvim": { "branch": "main", "commit": "bf67d70bd7265d075191e7812d8eb42b9791f737" }, 43 | "none-ls.nvim": { "branch": "main", "commit": "912f81829e9ab4ee3d54c3ea5a304c264f0003bc" }, 44 | "nui.nvim": { "branch": "main", "commit": "35da9ca1de0fc4dda96c2e214d93d363c145f418" }, 45 | "nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" }, 46 | "nvim-lint": { "branch": "master", "commit": "76af3422e3c82ea40adf9ade1ccf1dc1eb361789" }, 47 | "nvim-lspconfig": { "branch": "master", "commit": "9a6279953c82d01b58825a46ede032ab246a5983" }, 48 | "nvim-spectre": { "branch": "master", "commit": "d1ce28b6dc287a6f673461218f3326f0266d75f7" }, 49 | "nvim-treesitter": { "branch": "master", "commit": "1cda98132abfde758c1778096960f9b2c0bd78c1" }, 50 | "nvim-treesitter-context": { "branch": "master", "commit": "9c06b115abc57c99cf0aa81dc29490f5001f57a1" }, 51 | "nvim-treesitter-textobjects": { "branch": "master", "commit": "8edd5a6d96936bdff23333d3bc177481388839e5" }, 52 | "nvim-ts-autotag": { "branch": "main", "commit": "a65b202cfd08e0e69e531eab737205ff5bc082a4" }, 53 | "nvim-ts-context-commentstring": { "branch": "main", "commit": "7ab799a9792f7cf3883cf28c6a00ad431f3d382a" }, 54 | "nvim-ufo": { "branch": "main", "commit": "b0741a647efd98d9abb6cb653e056d24a07e4581" }, 55 | "nvim-web-devicons": { "branch": "master", "commit": "aaec87dbdaa776bfa0a13c8694bec9bcb7454719" }, 56 | "persistence.nvim": { "branch": "main", "commit": "4982499c1636eac254b72923ab826ee7827b3084" }, 57 | "plenary.nvim": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" }, 58 | "previm": { "branch": "master", "commit": "86d4dc0d28e7fdc0685a7a6e37eb3811dcff93a1" }, 59 | "promise-async": { "branch": "main", "commit": "94f6f03c6c1e2aab551aacdf0c1e597a7269abb6" }, 60 | "statuscol.nvim": { "branch": "main", "commit": "3b629754420919575a9e5758027d6e1831dbf2aa" }, 61 | "tailwindcss-colorizer-cmp.nvim": { "branch": "main", "commit": "bc25c56083939f274edcfe395c6ff7de23b67c50" }, 62 | "telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" }, 63 | "telescope.nvim": { "branch": "master", "commit": "7b5c5f56a21e82fdcfe5b250278b8dfc4b1cbab4" }, 64 | "todo-comments.nvim": { "branch": "main", "commit": "833d8dd8b07eeda37a09e99460f72a02616935cb" }, 65 | "tokyonight.nvim": { "branch": "main", "commit": "610179f7f12db3d08540b6cc61434db2eaecbcff" }, 66 | "trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" }, 67 | "vim-illuminate": { "branch": "master", "commit": "97c1265ff0b67064b6cfdc15bafc50202a537ae2" }, 68 | "vim-jsdoc": { "branch": "master", "commit": "6e5bc2a1f98a69e4902081c9f5969b228a7a5fd6" }, 69 | "vim-startuptime": { "branch": "master", "commit": "454b3de856b7bd298700de33d79774ca9b9e3875" }, 70 | "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } 71 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | --------------------------------------------------------------------------------