updates
This commit is contained in:
parent
b1b8726545
commit
5a42e61598
8 changed files with 237 additions and 133 deletions
|
@ -121,6 +121,7 @@
|
||||||
./nixos/dotfiles
|
./nixos/dotfiles
|
||||||
|
|
||||||
./nixos/configs/stylix
|
./nixos/configs/stylix
|
||||||
|
./nixos/configs/ld.nix
|
||||||
./nixos/configs/lix.nix
|
./nixos/configs/lix.nix
|
||||||
./nixos/configs/nix.nix
|
./nixos/configs/nix.nix
|
||||||
./nixos/configs/ccache.nix
|
./nixos/configs/ccache.nix
|
||||||
|
|
9
nixos/configs/ld.nix
Normal file
9
nixos/configs/ld.nix
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
#
|
||||||
|
# Nix-ld configuration.
|
||||||
|
#
|
||||||
|
{pkgs, ...}: {
|
||||||
|
programs.nix-ld.enable = true;
|
||||||
|
programs.nix-ld.libraries = with pkgs; [
|
||||||
|
|
||||||
|
];
|
||||||
|
}
|
|
@ -103,9 +103,7 @@ with pkgs;
|
||||||
supersonic
|
supersonic
|
||||||
|
|
||||||
# Development.
|
# Development.
|
||||||
jetbrains.rust-rover
|
jetbrains-toolbox
|
||||||
jetbrains.webstorm
|
|
||||||
jetbrains.clion
|
|
||||||
|
|
||||||
# Xwayland support.
|
# Xwayland support.
|
||||||
xwayland
|
xwayland
|
||||||
|
|
|
@ -1,86 +1,86 @@
|
||||||
vim.cmd([[
|
vim.cmd([[
|
||||||
syntax on
|
syntax on
|
||||||
filetype plugin indent on
|
filetype plugin indent on
|
||||||
|
|
||||||
let mapleader=","
|
let mapleader=","
|
||||||
|
|
||||||
""" Options
|
""" Options
|
||||||
set number " Show line numbers.
|
set number " Show line numbers.
|
||||||
set modeline " Allow vim commands in text file comments.
|
set modeline " Allow vim commands in text file comments.
|
||||||
set undofile " Persistent undo tree.
|
set undofile " Persistent undo tree.
|
||||||
set incsearch " Incremental search.
|
set incsearch " Incremental search.
|
||||||
set tabstop=4 " Number of visual spaces to be displayed per HT.
|
set tabstop=4 " Number of visual spaces to be displayed per HT.
|
||||||
set expandtab " Expand tabs to spaces by default.
|
set expandtab " Expand tabs to spaces by default.
|
||||||
set shiftwidth=0 " Use tabstop value for indenting.
|
set shiftwidth=0 " Use tabstop value for indenting.
|
||||||
set scrolloff=2 " Keep 2 lines between the end of the buffer and the cursor.
|
set scrolloff=2 " Keep 2 lines between the end of the buffer and the cursor.
|
||||||
set sidescrolloff=2 " Keep 2 characters between the current column and the screen edge.
|
set sidescrolloff=2 " Keep 2 characters between the current column and the screen edge.
|
||||||
set mouse=n " Enable the mouse in normal mode.
|
set mouse=n " Enable the mouse in normal mode.
|
||||||
set colorcolumn=120
|
set colorcolumn=120
|
||||||
set wildmenu " Tab-complete command menu.
|
set wildmenu " Tab-complete command menu.
|
||||||
set wildmode=longest:full,full " Most bash-like way.
|
set wildmode=longest:full,full " Most bash-like way.
|
||||||
set wildignorecase " Ignore case when completing.
|
set wildignorecase " Ignore case when completing.
|
||||||
set splitright " Make :vsplit put the new window on the right.
|
set splitright " Make :vsplit put the new window on the right.
|
||||||
set splitbelow " Make :split put the new window on the bottom.
|
set splitbelow " Make :split put the new window on the bottom.
|
||||||
set foldlevel=5 " Don't fold almost anything by default.
|
set foldlevel=5 " Don't fold almost anything by default.
|
||||||
set hidden " Allow for hidden, modified but not written buffers.
|
set hidden " Allow for hidden, modified but not written buffers.
|
||||||
set bufhidden=hide " Hide buffers instead of deleting or unloading them.
|
set bufhidden=hide " Hide buffers instead of deleting or unloading them.
|
||||||
set ignorecase
|
set ignorecase
|
||||||
set smartcase
|
set smartcase
|
||||||
set gdefault
|
set gdefault
|
||||||
set cindent " A good basis/default for many languages, though this is usually overridden by the filetype plugin.
|
set cindent " A good basis/default for many languages, though this is usually overridden by the filetype plugin.
|
||||||
set cinoptions=l1,j1 " Indent case blocks correct, and indent Java anonymous classes correctly.
|
set cinoptions=l1,j1 " Indent case blocks correct, and indent Java anonymous classes correctly.
|
||||||
" Autowrap comments using textwidth, inserting the comment leader,
|
" Autowrap comments using textwidth, inserting the comment leader,
|
||||||
" and remove the comment leader when joining lines when it makes sense.
|
" and remove the comment leader when joining lines when it makes sense.
|
||||||
set formatoptions=cj
|
set formatoptions=cj
|
||||||
" Don't display . on folds.
|
" Don't display . on folds.
|
||||||
set fillchars=fold:\
|
set fillchars=fold:\
|
||||||
set diffopt=algorithm:patience
|
set diffopt=algorithm:patience
|
||||||
set fsync " Syncs the filesystem after :write.
|
set fsync " Syncs the filesystem after :write.
|
||||||
set nowrap
|
set nowrap
|
||||||
|
|
||||||
set updatetime=1000 "Lets languageservers update faster, and shortens the time for CursorHold.
|
set updatetime=1000 "Lets languageservers update faster, and shortens the time for CursorHold.
|
||||||
set noshowmode " We're using lualine, so showing the mode in the command line is redundant.
|
set noshowmode " We're using lualine, so showing the mode in the command line is redundant.
|
||||||
|
|
||||||
" Have the visual-selection indent commands re-highlight the last visual selection after indenting.
|
" Have the visual-selection indent commands re-highlight the last visual selection after indenting.
|
||||||
vnoremap > >gv
|
vnoremap > >gv
|
||||||
vnoremap < <gv
|
vnoremap < <gv
|
||||||
|
|
||||||
" Don't use backtick for anything, as it's our wezterm leader key and this leads
|
" Don't use backtick for anything, as it's our wezterm leader key and this leads
|
||||||
" to typos.
|
" to typos.
|
||||||
map ` <Nop>
|
map ` <Nop>
|
||||||
|
|
||||||
" Leader Q should banish the current window.
|
" Leader Q should banish the current window.
|
||||||
map <leader>q :only<cr> \| :q<cr>
|
map <leader>q :only<cr> \| :q<cr>
|
||||||
|
|
||||||
" Leader W should save and then banish the current window.
|
" Leader W should save and then banish the current window.
|
||||||
map <leader>q :only<cr> \| :wq<cr>
|
map <leader>q :only<cr> \| :wq<cr>
|
||||||
|
|
||||||
" Fold augroups, functions, Lua, and Python
|
" Fold augroups, functions, Lua, and Python
|
||||||
let g:vimsyn_folding = 'aflP'
|
let g:vimsyn_folding = 'aflP'
|
||||||
|
|
||||||
" Support embedded Lua and Python.
|
" Support embedded Lua and Python.
|
||||||
let g:vimsyn_embed = 'lP'
|
let g:vimsyn_embed = 'lP'
|
||||||
|
|
||||||
" Highlight whitespace errors.
|
" Highlight whitespace errors.
|
||||||
let g:c_space_errors = 1
|
let g:c_space_errors = 1
|
||||||
let g:python_space_error_highlight = 1
|
let g:python_space_error_highlight = 1
|
||||||
|
|
||||||
let g:python_highlight_builtins = 1
|
let g:python_highlight_builtins = 1
|
||||||
let g:python_highlight_builtin_funcs = 1
|
let g:python_highlight_builtin_funcs = 1
|
||||||
let g:python_highlight_builtin_types = 1
|
let g:python_highlight_builtin_types = 1
|
||||||
let g:python_highlight_exceptions = 1
|
let g:python_highlight_exceptions = 1
|
||||||
let g:python_highlight_string_formatting = 1
|
let g:python_highlight_string_formatting = 1
|
||||||
let g:python_highlight_string_format = 1
|
let g:python_highlight_string_format = 1
|
||||||
let g:python_highlight_indent_errors = 1
|
let g:python_highlight_indent_errors = 1
|
||||||
let g:python_highlight_space_errors = 1
|
let g:python_highlight_space_errors = 1
|
||||||
let g:python_highlight_class_vars = 1
|
let g:python_highlight_class_vars = 1
|
||||||
|
|
||||||
let g:xsh_highlight_all = v:true
|
let g:xsh_highlight_all = v:true
|
||||||
|
|
||||||
let g:NERDCustomDelimiters = { 'dosini': { 'left': '#' }, 'xonsh': { 'left': '#' } }
|
let g:NERDCustomDelimiters = { 'dosini': { 'left': '#' }, 'xonsh': { 'left': '#' } }
|
||||||
|
|
||||||
" Use truecolor.
|
" Use truecolor.
|
||||||
set termguicolors
|
set termguicolors
|
||||||
|
|
||||||
" Disable relative numbering, if anything turns it on.
|
" Disable relative numbering, if anything turns it on.
|
||||||
set nornu!
|
set nornu!
|
||||||
|
|
|
@ -1,22 +1,22 @@
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"LazyVim/LazyVim",
|
"LazyVim/LazyVim",
|
||||||
opts = {
|
opts = {
|
||||||
colorscheme = function() end,
|
colorscheme = function() end,
|
||||||
|
|
||||||
defaults = {
|
defaults = {
|
||||||
autocmds = true,
|
autocmds = true,
|
||||||
keymaps = true,
|
keymaps = true,
|
||||||
},
|
},
|
||||||
|
|
||||||
news = {
|
news = {
|
||||||
lazyvim = false,
|
lazyvim = false,
|
||||||
neovim = false,
|
neovim = false,
|
||||||
},
|
},
|
||||||
|
|
||||||
-- icons used by other plugins
|
-- icons used by other plugins
|
||||||
-- stylua: ignore
|
-- stylua: ignore
|
||||||
icons = {
|
icons = {
|
||||||
misc = {
|
misc = {
|
||||||
dots = "",
|
dots = "",
|
||||||
},
|
},
|
||||||
|
@ -80,42 +80,42 @@ return {
|
||||||
Variable = " ",
|
Variable = " ",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
---@type table<string, string[]|boolean>?
|
---@type table<string, string[]|boolean>?
|
||||||
kind_filter = {
|
kind_filter = {
|
||||||
default = {
|
default = {
|
||||||
"Class",
|
"Class",
|
||||||
"Constructor",
|
"Constructor",
|
||||||
"Enum",
|
"Enum",
|
||||||
"Field",
|
"Field",
|
||||||
"Function",
|
"Function",
|
||||||
"Interface",
|
"Interface",
|
||||||
"Method",
|
"Method",
|
||||||
"Module",
|
"Module",
|
||||||
"Namespace",
|
"Namespace",
|
||||||
"Package",
|
"Package",
|
||||||
"Property",
|
"Property",
|
||||||
"Struct",
|
"Struct",
|
||||||
"Trait",
|
"Trait",
|
||||||
},
|
},
|
||||||
markdown = false,
|
markdown = false,
|
||||||
help = false,
|
help = false,
|
||||||
-- you can specify a different filter for each filetype
|
-- you can specify a different filter for each filetype
|
||||||
lua = {
|
lua = {
|
||||||
"Class",
|
"Class",
|
||||||
"Constructor",
|
"Constructor",
|
||||||
"Enum",
|
"Enum",
|
||||||
"Field",
|
"Field",
|
||||||
"Function",
|
"Function",
|
||||||
"Interface",
|
"Interface",
|
||||||
"Method",
|
"Method",
|
||||||
"Module",
|
"Module",
|
||||||
"Namespace",
|
"Namespace",
|
||||||
-- "Package", -- remove package since luals uses it for control flow structures
|
-- "Package", -- remove package since luals uses it for control flow structures
|
||||||
"Property",
|
"Property",
|
||||||
"Struct",
|
"Struct",
|
||||||
"Trait",
|
"Trait",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"williamboman/mason.nvim",
|
"williamboman/mason.nvim",
|
||||||
opts = {
|
opts = {
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
"nil",
|
"nil",
|
||||||
"pyright",
|
"basedpyright",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
return {
|
return {
|
||||||
-- disable the weird UI provided by noice.nvim
|
-- disable the weird UI provided by noice.nvim
|
||||||
{ "folke/noice.nvim", enabled = false },
|
{ "folke/noice.nvim", enabled = false },
|
||||||
}
|
}
|
||||||
|
|
96
nvim/lua/plugins/snacks.lua
Normal file
96
nvim/lua/plugins/snacks.lua
Normal file
|
@ -0,0 +1,96 @@
|
||||||
|
-- lazy.nvim
|
||||||
|
return {
|
||||||
|
"folke/snacks.nvim",
|
||||||
|
---@type snacks.Config
|
||||||
|
opts = {
|
||||||
|
image = {},
|
||||||
|
dashboard = {
|
||||||
|
---@class snacks.dashboard.Config
|
||||||
|
---@field enabled? boolean
|
||||||
|
---@field sections snacks.dashboard.Section
|
||||||
|
---@field formats table<string, snacks.dashboard.Text|fun(item:snacks.dashboard.Item, ctx:snacks.dashboard.Format.ctx):snacks.dashboard.Text>
|
||||||
|
width = 70,
|
||||||
|
row = nil, -- dashboard position. nil for center
|
||||||
|
col = nil, -- dashboard position. nil for center
|
||||||
|
pane_gap = 4, -- empty columns between vertical panes
|
||||||
|
autokeys = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", -- autokey sequence
|
||||||
|
preset = {
|
||||||
|
pick = nil,
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
icon = " ",
|
||||||
|
key = "f",
|
||||||
|
desc = "Find File",
|
||||||
|
action = ":lua Snacks.dashboard.pick('files')",
|
||||||
|
},
|
||||||
|
{ icon = " ", key = "n", desc = "New File", action = ":ene | startinsert" },
|
||||||
|
{
|
||||||
|
icon = " ",
|
||||||
|
key = "g",
|
||||||
|
desc = "Find Text",
|
||||||
|
action = ":lua Snacks.dashboard.pick('live_grep')",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon = " ",
|
||||||
|
key = "r",
|
||||||
|
desc = "Recent Files",
|
||||||
|
action = ":lua Snacks.dashboard.pick('oldfiles')",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon = " ",
|
||||||
|
key = "c",
|
||||||
|
desc = "Config",
|
||||||
|
action = ":lua Snacks.dashboard.pick('files', {cwd = vim.fn.stdpath('config')})",
|
||||||
|
},
|
||||||
|
{ icon = " ", key = "s", desc = "Restore Session", section = "session" },
|
||||||
|
{
|
||||||
|
icon = " ",
|
||||||
|
key = "L",
|
||||||
|
desc = "Lazy",
|
||||||
|
action = ":Lazy",
|
||||||
|
enabled = package.loaded.lazy ~= nil,
|
||||||
|
},
|
||||||
|
{ icon = " ", key = "q", desc = "Quit", action = ":qa" },
|
||||||
|
},
|
||||||
|
-- Used by the `header` section
|
||||||
|
header = [[
|
||||||
|
██╗ ██╗████████╗███████╗███╗ ███╗██╗ ██╗██╗ ██╗██╗███╗ ███╗
|
||||||
|
██║ ██╔╝╚══██╔══╝██╔════╝████╗ ████║██║ ██╔╝██║ ██║██║████╗ ████║
|
||||||
|
█████╔╝ ██║ █████╗ ██╔████╔██║█████╔╝ ██║ ██║██║██╔████╔██║
|
||||||
|
██╔═██╗ ██║ ██╔══╝ ██║╚██╔╝██║██╔═██╗ ╚██╗ ██╔╝██║██║╚██╔╝██║
|
||||||
|
██║ ██╗ ██║ ███████╗██║ ╚═╝ ██║██║ ██╗ ╚████╔╝ ██║██║ ╚═╝ ██║
|
||||||
|
╚═╝ ╚═╝ ╚═╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═╝]],
|
||||||
|
},
|
||||||
|
-- item field formatters
|
||||||
|
formats = {
|
||||||
|
icon = function(item)
|
||||||
|
if item.file and item.icon == "file" or item.icon == "directory" then
|
||||||
|
return M.icon(item.file, item.icon)
|
||||||
|
end
|
||||||
|
return { item.icon, width = 2, hl = "icon" }
|
||||||
|
end,
|
||||||
|
footer = { "%s", align = "center" },
|
||||||
|
header = { "%s", align = "center" },
|
||||||
|
file = function(item, ctx)
|
||||||
|
local fname = vim.fn.fnamemodify(item.file, ":~")
|
||||||
|
fname = ctx.width and #fname > ctx.width and vim.fn.pathshorten(fname) or fname
|
||||||
|
if #fname > ctx.width then
|
||||||
|
local dir = vim.fn.fnamemodify(fname, ":h")
|
||||||
|
local file = vim.fn.fnamemodify(fname, ":t")
|
||||||
|
if dir and file then
|
||||||
|
file = file:sub(-(ctx.width - #dir - 2))
|
||||||
|
fname = dir .. "/…" .. file
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local dir, file = fname:match("^(.*)/(.+)$")
|
||||||
|
return dir and { { dir .. "/", hl = "dir" }, { file, hl = "file" } } or { { fname, hl = "file" } }
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
sections = {
|
||||||
|
{ section = "header" },
|
||||||
|
{ section = "keys", gap = 1, padding = 1 },
|
||||||
|
{ section = "startup" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue