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

Commit

Permalink
Pushing changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ashincoder committed Jul 28, 2021
1 parent 7880f4b commit f6dd7df
Show file tree
Hide file tree
Showing 37 changed files with 3,232 additions and 0 deletions.
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions bin/install-latest-neovim
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
!#/bin/bash
git clone --branch master --depth 1 https://github.com/neovim/neovim
cd neovim
sudo make CMAKE_BUILD_TYPE=Release install
cd ~
sudo rm -r neovim
46 changes: 46 additions & 0 deletions bin/installer
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/sh

set -o nounset # error when referencing undefined variable
set -o errexit # exit when command fails

moveoldnvim() {
echo "Moving your ~/.config/nvim folder to ~/.config/nvim.bak"
mv "$HOME/.config/nvim" "$HOME/.config/nvim.bak"
}

installpacker() {
git clone https://github.com/wbthomason/packer.nvim ~/.local/share/nvim/site/pack/packer/opt/packer.nvim
}

cloneconfig() {
echo "Cloning StarVim configuration"
git clone --branch main https://github.com/ashincoder/StarVim.git ~/.config/nvim
cp "$HOME"/.config/nvim/bin/sv-config.example.lua "$HOME"/.config/nvim/sv-config.lua
cp "$HOME"/.config/nvim/bin/starrc.example.lua "$HOME"/.config/nvim/starrc.lua

nvim +":lua require 'modules' vim.cmd('PackerInstall')"
nvim +":lua require 'modules' vim.cmd('PackerCompile')"

echo -e "\nCompile Complete"
}

# Welcome
echo 'Installing StarVim'

# move old nvim directory if it exists
[ -d "$HOME/.config/nvim" ] && moveoldnvim

if [ -e "$HOME/.local/share/nvim/site/pack/packer/start/packer.nvim" ]; then
echo 'packer already installed'
else
installpacker
fi

if [ -e "$HOME/.config/nvim/init.lua" ]; then
echo 'StarVim already installed'
else
# clone config down
cloneconfig
fi

echo "I recommend you also install and activate a font from here: https://github.com/ryanoasis/nerd-fonts"
39 changes: 39 additions & 0 deletions bin/starrc.example.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
local star = {
ui = {
"dashboard", -- Start screen
"statusline", -- Statusline
"tabline", -- Tabline, shows your buffers list at top
"which-key", -- Keybindings popup menu like Emacs' guide-key
-- 'zen', -- Distraction free environment
-- 'indentlines', -- Show indent lines
},
star = {
-- 'orgmode', -- Life Organization Tool
},
colors = {
"stardark", -- The shiny theme
-- "gruvbox", -- The almighty
-- "icy", -- Shiver to death!
},
editor = {
"lsp", -- Language Server Protocols
"completion", -- The ultimate completion
"nvim-tree", -- Tree explorer
"symbols", -- LSP symbols and tags
"gitsigns", -- Git signs
"telescope", -- Highly extendable fuzzy finder over lists
"formatter", -- File formatting
"autopairs", -- Autopairs
"commentary", -- Commentary plugin
-- "terminal", -- Terminal for Neovim (NOTE: needed for runner and compiler)
-- 'minimap', -- Code minimap, requires github.com/wfxr/code-minimap
},
utilities = {
"colorizer", -- Fastets colorizer for Neovim
-- 'lazygit', -- LazyGit integration for Neovim, requires LazyGit
-- 'suda', -- Write and read files without sudo permissions
-- 'range-highlight', -- hightlights ranges you have entered in commandline
},
}

return star
108 changes: 108 additions & 0 deletions bin/sv-config.example.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
-- This is a example config.
-- 'Sv' is the global options object
-- General Settings
Sv.number = true

Sv.pumheight = 20
Sv.timeoutlen = 100

Sv.shell = "zsh"

Sv.undofile = true

Sv.leader_key = "space"
Sv.colorscheme = "stardark" -- The only added colorscheme is stardark and icy.

Sv.autosave = false
Sv.format_on_save = true

-- TreeSitter parsers config
Sv.treesitter.ensure_installed = {
"lua",
-- "bash",
-- "json",
-- "python",
-- "c",
-- "c_sharp",
-- "clojure",
-- "comment",
-- "cpp",
-- "commonlisp",
-- "cuda",
-- "dart",
-- "devicetree",
-- "dockerfile",
-- "elixir",
-- "erlang",
-- "go",
-- "fish",
-- "haskell",
-- "java",
-- "jsdoc",
-- "graphql",
-- "julia",
-- "kotlin",
-- "ledger",
-- "latex",
-- "php",
-- "nix",
-- "ocamel",
-- "ql",
-- "regex",
-- "ruby",
-- "rust",
-- "rst",
-- "scss",
-- "sparql",
-- "teal",
-- "toml",
-- "typescript",
-- "vue",
-- "yaml",
-- "zig"
}
Sv.treesitter.ignore_install = { "haskell" }
Sv.treesitter.highlight.enabled = true

-- lua
-- Sv.lang.lua.formatter.exe = "stylua"

-- python
-- Sv.lang.python.isort = true
-- Sv.lang.python.diagnostics.virtual_text = true
-- Sv.lang.python.analysis.use_library_code_types = true
-- to change default formatter from yapf to black
-- Sv.lang.python.formatter.exe = "black"
-- Sv.lang.python.formatter.args = {"-"}

-- go
-- to change default formatter from gofmt to goimports
-- Sv.lang.go.formatter.exe = "goimports"

-- javascript formatter is prettier

-- rust
-- Sv.lang.rust.formatter = {
-- exe = "rustfmt",
-- args = { "--emit=stdout" },
-- }

-- Additional Plugins
-- Sv.user_plugins = {
-- {"ashincoder/gruvbox.nvim"},
-- {"ashincoder/icy.nvim"},
-- }

-- Additional Leader bindings for WhichKey
-- Sv.user_which_key = {

-- A = {
-- name = "+Custom Leader Keys",
-- a = { "<cmd>'Command for a key'<cr>", "Description for a" },
-- b = { "<cmd>'Command for b key'<cr>", "Description for b" },
-- },

-- }

-- Additional Autocommands
-- Sv.user_autocommands = { }
8 changes: 8 additions & 0 deletions lua/core/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# The Core of StarVim

Here lies the hot core of StarVim.

- Keybindings - The keys to control the Star ship
- Configs - The control center of Star Ship
- Functions - Where all the functions of Ship are defined
- Autocmds - Commands to trigger during specific situations
50 changes: 50 additions & 0 deletions lua/core/autocmds/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
local M = {}

function M.define_augroups(definitions) -- {{{1
for group_name, definition in pairs(definitions) do
vim.cmd("augroup " .. group_name)
vim.cmd("autocmd!")

for _, def in pairs(definition) do
local command = table.concat(vim.tbl_flatten({ "autocmd", def }), " ")
vim.cmd(command)
end

vim.cmd("augroup END")
end
end

M.define_augroups({

_user_autocommands = Sv.user_autocommands,
_general_settings = {
{
"TextYankPost",
"*",
"lua require('vim.highlight').on_yank({higroup = 'Search', timeout = 200})",
},
{
"BufWinEnter",
"*",
"setlocal formatoptions-=c formatoptions-=r formatoptions-=o",
},
{
"BufRead",
"*",
"setlocal formatoptions-=c formatoptions-=r formatoptions-=o",
},
{
"BufNewFile",
"*",
"setlocal formatoptions-=c formatoptions-=r formatoptions-=o",
},
{ "BufWritePost", "sv-config.lua", "lua require('core.functions').reload_config()" },
{
"TextChanged,InsertLeave",
"<buffer>",
"silent! write",
},
},
})

return M
Loading

0 comments on commit f6dd7df

Please sign in to comment.