Skip to content

Commit

Permalink
chore: Improved docs, formatting, API and statusline.
Browse files Browse the repository at this point in the history
  • Loading branch information
DrKJeff16 committed Apr 10, 2024
1 parent bd72d31 commit f345921
Show file tree
Hide file tree
Showing 6 changed files with 163 additions and 93 deletions.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@
*.out
*.i
*.s
*.a
*.as

/.env

.mypy_cache/
.ropeproject
.ropeproject/

*.list
*.log
22 changes: 10 additions & 12 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ local types = User.types
local maps_t = types.user.maps
local exists = User.exists -- Checks for missing modules
local map = User.maps.map
local kmap = User.maps.kmap

local set = vim.o
local opt = vim.opt
Expand All @@ -19,7 +20,7 @@ local bo = vim.bo
local nmap = map.n

-- Set `<Space>` as Leader Key.
nmap('<Space>', '<Nop>')
nmap('<space>', '<Nop>')
let.mapleader = ' '
let.maplocalleader = ' '

Expand All @@ -32,17 +33,16 @@ let.loaded_netrwPlugin = 1
User.opts()

--- Table of mappings for each mode `(normal|insert|visual|terminal)`.
---
--- ---
--- Each mode contains its respective mappings.
--- `map_tbl.[n|i|v|t].opts` is an **API** option table.
---@type ApiMapTbl
---@type ApiMapModeDicts
local map_tbl = {
n = {
{ lhs = '<Leader>fn', rhs = ':edit ', opts = { silent = false } },
{ lhs = '<Leader>fs', rhs = ':w<CR>' },
{ lhs = '<Leader>fS', rhs = ':w ', opts = { silent = false } },
{ lhs = '<Leader>ff', rhs = ':ed ', opts = { silent = false } },

{ lhs = '<Leader>fvs', rhs = ':luafile $MYVIMRC<CR>' },
{ lhs = '<Leader>fvl', rhs = ':luafile %<CR>' },
{ lhs = '<Leader>fvv', rhs = ':so %<CR>' },
Expand Down Expand Up @@ -105,20 +105,18 @@ for k, func in next, map do
end
end

--- List of manually-called, non-lazy
--- plugins.
--- List of manually-called, plugins.
local Pkg = require('lazy_cfg')

local Csc = Pkg.colorschemes

-- Reorder to your liking.
if Csc.nightfox then
if Csc.tokyonight and Csc.tokyonight.setup then
Csc.tokyonight.setup()
elseif Csc.nightfox and Csc.nightfox.setup then
Csc.nightfox.setup()
elseif Csc.catppuccin then
elseif Csc.catppuccin and Csc.catppuccin.setup then
Csc.catppuccin.setup()
elseif Csc.tokyonight then
Csc.tokyonight.setup()
elseif Csc.spaceduck then
elseif Csc.spaceduck and Csc.spaceduck.setup then
Csc.spaceduck.setup()
end

Expand Down
109 changes: 76 additions & 33 deletions lua/lazy_cfg/lualine/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ Lualine.setup({
},
ignore_focus = {},
always_divide_middle = true,
globalstatus = true,
globalstatus = false,
refresh = {
statusline = 500,
tabline = 500,
winbar = 500,
statusline = 1000,
tabline = 1000,
winbar = 1000,
},
},
sections = {
Expand All @@ -40,9 +40,67 @@ Lualine.setup({
end,
},
},
lualine_b = {
'branch',
-- 'diff',
lualine_b = {},
lualine_c = {},
lualine_x = {
'encoding',
'fileformat',
'filetype',
},
lualine_y = { 'progress' },
lualine_z = { 'location' }
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = {},
lualine_x = {},
lualine_y = {'progress'},
lualine_z = {}
},
tabline = {
lualine_a = { 'tabs' },
lualine_b = {
'buffers'
},
lualine_c = { 'branch' },
lualine_x = {},
lualine_y = {},
lualine_z = {{
'datetime',
style = 'uk'
}},
},
winbar = {
lualine_a = {{
'diff',
colored = true,
diff_color = {
-- Same color values as the general color option can be used here.
added = 'LuaLineDiffAdd', -- Changes the diff's added color
modified = 'LuaLineDiffChange', -- Changes the diff's modified color
removed = 'LuaLineDiffDelete', -- Changes the diff's removed color you
},
symbols = {added = '+', modified = '~', removed = '-'}, -- Changes the symbols used by the diff.
}},
lualine_b = {
{
'filename',
file_status = true,
newfile_status = true,
path = 4,
shorting_target = 15,
symbold = {
modified = '[+]',
readonly = '[RO]',
unnamed = '[NONAME]',
newfile = '[NEW]'
},
},
},
lualine_c = {},
lualine_x = {},
lualine_y = {
{
'diagnostics',
sources = { 'nvim_lsp' },
Expand All @@ -54,13 +112,17 @@ Lualine.setup({
hint = '?'
},
},
},
lualine_c = {
},
lualine_z = {},
},
inactive_winbar = {
lualine_a = {},
lualine_b = {
{
'filename',
file_status = true,
newfile_status = true,
path = 1,
path = 4,
shorting_target = 15,
symbold = {
modified = '[+]',
Expand All @@ -70,29 +132,10 @@ Lualine.setup({
},
},
},
lualine_x = {
'encoding',
'fileformat',
{
'filetype',
icon_only = false,
icon = { '', align = 'right' },
}
},
lualine_y = {
'progress',
-- { 'searchcount', timeout = 10 }
},
lualine_z = {'location'}
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = {'filename'},
lualine_x = {},
lualine_y = {'progress'},
lualine_z = {'location'}
lualine_c = {},
lualine_x = {},
lualine_y = { 'progress' },
lualine_z = {},
},
inactive_winbar = {},
extensions = {}
})
13 changes: 5 additions & 8 deletions lua/lazy_cfg/treesitter/context.lua
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
---@diagnostic disable:unused-local
---@diagnostic disable:unused-function

require('user.types.user.highlight')

local User = require('user')
local exists = User.exists
local hl = User.highlight
local types = User.types.user.highlight
local hi = User.highlight.hl

if not exists('treesitter-context') then
return
end

local hi = hl.hl

local Context = require('treesitter-context')
local Config = require('treesitter-context.config')

---@type TSContext.UserConfig
local Options = {
mode = 'cursor',
mode = 'topline',
trim_scope = 'outer',
line_numbers = true,
line_numbers = false,
min_window_height = 3,
zindex = 30,
zindex = 15,
enable = true,
max_lines = 4,
}
Expand Down
8 changes: 4 additions & 4 deletions lua/lazy_cfg/which_key/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ WK.setup({
align = "center", -- align columns left, center or right
},
ignore_missing = false, -- enable this to hide mappings for which you didn't specify a label
hidden = { "<silent>", "<cmd>", "<Cmd>", "<CR>", "^:", "^ ", "^call ", "^lua " }, -- hide mapping boilerplate
hidden = { "<silent>", "<cmd>", "<Cmd>", "<CR>", '<space>', "^:", "^ ", "^call ", "^lua " }, -- hide mapping boilerplate
show_help = true, -- show a help message in the command line for using WhichKey
show_keys = true, -- show the currently pressed key and its label as a message in the command line
triggers = "auto", -- automatically setup triggers
Expand All @@ -94,9 +94,9 @@ WK.setup({
triggers_blacklist = {
-- list of mode / prefixes that should never be hooked by WhichKey
-- this is mostly relevant for keymaps that start with a native binding
i = { "j", "k" },
v = { "j", "k", "v", 'y', 'c', 'd' },
n = { "j", "k", "v", 'y', 'c', 'd' },
i = { "j", "k", '<space>', '<leader>' },
v = { "j", "k", "v" },
n = { "j", "k", "v" },
},
-- disable the WhichKey popup for certain buf types and file types.
-- Disabled by default for Telescope
Expand Down
Loading

0 comments on commit f345921

Please sign in to comment.