diff --git a/README.md b/README.md index ab4c1a6..cbd9647 100644 --- a/README.md +++ b/README.md @@ -59,10 +59,7 @@ Here you go : ## Lazy loading StarVim is lazy loaded so hard that your machine does'nt feel the force of the arrival of StarVim. -- Almost 30+ plugins are installed. All of them are lazyloaded. - -This was tested in core i3 intel machine with a HDD. Will be fast as a *Star* in your machine -![Lazy](https://github.com/ashincoder/StarVim/blob/screenshots/lazy.png) +- Almost 25+ plugins are installed. All of them are lazyloaded. ## Colors StarVim will have more colorschemes with colorfulness. @@ -133,12 +130,9 @@ The following repositories helped me in improving StarVim ## TODO -This project is still a work in progress. But there won't be any breakage. - - [ ] Logo - [X] Readme -- [X] Clean code +- [X] Clean code [![CodeFactor](https://www.codefactor.io/repository/github/ashincoder/starvim/badge)](https://www.codefactor.io/repository/github/ashincoder/starvim) - [X] More Custom Colorschemes - [X] Easily Installable plugins - [ ] Documentation, Wiki and stuff - diff --git a/bin/starplug.example.lua b/bin/starplug.example.lua index 2a01695..3076d55 100644 --- a/bin/starplug.example.lua +++ b/bin/starplug.example.lua @@ -9,14 +9,17 @@ local star = { }, star = { -- 'orgmode', -- Life Organization Tool + -- 'runner', -- Code runner for your language }, colors = { "stardark", -- The shiny theme -- "gruvbox", -- The almighty -- "icy", -- Shiver to death! + -- "neon", -- Welcome to the light }, editor = { "lsp", -- Language Server Protocols + "lint", -- A beauty teacher for your language "completion", -- The ultimate completion "nvim-tree", -- Tree explorer "symbols", -- LSP symbols and tags diff --git a/bin/sv-config.example.lua b/bin/sv-config.example.lua index 3cc305c..e1c0baf 100644 --- a/bin/sv-config.example.lua +++ b/bin/sv-config.example.lua @@ -1,8 +1,6 @@ -- This is a example config. -- 'Sv' is the global options object -- General Settings -Sv.number = true - Sv.pumheight = 20 Sv.timeoutlen = 100 @@ -11,9 +9,8 @@ Sv.shell = "zsh" Sv.undofile = true Sv.leader_key = "space" -Sv.colorscheme = "stardark" -- The only added colorscheme is stardark and icy. +Sv.colorscheme = "stardark" -Sv.autosave = false Sv.format_on_save = true -- TreeSitter parsers config @@ -89,8 +86,7 @@ Sv.treesitter.highlight.enabled = true -- Additional Plugins -- Sv.user_plugins = { --- {"ashincoder/gruvbox.nvim"}, --- {"ashincoder/icy.nvim"}, +-- {"kyazdani42/blue-moon"}, -- } -- Additional Leader bindings for WhichKey diff --git a/lua/core/autocmds/init.lua b/lua/core/autocmds/init.lua index be4c42a..11e16e5 100644 --- a/lua/core/autocmds/init.lua +++ b/lua/core/autocmds/init.lua @@ -38,13 +38,34 @@ M.define_augroups({ "*", "setlocal formatoptions-=c formatoptions-=r formatoptions-=o", }, - { "BufWritePost", "sv-config.lua", "lua require('core.functions').reload_config()" }, + { + "BufWritePost", + "sv-config.lua", + "lua require('core.functions').reload_config()", + }, + { + "BufWritePost", + "starplug.lua", + "lua require('core.functions').reload_config()", + }, { "TextChanged,InsertLeave", "", "silent! write", }, }, + _autolint = { + { + "BufWritePost", + "", + ":silent lua require('lint').try_lint()", + }, + { + "BufEnter", + "", + ":silent lua require('lint').try_lint()", + }, + }, }) return M diff --git a/lua/core/config/init.lua b/lua/core/config/init.lua index 1a736c0..420b1fe 100644 --- a/lua/core/config/init.lua +++ b/lua/core/config/init.lua @@ -35,8 +35,8 @@ Sv = { hl_search = true, leader_key = " ", - autosave = false, format_on_save = true, + lint_on_save = true, terminal_width = 70, terminal_height = 20, diff --git a/lua/core/config/starrc.lua b/lua/core/config/starrc.lua index 8e10e37..ecd625a 100644 --- a/lua/core/config/starrc.lua +++ b/lua/core/config/starrc.lua @@ -19,11 +19,13 @@ local function default_starrc_values() }, star = { -- 'orgmode', -- Life Organization Tool + -- 'runner', -- Code runner for your language }, colors = { "stardark", -- The shiny theme -- "gruvbox", -- The almighty -- "icy", -- Shiver to death! + -- "neon", -- Welcome to the light }, editor = { -- 'terminal', -- Terminal for Neovim (NOTE: needed for runner and compiler) @@ -34,9 +36,9 @@ local function default_starrc_values() "telescope", -- Highly extendable fuzzy finder over lists "formatter", -- File formatting "autopairs", -- Autopairs - -- 'editorconfig', -- EditorConfig support for Neovim "commentary", -- Comments plugin "lsp", -- Language Server Protocols + "lint", -- A beauty teacher for your language }, utilities = { -- 'suda', -- Write and read files without sudo permissions diff --git a/lua/core/functions/init.lua b/lua/core/functions/init.lua index eea9418..8fc844c 100644 --- a/lua/core/functions/init.lua +++ b/lua/core/functions/init.lua @@ -5,6 +5,7 @@ local M = {} function M.reload_config() vim.cmd("source ~/.config/nvim/lua/core/config/init.lua") vim.cmd("source ~/.config/nvim/sv-config.lua") + vim.cmd("source ~/.config/nvim/starplug.lua") vim.cmd("source ~/.config/nvim/lua/modules/init.lua") vim.cmd(":PackerInstall") vim.cmd(":PackerCompile") diff --git a/lua/core/keybindings/init.lua b/lua/core/keybindings/init.lua index d60d48e..f805c2d 100644 --- a/lua/core/keybindings/init.lua +++ b/lua/core/keybindings/init.lua @@ -77,14 +77,14 @@ utils.map("n", "gc", "Telescope git_commits", opts) -- Commits utils.map("n", "gC", "Telescope git_bcommits", opts) -- Commits List for current file utils.map("n", "gb", "Telescope git_branches", opts) -- Branches List utils.map("n", "gt", "Telescope git_status", opts) -- Git status -utils.map("n", "gj", "lua require 'gitsigns'.next_hunk()", opts) -- Next Hunk -utils.map("n", "gk", "lua require 'gitsigns'.prev_hunk()", opts) -- Prev Hunk -utils.map("n", "gl", "lua require 'gitsigns'.blame_line()", opts) -- Blame -utils.map("n", "gp", "lua require 'gitsigns'.preview_hunk()", opts) -- Preview Hunk -utils.map("n", "gr", "lua require 'gitsigns'.reset_hunk()", opts) -- Reset Hunk -utils.map("n", "gR", "lua require 'gitsigns'.reset_buffer()", opts) -- Reset Buffer -utils.map("n", "gs", "lua require 'gitsigns'.stage_hunk()", opts) -- Stage Hunk -utils.map("n", "gu", "lua require 'gitsigns'.undo_stage_hunk()", opts) -- Unstage Hunk +utils.map("n", "gj ", "lua require 'gitsigns'.next_hunk()", opts) -- Next Hunk +utils.map("n", "gk ", "lua require 'gitsigns'.prev_hunk()", opts) -- Prev Hunk +utils.map("n", "gl ", "lua require 'gitsigns'.blame_line()", opts) -- Blame +utils.map("n", "gp ", "lua require 'gitsigns'.preview_hunk()", opts) -- Preview Hunk +utils.map("n", "gr ", "lua require 'gitsigns'.reset_hunk()", opts) -- Reset Hunk +utils.map("n", "gR ", "lua require 'gitsigns'.reset_buffer()", opts) -- Reset Buffer +utils.map("n", "gs ", "lua require 'gitsigns'.stage_hunk()", opts) -- Stage Hunk +utils.map("n", "gu ", "lua require 'gitsigns'.undo_stage_hunk()", opts) -- Unstage Hunk -- Help Telescope utils.map("n", "hh", "Telescope help_tags", opts) -- help_tags @@ -107,9 +107,9 @@ utils.map("n", "cd", "Lspsaga preview_definition", opts) -- Pre utils.map("n", "cF", "Format", opts) -- Format buffer utils.map("n", "K", "lua vim.lsp.buf.hover()", opts) -utils.map("n", "cl", "lua vim.lsp.diagnostic.set_loclist()", opts) -- error list utils.map("n", "", "lnext", opts) -- error navigation list utils.map("n", "", "lprev", opts) -- error navigation list +utils.map("n", "cl", "lua vim.lsp.diagnostic.set_loclist()", opts) -- error list utils.map("n", "cgD", "lua vim.lsp.buf.definition()", opts) -- jump to definition utils.map("n", "cgr", "lua vim.lsp.buf.references()", opts) -- go to reference utils.map("n", "cgi", "lua vim.lsp.buf.implementation()", opts) -- buf implementation @@ -131,6 +131,7 @@ utils.map("n", "sb", "Telescope current_buffer_fuzzy_find", opt utils.map("n", "ss", "Telescope lsp_document_symbols", opts) utils.map("n", "sh", "Telescope command_history", opts) utils.map("n", "sm", "Telescope marks", opts) +utils.map("n", "sc", "lua require('telescope.builtin.internal').colorscheme({enable_preview = true})") -- Files utils.map("n", "ff", "Telescope find_files", opts) diff --git a/lua/modules/configs/compe.lua b/lua/modules/configs/compe.lua index b4a59de..924a170 100644 --- a/lua/modules/configs/compe.lua +++ b/lua/modules/configs/compe.lua @@ -19,6 +19,7 @@ compe.setup({ max_menu_width = 100, documentation = true, source = { + zsh = true, orgmode = true, nvim_lsp = true, nvim_lua = true, diff --git a/lua/modules/configs/icons.lua b/lua/modules/configs/icons.lua index c169aa4..daa5253 100644 --- a/lua/modules/configs/icons.lua +++ b/lua/modules/configs/icons.lua @@ -16,112 +16,112 @@ local colors = { require("nvim-web-devicons").setup({ override = { html = { - icon = "", + icon = " ", color = colors.baby_pink, name = "html", }, css = { - icon = "", + icon = " ", color = colors.blue, name = "css", }, js = { - icon = "", + icon = " ", color = colors.sun, name = "js", }, ts = { - icon = "ﯤ", + icon = "ﯤ ", color = colors.teal, name = "ts", }, kt = { - icon = "󱈙", + icon = "󱈙 ", color = colors.orange, name = "kt", }, png = { - icon = "", + icon = " ", color = colors.dark_purple, name = "png", }, jpg = { - icon = "", + icon = " ", color = colors.dark_purple, name = "jpg", }, jpeg = { - icon = "", + icon = " ", color = colors.dark_purple, name = "jpeg", }, mp3 = { - icon = "", + icon = " ", color = colors.white, name = "mp3", }, mp4 = { - icon = "", + icon = " ", color = colors.white, name = "mp4", }, out = { - icon = "", + icon = " ", color = colors.white, name = "out", }, Dockerfile = { - icon = "", + icon = " ", color = colors.cyan, name = "Dockerfile", }, rb = { - icon = "", + icon = " ", color = colors.pink, name = "rb", }, vue = { - icon = "﵂", + icon = "﵂ ", color = colors.vibrant_green, name = "vue", }, py = { - icon = "", + icon = " ", color = colors.cyan, name = "py", }, toml = { - icon = "", + icon = " ", color = colors.blue, name = "toml", }, lock = { - icon = "", + icon = " ", color = colors.red, name = "lock", }, zip = { - icon = "", + icon = " ", color = colors.sun, name = "zip", }, xz = { - icon = "", + icon = " ", color = colors.sun, name = "xz", }, deb = { - icon = "", + icon = " ", color = colors.cyan, name = "deb", }, rpm = { - icon = "", + icon = " ", color = colors.orange, name = "rpm", }, lua = { - icon = "", + icon = " ", color = colors.blue, name = "lua", }, diff --git a/lua/modules/configs/linter.lua b/lua/modules/configs/linter.lua new file mode 100644 index 0000000..67f21a2 --- /dev/null +++ b/lua/modules/configs/linter.lua @@ -0,0 +1,10 @@ +local status_ok, _ = pcall(require, "lint") +if not status_ok then + return +end + +if not Sv.lint_on_save then + vim.cmd([[if exists('#autolint#BufWritePost') + :autocmd! autolint + endif]]) +end diff --git a/lua/modules/configs/lsp_config.lua b/lua/modules/configs/lsp_config.lua index 4998f38..31ccfec 100644 --- a/lua/modules/configs/lsp_config.lua +++ b/lua/modules/configs/lsp_config.lua @@ -18,6 +18,13 @@ end local capabilities = vim.lsp.protocol.make_client_capabilities() capabilities.textDocument.completion.completionItem.snippetSupport = true +capabilities.textDocument.completion.completionItem.resolveSupport = { + properties = { + "documentation", + "detail", + "additionalTextEdits", + }, +} -- lspInstall + lspconfig stuff @@ -75,7 +82,7 @@ vim.fn.sign_define("LspDiagnosticsSignHint", { text = "", numhl = "LspDiagnos vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { virtual_text = { - prefix = "●", + prefix = "", spacing = 0, }, signs = true, diff --git a/lua/modules/configs/lualine.lua b/lua/modules/configs/lualine.lua index 1a623ef..c6d0093 100644 --- a/lua/modules/configs/lualine.lua +++ b/lua/modules/configs/lualine.lua @@ -1,8 +1,8 @@ require("lualine").setup({ options = { - -- ... your lualine config theme = Sv.colorscheme, - -- ... your lualine config + -- section_separators = { "", "" }, + component_separators = { "", "" }, }, sections = { lualine_a = { "mode" }, diff --git a/lua/modules/configs/telescope.lua b/lua/modules/configs/telescope.lua index b646983..06a2eb0 100644 --- a/lua/modules/configs/telescope.lua +++ b/lua/modules/configs/telescope.lua @@ -14,8 +14,8 @@ telescope.setup({ "--column", "--smart-case", }, - prompt_prefix = "  ", - selection_caret = " ", + prompt_prefix = " ", + selection_caret = " ", entry_prefix = " ", initial_mode = "insert", selection_strategy = "reset", @@ -34,7 +34,7 @@ telescope.setup({ height = 0.80, preview_cutoff = 120, }, - file_sorter = require("telescope.sorters").get_fuzzy_file, + file_sorter = require("telescope.sorters").get_fzy_sorter, file_ignore_patterns = {}, generic_sorter = require("telescope.sorters").get_generic_fuzzy_sorter, winblend = 0, @@ -50,19 +50,9 @@ telescope.setup({ buffer_previewer_maker = require("telescope.previewers").buffer_previewer_maker, }, extensions = { - fzf = { - fuzzy = true, -- false will only do exact matching - override_generic_sorter = false, -- override the generic sorter - override_file_sorter = true, -- override the file sorter - case_mode = "smart_case", -- or "ignore_case" or "respect_case" - -- the default case_mode is "smart_case" - }, - media_files = { - filetypes = { "png", "webp", "jpg", "jpeg" }, - find_cmd = "rg", -- find command (defaults to `fd`) + fzy_native = { + override_generic_sorter = false, + override_file_sorter = true, }, }, }) - -require("telescope").load_extension("fzf") -require("telescope").load_extension("media_files") diff --git a/lua/modules/configs/whichkey.lua b/lua/modules/configs/whichkey.lua index b810df3..62fccad 100644 --- a/lua/modules/configs/whichkey.lua +++ b/lua/modules/configs/whichkey.lua @@ -138,6 +138,7 @@ local mappings = { b = { "Search in Buffer" }, h = { "Command History" }, m = { "Jump to Marks" }, + c = { "Colorschemes with previwer" }, }, f = { name = "+Files", diff --git a/lua/modules/init.lua b/lua/modules/init.lua index fed2540..94f9d18 100644 --- a/lua/modules/init.lua +++ b/lua/modules/init.lua @@ -43,6 +43,9 @@ return packer.startup(function() local disabled_stardark = functions.is_plugin_disabled("stardark") use({ "ashincoder/stardark", disable = disabled_stardark }) + local disabled_neon = functions.is_plugin_disabled("neon") + use({ "ashincoder/neon", disable = disabled_neon }) + local disabled_gruvbox = functions.is_plugin_disabled("gruvbox") use({ "ashincoder/gruvbox.nvim", disable = disabled_gruvbox }) @@ -81,6 +84,10 @@ return packer.startup(function() end, wants = { "LuaSnip" }, requires = { + { + "tamago324/compe-zsh", + after = "nvim-compe", + }, { "L3MON4D3/LuaSnip", wants = "friendly-snippets", @@ -126,9 +133,6 @@ return packer.startup(function() use({ "glepnir/lspsaga.nvim", - -- config = function() - -- require("modules.configs.lsp_saga").saga() - -- end, cmd = "Lspsaga", module = "lspsaga", disable = disabled_lsp, @@ -143,6 +147,31 @@ return packer.startup(function() disable = disabled_lsp, }) + -- Linter + local disabled_lint = functions.is_plugin_disabled("lint") + use({ + "mfussenegger/nvim-lint", + config = function() + require("modules.configs.linter") + end, + -- module = "lint", + disable = disabled_lint, + }) + + local disabled_runner = functions.is_plugin_disabled("runner") + use({ + "michaelb/sniprun", + run = "bash install.sh", + disable = disabled_runner, + cmd = { + "SnipRun", + "SnipClose", + "SnipTerminate", + "SnipReset", + "SnipReplMemoryClean", + }, + }) + -- Viewer & finder for LSP symbols and tags local disabled_outline = functions.is_plugin_disabled("symbols") use({ @@ -184,7 +213,7 @@ return packer.startup(function() local disabled_gitsigns = functions.is_plugin_disabled("gitsigns") use({ "lewis6991/gitsigns.nvim", - event = "BufRead", + module = "gitsigns", config = function() require("modules.configs.gitsigns") end, @@ -225,19 +254,6 @@ return packer.startup(function() disable = disabled_telescope, }) - use({ - "nvim-telescope/telescope-fzf-native.nvim", - run = "make", - cmd = "Telescope", - disable = disabled_telescope, - }) - - use({ - "nvim-telescope/telescope-media-files.nvim", - cmd = "Telescope", - disable = disabled_telescope, - }) - -- Git stuff local disabled_lazygit = functions.is_plugin_disabled("lazygit") use({ @@ -356,6 +372,7 @@ return packer.startup(function() config = function() require("modules.configs.dashboard") end, + event = "BufWinEnter", disable = disabled_dashboard, }) @@ -368,8 +385,6 @@ return packer.startup(function() end, }) - use({ "dstein64/vim-startuptime", cmd = "StartupTime" }) - -- Smooth Scroll local disabled_neoscroll = functions.is_plugin_disabled("neoscroll") use({