diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 2ad4d31ddb0..00000000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: '' -labels: '' -assignees: '' - ---- - - - -## Describe the bug - - -## To Reproduce - -1. ... - -## Desktop - -- OS: -- Terminal: - -## Neovim Version - - -``` -``` diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/.stylua.toml b/.stylua.toml deleted file mode 100644 index 139e9397d90..00000000000 --- a/.stylua.toml +++ /dev/null @@ -1,6 +0,0 @@ -column_width = 160 -line_endings = "Unix" -indent_type = "Spaces" -indent_width = 2 -quote_style = "AutoPreferSingle" -call_parentheses = "None" diff --git a/LICENSE.md b/LICENSE.md deleted file mode 100644 index 9cf106272ac..00000000000 --- a/LICENSE.md +++ /dev/null @@ -1,19 +0,0 @@ -MIT License - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/README.md b/README.md deleted file mode 100644 index 49fa0f315e6..00000000000 --- a/README.md +++ /dev/null @@ -1,159 +0,0 @@ -# kickstart.nvim - -https://github.com/kdheepak/kickstart.nvim/assets/1813121/f3ff9a2b-c31f-44df-a4fa-8a0d7b17cf7b - -### Introduction - -A starting point for Neovim that is: - -* Small -* Single-file (with examples of moving to multi-file) -* Documented -* Modular - -This repo is meant to be used by **YOU** to begin your Neovim journey; remove the things you don't use and add what you miss. - -Kickstart.nvim targets *only* the latest ['stable'](https://github.com/neovim/neovim/releases/tag/stable) and latest ['nightly'](https://github.com/neovim/neovim/releases/tag/nightly) of Neovim. If you are experiencing issues, please make sure you have the latest versions. - -Distribution Alternatives: -- [LazyVim](https://www.lazyvim.org/): A delightful distribution maintained by @folke (the author of lazy.nvim, the package manager used here) - -### Installation - -> **NOTE** -> [Backup](#FAQ) your previous configuration (if any exists) - -Requirements: -* Make sure to review the readmes of the plugins if you are experiencing errors. In particular: - * [ripgrep](https://github.com/BurntSushi/ripgrep#installation) is required for multiple [telescope](https://github.com/nvim-telescope/telescope.nvim#suggested-dependencies) pickers. -* See [Windows Installation](#Windows-Installation) if you have trouble with `telescope-fzf-native` - -Neovim's configurations are located under the following paths, depending on your OS: - -| OS | PATH | -| :- | :--- | -| Linux | `$XDG_CONFIG_HOME/nvim`, `~/.config/nvim` | -| MacOS | `$XDG_CONFIG_HOME/nvim`, '~/.config/nvim` | -| Windows | `%userprofile%\AppData\Local\nvim\` | - -Clone kickstart.nvim: - -```sh -# on Linux and Mac -git clone https://github.com/nvim-lua/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim -# on Windows -git clone https://github.com/nvim-lua/kickstart.nvim.git %userprofile%\AppData\Local\nvim\ -``` - -### Post Installation - -Run the following command and then **you are ready to go**! - -```sh -nvim --headless "+Lazy! sync" +qa -``` - -### Recommended Steps - -[Fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) this repo (so that you have your own copy that you can modify) and then installing you can install to your machine using the methods above. - -> **NOTE** -> Your fork's url will be something like this: `https://github.com//kickstart.nvim.git` - -### Configuration And Extension - -* Inside of your copy, feel free to modify any file you like! It's your copy! -* Feel free to change any of the default options in `init.lua` to better suit your needs. -* For adding plugins, there are 3 primary options: - * Add new configuration in `lua/custom/plugins/*` files, which will be auto sourced using `lazy.nvim` (uncomment the line importing the `custom/plugins` directory in the `init.lua` file to enable this) - * Modify `init.lua` with additional plugins. - * Include the `lua/kickstart/plugins/*` files in your configuration. - -You can also merge updates/changes from the repo back into your fork, to keep up-to-date with any changes for the default configuration. - -#### Example: Adding an autopairs plugin - -In the file: `lua/custom/plugins/autopairs.lua`, add: - -```lua --- File: lua/custom/plugins/autopairs.lua - -return { - "windwp/nvim-autopairs", - -- Optional dependency - dependencies = { 'hrsh7th/nvim-cmp' }, - config = function() - require("nvim-autopairs").setup {} - -- If you want to automatically add `(` after selecting a function or method - local cmp_autopairs = require('nvim-autopairs.completion.cmp') - local cmp = require('cmp') - cmp.event:on( - 'confirm_done', - cmp_autopairs.on_confirm_done() - ) - end, -} -``` - - -This will automatically install [windwp/nvim-autopairs](https://github.com/windwp/nvim-autopairs) and enable it on startup. For more information, see documentation for [lazy.nvim](https://github.com/folke/lazy.nvim). - -#### Example: Adding a file tree plugin - -In the file: `lua/custom/plugins/filetree.lua`, add: - -```lua --- Unless you are still migrating, remove the deprecated commands from v1.x -vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]]) - -return { - "nvim-neo-tree/neo-tree.nvim", - version = "*", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended - "MunifTanjim/nui.nvim", - }, - config = function () - require('neo-tree').setup {} - end, -} -``` - -This will install the tree plugin and add the command `:Neotree` for you. You can explore the documentation at [neo-tree.nvim](https://github.com/nvim-neo-tree/neo-tree.nvim) for more information. - -### Contribution - -Pull-requests are welcome. The goal of this repo is not to create a Neovim configuration framework, but to offer a starting template that shows, by example, available features in Neovim. Some things that will not be included: - -* Custom language server configuration (null-ls templates) -* Theming beyond a default colorscheme necessary for LSP highlight groups - -Each PR, especially those which increase the line count, should have a description as to why the PR is necessary. - -### FAQ - -* What should I do if I already have a pre-existing neovim configuration? - * You should back it up, then delete all files associated with it. - * This includes your existing init.lua and the neovim files in `~/.local` which can be deleted with `rm -rf ~/.local/share/nvim/` - * You may also want to look at the [migration guide for lazy.nvim](https://github.com/folke/lazy.nvim#-migration-guide) -* What if I want to "uninstall" this configuration: - * See [lazy.nvim uninstall](https://github.com/folke/lazy.nvim#-uninstalling) information -* Are there any cool videos about this plugin? - * Current iteration of kickstart (coming soon) - * Here is one about the previous iteration of kickstart: [video introduction to Kickstart.nvim](https://youtu.be/stqUbv-5u2s). Note the install via init.lua no longer works as specified. Please follow the install instructions in this file instead as they're up to date. - -### Windows Installation - -Installation may require installing build tools, and updating the run command for `telescope-fzf-native` - -See `telescope-fzf-native` documentation for [more details](https://github.com/nvim-telescope/telescope-fzf-native.nvim#installation) - -This requires: - -- Install CMake, and the Microsoft C++ Build Tools on Windows - -```lua -{'nvim-telescope/telescope-fzf-native.nvim', build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' } -``` - diff --git a/doc/kickstart.txt b/doc/kickstart.txt deleted file mode 100644 index cb87ac3f1de..00000000000 --- a/doc/kickstart.txt +++ /dev/null @@ -1,24 +0,0 @@ -================================================================================ -INTRODUCTION *kickstart.nvim* - -Kickstart.nvim is a project to help you get started on your neovim journey. - - *kickstart-is-not* -It is not: -- Complete framework for every plugin under the sun -- Place to add every plugin that could ever be useful - - *kickstart-is* -It is: -- Somewhere that has a good start for the most common "IDE" type features: - - autocompletion - - goto-definition - - find references - - fuzzy finding - - and hinting at what more can be done :) -- A place to _kickstart_ your journey. - - You should fork this project and use/modify it so that it matches your - style and preferences. If you don't want to do that, there are probably - other projects that would fit much better for you (and that's great!)! - - vim:tw=78:ts=8:ft=help:norl: diff --git a/doc/tags b/doc/tags deleted file mode 100644 index 687ae7721d9..00000000000 --- a/doc/tags +++ /dev/null @@ -1,3 +0,0 @@ -kickstart-is kickstart.txt /*kickstart-is* -kickstart-is-not kickstart.txt /*kickstart-is-not* -kickstart.nvim kickstart.txt /*kickstart.nvim* diff --git a/init.lua b/init.lua old mode 100644 new mode 100755 index ea330eb16f4..7f01b23133e --- a/init.lua +++ b/init.lua @@ -40,9 +40,14 @@ P.S. You can delete this when you're done too. It's your config now :) -- Set as the leader key -- See `:help mapleader` -- NOTE: Must happen before plugins are required (otherwise wrong leader will be used) + vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' +-- disable netrw for NvimTree +vim.g.loaded_netrw = 1 +vim.g.loaded_netrwPlugin = 1 + -- Install package manager -- https://github.com/folke/lazy.nvim -- `:help lazy.nvim.txt` for more info @@ -86,7 +91,7 @@ require('lazy').setup({ -- Useful status updates for LSP -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` - { 'j-hui/fidget.nvim', tag = 'legacy', opts = {} }, + { 'j-hui/fidget.nvim', tag = 'legacy', opts = {} }, -- Additional lua configuration, makes nvim stuff amazing! 'folke/neodev.nvim', @@ -110,7 +115,7 @@ require('lazy').setup({ }, -- Useful plugin to show you pending keybinds. - { 'folke/which-key.nvim', opts = {} }, + { 'folke/which-key.nvim', opts = {} }, { -- Adds git related signs to the gutter, as well as utilities for managing changes 'lewis6991/gitsigns.nvim', @@ -128,56 +133,24 @@ require('lazy').setup({ -- don't override the built-in and fugitive keymaps local gs = package.loaded.gitsigns - vim.keymap.set({'n', 'v'}, ']c', function() + vim.keymap.set({ 'n', 'v' }, ']c', function() if vim.wo.diff then return ']c' end vim.schedule(function() gs.next_hunk() end) return '' - end, {expr=true, buffer = bufnr, desc = "Jump to next hunk"}) - vim.keymap.set({'n', 'v'}, '[c', function() + end, { expr = true, buffer = bufnr, desc = "Jump to next hunk" }) + vim.keymap.set({ 'n', 'v' }, '[c', function() if vim.wo.diff then return '[c' end vim.schedule(function() gs.prev_hunk() end) return '' - end, {expr=true, buffer = bufnr, desc = "Jump to previous hunk"}) + end, { expr = true, buffer = bufnr, desc = "Jump to previous hunk" }) end, }, }, - { - -- Theme inspired by Atom - 'navarasu/onedark.nvim', - priority = 1000, - config = function() - vim.cmd.colorscheme 'onedark' - end, - }, - - { - -- Set lualine as statusline - 'nvim-lualine/lualine.nvim', - -- See `:help lualine.txt` - opts = { - options = { - icons_enabled = false, - theme = 'onedark', - component_separators = '|', - section_separators = '', - }, - }, - }, - - { - -- Add indentation guides even on blank lines - 'lukas-reineke/indent-blankline.nvim', - -- Enable `lukas-reineke/indent-blankline.nvim` - -- See `:help indent_blankline.txt` - opts = { - char = '┊', - show_trailing_blankline_indent = false, - }, - }, + { 'mfussenegger/nvim-jdtls' }, -- "gc" to comment visual regions/lines - { 'numToStr/Comment.nvim', opts = {} }, + { 'numToStr/Comment.nvim', opts = {} }, -- Fuzzy Finder (files, lsp, etc) { @@ -198,6 +171,16 @@ require('lazy').setup({ end, }, }, + config = function() + -- load refactoring Telescope extension + require("telescope").load_extension("refactoring") + + vim.keymap.set( + { "n", "x" }, + "rr", + function() require('telescope').extensions.refactoring.refactors() end + ) + end, }, { @@ -221,9 +204,13 @@ require('lazy').setup({ -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. -- -- For additional information see: https://github.com/folke/lazy.nvim#-structuring-your-plugins - -- { import = 'custom.plugins' }, + { import = 'custom/plugins' }, }, {}) +-- [[ Theme ]] +vim.cmd [[colorscheme tokyonight]] +vim.g.theme = "tokyonight" + -- [[ Setting options ]] -- See `:help vim.o` -- NOTE: You can change these options as you wish! @@ -233,6 +220,7 @@ vim.o.hlsearch = false -- Make line numbers default vim.wo.number = true +vim.api.nvim_set_hl(0, 'LineNr', { fg = "white" }) -- Enable mouse mode vim.o.mouse = 'a' @@ -275,6 +263,12 @@ vim.keymap.set({ 'n', 'v' }, '', '', { silent = true }) vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) + +-- Remap for navigating between buffers +-- vim.keymap.set('n', 'x', 'bd', { silent = true }) +-- vim.keymap.set('n', 'l', 'bnext', { silent = true }) +-- vim.keymap.set('n', 'h', 'bprev', { silent = true }) + -- [[ Highlight on yank ]] -- See `:help vim.highlight.on_yank()` local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true }) @@ -326,9 +320,11 @@ vim.keymap.set('n', 'sr', require('telescope.builtin').resume, { desc = require('nvim-treesitter.configs').setup { -- Add languages to be installed here that you want installed for treesitter ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim' }, - + autotag = { + enable = true, + }, -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!) - auto_install = false, + auto_install = true, highlight = { enable = true }, indent = { enable = true }, @@ -387,12 +383,16 @@ require('nvim-treesitter.configs').setup { }, } --- Diagnostic keymaps + + +-- Diagnostic keymap vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic message' }) vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnostic message' }) +vim.keymap.set('n', 'C-y', vim.diagnostic.goto_next, { desc = 'Go to next diagnostic message' }) vim.keymap.set('n', 'e', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' }) vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' }) + -- [[ Configure LSP ]] -- This function gets run when an LSP connects to a particular buffer. local on_attach = function(_, bufnr) @@ -415,7 +415,7 @@ local on_attach = function(_, bufnr) nmap('gd', vim.lsp.buf.definition, '[G]oto [D]efinition') nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences') - nmap('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation') + nmap('gi', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation') nmap('D', vim.lsp.buf.type_definition, 'Type [D]efinition') nmap('ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols') nmap('ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols') @@ -447,12 +447,13 @@ end -- If you want to override the default filetypes that your language server will attach to you can -- define the property 'filetypes' to the map in question. local servers = { - -- clangd = {}, - -- gopls = {}, - -- pyright = {}, - -- rust_analyzer = {}, - -- tsserver = {}, - -- html = { filetypes = { 'html', 'twig', 'hbs'} }, + clangd = {}, + gopls = { filetypes = { 'go' } }, + pyright = {}, + rust_analyzer = {}, + tsserver = {}, + jdtls = { filetypes = { 'java' } }, + html = { filetypes = { 'html', 'twig', 'hbs' } }, lua_ls = { Lua = { @@ -478,6 +479,9 @@ mason_lspconfig.setup { mason_lspconfig.setup_handlers { function(server_name) + if server_name == 'jdtls' then + return + end require('lspconfig')[server_name].setup { capabilities = capabilities, on_attach = on_attach, @@ -506,10 +510,11 @@ cmp.setup { [''] = cmp.mapping.scroll_docs(-4), [''] = cmp.mapping.scroll_docs(4), [''] = cmp.mapping.complete {}, - [''] = cmp.mapping.confirm { + [''] = cmp.mapping.confirm { behavior = cmp.ConfirmBehavior.Replace, select = true, }, + [''] = cmp.mapping.confirm({ select = false }), [''] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_next_item() @@ -535,5 +540,15 @@ cmp.setup { }, } +-- [[NvimTree]] +require("nvim-tree").setup { + update_focused_file = { + enable = true + } +} + +-- [[Other configs]] +require("custom") + -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et diff --git a/lua/custom/configs/jdtls.lua b/lua/custom/configs/jdtls.lua new file mode 100755 index 00000000000..1048112aadf --- /dev/null +++ b/lua/custom/configs/jdtls.lua @@ -0,0 +1,285 @@ +local java_cmds = vim.api.nvim_create_augroup('java_cmds', { clear = true }) +local cache_vars = {} + +local root_files = { + '.git', + 'mvnw', + 'gradlew', + 'pom.xml', + 'build.gradle', +} + +local features = { + -- change this to `true` to enable codelens + codelens = false, + + -- change this to `true` if you have `nvim-dap`, + -- `java-test` and `java-debug-adapter` installed + debugger = true, +} + +local function get_jdtls_paths() + if cache_vars.paths then + return cache_vars.paths + end + + local path = {} + + path.data_dir = vim.fn.stdpath('cache') .. '/nvim-jdtls' + + local jdtls_install = require('mason-registry') + .get_package('jdtls') + :get_install_path() + + path.java_agent = jdtls_install .. '/lombok.jar' + path.launcher_jar = vim.fn.glob(jdtls_install .. '/plugins/org.eclipse.equinox.launcher_*.jar') + + if vim.fn.has('mac') == 1 then + path.platform_config = jdtls_install .. '/config_mac' + elseif vim.fn.has('unix') == 1 then + path.platform_config = jdtls_install .. '/config_linux' + elseif vim.fn.has('win32') == 1 then + path.platform_config = jdtls_install .. '/config_win' + end + + path.bundles = {} + + --- + -- Include java-test bundle if present + --- + local java_test_path = require('mason-registry') + .get_package('java-test') + :get_install_path() + + local java_test_bundle = vim.split( + vim.fn.glob(java_test_path .. '/extension/server/*.jar'), + '\n' + ) + + if java_test_bundle[1] ~= '' then + vim.list_extend(path.bundles, java_test_bundle) + end + + --- + -- Include java-debug-adapter bundle if present + --- + local java_debug_path = require('mason-registry') + .get_package('java-debug-adapter') + :get_install_path() + + local java_debug_bundle = vim.split( + vim.fn.glob(java_debug_path .. '/extension/server/com.microsoft.java.debug.plugin-*.jar'), + '\n' + ) + + if java_debug_bundle[1] ~= '' then + vim.list_extend(path.bundles, java_debug_bundle) + end + + --- + -- Useful if you're starting jdtls with a Java version that's + -- different from the one the project uses. + --- + path.runtimes = { + -- Note: the field `name` must be a valid `ExecutionEnvironment`, + -- you can find the list here: + -- https://github.com/eclipse/eclipse.jdt.ls/wiki/Running-the-JAVA-LS-server-from-the-command-line#initialize-request + -- + -- This example assume you are using sdkman: https://sdkman.io + -- { + -- name = 'JavaSE-17', + -- path = vim.fn.expand('~/.sdkman/candidates/java/17.0.6-tem'), + -- }, + -- { + -- name = 'JavaSE-18', + -- path = vim.fn.expand('~/.sdkman/candidates/java/18.0.2-amzn'), + -- }, + } + + cache_vars.paths = path + + return path +end + +local function enable_codelens(bufnr) + pcall(vim.lsp.codelens.refresh) + + vim.api.nvim_create_autocmd('BufWritePost', { + buffer = bufnr, + group = java_cmds, + desc = 'refresh codelens', + callback = function() + pcall(vim.lsp.codelens.refresh) + end, + }) +end + +local function enable_debugger(bufnr) + require('jdtls').setup_dap({ hotcodereplace = 'auto' }) + require('jdtls.dap').setup_dap_main_class_configs() + + local opts = { buffer = bufnr } + vim.keymap.set('n', 'df', "lua require('jdtls').test_class()", opts) + vim.keymap.set('n', 'dn', "lua require('jdtls').test_nearest_method()", opts) +end + +local function jdtls_on_attach(client, bufnr) + if features.debugger then + enable_debugger(bufnr) + end + + if features.codelens then + enable_codelens(bufnr) + end + + -- The following mappings are based on the suggested usage of nvim-jdtls + -- https://github.com/mfussenegger/nvim-jdtls#usage + + local opts = { buffer = bufnr } + vim.keymap.set('n', '', "lua require('jdtls').organize_imports()", opts) + vim.keymap.set('n', 'rv', "lua require('jdtls').extract_variable()", opts) + vim.keymap.set('x', 'rv', "lua require('jdtls').extract_variable(true)", opts) + vim.keymap.set('n', 'rc', "lua require('jdtls').extract_constant()", opts) + vim.keymap.set('x', 'rc', "lua require('jdtls').extract_constant(true)", opts) + vim.keymap.set('x', 'rc', "lua require('jdtls').extract_method(true)", opts) +end + +local function jdtls_setup(event) + local jdtls = require('jdtls') + + local path = get_jdtls_paths() + local data_dir = path.data_dir .. '/' .. vim.fn.fnamemodify(vim.fn.getcwd(), ':p:h:t') + + if cache_vars.capabilities == nil then + jdtls.extendedClientCapabilities.resolveAdditionalTextEditsSupport = true + + local ok_cmp, cmp_lsp = pcall(require, 'cmp_nvim_lsp') + cache_vars.capabilities = vim.tbl_deep_extend( + 'force', + vim.lsp.protocol.make_client_capabilities(), + ok_cmp and cmp_lsp.default_capabilities() or {} + ) + end + + -- The command that starts the language server + -- See: https://github.com/eclipse/eclipse.jdt.ls#running-from-the-command-line + local cmd = { + -- 💀 + '/usr/lib/jvm/java-17-openjdk-amd64/bin/java', + + '-Declipse.application=org.eclipse.jdt.ls.core.id1', + '-Dosgi.bundles.defaultStartLevel=4', + '-Declipse.product=org.eclipse.jdt.ls.core.product', + '-Dlog.protocol=true', + '-Dlog.level=ALL', + '-javaagent:' .. path.java_agent, + '-Xms1g', + '--add-modules=ALL-SYSTEM', + '--add-opens', + 'java.base/java.util=ALL-UNNAMED', + '--add-opens', + 'java.base/java.lang=ALL-UNNAMED', + + -- 💀 + '-jar', + path.launcher_jar, + + -- 💀 + '-configuration', + path.platform_config, + + -- 💀 + '-data', + data_dir, + } + + local lsp_settings = { + java = { + -- jdt = { + -- ls = { + -- vmargs = "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx1G -Xms100m" + -- } + -- }, + eclipse = { + downloadSources = true, + }, + configuration = { + updateBuildConfiguration = 'interactive', + runtimes = path.runtimes, + }, + maven = { + downloadSources = true, + }, + implementationsCodeLens = { + enabled = true, + }, + referencesCodeLens = { + enabled = true, + }, + -- inlayHints = { + -- parameterNames = { + -- enabled = 'all' -- literals, all, none + -- } + -- }, + format = { + enabled = true, + -- settings = { + -- profile = 'asdf' + -- }, + } + }, + signatureHelp = { + enabled = true, + }, + completion = { + favoriteStaticMembers = { + 'org.hamcrest.MatcherAssert.assertThat', + 'org.hamcrest.Matchers.*', + 'org.hamcrest.CoreMatchers.*', + 'org.junit.jupiter.api.Assertions.*', + 'java.util.Objects.requireNonNull', + 'java.util.Objects.requireNonNullElse', + 'org.mockito.Mockito.*', + }, + }, + contentProvider = { + preferred = 'fernflower', + }, + extendedClientCapabilities = jdtls.extendedClientCapabilities, + sources = { + organizeImports = { + starThreshold = 9999, + staticStarThreshold = 9999, + } + }, + codeGeneration = { + toString = { + template = '${object.className}{${member.name()}=${member.value}, ${otherMembers}}', + }, + useBlocks = true, + }, + } + + -- This starts a new client & server, + -- or attaches to an existing client & server depending on the `root_dir`. + jdtls.start_or_attach({ + cmd = cmd, + settings = lsp_settings, + on_attach = jdtls_on_attach, + capabilities = cache_vars.capabilities, + root_dir = jdtls.setup.find_root(root_files), + flags = { + allow_incremental_sync = true, + }, + init_options = { + bundles = path.bundles, + }, + }) +end + +vim.api.nvim_create_autocmd('FileType', { + group = java_cmds, + pattern = { 'java' }, + desc = 'Setup jdtls', + callback = jdtls_setup, +}) diff --git a/lua/custom/configs/remaps.lua b/lua/custom/configs/remaps.lua new file mode 100755 index 00000000000..96ca00f1228 --- /dev/null +++ b/lua/custom/configs/remaps.lua @@ -0,0 +1,54 @@ +-- thanks https://github.com/ThePrimeagen/init.lua/blob/master/lua/theprimeagen/remap.lua + +-- move hightlighted code +vim.keymap.set("v", "C-P", ":m '>+1gv=gv") +vim.keymap.set("v", "C-N", ":m '<-2gv=gv") + +-- J appends line below to current line but cursor doesn't move +vim.keymap.set("n", "J", "mzJ`z") + +-- keeps cursos in middle when moving/searching +vim.keymap.set("n", "", "zz") +vim.keymap.set("n", "", "zz") +vim.keymap.set("n", "n", "nzzzv") +vim.keymap.set("n", "N", "Nzzzv") + +-- greatest remap ever +-- paste without adding deleted text to register +vim.keymap.set("x", "p", [["_dP]]) +-- delete without adding deleted text to register +vim.keymap.set("x", "d", [["_d]]) + +-- next greatest remap ever : asbjornHaland +-- yank/delete into system clipboard +vim.keymap.set({ "n", "v" }, "y", [["+y]]) +vim.keymap.set("n", "Y", [["+Y]]) +vim.keymap.set({ "n", "v" }, "d", [["_d]]) + +-- dont press this +vim.keymap.set("n", "Q", "") + +-- quickfix nav +vim.keymap.set("n", "", "cnextzz") +vim.keymap.set("n", "", "cprevzz") +vim.keymap.set("n", "k", "lnextzz") +vim.keymap.set("n", "j", "lprevzz") + +-- find/replace word you're on +vim.keymap.set("n", "s", [[:%s/\<\>//gI]]) +-- make script executable +vim.keymap.set("n", "+", "!chmod +x %", { silent = true }) + +--trouble.nvim +vim.keymap.set("n", "xx", function() require("trouble").toggle() end, { desc = 'Open Trouble' }) +vim.keymap.set("n", "xw", function() require("trouble").toggle("workspace_diagnostics") end, + { desc = 'Trouble [w]orkspace Diagnostics' }) +vim.keymap.set("n", "xd", function() require("trouble").toggle("document_diagnostics") end, + { desc = 'Trouble [d]ocument Diagnostics' }) +vim.keymap.set("n", "xq", function() require("trouble").toggle("quickfix") end, { desc = 'Trouble [q]uickfix' }) +vim.keymap.set("n", "xl", function() require("trouble").toggle("loclist") end, { desc = 'Trouble [l]oclist' }) +vim.keymap.set("n", "xR", function() require("trouble").toggle("lsp_references") end, + { desc = 'Trouble [g]o to [R]eferences' }) + +-- undotree +vim.keymap.set('n', 'u', vim.cmd.UndotreeToggle) diff --git a/lua/custom/configs/set.lua b/lua/custom/configs/set.lua new file mode 100755 index 00000000000..a6fcb75fe0e --- /dev/null +++ b/lua/custom/configs/set.lua @@ -0,0 +1,20 @@ +vim.opt.nu = true +vim.opt.relativenumber = true + +vim.opt.tabstop = 4 +vim.opt.softtabstop = 4 +vim.opt.shiftwidth = 4 +vim.opt.expandtab = true + +vim.opt.smartindent = true + +vim.opt.termguicolors = true + +vim.opt.scrolloff = 8 +vim.opt.signcolumn = "yes" +vim.opt.isfname:append("@-@") + +vim.opt.updatetime = 50 + +-- Define a command to write with sudo +vim.cmd("command! -nargs=0 W execute 'w !sudo tee % > /dev/null' | edit!") diff --git a/lua/custom/init.lua b/lua/custom/init.lua new file mode 100755 index 00000000000..6ce4178492a --- /dev/null +++ b/lua/custom/init.lua @@ -0,0 +1,4 @@ +require("custom.configs.set") +require("custom.configs.remaps") +require("custom.configs.jdtls") +require("custom.statusline.init") diff --git a/lua/kickstart/plugins/autoformat.lua b/lua/custom/plugins/autoformat.lua old mode 100644 new mode 100755 similarity index 95% rename from lua/kickstart/plugins/autoformat.lua rename to lua/custom/plugins/autoformat.lua index bc56b15b027..8764b67bbd7 --- a/lua/kickstart/plugins/autoformat.lua +++ b/lua/custom/plugins/autoformat.lua @@ -46,7 +46,7 @@ return { -- Tsserver usually works poorly. Sorry you work with bad languages -- You can remove this line if you know what you're doing :) - if client.name == 'tsserver' then + if client.name == 'tsserver' or client.name == 'jsonls' or client.name == 'html' or client.name == 'intelephense' then return end diff --git a/lua/kickstart/plugins/debug.lua b/lua/custom/plugins/debug.lua old mode 100644 new mode 100755 similarity index 81% rename from lua/kickstart/plugins/debug.lua rename to lua/custom/plugins/debug.lua index 7fc783fabd4..4ba264c4a8c --- a/lua/kickstart/plugins/debug.lua +++ b/lua/custom/plugins/debug.lua @@ -25,6 +25,19 @@ return { local dap = require 'dap' local dapui = require 'dapui' + dap.listeners.after.event_initialized["dapui_config"] = function() + dapui.open() + end + dap.listeners.before.event_terminated["dapui_config"] = function() + dapui.close() + end + dap.listeners.before.event_exited["dapui_config"] = function() + dapui.close() + end + + vim.fn.sign_define('DapBreakpoint', { text = '🟥', texthl = '', linehl = '', numhl = '' }) + vim.fn.sign_define('DapStopped', { text = '▶️', texthl = '', linehl = '', numhl = '' }) + require('mason-nvim-dap').setup { -- Makes a best effort to setup the various debuggers with -- reasonable debug configurations @@ -44,9 +57,9 @@ return { -- Basic debugging keymaps, feel free to change to your liking! vim.keymap.set('n', '', dap.continue, { desc = 'Debug: Start/Continue' }) - vim.keymap.set('n', '', dap.step_into, { desc = 'Debug: Step Into' }) - vim.keymap.set('n', '', dap.step_over, { desc = 'Debug: Step Over' }) - vim.keymap.set('n', '', dap.step_out, { desc = 'Debug: Step Out' }) + vim.keymap.set('n', '', dap.step_into, { desc = 'Debug: Step Into' }) + vim.keymap.set('n', '', dap.step_over, { desc = 'Debug: Step Over' }) + vim.keymap.set('n', '', dap.step_out, { desc = 'Debug: Step Out' }) vim.keymap.set('n', 'b', dap.toggle_breakpoint, { desc = 'Debug: Toggle Breakpoint' }) vim.keymap.set('n', 'B', function() dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ') diff --git a/lua/custom/plugins/dressing.lua b/lua/custom/plugins/dressing.lua new file mode 100644 index 00000000000..996ea793dc7 --- /dev/null +++ b/lua/custom/plugins/dressing.lua @@ -0,0 +1,15 @@ +return { + "stevearc/dressing.nvim", + init = function() + ---@diagnostic disable-next-line: duplicate-set-field + vim.ui.select = function(...) + require("lazy").load({ plugins = { "dressing.nvim" } }) + return vim.ui.select(...) + end + ---@diagnostic disable-next-line: duplicate-set-field + vim.ui.input = function(...) + require("lazy").load({ plugins = { "dressing.nvim" } }) + return vim.ui.input(...) + end + end, +} diff --git a/lua/custom/plugins/harpoon.lua b/lua/custom/plugins/harpoon.lua new file mode 100644 index 00000000000..9f526a65dc4 --- /dev/null +++ b/lua/custom/plugins/harpoon.lua @@ -0,0 +1,50 @@ +return { + "theprimeagen/harpoon", + branch = "harpoon2", + lazy = false, + dependencies = { "nvim-lua/plenary.nvim" }, + config = function() + require("harpoon"):setup() + end, + keys = { + { + "h", + function() require("harpoon"):list():append() end, + desc = + "harpoon file", + }, + { + "", + function() + local harpoon = require("harpoon") + harpoon.ui:toggle_quick_menu(harpoon:list()) + end, + desc = + "harpoon quick menu", + }, + { + "1", + function() require("harpoon"):list():select(1) end, + desc = + "harpoon to file 1", + }, + { + "2", + function() require("harpoon"):list():select(2) end, + desc = + "harpoon to file 2", + }, + { + "3", + function() require("harpoon"):list():select(3) end, + desc = + "harpoon to file 3", + }, + { + "4", + function() require("harpoon"):list():select(4) end, + desc = + "harpoon to file 4", + }, + }, +} diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua deleted file mode 100644 index be0eb9d8d7a..00000000000 --- a/lua/custom/plugins/init.lua +++ /dev/null @@ -1,5 +0,0 @@ --- You can add your own plugins here or in other files in this directory! --- I promise not to create any merge conflicts in this directory :) --- --- See the kickstart.nvim README for more information -return {} diff --git a/lua/custom/plugins/markdown-preview.lua b/lua/custom/plugins/markdown-preview.lua new file mode 100644 index 00000000000..153accf4583 --- /dev/null +++ b/lua/custom/plugins/markdown-preview.lua @@ -0,0 +1,11 @@ +return { + { + "iamcco/markdown-preview.nvim", + cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, + build = "cd app && yarn install", + init = function() + vim.g.mkdp_filetypes = { "markdown" } + end, + ft = { "markdown" }, + }, +} diff --git a/lua/custom/plugins/multicursor.lua b/lua/custom/plugins/multicursor.lua new file mode 100644 index 00000000000..a50d9ee0498 --- /dev/null +++ b/lua/custom/plugins/multicursor.lua @@ -0,0 +1,17 @@ +return { + "smoka7/multicursors.nvim", + event = "VeryLazy", + dependencies = { + 'smoka7/hydra.nvim', + }, + opts = {}, + cmd = { 'MCstart', 'MCvisual', 'MCclear', 'MCpattern', 'MCvisualPattern', 'MCunderCursor' }, + keys = { + { + mode = { 'v', 'n' }, + 'm', + 'MCstart', + desc = 'Create a selection for selected text or word under the cursor', + }, + }, +} diff --git a/lua/custom/plugins/neodev.lua b/lua/custom/plugins/neodev.lua new file mode 100644 index 00000000000..81416b5bfba --- /dev/null +++ b/lua/custom/plugins/neodev.lua @@ -0,0 +1,9 @@ +return { + "folke/neodev.nvim", + config = function() + require("neodev").setup({ + library = { plugins = { "nvim-dap-ui" }, types = true }, + }) + end, + opts = {}, +} diff --git a/lua/custom/plugins/noice.lua b/lua/custom/plugins/noice.lua new file mode 100644 index 00000000000..0a2947f760b --- /dev/null +++ b/lua/custom/plugins/noice.lua @@ -0,0 +1,35 @@ +return { + "folke/noice.nvim", + event = "VeryLazy", + opts = { + -- add any options here + }, + dependencies = { + -- if you lazy-load any plugin below, make sure to add proper `module="..."` entries + "MunifTanjim/nui.nvim", + -- OPTIONAL: + -- `nvim-notify` is only needed, if you want to use the notification view. + -- If not available, we use `mini` as the fallback + -- "rcarriga/nvim-notify", + }, + setup = function() + require("noice").setup({ + lsp = { + -- override markdown rendering so that **cmp** and other plugins use **Treesitter** + override = { + ["vim.lsp.util.convert_input_to_markdown_lines"] = true, + ["vim.lsp.util.stylize_markdown"] = true, + ["cmp.entry.get_documentation"] = true, -- requires hrsh7th/nvim-cmp + }, + }, + -- you can enable a preset for easier configuration + presets = { + bottom_search = true, -- use a classic bottom cmdline for search + command_palette = true, -- position the cmdline and popupmenu together + long_message_to_split = true, -- long messages will be sent to a split + inc_rename = false, -- enables an input dialog for inc-rename.nvim + lsp_doc_border = false, -- add a border to hover docs and signature help + }, + }) + end +} diff --git a/lua/custom/plugins/nvim-tree.lua b/lua/custom/plugins/nvim-tree.lua new file mode 100755 index 00000000000..5b5a7bb2046 --- /dev/null +++ b/lua/custom/plugins/nvim-tree.lua @@ -0,0 +1,21 @@ +return { + { + "nvim-tree/nvim-tree.lua", + version = "*", + lazy = false, + dependencies = { + "nvim-tree/nvim-web-devicons", + }, + window = { + mappings = { + [""] = "none", + }, + }, + keys = { + { "et", "NvimTreeToggle", desc = "Nvim[T]ree [T]oggle" }, + { "ef", "NvimTreeFocus", desc = "Nvim[T]ree [F]ocus " }, + { "eo", "NvimTreeOpen", desc = "Nvim[T]ree [O]pen" }, + { "ex", "NvimTreeClose", desc = "Nvim[T]ree [C]lose" }, + }, + }, +} diff --git a/lua/custom/plugins/refactor.lua b/lua/custom/plugins/refactor.lua new file mode 100644 index 00000000000..a3f37f02929 --- /dev/null +++ b/lua/custom/plugins/refactor.lua @@ -0,0 +1,32 @@ +return { + { + "ThePrimeagen/refactoring.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-treesitter/nvim-treesitter", + }, + config = function() + require("refactoring").setup() + vim.keymap.set("x", "re", function() require('refactoring').refactor('Extract Function') end + , { desc = '[E]xtract Function' }) + vim.keymap.set("x", "rf", function() require('refactoring').refactor('Extract Function To File') end, + { desc = 'Extract Function to [F]ile' }) + -- Extract function supports only visual mode + vim.keymap.set("x", "rv", function() require('refactoring').refactor('Extract Variable') end + , { desc = 'Extract [V]ariable' }) + -- Extract variable supports only visual mode + vim.keymap.set("n", "rI", function() require('refactoring').refactor('Inline Function') end + , { desc = '[I]nline Function' }) + -- Inline func supports only normal + vim.keymap.set({ "n", "x" }, "ri", function() require('refactoring').refactor('Inline Variable') end + , { desc = '[I]nline Variable' }) + -- Inline var supports both normal and visual mode + + vim.keymap.set("n", "rb", function() require('refactoring').refactor('Extract Block') end, + { desc = 'Extract [B]lock' }) + vim.keymap.set("n", "rbf", function() require('refactoring').refactor('Extract Block To File') end, + { desc = 'Extract [B]lock to [F]ile' }) + -- Extract block supports only normal mode + end, + }, +} diff --git a/lua/custom/plugins/suda.lua b/lua/custom/plugins/suda.lua new file mode 100755 index 00000000000..1ac49bd91d7 --- /dev/null +++ b/lua/custom/plugins/suda.lua @@ -0,0 +1,5 @@ +return { + { + "lambdalisue/suda.vim" + } +} diff --git a/lua/custom/plugins/surround.lua b/lua/custom/plugins/surround.lua new file mode 100644 index 00000000000..c08e62cf916 --- /dev/null +++ b/lua/custom/plugins/surround.lua @@ -0,0 +1,10 @@ +return { + "kylechui/nvim-surround", + version = "*", -- Use for stability; omit to use `main` branch for the latest features + event = "VeryLazy", + config = function() + require("nvim-surround").setup({ + -- Configuration here, or leave empty to use defaults + }) + end +} diff --git a/lua/custom/plugins/themes.lua b/lua/custom/plugins/themes.lua new file mode 100755 index 00000000000..fc34e21a680 --- /dev/null +++ b/lua/custom/plugins/themes.lua @@ -0,0 +1,88 @@ +return { + { + "folke/tokyonight.nvim", + lazy = false, + priority = 1000, + opts = { + style = "moon", + }, + }, + -- { + -- "catppuccin/nvim", + -- lazy = false, + -- priority = 1000, + -- }, + -- { + -- Set lualine as statusline + -- 'nvim-lualine/lualine.nvim', + -- See `:help lualine.txt` + -- opts = { + -- options = { + -- icons_enabled = true, + -- theme = 'catppuccin-mocha', + -- theme = 'tokyonight', + -- section_separators = { left = '', right = '' }, + -- component_separators = { left = '', right = '' } + -- }, + -- }, + -- }, + { + "lukas-reineke/indent-blankline.nvim", + main = "ibl", + opts = { + indent = { + char = "│", + tab_char = "│", + }, + scope = { enabled = false }, + exclude = { + filetypes = { + "help", + "alpha", + "dashboard", + "neo-tree", + "Trouble", + "trouble", + "lazy", + "mason", + "notify", + "toggleterm", + "lazyterm", + }, + }, + }, + }, + + -- Active indent guide and indent text objects. When you're browsing + -- code, this highlights the current level of indentation, and animates + -- the highlighting. + { + "echasnovski/mini.indentscope", + version = false, -- wait till new 0.7.0 release to put it back on semver + opts = { + -- symbol = "▏", + symbol = "│", + options = { try_as_border = true }, + }, + init = function() + vim.api.nvim_create_autocmd("FileType", { + pattern = { + "help", + "alpha", + "dashboard", + "neo-tree", + "Trouble", + "trouble", + "lazy", + "mason", + "notify", + "toggleterm", + "lazyterm", + }, + callback = function() + vim.b.miniindentscope_disable = true + end, + }) + end, + }, +} diff --git a/lua/custom/plugins/tmux-nvim.lua b/lua/custom/plugins/tmux-nvim.lua new file mode 100755 index 00000000000..9a723a5a918 --- /dev/null +++ b/lua/custom/plugins/tmux-nvim.lua @@ -0,0 +1,6 @@ +return { + { + "christoomey/vim-tmux-navigator", + lazy = false, + }, +} diff --git a/lua/custom/plugins/trouble.lua b/lua/custom/plugins/trouble.lua new file mode 100644 index 00000000000..2e8e8fd40f5 --- /dev/null +++ b/lua/custom/plugins/trouble.lua @@ -0,0 +1,9 @@ +return { + "folke/trouble.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + opts = { + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below + }, +} diff --git a/lua/custom/plugins/undotree.lua b/lua/custom/plugins/undotree.lua new file mode 100644 index 00000000000..4c9b5f58df3 --- /dev/null +++ b/lua/custom/plugins/undotree.lua @@ -0,0 +1,3 @@ +return { + "mbbill/undotree", +} diff --git a/lua/custom/plugins/util.lua b/lua/custom/plugins/util.lua new file mode 100755 index 00000000000..60d84ed870d --- /dev/null +++ b/lua/custom/plugins/util.lua @@ -0,0 +1,17 @@ +return { + + -- [[Autopairs]] + -- doubles up common surrounding characters + { 'windwp/nvim-autopairs', event = "InsertEnter", opts = {} }, + + -- [[Comment]] + -- comments code with 'gcc' & 'gbc' + { + 'numToStr/Comment.nvim', + opts = { + -- add any options here + }, + lazy = false, + }, + -- { 'nvim-ts-autotag', opts = {} }, +} diff --git a/lua/custom/statusline/init.lua b/lua/custom/statusline/init.lua new file mode 100755 index 00000000000..efdd7cbcd99 --- /dev/null +++ b/lua/custom/statusline/init.lua @@ -0,0 +1,17 @@ +vim.opt.statusline = "%!v:lua.require('custom.statusline.statusline').run()" +vim.opt.laststatus = 3 + +function SetColors(theme) + for hlgroupName, hlgroup_vals in pairs(theme) do + local hlname = hlgroupName + local opts = {} + + for optName, optVal in pairs(hlgroup_vals) do + opts[optName] = optVal + end + vim.api.nvim_set_hl(0, hlname, opts) + end +end + +Theme = require('custom.statusline.theme') +SetColors(Theme) diff --git a/lua/custom/statusline/statusline.lua b/lua/custom/statusline/statusline.lua new file mode 100755 index 00000000000..6118c2b17e6 --- /dev/null +++ b/lua/custom/statusline/statusline.lua @@ -0,0 +1,216 @@ +local fn = vim.fn +local sep_style = "default" + +local default_sep_icons = { + default = { left = "", right = "" }, + round = { left = "", right = "" }, + block = { left = "█", right = "█" }, + arrow = { left = "", right = "" }, +} + +local separators = (type(sep_style) == "table" and sep_style) or default_sep_icons[sep_style] + +local sep_l = separators["left"] +local sep_r = separators["right"] +local sep_m = default_sep_icons["block"]["left"] + +local function stbufnr() + return vim.api.nvim_win_get_buf(vim.g.statusline_winid) +end + +local function is_activewin() + return vim.api.nvim_get_current_win() == vim.g.statusline_winid +end + +local M = {} + +M.modes = { + ["n"] = { "NORMAL", "St_NormalMode" }, + ["no"] = { "NORMAL (no)", "St_NormalMode" }, + ["nov"] = { "NORMAL (nov)", "St_NormalMode" }, + ["noV"] = { "NORMAL (noV)", "St_NormalMode" }, + ["noCTRL-V"] = { "NORMAL", "St_NormalMode" }, + ["niI"] = { "NORMAL i", "St_NormalMode" }, + ["niR"] = { "NORMAL r", "St_NormalMode" }, + ["niV"] = { "NORMAL v", "St_NormalMode" }, + ["nt"] = { "NTERMINAL", "St_NTerminalMode" }, + ["ntT"] = { "NTERMINAL (ntT)", "St_NTerminalMode" }, + + ["v"] = { "VISUAL", "St_VisualMode" }, + ["vs"] = { "V-CHAR (Ctrl O)", "St_VisualMode" }, + ["V"] = { "V-LINE", "St_VisualMode" }, + ["Vs"] = { "V-LINE", "St_VisualMode" }, + [""] = { "V-BLOCK", "St_VisualMode" }, + + ["i"] = { "INSERT", "St_InsertMode" }, + ["ic"] = { "INSERT (completion)", "St_InsertMode" }, + ["ix"] = { "INSERT completion", "St_InsertMode" }, + + ["t"] = { "TERMINAL", "St_TerminalMode" }, + + ["R"] = { "REPLACE", "St_ReplaceMode" }, + ["Rc"] = { "REPLACE (Rc)", "St_ReplaceMode" }, + ["Rx"] = { "REPLACEa (Rx)", "St_ReplaceMode" }, + ["Rv"] = { "V-REPLACE", "St_ReplaceMode" }, + ["Rvc"] = { "V-REPLACE (Rvc)", "St_ReplaceMode" }, + ["Rvx"] = { "V-REPLACE (Rvx)", "St_ReplaceMode" }, + + ["s"] = { "SELECT", "St_SelectMode" }, + ["S"] = { "S-LINE", "St_SelectMode" }, + [""] = { "S-BLOCK", "St_SelectMode" }, + ["c"] = { "COMMAND", "St_CommandMode" }, + ["cv"] = { "COMMAND", "St_CommandMode" }, + ["ce"] = { "COMMAND", "St_CommandMode" }, + ["r"] = { "PROMPT", "St_ConfirmMode" }, + ["rm"] = { "MORE", "St_ConfirmMode" }, + ["r?"] = { "CONFIRM", "St_ConfirmMode" }, + ["x"] = { "CONFIRM", "St_ConfirmMode" }, + ["!"] = { "SHELL", "St_TerminalMode" }, +} + +M.mode = function() + if not is_activewin() then + return "" + end + + local m = vim.api.nvim_get_mode().mode + local current_mode = "%#" .. M.modes[m][2] .. "#" .. "  " .. M.modes[m][1] + local mode_sep1 = "%#" .. M.modes[m][2] .. "Sep" .. "#" .. sep_r + + return current_mode .. mode_sep1 .. "%#ST_EmptySpace#" .. sep_r +end + +-- credits to ii14 for str:match func +M.fileInfo = function() + local icon = " 󰈚 " + local path = vim.api.nvim_buf_get_name(stbufnr()) + local name = (path == "" and "Empty ") or path:match "([^/\\]+)[/\\]*$" + + if name ~= "Empty " then + local devicons_present, devicons = pcall(require, "nvim-web-devicons") + + if devicons_present then + local ft_icon = devicons.get_icon(name) + icon = (ft_icon ~= nil and " " .. ft_icon) or icon + end + + name = " " .. name .. " " + end + + return "%#St_file_info#" .. icon .. name .. "%#St_file_sep#" .. sep_r +end + +M.git = function() + if not vim.b[stbufnr()].gitsigns_head or vim.b[stbufnr()].gitsigns_git_status then + return "" + end + + local git_status = vim.b[stbufnr()].gitsigns_status_dict + + local added = (git_status.added and git_status.added ~= 0) and ("  " .. git_status.added) or "" + local changed = (git_status.changed and git_status.changed ~= 0) and ("  " .. git_status.changed) or "" + local removed = (git_status.removed and git_status.removed ~= 0) and ("  " .. git_status.removed) or "" + local branch_name = "  " .. git_status.head + + return "%#St_gitIcons#" .. branch_name .. added .. changed .. removed +end + +-- LSP STUFF +M.LSP_progress = function() + if not rawget(vim, "lsp") or vim.lsp.status or not is_activewin() then + return "" + end + + local Lsp = vim.lsp.util.get_progress_messages()[1] + + if vim.o.columns < 120 or not Lsp then + return "" + end + + if Lsp.done then + vim.defer_fn(function() + vim.cmd.redrawstatus() + end, 1000) + end + + local msg = Lsp.message or "" + local percentage = Lsp.percentage or 0 + local title = Lsp.title or "" + local spinners = { "", "󰪞", "󰪟", "󰪠", "󰪢", "󰪣", "󰪤", "󰪥" } + local ms = vim.loop.hrtime() / 1000000 + local frame = math.floor(ms / 120) % #spinners + local content = string.format(" %%<%s %s %s (%s%%%%) ", spinners[frame + 1], title, msg, percentage) + + + return ("%#St_LspProgress#" .. content) or "" +end + +M.LSP_Diagnostics = function() + if not rawget(vim, "lsp") then + return "" + end + + local errors = #vim.diagnostic.get(stbufnr(), { severity = vim.diagnostic.severity.ERROR }) + local warnings = #vim.diagnostic.get(stbufnr(), { severity = vim.diagnostic.severity.WARN }) + local hints = #vim.diagnostic.get(stbufnr(), { severity = vim.diagnostic.severity.HINT }) + local info = #vim.diagnostic.get(stbufnr(), { severity = vim.diagnostic.severity.INFO }) + + errors = (errors and errors > 0) and ("%#St_lspError#" .. " " .. errors .. " ") or "" + warnings = (warnings and warnings > 0) and ("%#St_lspWarning#" .. " " .. warnings .. " ") or "" + hints = (hints and hints > 0) and ("%#St_lspHints#" .. "󰛩 " .. hints .. " ") or "" + info = (info and info > 0) and ("%#St_lspInfo#" .. "󰋼 " .. info .. " ") or "" + + return errors .. warnings .. hints .. info +end + +M.LSP_status = function() + if rawget(vim, "lsp") then + for _, client in ipairs(vim.lsp.get_active_clients()) do + if client.attached_buffers[stbufnr()] and client.name ~= "null-ls" then + return (vim.o.columns > 100 and "%#St_LspStatus#" .. "  LSP ~ " .. client.name .. " ") or "  LSP " + end + end + end +end + +M.cwd = function() + -- local dir_icon = "%#St_cwd_icon#" .. "󰉋 " + local dir_icon = "%#St_cwd_sep#" .. sep_m + local dir_name = "%#St_file_info#" .. " " .. fn.fnamemodify(fn.getcwd(), ":t") .. " " + return (vim.o.columns > 85 and ("%#St_cwd_sep#" .. sep_l .. dir_icon .. dir_name)) or "" +end + +M.cursor_position = function() + local left_sep = "%#St_pos_sep#" .. sep_l .. "%#St_pos_icon#" .. " " + + local current_line = fn.line(".", vim.g.statusline_winid) + local total_line = fn.line("$", vim.g.statusline_winid) + local text = math.modf((current_line / total_line) * 100) .. tostring "%%" + text = string.format("%4s", text) + + text = (current_line == 1 and "Top") or text + text = (current_line == total_line and "Bot") or text + + return left_sep .. "%#St_pos_text#" .. " " .. text .. " " +end + +M.run = function() + local modules = { + M.mode(), + M.fileInfo(), + M.git(), + + "%=", + M.LSP_progress(), + "%=", + + M.LSP_Diagnostics(), + M.LSP_status() or "", + M.cwd(), + M.cursor_position(), + } + + return table.concat(modules) +end + +return M diff --git a/lua/custom/statusline/theme.lua b/lua/custom/statusline/theme.lua new file mode 100755 index 00000000000..10b87e87812 --- /dev/null +++ b/lua/custom/statusline/theme.lua @@ -0,0 +1,127 @@ +local statusline_bg = nil +local merge_tb = vim.tbl_deep_extend + +local theme = require('custom.statusline.themes.tokyodark') +local colors = theme.base_30 + +local Lsp_highlights = { + St_lspError = { + fg = colors.red, + bg = statusline_bg, + }, + + St_lspWarning = { + fg = colors.yellow, + bg = statusline_bg, + }, + + St_LspHints = { + fg = colors.purple, + bg = statusline_bg, + }, + + St_LspInfo = { + fg = colors.green, + bg = statusline_bg, + }, +} + +local M = {} + +M.theme = { + StatusLine = { + bg = statusline_bg, + }, + + St_gitIcons = { + fg = colors.light_grey, + bg = statusline_bg, + bold = true, + }, + + St_LspStatus = { + fg = colors.nord_blue, + bg = statusline_bg, + }, + + St_LspProgress = { + fg = colors.green, + bg = statusline_bg, + }, + + St_LspStatus_Icon = { + fg = colors.black, + bg = colors.nord_blue, + }, + + St_EmptySpace = { + fg = colors.grey, + bg = colors.lightbg, + }, + + St_EmptySpace2 = { + fg = colors.grey, + bg = statusline_bg, + }, + + St_file_info = { + bg = colors.lightbg, + fg = colors.white, + }, + + St_file_sep = { + bg = statusline_bg, + fg = colors.lightbg, + }, + + St_cwd_icon = { + fg = colors.one_bg, + bg = colors.red, + }, + + St_cwd_text = { + fg = colors.white, + bg = colors.lightbg, + }, + + St_cwd_sep = { + fg = colors.red, + bg = statusline_bg, + }, + + St_pos_sep = { + fg = colors.green, + bg = colors.lightbg, + }, + + St_pos_icon = { + fg = colors.black, + bg = colors.green, + }, + + St_pos_text = { + fg = colors.green, + bg = colors.lightbg, + }, +} + +M.theme = merge_tb("force", M.theme, Lsp_highlights) + +local function genModes_hl(modename, col) + M.theme["St_" .. modename .. "Mode"] = { fg = colors.black, bg = colors[col], bold = true } + M.theme["St_" .. modename .. "ModeSep"] = { fg = colors[col], bg = colors.grey } +end + +-- add mode highlights +genModes_hl("Normal", "nord_blue") + +genModes_hl("Visual", "cyan") +genModes_hl("Insert", "dark_purple") +genModes_hl("Terminal", "green") +genModes_hl("NTerminal", "yellow") +genModes_hl("Replace", "orange") +genModes_hl("Confirm", "teal") +genModes_hl("Command", "green") +genModes_hl("Select", "blue") + +return M.theme diff --git a/lua/custom/statusline/themes/catppuccin.lua b/lua/custom/statusline/themes/catppuccin.lua new file mode 100755 index 00000000000..161fd1d9f13 --- /dev/null +++ b/lua/custom/statusline/themes/catppuccin.lua @@ -0,0 +1,66 @@ +local M = {} + +M.base_30 = { + white = "#D9E0EE", + darker_black = "#191828", + black = "#1E1D2D", -- nvim bg + black2 = "#252434", + one_bg = "#2d2c3c", -- real bg of onedark + one_bg2 = "#363545", + one_bg3 = "#3e3d4d", + grey = "#474656", + grey_fg = "#4e4d5d", + grey_fg2 = "#555464", + light_grey = "#605f6f", + red = "#F38BA8", + baby_pink = "#ffa5c3", + pink = "#F5C2E7", + line = "#383747", -- for lines like vertsplit + green = "#ABE9B3", + vibrant_green = "#b6f4be", + nord_blue = "#8bc2f0", + blue = "#89B4FA", + yellow = "#FAE3B0", + sun = "#ffe9b6", + purple = "#d0a9e5", + dark_purple = "#c7a0dc", + teal = "#B5E8E0", + orange = "#F8BD96", + cyan = "#89DCEB", + statusline_bg = "#232232", + lightbg = "#2f2e3e", + pmenu_bg = "#ABE9B3", + folder_bg = "#89B4FA", + lavender = "#c7d1ff", +} + +M.base_16 = { + base00 = "#1E1D2D", + base01 = "#282737", + base02 = "#2f2e3e", + base03 = "#383747", + base04 = "#414050", + base05 = "#bfc6d4", + base06 = "#ccd3e1", + base07 = "#D9E0EE", + base08 = "#F38BA8", + base09 = "#F8BD96", + base0A = "#FAE3B0", + base0B = "#ABE9B3", + base0C = "#89DCEB", + base0D = "#89B4FA", + base0E = "#CBA6F7", + base0F = "#F38BA8", +} + +M.polish_hl = { + ["@variable"] = { fg = M.base_30.lavender }, + ["@property"] = { fg = M.base_30.teal }, + ["@variable.builtin"] = { fg = M.base_30.red }, +} + +M.type = "dark" + +M = require("base46").override_theme(M, "catppuccin") + +return M diff --git a/lua/custom/statusline/themes/chadracula.lua b/lua/custom/statusline/themes/chadracula.lua new file mode 100755 index 00000000000..cb5812144ff --- /dev/null +++ b/lua/custom/statusline/themes/chadracula.lua @@ -0,0 +1,67 @@ +-- Credits to original theme https://github.com/dracula/vim +-- This is a modified version + +local M = {} + +M.base_30 = { + white = "#F8F8F2", + darker_black = "#222430", + black = "#282A36", -- nvim bg + black2 = "#2d303e", + one_bg = "#373844", -- real bg of onedark + one_bg2 = "#44475a", + one_bg3 = "#565761", + grey = "#5e5f69", + grey_fg = "#666771", + grey_fg2 = "#6e6f79", + light_grey = "#73747e", + red = "#ff7070", + baby_pink = "#ff86d3", + pink = "#FF79C6", + line = "#3c3d49", -- for lines like vertsplit + green = "#50fa7b", + vibrant_green = "#5dff88", + nord_blue = "#8b9bcd", + blue = "#a1b1e3", + yellow = "#F1FA8C", + sun = "#FFFFA5", + purple = "#BD93F9", + dark_purple = "#BD93F9", + teal = "#92a2d4", + orange = "#FFB86C", + cyan = "#8BE9FD", + statusline_bg = "#2d2f3b", + lightbg = "#41434f", + pmenu_bg = "#b389ef", + folder_bg = "#BD93F9", +} + +M.base_16 = { + base00 = "#282936", + base01 = "#3a3c4e", + base02 = "#4d4f68", + base03 = "#626483", + base04 = "#62d6e8", + base05 = "#e9e9f4", + base06 = "#f1f2f8", + base07 = "#f7f7fb", + base08 = "#c197fd", + base09 = "#FFB86C", + base0A = "#62d6e8", + base0B = "#F1FA8C", + base0C = "#8BE9FD", + base0D = "#50fa7b", + base0E = "#ff86d3", + base0F = "#F8F8F2", +} + +M.polish_hl = { + ["@function.builtin"] = { fg = M.base_30.cyan }, + ["@number"] = { fg = M.base_30.purple }, +} + +M.type = "dark" + +M = require("base46").override_theme(M, "chadracula") + +return M diff --git a/lua/custom/statusline/themes/github_dark.lua b/lua/custom/statusline/themes/github_dark.lua new file mode 100755 index 00000000000..0f2855bf7db --- /dev/null +++ b/lua/custom/statusline/themes/github_dark.lua @@ -0,0 +1,85 @@ +-- credits to original theme for existing https://github.com/primer/github-vscode-theme +-- This is a modified version of it + +local M = {} + +M.base_30 = { + white = "#d3dbe3", + darker_black = "#1F2428", + black = "#24292E", -- nvim bg + black2 = "#2e3338", + one_bg = "#33383d", + one_bg2 = "#383d42", -- StatusBar (filename) + one_bg3 = "#42474c", + grey = "#4c5156", -- Line numbers (shouldn't be base01?) + grey_fg = "#565b60", -- Why this affects comments? + grey_fg2 = "#60656a", + light_grey = "#6a6f74", + red = "#ff7f8d", -- StatusBar (username) + baby_pink = "#ffa198", + pink = "#ec6cb9", + line = "#33383d", -- for lines like vertsplit + green = "#56d364", -- StatusBar (file percentage) + vibrant_green = "#85e89d", + nord_blue = "#58a6ff", -- Mode indicator + blue = "#79c0ff", + yellow = "#ffdf5d", + sun = "#ffea7f", + purple = "#d2a8ff", + dark_purple = "#bc8cff", + teal = "#39c5cf", + orange = "#ffab70", + cyan = "#56d4dd", + statusline_bg = "#2b3035", + lightbg = "#383d42", + pmenu_bg = "#58a6ff", -- Command bar suggestions + folder_bg = "#58a6ff", +} + +M.base_16 = { + base00 = "#24292E", -- Default bg + base01 = "#33383d", -- Lighter bg (status bar, line number, folding mks) + base02 = "#383d42", -- Selection bg + base03 = "#42474c", -- Comments, invisibles, line hl + base04 = "#4c5156", -- Dark fg (status bars) + base05 = "#c9d1d9", -- Default fg (caret, delimiters, Operators) + base06 = "#d3dbe3", -- Light fg (not often used) + base07 = "#dde5ed", -- Light bg (not often used) + base08 = "#B392E9", -- Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted + base09 = "#ffab70", -- Integers, Boolean, Constants, XML Attributes, Markup Link Url + base0A = "#ffdf5d", -- Classes, Markup Bold, Search Text Background + base0B = "#a5d6ff", -- Strings, Inherited Class, Markup Code, Diff Inserted + base0C = "#83caff", -- Support, regex, escape chars + base0D = "#6AB1F0", -- Function, methods, headings + base0E = "#ff7f8d", -- Keywords + base0F = "#85e89d", -- Deprecated, open/close embedded tags +} + +M.type = "dark" + +M.polish_hl = { + ["@punctuation.bracket"] = { + fg = M.base_30.orange, + }, + + ["@string"] = { + fg = M.base_30.white, + }, + + ["@field.key"] = { + fg = M.base_30.white, + }, + + ["@constructor"] = { + fg = M.base_30.vibrant_green, + bold = true, + }, + + ["@tag.attribute"] = { + link = "@method", + }, +} + +M = require("base46").override_theme(M, "github_dark") + +return M diff --git a/lua/custom/statusline/themes/gruvbox.lua b/lua/custom/statusline/themes/gruvbox.lua new file mode 100755 index 00000000000..098e79b501d --- /dev/null +++ b/lua/custom/statusline/themes/gruvbox.lua @@ -0,0 +1,72 @@ +-- Credits to original https://github.com/morhetz/gruvbox +-- This is modified version of it + +local M = {} + +M.base_30 = { + white = "#ebdbb2", + darker_black = "#232323", + black = "#282828", -- nvim bg + black2 = "#2e2e2e", + one_bg = "#353535", + one_bg2 = "#3f3f3f", + one_bg3 = "#444444", + grey = "#4b4b4b", + grey_fg = "#4e4e4e", + grey_fg2 = "#505050", + light_grey = "#656565", + red = "#fb4934", + baby_pink = "#cc241d", + pink = "#ff75a0", + line = "#36393a", -- for lines like vertsplit + green = "#b8bb26", + vibrant_green = "#a9b665", + nord_blue = "#83a598", + blue = "#458588", + yellow = "#d79921", + sun = "#fabd2f", + purple = "#b4bbc8", + dark_purple = "#d3869b", + teal = "#749689", + orange = "#e78a4e", + cyan = "#82b3a8", + statusline_bg = "#2c2c2c", + lightbg = "#3d3d3d", + pmenu_bg = "#83a598", + folder_bg = "#749689", +} + +M.base_16 = { + base00 = "#282828", + base01 = "#3c3836", + base02 = "#423e3c", + base03 = "#484442", + base04 = "#bdae93", + base05 = "#d5c4a1", + base06 = "#ebdbb2", + base07 = "#fbf1c7", + base08 = "#fb4934", + base09 = "#fe8019", + base0A = "#fabd2f", + base0B = "#b8bb26", + base0C = "#8ec07c", + base0D = "#83a598", + base0E = "#d3869b", + base0F = "#d65d0e", +} + +M.type = "dark" + +M = require("base46").override_theme(M, "gruvbox") + +M.polish_hl = { + Operator = { + fg = M.base_30.nord_blue, + }, + + ["@operator"] = { + fg = M.base_30.nord_blue, + }, +} + +return M diff --git a/lua/custom/statusline/themes/melange.lua b/lua/custom/statusline/themes/melange.lua new file mode 100755 index 00000000000..138af8053e8 --- /dev/null +++ b/lua/custom/statusline/themes/melange.lua @@ -0,0 +1,84 @@ +-- Thanks to https://github.com/savq/melange for existing +-- This is a modified version of it + +local M = {} + +M.base_30 = { + white = "#ECE1D7", + darker_black = "#241f1a", + black = "#2A2520", -- nvim bg + black2 = "#342f2a", + one_bg = "#39342f", + one_bg2 = "#433e39", + one_bg3 = "#4d4843", + grey = "#57524d", + grey_fg = "#605b56", + grey_fg2 = "#6b6661", + light_grey = "#75706b", + red = "#B65C60", + baby_pink = "#CE9BCB", + pink = "#B65C60", + line = "#39342f", -- for lines like vertsplit + green = "#86A3A3", + vibrant_green = "#99D59D", + nord_blue = "#88B3B2", + blue = "#9AACCE", + yellow = "#e3b865", + sun = "#EBC06D", + purple = "#c47fd5", + dark_purple = "#b570c6", + teal = "#697893", + orange = "#E49B5D", + firered = "#F17C64", + cyan = "#bbcdef", + statusline_bg = "#312c27", + lightbg = "#433e39", + pmenu_bg = "#86A3A3", + folder_bg = "#697893", +} + +M.base_16 = { + base00 = "#2A2520", + base01 = "#39342f", + base02 = "#433e39", + base03 = "#4d4843", + base04 = "#57524d", + base05 = "#ECE1D7", + base06 = "#e3d8ce", + base07 = "#d8cdc3", + base08 = "#ECE1D7", + base09 = "#86A3A3", + base0A = "#99D59D", + base0B = "#9AACCE", + base0C = "#EBC06D", + base0D = "#EBC06D", + base0E = "#E49B5D", + base0F = "#8E733F", +} + +M.type = "dark" + +M.polish_hl = { + ["@field"] = { fg = M.base_30.white }, + ["@field.key"] = { fg = M.base_30.white }, + + ["@function.macro"] = { + fg = M.base_30.vibrant_green, + }, + + Include = { + fg = M.base_30.vibrant_green, + }, + + Operator = { + fg = M.base_30.firered, + }, + + Boolean = { + fg = M.base_30.purple + } +} + +M = require("base46").override_theme(M, "melange") + +return M diff --git a/lua/custom/statusline/themes/nord.lua b/lua/custom/statusline/themes/nord.lua new file mode 100755 index 00000000000..977e486a2c4 --- /dev/null +++ b/lua/custom/statusline/themes/nord.lua @@ -0,0 +1,66 @@ +-- Credits to original https://github.com/arcticicestudio/nord-vim +-- This is modified version of it + +local M = {} + +M.base_30 = { + white = "#abb2bf", + darker_black = "#2a303c", + black = "#2E3440", -- nvim bg + black2 = "#343a46", + one_bg = "#373d49", + one_bg2 = "#464c58", + one_bg3 = "#494f5b", + grey = "#4b515d", + grey_fg = "#565c68", + grey_fg2 = "#606672", + light_grey = "#646a76", + red = "#BF616A", + baby_pink = "#de878f", + pink = "#d57780", + line = "#414753", -- for lines like vertsplit + green = "#A3BE8C", + vibrant_green = "#afca98", + blue = "#7797b7", + nord_blue = "#81A1C1", + yellow = "#EBCB8B", + sun = "#e1c181", + purple = "#B48EAD", + dark_purple = "#a983a2", + teal = "#6484a4", + orange = "#e39a83", + cyan = "#9aafe6", + statusline_bg = "#333945", + lightbg = "#3f4551", + pmenu_bg = "#A3BE8C", + folder_bg = "#7797b7", +} + +M.base_16 = { + base00 = "#2E3440", + base01 = "#3B4252", + base02 = "#434C5E", + base03 = "#4C566A", + base04 = "#D8DEE9", + base05 = "#E5E9F0", + base06 = "#ECEFF4", + base07 = "#8FBCBB", + base08 = "#88C0D0", + base09 = "#81A1C1", + base0A = "#88C0D0", + base0B = "#A3BE8C", + base0C = "#81A1C1", + base0D = "#81A1C1", + base0E = "#81A1C1", + base0F = "#B48EAD", +} + +M.polish_hl = { + ["@punctuation.bracket"] = { fg = M.base_30.white }, + ["@punctuation.delimiter"] = { fg = M.base_30.white }, +} +M.type = "dark" + +M = require("base46").override_theme(M, "nord") + +return M diff --git a/lua/custom/statusline/themes/onedark.lua b/lua/custom/statusline/themes/onedark.lua new file mode 100755 index 00000000000..128e113f482 --- /dev/null +++ b/lua/custom/statusline/themes/onedark.lua @@ -0,0 +1,62 @@ +-- Credits to original https://github.com/one-dark +-- This is modified version of it + +local M = {} + +M.base_30 = { + white = "#abb2bf", + darker_black = "#1b1f27", + black = "#1e222a", -- nvim bg + black2 = "#252931", + one_bg = "#282c34", -- real bg of onedark + one_bg2 = "#353b45", + one_bg3 = "#373b43", + grey = "#42464e", + grey_fg = "#565c64", + grey_fg2 = "#6f737b", + light_grey = "#6f737b", + red = "#e06c75", + baby_pink = "#DE8C92", + pink = "#ff75a0", + line = "#31353d", -- for lines like vertsplit + green = "#98c379", + vibrant_green = "#7eca9c", + nord_blue = "#81A1C1", + blue = "#61afef", + yellow = "#e7c787", + sun = "#EBCB8B", + purple = "#de98fd", + dark_purple = "#c882e7", + teal = "#519ABA", + orange = "#fca2aa", + cyan = "#a3b8ef", + statusline_bg = "#22262e", + lightbg = "#2d3139", + pmenu_bg = "#61afef", + folder_bg = "#61afef", +} + +M.base_16 = { + base00 = "#1e222a", + base01 = "#353b45", + base02 = "#3e4451", + base03 = "#545862", + base04 = "#565c64", + base05 = "#abb2bf", + base06 = "#b6bdca", + base07 = "#c8ccd4", + base08 = "#e06c75", + base09 = "#d19a66", + base0A = "#e5c07b", + base0B = "#98c379", + base0C = "#56b6c2", + base0D = "#61afef", + base0E = "#c678dd", + base0F = "#be5046", +} + +M.type = "dark" + +M = require("base46").override_theme(M, "onedark") + +return M diff --git a/lua/custom/statusline/themes/onenord.lua b/lua/custom/statusline/themes/onenord.lua new file mode 100755 index 00000000000..24af9667e8b --- /dev/null +++ b/lua/custom/statusline/themes/onenord.lua @@ -0,0 +1,62 @@ +-- Credits to original https://github.com/arcticicestudio/nord-vim +-- This is modified version of it + +local M = {} + +M.base_30 = { + white = "#D8DEE9", + darker_black = "#252b37", + black = "#2a303c", -- nvim bg + black2 = "#2f3541", + one_bg = "#343a46", + one_bg2 = "#3e4450", + one_bg3 = "#484e5a", + grey = "#4d535f", + grey_fg = "#545a66", + grey_fg2 = "#595f6b", + light_grey = "#606672", + red = "#d57780", + baby_pink = "#de878f", + pink = "#da838b", + line = "#414753", -- for lines like vertsplit + green = "#A3BE8C", + vibrant_green = "#afca98", + blue = "#7797b7", + nord_blue = "#81A1C1", + yellow = "#EBCB8B", + sun = "#e1c181", + purple = "#aab1be", + dark_purple = "#B48EAD", + teal = "#6484a4", + orange = "#e39a83", + cyan = "#9aafe6", + statusline_bg = "#333945", + lightbg = "#3f4551", + pmenu_bg = "#A3BE8C", + folder_bg = "#7797b7", +} + +M.base_16 = { + base00 = "#2a303c", + base01 = "#3B4252", + base02 = "#434C5E", + base03 = "#4C566A", + base04 = "#566074", + base05 = "#bfc5d0", + base06 = "#c7cdd8", + base07 = "#ced4df", + base08 = "#d57780", + base09 = "#e39a83", + base0A = "#EBCB8B", + base0B = "#A3BE8C", + base0C = "#97b7d7", + base0D = "#81A1C1", + base0E = "#B48EAD", + base0F = "#d57780", +} + +M.type = "dark" + +M = require("base46").override_theme(M, "onenord") + +return M diff --git a/lua/custom/statusline/themes/penumbra_dark.lua b/lua/custom/statusline/themes/penumbra_dark.lua new file mode 100755 index 00000000000..c0b19a32a77 --- /dev/null +++ b/lua/custom/statusline/themes/penumbra_dark.lua @@ -0,0 +1,96 @@ +-- credits to original theme for existing https://github.com/nealmckee/penumbra +-- This is a modified version of it + +local M = {} + +M.base_30 = { + white = "#FFFDFB", + darker_black = "#2b2e33", + black = "#303338", + black2 = "#3a3d42", + one_bg = "#3d4045", + one_bg2 = "#484b50", + one_bg3 = "#515459", + grey = "#5c5f64", + grey_fg = "#676a6f", + grey_fg2 = "#72757a", + light_grey = "#7d8085", + red = "#CA7081", + baby_pink = "#E18163", + pink = "#D07EBA", + green = "#4EB67F", + vibrant_green = "#50B584", + nord_blue = "#6e8dd5", + blue = "#8C96EC", + yellow = "#c1ad4b", + sun = "#9CA748", + purple = "#ac78bd", + dark_purple = "#8C96EC", + orange = "#CE9042", + teal = "#00a6c8", + cyan = "#00B3C2", + line = "#3E4044", + statusline_bg = "#34373c", + lightbg = "#484b50", + pmenu_bg = "#4EB67F", + folder_bg = "#8C96EC", +} + +M.base_16 = { + base00 = "#303338", + base01 = "#3a3d42", + base02 = "#3d4045", + base03 = "#484b50", + base04 = "#515459", + base05 = "#CECECE", + base06 = "#F2E6D4", + base07 = "#FFF7ED", + base08 = "#999999", + base09 = "#BE85D1", + base0A = "#CA7081", + base0B = "#4ec093", + base0C = "#D68B47", + base0D = "#7A9BEC", + base0E = "#BE85D1", + base0F = "#A1A641", +} + +M.polish_hl = { + ["@field.key"] = { + fg = M.base_30.red, + }, + + Constant = { + fg = M.base_30.red, + }, + + ["@punctuation.bracket"] = { + fg = M.base_16.base08, + }, + + ["@constructor"] = { + fg = M.base_30.orange, + }, + + ["@parameter"] = { + fg = M.base_30.orange, + }, + + Operator = { + fg = M.base_30.cyan, + }, + + ["@tag.delimiter"] = { + fg = M.base_16.base08, + }, + + ["@tag.attribute"] = { + link = "@annotation", + }, +} + +M.type = "dark" + +M = require("base46").override_theme(M, "penumbra_dark") + +return M diff --git a/lua/custom/statusline/themes/solarized_dark.lua b/lua/custom/statusline/themes/solarized_dark.lua new file mode 100755 index 00000000000..f696a4ed496 --- /dev/null +++ b/lua/custom/statusline/themes/solarized_dark.lua @@ -0,0 +1,62 @@ +-- Credits to original https://github.com/altercation/solarized +-- This is modified version of it + +local M = {} + +M.base_30 = { + white = "#abb2bf", + darker_black = "#002530", + black = "#002b36", -- nvim bg + black2 = "#06313c", + one_bg = "#0a3540", -- real bg of onedark + one_bg2 = "#133e49", + one_bg3 = "#1b4651", + grey = "#28535e", + grey_fg = "#325d68", + grey_fg2 = "#3c6772", + light_grey = "#446f7a", + red = "#dc322f", + baby_pink = "#eb413e", + pink = "#d33682", + line = "#0f3a45", -- for lines like vertsplit + green = "#859900", + vibrant_green = "#b2c62d", + nord_blue = "#197ec5", + blue = "#268bd2", + yellow = "#b58900", + sun = "#c4980f", + purple = "#6c71c4", + dark_purple = "#5d62b5", + teal = "#519ABA", + orange = "#cb4b16", + cyan = "#2aa198", + statusline_bg = "#042f3a", + lightbg = "#113c47", + pmenu_bg = "#268bd2", + folder_bg = "#268bd2", +} + +M.base_16 = { + base00 = "#002b36", + base01 = "#06313c", + base02 = "#0a3540", + base03 = "#133e49", + base04 = "#1b4651", + base05 = "#93a1a1", + base06 = "#eee8d5", + base07 = "#fdf6e3", + base08 = "#dc322f", + base09 = "#cb4b16", + base0A = "#b58900", + base0B = "#859900", + base0C = "#2aa198", + base0D = "#268bd2", + base0E = "#6c71c4", + base0F = "#d33682", +} + +M.type = "dark" + +M = require("base46").override_theme(M, "solarized_dark") + +return M diff --git a/lua/custom/statusline/themes/tokyodark.lua b/lua/custom/statusline/themes/tokyodark.lua new file mode 100755 index 00000000000..8e4e9b7e5d2 --- /dev/null +++ b/lua/custom/statusline/themes/tokyodark.lua @@ -0,0 +1,61 @@ +-- Credits to original https://github.com/tiagovla/tokyodark.nvim +-- This is modified version of it + +local M = {} + +M.base_30 = { + white = "#A0A8CD", + darker_black = "#0c0d18", + black = "#11121D", -- nvim bg + black2 = "#171823", + one_bg = "#1d1e29", + one_bg2 = "#252631", + one_bg3 = "#252631", + grey = "#474853", + grey_fg = "#474853", + grey_fg2 = "#4e4f5a", + light_grey = "#545560", + red = "#ee6d85", + baby_pink = "#fd7c94", + pink = "#fe6D85", + line = "#252631", + green = "#98c379", + vibrant_green = "#95c561", + nord_blue = "#648ce1", + blue = "#7199ee", + yellow = "#d7a65f", + sun = "#dfae67", + purple = "#a485dd", + dark_purple = "#9071c9", + teal = "#519aba", + orange = "#f6955b", + cyan = "#38a89d", + statusline_bg = "#161722", + lightbg = "#2a2b36", + pmenu_bg = "#ee6d85", + folder_bg = "#7199ee", +} + +M.base_16 = { + base00 = "#11121d", + base01 = "#1b1c27", + base02 = "#21222d", + base03 = "#282934", + base04 = "#30313c", + base05 = "#abb2bf", + base06 = "#b2b9c6", + base07 = "#A0A8CD", + base08 = "#ee6d85", + base09 = "#7199ee", + base0A = "#7199ee", + base0B = "#dfae67", + base0C = "#a485dd", + base0D = "#95c561", + base0E = "#a485dd", + base0F = "#f3627a", +} + +M.type = "dark" + + +return M diff --git a/lua/custom/statusline/themes/tokyonight.lua b/lua/custom/statusline/themes/tokyonight.lua new file mode 100755 index 00000000000..b3484dad12f --- /dev/null +++ b/lua/custom/statusline/themes/tokyonight.lua @@ -0,0 +1,70 @@ +-- Credits to original https://github.com/tiagovla/tokyonight.nvim +-- This is modified version of it + +local M = {} + +M.base_30 = { + white = "#c0caf5", + darker_black = "#16161e", + black = "#1a1b26", -- nvim bg + black2 = "#1f2336", + one_bg = "#24283b", + one_bg2 = "#414868", + one_bg3 = "#353b45", + grey = "#40486a", + grey_fg = "#565f89", + grey_fg2 = "#4f5779", + light_grey = "#545c7e", + red = "#f7768e", + baby_pink = "#DE8C92", + pink = "#ff75a0", + line = "#32333e", -- for lines like vertsplit + green = "#9ece6a", + vibrant_green = "#73daca", + nord_blue = "#80a8fd", + blue = "#7aa2f7", + yellow = "#e0af68", + sun = "#EBCB8B", + purple = "#bb9af7", + dark_purple = "#9d7cd8", + teal = "#1abc9c", + orange = "#ff9e64", + cyan = "#7dcfff", + statusline_bg = "#1d1e29", + lightbg = "#32333e", + pmenu_bg = "#7aa2f7", + folder_bg = "#7aa2f7", +} + +M.base_16 = { + base00 = "#1a1b26", + base01 = "#16161e", + base02 = "#2f3549", + base03 = "#444b6a", + base04 = "#787c99", + base05 = "#a9b1d6", + base06 = "#cbccd1", + base07 = "#d5d6db", + base08 = "#73daca", + base09 = "#ff9e64", + base0A = "#0db9d7", + base0B = "#9ece6a", + base0C = "#b4f9f8", + base0D = "#2ac3de", + base0E = "#bb9af7", + base0F = "#f7768e", +} + +M.polish_hl = { + ["@variable"] = { fg = M.base_16.base05 }, + ["@punctuation.bracket"] = { fg = M.base_30.purple }, + ["@method.call"] = { fg = M.base_30.red }, + ["@function.call"] = { fg = M.base_30.blue }, + ["@constant"] = { fg = M.base_30.orange }, + ["@parameter"] = { fg = M.base_30.orange }, +} + +M.type = "dark" + + +return M diff --git a/lua/custom/statusline/themes/tundra.lua b/lua/custom/statusline/themes/tundra.lua new file mode 100755 index 00000000000..a9999ca34b7 --- /dev/null +++ b/lua/custom/statusline/themes/tundra.lua @@ -0,0 +1,104 @@ +-- Thanks to original theme for existing https://github.com/sam4llis/nvim-tundra +-- this is a modified version of it + +local M = {} + +M.base_30 = { + white = "#FFFFFF", + darker_black = "#0b1221", + black = "#111827", -- nvim bg + black2 = "#1a2130", + one_bg = "#1e2534", + one_bg2 = "#282f3e", + one_bg3 = "#323948", + grey = "#3e4554", + grey_fg = "#4a5160", + grey_fg2 = "#545b6a", + light_grey = "#5f6675", + red = "#FCA5A5", + baby_pink = "#FECDD3", + pink = "#ff8e8e", + line = "#282f3e", -- for lines like vertsplit + green = "#B5E8B0", + vibrant_green = "#B5E8B0", + nord_blue = "#9baaf2", + blue = "#A5B4FC", + yellow = "#E8D4B0", + sun = "#f2deba", + purple = "#BDB0E4", + dark_purple = "#b3a6da", + teal = "#719bd3", + orange = "#FBC19D", + cyan = "#BAE6FD", + statusline_bg = "#171e2d", + lightbg = "#282f3e", + pmenu_bg = "#FCA5A5", + folder_bg = "#A5B4FC", +} + +M.base_16 = { + base00 = "#111827", + base01 = "#1e2534", + base02 = "#282f3e", + base03 = "#323948", + base04 = "#3e4554", + base05 = "#F3F4F6", + base06 = "#E5E7EB", + base07 = "#D1D5DB", + base08 = "#DDD6FE", + base09 = "#E8D4B0", + base0A = "#FBC19D", + base0B = "#B5E8B0", + base0C = "#BAE6FD", + base0D = "#BAE6FD", + base0E = "#FCA5A5", + base0F = "#9CA3AF", +} + +M.type = "dark" + +M.polish_hl = { + Constant = { + fg = M.base_30.orange, + }, + + ["@constructor"] = { + fg = M.base_30.cyan, + }, + + ["@keyword"] = { + fg = M.base_30.red, + }, + + ["@method.call"] = { + fg = M.base_30.cyan, + }, + + ["@function.call"] = { + fg = M.base_30.cyan, + }, + + ["@function.builtin"] = { + fg = M.base_30.orange, + }, + + Conditional = { + fg = M.base_30.baby_pink, + }, + + Repeat = { + fg = M.base_30.baby_pink, + }, + + Type = { + fg = M.base_30.baby_pink, + }, + + Operator = { + fg = M.base_30.baby_pink, + }, +} + +M = require("base46").override_theme(M, "tundra") + +return M