Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #20 from ashincoder/dev
Browse files Browse the repository at this point in the history
Merge 'dev' branch to 'main'
  • Loading branch information
ashincoder authored Aug 6, 2021
2 parents 1c271f4 + 915407f commit be43d63
Show file tree
Hide file tree
Showing 16 changed files with 128 additions and 86 deletions.
10 changes: 2 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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

3 changes: 3 additions & 0 deletions bin/starplug.example.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 2 additions & 6 deletions bin/sv-config.example.lua
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
23 changes: 22 additions & 1 deletion lua/core/autocmds/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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",
"<buffer>",
"silent! write",
},
},
_autolint = {
{
"BufWritePost",
"<buffer>",
":silent lua require('lint').try_lint()",
},
{
"BufEnter",
"<buffer>",
":silent lua require('lint').try_lint()",
},
},
})

return M
2 changes: 1 addition & 1 deletion lua/core/config/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 3 additions & 1 deletion lua/core/config/starrc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions lua/core/functions/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
19 changes: 10 additions & 9 deletions lua/core/keybindings/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,14 @@ utils.map("n", "<leader>gc", "<cmd>Telescope git_commits<CR>", opts) -- Commits
utils.map("n", "<leader>gC", "<cmd>Telescope git_bcommits<CR>", opts) -- Commits List for current file
utils.map("n", "<leader>gb", "<cmd>Telescope git_branches<CR>", opts) -- Branches List
utils.map("n", "<leader>gt", "<cmd>Telescope git_status<CR>", opts) -- Git status
utils.map("n", "<leader>gj", "<cmd>lua require 'gitsigns'.next_hunk()<CR>", opts) -- Next Hunk
utils.map("n", "<leader>gk", "<cmd>lua require 'gitsigns'.prev_hunk()<CR>", opts) -- Prev Hunk
utils.map("n", "<leader>gl", "<cmd>lua require 'gitsigns'.blame_line()<CR>", opts) -- Blame
utils.map("n", "<leader>gp", "<cmd>lua require 'gitsigns'.preview_hunk()<CR>", opts) -- Preview Hunk
utils.map("n", "<leader>gr", "<cmd>lua require 'gitsigns'.reset_hunk()<CR>", opts) -- Reset Hunk
utils.map("n", "<leader>gR", "<cmd>lua require 'gitsigns'.reset_buffer()<CR>", opts) -- Reset Buffer
utils.map("n", "<leader>gs", "<cmd>lua require 'gitsigns'.stage_hunk()<CR>", opts) -- Stage Hunk
utils.map("n", "<leader>gu", "<cmd>lua require 'gitsigns'.undo_stage_hunk()<CR>", opts) -- Unstage Hunk
utils.map("n", "<leader>gj ", "<cmd>lua require 'gitsigns'.next_hunk()<CR>", opts) -- Next Hunk
utils.map("n", "<leader>gk ", "<cmd>lua require 'gitsigns'.prev_hunk()<CR>", opts) -- Prev Hunk
utils.map("n", "<leader>gl ", "<cmd>lua require 'gitsigns'.blame_line()<CR>", opts) -- Blame
utils.map("n", "<leader>gp ", "<cmd>lua require 'gitsigns'.preview_hunk()<CR>", opts) -- Preview Hunk
utils.map("n", "<leader>gr ", "<cmd>lua require 'gitsigns'.reset_hunk()<CR>", opts) -- Reset Hunk
utils.map("n", "<leader>gR ", "<cmd>lua require 'gitsigns'.reset_buffer()<CR>", opts) -- Reset Buffer
utils.map("n", "<leader>gs ", "<cmd>lua require 'gitsigns'.stage_hunk()<CR>", opts) -- Stage Hunk
utils.map("n", "<leader>gu ", "<cmd>lua require 'gitsigns'.undo_stage_hunk()<CR>", opts) -- Unstage Hunk

-- Help Telescope
utils.map("n", "<leader>hh", "<cmd>Telescope help_tags<CR>", opts) -- help_tags
Expand All @@ -107,9 +107,9 @@ utils.map("n", "<leader>cd", "<cmd>Lspsaga preview_definition<CR>", opts) -- Pre
utils.map("n", "<leader>cF", "<cmd>Format<CR>", opts) -- Format buffer

utils.map("n", "K", "<cmd>lua vim.lsp.buf.hover()<CR>", opts)
utils.map("n", "<leader>cl", "<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>", opts) -- error list
utils.map("n", "<C-n>", "<cmd>lnext<CR>", opts) -- error navigation list
utils.map("n", "<C-p>", "<cmd>lprev<CR>", opts) -- error navigation list
utils.map("n", "<leader>cl", "<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>", opts) -- error list
utils.map("n", "<leader>cgD", "<cmd>lua vim.lsp.buf.definition()<CR>", opts) -- jump to definition
utils.map("n", "<leader>cgr", "<cmd>lua vim.lsp.buf.references()<CR>", opts) -- go to reference
utils.map("n", "<leader>cgi", "<cmd>lua vim.lsp.buf.implementation()<CR>", opts) -- buf implementation
Expand All @@ -131,6 +131,7 @@ utils.map("n", "<leader>sb", "<cmd>Telescope current_buffer_fuzzy_find<CR>", opt
utils.map("n", "<leader>ss", "<cmd>Telescope lsp_document_symbols<CR>", opts)
utils.map("n", "<leader>sh", "<cmd>Telescope command_history<CR>", opts)
utils.map("n", "<leader>sm", "<cmd>Telescope marks<CR>", opts)
utils.map("n", "<leader>sc", "<cmd>lua require('telescope.builtin.internal').colorscheme({enable_preview = true})<cr>")

-- Files
utils.map("n", "<leader>ff", "<cmd>Telescope find_files<CR>", opts)
Expand Down
1 change: 1 addition & 0 deletions lua/modules/configs/compe.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ compe.setup({
max_menu_width = 100,
documentation = true,
source = {
zsh = true,
orgmode = true,
nvim_lsp = true,
nvim_lua = true,
Expand Down
44 changes: 22 additions & 22 deletions lua/modules/configs/icons.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
Expand Down
10 changes: 10 additions & 0 deletions lua/modules/configs/linter.lua
Original file line number Diff line number Diff line change
@@ -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
9 changes: 8 additions & 1 deletion lua/modules/configs/lsp_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions lua/modules/configs/lualine.lua
Original file line number Diff line number Diff line change
@@ -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" },
Expand Down
Loading

0 comments on commit be43d63

Please sign in to comment.