Skip to content

Commit

Permalink
🎉 initial commit
Browse files Browse the repository at this point in the history
Co-authored-by: CallMeEchoCodes <[email protected]>
  • Loading branch information
mekb-turtle and CallMeEchoCodes committed Apr 9, 2023
0 parents commit 0725a93
Show file tree
Hide file tree
Showing 10 changed files with 290 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
indent_style = tab
tab_width = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
lazy-lock.json
vimrc.old.vim
3 changes: 3 additions & 0 deletions init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
if not vim.g.vscode then
require("core")
end
79 changes: 79 additions & 0 deletions lua/core/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
local o, g = vim.o, vim.g

-- Terminal cursor
-- o.guicursor = ""

-- Line numbers
o.number = true
o.relativenumber = true
o.number = 2

-- Clipboard
o.clipboard = "unnamedplus"

-- Indentation
o.autoindent = true
o.expandtab = false
o.shiftwidth = 4
o.smartindent = true
o.tabstop = 4
o.softtabstop = 4

-- Wildcard menu
o.wildmenu = true

-- Mouse
o.mouse = "a"

-- Disable netrw
g.loaded_netrw = 1
g.loaded_netrwPlugin = 1

-- Use terminal colours
o.termguicolors = true

-- Wrap moving cursor horizontal to next/previous lines
-- vim.opt.whichwrap:append("<>[]hl")

-- Leaders
g.mapleader = " "

-- Neovide
vim.api.nvim_set_option_value("guifont", "Fira Code,Symbols Nerd Font,Twemoji:h12", {})
g.neovide_refresh_rate = 60
g.neovide_cursor_animation_length = 0.03
g.neovide_cursor_trail_length = 0.05
g.neovide_cursor_antialiasing = true
g.neovide_transparency = 0.2
g.neovide_cursor_vfx_mode = "railgun"

-- Keybinds
function map(mode, keystroke, out)
vim.api.nvim_set_keymap(mode, keystroke, out, {
noremap = true,
silent = true,
})
end

-- Tab keybinds
map('n', '<C-`>', ':BufferLineCycleNext<CR>')
map('n', '<C-S-`>', ':BufferLineCyclePrev<CR>')
map('n', '<C-.>', ':BufferLineMoveNext<CR>')
map('n', '<C-,>', ':BufferLineMovePrev<CR>')
map('n', '<C-Right>', ':BufferLineCycleNext<CR>')
map('n', '<C-Left>', ':BufferLineCyclePrev<CR>')
map('n', '<C-W>', ':bd<CR>')
map('n', '<C-T>', ':enew<CR>')

-- Other keybinds
map('n', '<C-/>', ':let @/ = ""<CR>')
map('n', '<C-Up>', 'g<Up>')
map('n', '<C-Down>', 'g<Down>')
map('n', '<C-Backspace>', 'db')
map('n', '<C-Delete>', 'dw')
map('n', '<C-F>', '/')
map('n', '<C-O>', ':set nowrap!<CR>')
map('n', '<C-S>', ':w<CR>')

-- Plugins
require("plugins")
47 changes: 47 additions & 0 deletions lua/plugins/configs/bufferline.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
return function()
local ctp = require("catppuccin.palettes").get_palette()

require("bufferline").setup({
options = {
max_name_length = 14,
max_prefix_length = 10,
tab_size = 20,

color_icons = true,
show_buffer_icons = true,
show_buffer_close_icons = true,
show_buffer_default_icon = true,
show_close_icon = true,
show_tab_indicators = true,

enforce_regular_tabs = true,
persist_buffer_sort = true,
always_show_bufferline = true,

separator_style = "thin",

diagnostics = "nvim_lsp",
diagnostics_indicator = function(count)
return "(" .. count .. ")"
end,
offsets = {
{
filetype = "NvimTree",
text = "",
text_align = "center",
padding = 1,
},
{
filetype = "lspsagaoutline",
text = "Lspsaga Outline",
text_align = "center",
padding = 1,
},
},
},

highlights = require("catppuccin.groups.integrations.bufferline").get({
styles = { "italic", "bold" },
}),
})
end
17 changes: 17 additions & 0 deletions lua/plugins/configs/catppuccin.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
return function()
require("catppuccin").setup({
flavour = "mocha",
term_colors = true,
transparent_background = vim.g.neovide == nil,
integrations = {
treesitter = true,
nvimtree = true,
notify = true,
telescope = true,
ts_rainbow = true,
},
show_end_of_buffer = true,
})

vim.cmd.colorscheme("catppuccin")
end
11 changes: 11 additions & 0 deletions lua/plugins/configs/nvim-tree.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
return function()
require("nvim-tree").setup({
sort_by = "case_sensitive",
renderer = {
group_empty = true,
},
filters = {
dotfiles = true,
},
})
end
8 changes: 8 additions & 0 deletions lua/plugins/configs/presence.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
return function()
require("presence").setup({
main_image = "file",
enable_line_number = false,
show_time = false,
neovim_image_text = "Neovim",
})
end
36 changes: 36 additions & 0 deletions lua/plugins/configs/treesitter.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
return vim.schedule_wrap(
function()
vim.api.nvim_set_option_value("foldmethod", "manual", {})
vim.api.nvim_set_option_value("foldexpr", "nvim_treesitter#foldexpr()", {})

require("nvim-treesitter.configs").setup({
ensure_installed = {
"bash",
"c",
"cpp",
"css",
"cmake",
"html",
"javascript",
"json",
"make",
"markdown",
"markdown_inline",
"python",
"rust",
"typescript",
"yaml",
"java",
"c_sharp",
"lua",
"git_rebase",
"gitattributes",
"gitcommit",
"gitignore",
"go",
"jq",
}
})
require("nvim-treesitter.install").prefer_git = true
end
)
78 changes: 78 additions & 0 deletions lua/plugins/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
-- Load lazy
local lazy_path = vim.fn.stdpath("data") .. "lazy/lazy.nvim"
if not vim.loop.fs_stat(lazy_path) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable",
lazy_path
})
end

vim.opt.rtp:prepend(lazy_path)

-- Lazy settings
local lazy_settings = {
git = {
timeout = 300,
},
install = {
colorscheme = { "catppuccin" },
},
ui = {
border = "rounded",
},
}

-- Lazy plugins
local lazy_plugins = {
{
"catppuccin/nvim",
name = "catppuccin",
config = require("plugins.configs.catppuccin"),
priority = 99,
},
{
"nvim-treesitter/nvim-treesitter",
lazy = true,
build = function()
if #vim.api.nvim_list_uis() ~= 0 then
vim.api.nvim_command("TSUpdate")
end
end,
event = { "CursorHold", "CursorHoldI" },
dependencies = {
{ "andymass/vim-matchup" },
{ "mrjones2014/nvim-ts-rainbow" },
},
config = require("plugins.configs.treesitter"),
},
{
"andweeb/presence.nvim",
config = require("plugins.configs.presence"),
},
{
"akinsho/bufferline.nvim",
version = "v3.*",
dependencies = "nvim-tree/nvim-web-devicons",
lazy = true,
event = { "BufReadPost", "BufAdd", "BufNewFile" },
config = require("plugins.configs.bufferline")
},
{
"nvim-tree/nvim-tree.lua",
lazy = true,
cmd = {
"NvimTreeToggle",
"NvimTreeOpen",
"NvimTreeFindFile",
"NvimTreeFindFileToggle",
"NvimTreeRefresh",
},
config = require("plugins.configs.nvim-tree")
},
}

require("lazy").setup(lazy_plugins, lazy_settings)

0 comments on commit 0725a93

Please sign in to comment.