Skip to content

Commit

Permalink
Fix issue with Nerd Font V3 on startscreen
Browse files Browse the repository at this point in the history
  • Loading branch information
leslie255 committed Sep 8, 2023
1 parent 9eed37f commit c31ab5e
Show file tree
Hide file tree
Showing 6 changed files with 143 additions and 129 deletions.
12 changes: 10 additions & 2 deletions lua/configs/autocomplete.lua
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,18 @@ function M.config()
-- nvim-lspconfig config
-- List of all pre-configured LSP servers:
-- github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
local servers = { 'rust_analyzer', 'pylsp', 'clangd', 'html', 'cssls', 'sourcekit' }
local servers = { 'pylsp', 'clangd', 'html', 'cssls', 'sourcekit' }
local lspconfig = require('lspconfig')
for _, lsp in pairs(servers) do
require('lspconfig')[lsp].setup {}
lspconfig[lsp].setup {}
end
lspconfig.rust_analyzer.setup {
settings = {
["rust-analyzer"] = {
procMacro = { enable = true },
}
}
}

require("lspsaga").setup({
ui = {
Expand Down
37 changes: 0 additions & 37 deletions lua/configs/lang/rust.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,43 +14,6 @@ function M.config()
-- automatically call RustReloadWorkspace when writing to a Cargo.toml file.
reload_workspace_from_cargo_toml = true,

-- These apply to the default RustSetInlayHints command
inlay_hints = {
-- automatically set inlay hints (type hints)
-- default: true
auto = false,

-- Only show inlay hints for the current line
only_current_line = false,

-- whether to show parameter hints with the inlay hints or not
-- default: true
show_parameter_hints = true,

-- prefix for parameter hints
-- default: "<-"
parameter_hints_prefix = "<- ",

-- prefix for all the other hints (type, chaining)
-- default: "=>"
other_hints_prefix = "=> ",

-- whether to align to the length of the longest line in the file
max_len_align = false,

-- padding from the left if max_len_align is true
max_len_align_padding = 1,

-- whether to align to the extreme right or not
right_align = false,

-- padding from the right if right_align is true
right_align_padding = 7,

-- The color of the hints
highlight = "Comment",
},

-- options same as lsp hover / vim.lsp.util.open_floating_preview()
hover_actions = {

Expand Down
129 changes: 123 additions & 6 deletions lua/configs/startscreen.lua
Original file line number Diff line number Diff line change
@@ -1,11 +1,128 @@
-- aleph is a stripped down version of goolord/alpha-nvim to improve startup time
local M = {}

function theme()
local if_nil = vim.F.if_nil

local default_terminal = {
type = "terminal",
command = nil,
width = 69,
height = 8,
opts = {
redraw = true,
window_config = {},
},
}

local default_header = {
type = "text",
val = {
[[ __]],
[[ ___ ___ ___ __ __ /\_\ ___ ___]],
[[ / _ `\ / __`\ / __`\/\ \/\ \\/\ \ / __` __`\]],
[[ /\ \/\ \/\ __//\ \_\ \ \ \_/ |\ \ \/\ \/\ \/\ \]],
[[ \ \_\ \_\ \____\ \____/\ \___/ \ \_\ \_\ \_\ \_\]],
[[ \/_/\/_/\/____/\/___/ \/__/ \/_/\/_/\/_/\/_/]],
},
opts = {
position = "center",
hl = "Type",
-- wrap = "overflow";
},
}

local footer = {
type = "text",
val = "",
opts = {
position = "center",
hl = "Number",
},
}

local leader = "SPC"

--- @param sc string
--- @param txt string
--- @param keybind string? optional
--- @param keybind_opts table? optional
local function button(sc, txt, keybind, keybind_opts)
local sc_ = sc:gsub("%s", ""):gsub(leader, "<leader>")

local opts = {
position = "center",
shortcut = sc,
cursor = 3,
width = 50,
align_shortcut = "right",
hl_shortcut = "Keyword",
}
if keybind then
keybind_opts = if_nil(keybind_opts, { noremap = true, silent = true, nowait = true })
opts.keymap = { "n", sc_, keybind, keybind_opts }
end

local function on_press()
local key = vim.api.nvim_replace_termcodes(keybind or sc_ .. "<Ignore>", true, false, true)
vim.api.nvim_feedkeys(key, "t", false)
end

return {
type = "button",
val = txt,
on_press = on_press,
opts = opts,
}
end

local buttons = {
type = "group",
val = {
button("e", "󱪝 New file", "<cmd>ene <CR>"),
button("f3", "󰙅 File tree", "<f3>"),
button("f9", "󰈞 Find file", "<f9>"),
button("f10", "󰈞 Find file in git", "<f10>"),
button("q", " Quit", "<cmd>q<CR>"),
},
opts = {
spacing = 1,
},
}

local section = {
terminal = default_terminal,
header = default_header,
buttons = buttons,
footer = footer,
}

local config = {
layout = {
{ type = "padding", val = 2 },
section.header,
{ type = "padding", val = 2 },
section.buttons,
section.footer,
},
opts = {
margin = 5,
},
}

return {
button = button,
section = section,
config = config,
-- theme config
leader = leader,
-- deprecated
opts = config,
}

end

function M.config()
local aleph = require("aleph")
local dashboard = require("aleph.themes.dashboard")
aleph.setup(dashboard.opts)
-- Disable folding on aleph buffer:
vim.cmd("autocmd FileType aleph setlocal nofoldenable")
require'alpha'.setup(theme().config)
end

return M
8 changes: 6 additions & 2 deletions lua/core/plugins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ return require('packer').startup(function()
}
use 'moll/vim-bbye' -- for more sensible delete buffer cmd

-- themes (disabled other themes to optimize startup time)
-- themes
use 'sainnhe/sonokai'
use 'tiagovla/tokyodark.nvim'
use 'projekt0n/github-nvim-theme'
Expand All @@ -34,6 +34,7 @@ return require('packer').startup(function()
use 'sainnhe/edge'
use 'nyoom-engineering/oxocarbon.nvim'
-- use 'Th3Whit3Wolf/one-nvim'
use 'AlexvZyl/nordic.nvim'

-- language
use 'neovim/nvim-lspconfig'
Expand Down Expand Up @@ -80,7 +81,10 @@ return require('packer').startup(function()
use 'lukas-reineke/indent-blankline.nvim'

-- startup screen
use 'leslie255/aleph-nvim'
use {
'goolord/alpha-nvim',
requires = 'nvim-tree/nvim-web-devicons',
}

-- scroll bar
use 'petertriho/nvim-scrollbar'
Expand Down
5 changes: 4 additions & 1 deletion lua/core/theme.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ vim.g.edge_better_performance = 1
-- vim.cmd("colorscheme github_dark_high_contrast")

-- oxocarbon
vim.cmd("colorscheme oxocarbon")
-- vim.cmd("colorscheme oxocarbon")

-- nordic
vim.cmd("colorscheme nordic")

vim.cmd("set background=dark")
81 changes: 0 additions & 81 deletions syntax/shark.vim

This file was deleted.

0 comments on commit c31ab5e

Please sign in to comment.